用户登录问题修改
This commit is contained in:
parent
eb9e9db8b1
commit
8bb10191ea
|
|
@ -108,21 +108,21 @@
|
||||||
</div>
|
</div>
|
||||||
<el-form-item style="width: 100%;">
|
<el-form-item style="width: 100%;">
|
||||||
<el-button v-if="!isAdmin"
|
<el-button v-if="!isAdmin"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
size="medium"
|
size="medium"
|
||||||
type="primary"
|
type="primary"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
@click="loginMethod === 'password' ?IsAdmin():isLogin()"
|
@click="loginMethod === 'password' ?IsAdmin():isLogin()"
|
||||||
>
|
>
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="isAdmin"
|
<el-button v-if="isAdmin"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
size="medium"
|
size="medium"
|
||||||
type="primary"
|
type="primary"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
@click="isLogin()"
|
@click="isLogin()"
|
||||||
>
|
>
|
||||||
<span v-if="!loading">登 录</span>
|
<span v-if="!loading">登 录</span>
|
||||||
<span v-else>登 录 中...</span>
|
<span v-else>登 录 中...</span>
|
||||||
|
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue