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 | 30 | // }) |
31 | 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 | 47 | </script> |
36 | 48 | ... | ... |
... | ... | @@ -125,7 +125,9 @@ uni.$u.http.interceptors.response.use( |
125 | 125 | errorData = message || ""; |
126 | 126 | } |
127 | 127 | // console.log('errorData', errorData); |
128 | - uni.$u.toast(message); | |
128 | + if(message != "request:ok"){ | |
129 | + uni.$u.toast(message); | |
130 | + } | |
129 | 131 | // if (show) uni.$u.toast(errorData); |
130 | 132 | return Promise.reject(response); |
131 | 133 | } | ... | ... |
... | ... | @@ -241,6 +241,9 @@ |
241 | 241 | }, |
242 | 242 | onShow() { |
243 | 243 | this.page.num = 1; |
244 | + if(getApp().getBindNot()){ | |
245 | + return | |
246 | + } | |
244 | 247 | if (this.detailStatus) { |
245 | 248 | this.loadData(1, null, null, null, null, null, null); |
246 | 249 | } |
... | ... | @@ -256,6 +259,9 @@ |
256 | 259 | onLoad(e) { |
257 | 260 | // 隐藏原生的tabbar |
258 | 261 | uni.hideTabBar(); |
262 | + if(getApp().getBindNot()){ | |
263 | + return | |
264 | + } | |
259 | 265 | if (e.type == undefined) { |
260 | 266 | this.loadData(1, null, null, null, null, null, null); |
261 | 267 | } else { | ... | ... |
... | ... | @@ -211,6 +211,9 @@ |
211 | 211 | async onLoad(options) { |
212 | 212 | // 隐藏原生的tabbar |
213 | 213 | uni.hideTabBar(); |
214 | + if(getApp().getBindNot()){ | |
215 | + return | |
216 | + } | |
214 | 217 | this.page.num = 1; |
215 | 218 | const { |
216 | 219 | deviceState |
... | ... | @@ -231,6 +234,9 @@ |
231 | 234 | } |
232 | 235 | }, |
233 | 236 | onShow() { |
237 | + if(getApp().getBindNot()){ | |
238 | + return | |
239 | + } | |
234 | 240 | if (this.orgId) { |
235 | 241 | this.loadData(1, { |
236 | 242 | organizationId: this.orgId | ... | ... |