From 84418d9036ffc3f16b60e8a07698be1ddb8b14fb Mon Sep 17 00:00:00 2001 From: "471615499@qq.com" Date: Mon, 28 Oct 2024 22:14:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=A6=96=E9=A1=B5=E9=A1=B5=E9=9D=A2=EF=BC=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=89=93=E5=BC=80=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/Login.vue | 2 +- src/views/user/LoginCode.vue | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index b680a3f..ba9eac8 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -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()},欢迎回来` diff --git a/src/views/user/LoginCode.vue b/src/views/user/LoginCode.vue index 5371f36..7a37c91 100644 --- a/src/views/user/LoginCode.vue +++ b/src/views/user/LoginCode.vue @@ -1,9 +1,12 @@ @@ -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()},欢迎回来` + // }) + // }) } }) }