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