Commit 1125e32c25e7350e793538962ebe0b654a3308bb
Merge branch 'fix/request-error' into 'main_dev'
fix:修改第三方登录时请求页面请求数据报账号密码错误 See merge request yunteng/thingskit-app!110
Showing
5 changed files
with
31 additions
and
2 deletions
@@ -30,7 +30,19 @@ | @@ -30,7 +30,19 @@ | ||
30 | // }) | 30 | // }) |
31 | // #endif | 31 | // #endif |
32 | }, | 32 | }, |
33 | - onHide() {} | 33 | + onHide() {}, |
34 | + methods:{ | ||
35 | + // 判断是否是第三方登录没有绑定账号不请求数据 | ||
36 | + getBindNot(){ | ||
37 | + // #ifndef H5 | ||
38 | + const userInfo = uni.getStorageSync('userInfo'); | ||
39 | + // #endif | ||
40 | + // #ifdef H5 | ||
41 | + const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')); | ||
42 | + // #endif | ||
43 | + return userInfo.isThirdLogin | ||
44 | + } | ||
45 | + } | ||
34 | }; | 46 | }; |
35 | </script> | 47 | </script> |
36 | 48 |
@@ -125,7 +125,9 @@ uni.$u.http.interceptors.response.use( | @@ -125,7 +125,9 @@ uni.$u.http.interceptors.response.use( | ||
125 | errorData = message || ""; | 125 | errorData = message || ""; |
126 | } | 126 | } |
127 | // console.log('errorData', errorData); | 127 | // console.log('errorData', errorData); |
128 | - uni.$u.toast(message); | 128 | + if(message != "request:ok"){ |
129 | + uni.$u.toast(message); | ||
130 | + } | ||
129 | // if (show) uni.$u.toast(errorData); | 131 | // if (show) uni.$u.toast(errorData); |
130 | return Promise.reject(response); | 132 | return Promise.reject(response); |
131 | } | 133 | } |
@@ -241,6 +241,9 @@ | @@ -241,6 +241,9 @@ | ||
241 | }, | 241 | }, |
242 | onShow() { | 242 | onShow() { |
243 | this.page.num = 1; | 243 | this.page.num = 1; |
244 | + if(getApp().getBindNot()){ | ||
245 | + return | ||
246 | + } | ||
244 | if (this.detailStatus) { | 247 | if (this.detailStatus) { |
245 | this.loadData(1, null, null, null, null, null, null); | 248 | this.loadData(1, null, null, null, null, null, null); |
246 | } | 249 | } |
@@ -256,6 +259,9 @@ | @@ -256,6 +259,9 @@ | ||
256 | onLoad(e) { | 259 | onLoad(e) { |
257 | // 隐藏原生的tabbar | 260 | // 隐藏原生的tabbar |
258 | uni.hideTabBar(); | 261 | uni.hideTabBar(); |
262 | + if(getApp().getBindNot()){ | ||
263 | + return | ||
264 | + } | ||
259 | if (e.type == undefined) { | 265 | if (e.type == undefined) { |
260 | this.loadData(1, null, null, null, null, null, null); | 266 | this.loadData(1, null, null, null, null, null, null); |
261 | } else { | 267 | } else { |
@@ -211,6 +211,9 @@ | @@ -211,6 +211,9 @@ | ||
211 | async onLoad(options) { | 211 | async onLoad(options) { |
212 | // 隐藏原生的tabbar | 212 | // 隐藏原生的tabbar |
213 | uni.hideTabBar(); | 213 | uni.hideTabBar(); |
214 | + if(getApp().getBindNot()){ | ||
215 | + return | ||
216 | + } | ||
214 | this.page.num = 1; | 217 | this.page.num = 1; |
215 | const { | 218 | const { |
216 | deviceState | 219 | deviceState |
@@ -231,6 +234,9 @@ | @@ -231,6 +234,9 @@ | ||
231 | } | 234 | } |
232 | }, | 235 | }, |
233 | onShow() { | 236 | onShow() { |
237 | + if(getApp().getBindNot()){ | ||
238 | + return | ||
239 | + } | ||
234 | if (this.orgId) { | 240 | if (this.orgId) { |
235 | this.loadData(1, { | 241 | this.loadData(1, { |
236 | organizationId: this.orgId | 242 | organizationId: this.orgId |
@@ -128,6 +128,9 @@ | @@ -128,6 +128,9 @@ | ||
128 | onLoad() { | 128 | onLoad() { |
129 | // 隐藏原生的tabbar | 129 | // 隐藏原生的tabbar |
130 | uni.hideTabBar(); | 130 | uni.hideTabBar(); |
131 | + if(getApp().getBindNot()){ | ||
132 | + return | ||
133 | + } | ||
131 | this.getDeviceTotalData(); | 134 | this.getDeviceTotalData(); |
132 | uni.setStorageSync('getConfiguration', { | 135 | uni.setStorageSync('getConfiguration', { |
133 | isConfiguration: false | 136 | isConfiguration: false |