Commit 8f04b84a by 李伟康

提交代码

1 parent 08e154a0
...@@ -143,6 +143,7 @@ class UsersApi { ...@@ -143,6 +143,7 @@ class UsersApi {
/**获取微信用户信息 */ /**获取微信用户信息 */
async getWXUserInfo() { async getWXUserInfo() {
let wx_user_info = wx.$storage.get('wx_user_info') let wx_user_info = wx.$storage.get('wx_user_info')
console.log(wx_user_info)
if (!wx_user_info) { if (!wx_user_info) {
const data = await this.getUserProfile() const data = await this.getUserProfile()
wx.$storage.set('wx_user_info', data) wx.$storage.set('wx_user_info', data)
......
...@@ -273,9 +273,6 @@ Component({ ...@@ -273,9 +273,6 @@ Component({
disabled: false disabled: false
}) })
this.loginToken = data this.loginToken = data
USERAPI.getUserProfile(data).then(data => {
wx.$storage.set('wx_user_info', data)
})
} else this.reLogin(message) } else this.reLogin(message)
wx.hideLoading() wx.hideLoading()
} catch ({ } catch ({
......
...@@ -16,7 +16,7 @@ class Router { ...@@ -16,7 +16,7 @@ class Router {
wx.onAppRoute(async e => { wx.onAppRoute(async e => {
let thisPage = this.getPageInstance() let thisPage = this.getPageInstance()
if (thisPage) { if (thisPage) {
await USERAPI.getWXUserInfo() if(!thisPage.route.includes('login')) await USERAPI.getWXUserInfo()
thisPage.setData({ IMG_URL }) thisPage.setData({ IMG_URL })
if(Object.keys(this[_query]).length) thisPage.options = this[_query] if(Object.keys(this[_query]).length) thisPage.options = this[_query]
this.setNavigationBarTitleText(thisPage) this.setNavigationBarTitleText(thisPage)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!