| | |
| | | import { |
| | | fetchLoginPW, |
| | | fetchUserInfo, |
| | | fetchUserBaseInfo, |
| | | } from '../services/usercenter/fetchUser'; |
| | | import { fetchLoginPW, fetchUserInfo, fetchUserBaseInfo } from '../services/usercenter/fetchUser'; |
| | | import { loadConfig } from '../behaviors/loadConfig'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | |
| | | app.globalData.accessToken.suserId = data.suserId; |
| | | app.globalData.accessToken.openId = data.openId; |
| | | if (accessTokenPW.userName) { |
| | | app.globalData.accessToken.userName = |
| | | accessTokenPW.userName; |
| | | app.globalData.accessToken.userName = accessTokenPW.userName; |
| | | } |
| | | if (accessTokenPW.password) { |
| | | app.globalData.accessToken.password = |
| | | accessTokenPW.password; |
| | | app.globalData.accessToken.password = accessTokenPW.password; |
| | | } |
| | | wx.setStorage({ |
| | | key: 'accessToken', |
| | |
| | | key: 'userInfo', |
| | | data: data, |
| | | success: result => { |
| | | loadConfig().then(res => { |
| | | wx.switchTab({ |
| | | url: '/pages/home/index', |
| | | loadConfig() |
| | | .then(res => { |
| | | // 判断用户是否进入简化主页 |
| | | if (app.globalData.userConfig && app.globalData.userConfig.ucExtension1 == 'simple') { |
| | | wx.redirectTo({ |
| | | url: '/pages/simple-home/index', |
| | | }); |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/index', |
| | | }); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.setData({ |
| | | loading: false, |
| | | }); |
| | | }); |
| | | }, |
| | | fail: err => { |
| | | this.setData({ |
| | | loading: false, |
| | | }); |
| | | }, |
| | | }); |