...
|
...
|
@@ -15,7 +15,8 @@ import { Event } from '/login/utils/index.js'; |
|
|
import { wxLogin } from '/login/utils/login/login.js';
|
|
|
import { appReport } from './libs/appReport.js';
|
|
|
|
|
|
global.event = new Event();
|
|
|
const event = new Event();
|
|
|
global.event = event;
|
|
|
|
|
|
import { logEvent,
|
|
|
YB_LAUNCH_APP,
|
...
|
...
|
@@ -100,6 +101,25 @@ App({ |
|
|
}, 1000);
|
|
|
this.mtainit(options);
|
|
|
await wxLogin();
|
|
|
event.on('user-is-login', ({ logged, loginSuccess }) => {
|
|
|
const userInfo = wx.getStorageSync('userInfo');
|
|
|
console.log(userInfo);
|
|
|
if (userInfo && userInfo.uid && userInfo.session_key) {
|
|
|
this.globalData.userInfo = userInfo;
|
|
|
if (logged) {
|
|
|
logged(userInfo);
|
|
|
}
|
|
|
} else {
|
|
|
event.once('user-login-success', (userInfo) => {
|
|
|
if (loginSuccess) {
|
|
|
loginSuccess(userInfo);
|
|
|
}
|
|
|
});
|
|
|
wx.navigateTo({
|
|
|
url: '/login/login-page/login-page',
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//当应用程序进入前台显示状态时触发
|
...
|
...
|
|