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