mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 04:29:36 +08:00
修改登录跳转首页页面;
修改扫码登录逻辑,改为打开新页面
This commit is contained in:
parent
614531e765
commit
84418d9036
@ -301,7 +301,7 @@ export default {
|
||||
},
|
||||
loginSuccess(res) {
|
||||
if (res.code === 0) {
|
||||
this.$router.push({ name: 'repairStatistics' }, () => { // 登录跳转
|
||||
this.$router.push({ name: 'index' }, () => { // 登录跳转
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `${timeFix()},欢迎回来`
|
||||
|
@ -1,9 +1,12 @@
|
||||
<template>
|
||||
<div class='main' style='text-align: center'>
|
||||
<vue-qr
|
||||
:text="loginUrl"
|
||||
:size="250"
|
||||
<vue-qr v-if='!isLogin'
|
||||
:text='loginUrl'
|
||||
:size='250'
|
||||
></vue-qr>
|
||||
<a-button v-if='isLogin' @click='goIndex()' type="primary" style='margin-top: 20px'>
|
||||
访问系统
|
||||
</a-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -15,7 +18,7 @@ import { loginByCode, qrCode } from '@/api/login'
|
||||
import storage from 'store'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { timeFix } from '@/utils/util'
|
||||
import VueQr from "vue-qr"
|
||||
import VueQr from 'vue-qr'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -37,6 +40,9 @@ export default {
|
||||
clearInterval(this.intervalId)
|
||||
},
|
||||
methods: {
|
||||
goIndex() {
|
||||
window.open('/shoot-hand-html/')
|
||||
},
|
||||
getLoginUrl() {
|
||||
qrCode().then(res => {
|
||||
if (res.code === 0) {
|
||||
@ -53,14 +59,15 @@ export default {
|
||||
if (res.code == 0) {
|
||||
// 扫码成功
|
||||
clearInterval(this.intervalId)
|
||||
console.log('登录成功!')
|
||||
this.isLogin = true
|
||||
storage.set(ACCESS_TOKEN, res.token, 14 * 24 * 60 * 60 * 1000) // 14天过期
|
||||
this.$router.push({ name: 'index' }, () => { // 登录跳转
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `${timeFix()},欢迎回来`
|
||||
})
|
||||
})
|
||||
this.goIndex()
|
||||
// this.$router.push({ name: 'index' }, () => { // 登录跳转
|
||||
// this.$notification.success({
|
||||
// message: '欢迎',
|
||||
// description: `${timeFix()},欢迎回来`
|
||||
// })
|
||||
// })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user