From 23020a05125ca5ded8f91155bf2548d79087f1d0 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 15 Dec 2020 14:19:51 +0800 Subject: [PATCH 1/2] dist --- src/views/login/wxlogin.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/login/wxlogin.vue b/src/views/login/wxlogin.vue index 7fc2b8c..ff91f0e 100644 --- a/src/views/login/wxlogin.vue +++ b/src/views/login/wxlogin.vue @@ -20,12 +20,14 @@ export default defineComponent(({ setup(){ const code: any = useRoute().query.code; console.log(code) + alert(code) if(!code){ router.push("/") + return ; } accessToken(code, 1).then((res: any)=>{ console.log(res) - authLogin(res.uid, 2).then((res: any)=>{ + authLogin(res.uid, 1).then((res: any)=>{ if(res.redirect == 1){ sessionStorage.setItem('mid',res.memberid); router.push("/sign") From bf21a73598c1d23a9260cc1f8e23d1c02f794798 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 15 Dec 2020 14:23:23 +0800 Subject: [PATCH 2/2] dist --- src/views/login/wxlogin.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/views/login/wxlogin.vue b/src/views/login/wxlogin.vue index ff91f0e..b4347fe 100644 --- a/src/views/login/wxlogin.vue +++ b/src/views/login/wxlogin.vue @@ -19,7 +19,6 @@ import { useRoute } from "vue-router"; export default defineComponent(({ setup(){ const code: any = useRoute().query.code; - console.log(code) alert(code) if(!code){ router.push("/") @@ -37,11 +36,11 @@ export default defineComponent(({ message.error("存储错误, 请允许网页使用本地存储!") return false; }else{ - setToken(); - store.commit("login", true); - store.dispatch("setUserInfo"); - router.push("/mine/archives") - } + setToken(); + store.commit("login", true); + store.dispatch("setUserInfo"); + router.push("/mine/archives") + } } }) })