用户登录问题修改

This commit is contained in:
jiang 2024-09-10 10:04:32 +08:00
parent eb9e9db8b1
commit 8bb10191ea
2 changed files with 15 additions and 22 deletions

View File

@ -269,7 +269,7 @@ export default {
this.$store.dispatch('IsAdmin', this.loginForm).then(res => { this.$store.dispatch('IsAdmin', this.loginForm).then(res => {
if (res.data) { if (res.data) {
this.isAdmin = res.data this.isAdmin = res.data
//this.isLogin() this.$message.success('检测到您是超级管理账号,需进行手机检验')
} else { } else {
this.isLogin() this.isLogin()
} }
@ -279,15 +279,6 @@ export default {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
let that = this let that = this
this.loginForm.loginMethod = this.loginMethod this.loginForm.loginMethod = this.loginMethod
this.$store.dispatch('IsLogin', this.loginForm) this.$store.dispatch('IsLogin', this.loginForm)
@ -311,7 +302,7 @@ export default {
} }
}) })
}, },
sendAdminCode(){ sendAdminCode() {
this.loginForm.mobile = this.loginForm.username this.loginForm.mobile = this.loginForm.username
this.$store.dispatch('GetPhoneCode', this.loginForm) this.$store.dispatch('GetPhoneCode', this.loginForm)
.then(() => { .then(() => {
@ -375,7 +366,7 @@ export default {
this.loginForm.code = '' this.loginForm.code = ''
this.loginForm.verificationCode = '' this.loginForm.verificationCode = ''
this.loginForm.loginMethod = '' this.loginForm.loginMethod = ''
this.isAdmin=false this.isAdmin = false
this.getCode() this.getCode()
} }
} }

View File

@ -23,6 +23,7 @@
auto-complete="off" auto-complete="off"
placeholder="密码" placeholder="密码"
@keyup.enter.native="handleRegister" @keyup.enter.native="handleRegister"
show-password
> >
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
</el-input> </el-input>
@ -35,6 +36,7 @@
auto-complete="off" auto-complete="off"
placeholder="确认密码" placeholder="确认密码"
@keyup.enter.native="handleRegister" @keyup.enter.native="handleRegister"
show-password
> >
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
</el-input> </el-input>