fix: 去除无用代码

This commit is contained in:
fit2cloud-chenyw 2021-06-04 11:11:21 +08:00
parent 535b7b104e
commit a51ec3e2eb

View File

@ -49,35 +49,35 @@
<script>
import { encrypt } from '@/utils/rsaEncrypt'
import { validateUserName } from '@/api/user'
// import { validateUserName } from '@/api/user'
import { getSysUI } from '@/utils/auth'
export default {
name: 'Login',
data() {
const validateUsername = (rule, value, callback) => {
const userName = value.trim()
validateUserName({ userName: userName }).then(res => {
if (res.data) {
callback()
} else {
callback(this.$t('login.username_error'))
}
}).catch(() => {
callback(this.$t('login.username_error'))
})
// if (!validUsername(value)) {
// callback(new Error('Please enter the correct user name'))
// const validateUsername = (rule, value, callback) => {
// const userName = value.trim()
// validateUserName({ userName: userName }).then(res => {
// if (res.data) {
// callback()
// } else {
// callback(this.$t('login.username_error'))
// }
// }).catch(() => {
// callback(this.$t('login.username_error'))
// })
// // if (!validUsername(value)) {
// // callback(new Error('Please enter the correct user name'))
// // } else {
// // callback()
// // }
// }
// const validatePassword = (rule, value, callback) => {
// if (value.length < 8) {
// callback(this.$t('login.password_error'))
// } else {
// callback()
// }
}
const validatePassword = (rule, value, callback) => {
if (value.length < 8) {
callback(this.$t('login.password_error'))
} else {
callback()
}
}
// }
return {
loginForm: {
username: '',