Commit b16d82d6 by golton_gao

update: 逻辑调整

parent b1579ffa
Showing with 13 additions and 6 deletions
......@@ -43,7 +43,7 @@ const config = {
product: false,
ssoToken: 'token',
userid: '10001285',
appKey: 'd504275e',
appkey: 'd504275e',
uid: 'xycao@cndrealty.com',
token: 'T4777979921957888',
baseUrl: 'https://mxytest.cndrealty.com:4433/',
......
......@@ -53,10 +53,15 @@ app.ready(() => {
}, configuration.product);
function initUser() {
return Promise.all([app.getUser(), app.getExtra(configuration.identifier)])
.then(([user, {
extra
}]) => {
// return Promise.all([app.getUser(), app.getExtra(configuration.identifier)])
return app.getUser()
.then((user) => {
console.log('user:', user)
// todo: 需要通过接口抓取。
const extra = {
employeenumber: '10004534',
extra: '{"orgType": 1}'
}
userid = extra.employeenumber || user.employeenumber;
token = user.ssoToken;
_uid = extra.uid || user.uid;
......@@ -109,6 +114,7 @@ function initUser() {
}
})
.catch(e => {
console.log('e:', e.toString())
if (!configuration.product) {
_uid = configuration.uid;
userid = configuration.userid;
......@@ -122,6 +128,7 @@ function initUser() {
}
function mount() {
const customEvt = window.customEvt;
scrollBehavior();
attachAtivated(backButton);
attachAtivated(photo);
......@@ -141,7 +148,7 @@ function mount() {
);
*/
// 清除backbutton上的历史事件,绑定新事件
customEvt.removeListener('backbutton')
customEvt.removeEventListener('backbutton')
customEvt.addEventListener('backbutton', () => {
app.exit();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment