diff --git a/src/views/login/wxlogin.vue b/src/views/login/wxlogin.vue index 7fc2b8c..b4347fe 100644 --- a/src/views/login/wxlogin.vue +++ b/src/views/login/wxlogin.vue @@ -19,13 +19,14 @@ import { useRoute } from "vue-router"; 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") @@ -35,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") + } } }) })