From 1cd1f8d4ea733780f7cde0674bdbeddc3c115bc9 Mon Sep 17 00:00:00 2001 From: minimaxagent1 Date: Wed, 30 Jul 2025 09:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.interceptor.js | 52 ++--------------------------- pages/login/login.vue | 67 ++++++++++++++------------------------ 2 files changed, 28 insertions(+), 91 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 8d19cd7..a1cfcc2 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -83,55 +83,9 @@ const install = (Vue, vm) => { // // return res.result; // } if(res.code == 401) { - // res为服务端返回值,可能有code,result等字段 - // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到 - // 如果配置了originalData为true,请留意这里的返回值 - - // return res.result; - - uni.login({ - success: function(ret) { - console.log("main.js==>res", ret) - // vm.$u.post('/user/login',{"js_code": ret.code}).then(res=>{ - // if (res.code == 10003) { - // // console.log("新用户登录") - // uni.setStorageSync('token', res.data); - - // } else if (res.code == 200) { - // // console.log("老用户登录",res.data) - // uni.setStorageSync('token', res.data); - - // } - // }); - } - }); - wx.login({ - success(res) { - if (res.code) { - console.log('登录!', res); - let data = { - wxOpenId: res.code, - - }; - vm.$u.post('/app/auth/wxLogin',data).then(res=>{ - if (res.code == 10003) { - uni.navigateTo({ - url:'/pages/login/login' - }) - - } else if (res.code == 200) { - // console.log("老用户登录",res.data) - uni.switchTab({ - url:'/pages/index/index' - }) - - } - }); - } - }, - - }); - + uni.reLaunch({ + url:'/pages/login/login' + }) } return res; // else if(res.code == 201) { diff --git a/pages/login/login.vue b/pages/login/login.vue index 44478c9..da7808f 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,12 +1,12 @@