用户登录问题修改
This commit is contained in:
parent
eb9e9db8b1
commit
8bb10191ea
|
|
@ -108,21 +108,21 @@
|
|||
</div>
|
||||
<el-form-item style="width: 100%;">
|
||||
<el-button v-if="!isAdmin"
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%;"
|
||||
@click="loginMethod === 'password' ?IsAdmin():isLogin()"
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%;"
|
||||
@click="loginMethod === 'password' ?IsAdmin():isLogin()"
|
||||
>
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
</el-button>
|
||||
<el-button v-if="isAdmin"
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%;"
|
||||
@click="isLogin()"
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width: 100%;"
|
||||
@click="isLogin()"
|
||||
>
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
|
|
@ -269,7 +269,7 @@ export default {
|
|||
this.$store.dispatch('IsAdmin', this.loginForm).then(res => {
|
||||
if (res.data) {
|
||||
this.isAdmin = res.data
|
||||
//this.isLogin()
|
||||
this.$message.success('检测到您是超级管理账号,需进行手机检验')
|
||||
} else {
|
||||
this.isLogin()
|
||||
}
|
||||
|
|
@ -279,15 +279,6 @@ export default {
|
|||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
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
|
||||
this.loginForm.loginMethod = this.loginMethod
|
||||
this.$store.dispatch('IsLogin', this.loginForm)
|
||||
|
|
@ -311,7 +302,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
sendAdminCode(){
|
||||
sendAdminCode() {
|
||||
this.loginForm.mobile = this.loginForm.username
|
||||
this.$store.dispatch('GetPhoneCode', this.loginForm)
|
||||
.then(() => {
|
||||
|
|
@ -375,7 +366,7 @@ export default {
|
|||
this.loginForm.code = ''
|
||||
this.loginForm.verificationCode = ''
|
||||
this.loginForm.loginMethod = ''
|
||||
this.isAdmin=false
|
||||
this.isAdmin = false
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter.native="handleRegister"
|
||||
show-password
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
|
|
@ -35,6 +36,7 @@
|
|||
auto-complete="off"
|
||||
placeholder="确认密码"
|
||||
@keyup.enter.native="handleRegister"
|
||||
show-password
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
|
|
|
|||
Loading…
Reference in New Issue