This commit is contained in:
weipengfei 2023-09-09 09:03:38 +08:00
parent ea3f8f8a84
commit baea439695
5 changed files with 13 additions and 6 deletions

View File

@ -38,6 +38,7 @@
data data
} = await userInfo(); } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
this.$isResolve()
// uni.$emit('home_initUserInfo', data); // uni.$emit('home_initUserInfo', data);
return ; return ;
}catch(e){ }catch(e){

View File

@ -2,8 +2,8 @@ let httpApiThree;
let httpApi; // 总域名 let httpApi; // 总域名
let httpApiTwo; // 物流系统域名 let httpApiTwo; // 物流系统域名
const env = 'dev'; // 开发 // const env = 'dev'; // 开发
// const env = 'prod'; // 生产 const env = 'prod'; // 生产
// const env = 'prew'; // 预上线 // const env = 'prew'; // 预上线
switch(env){ switch(env){

View File

@ -14,6 +14,10 @@ Vue.use(mybtn)
Vue.use(company) Vue.use(company)
// initRouter() // initRouter()
// 让app的onLaunch先执行主要是用来进行登录
Vue.prototype.$onLaunched = new Promise(resolve => {
Vue.prototype.$isResolve = resolve
})
// #ifndef VUE3 // #ifndef VUE3

View File

@ -2,8 +2,8 @@
"name" : "里海社区", "name" : "里海社区",
"appid" : "__UNI__B5B1EDD", "appid" : "__UNI__B5B1EDD",
"description" : "", "description" : "",
"versionName" : "1.0.6", "versionName" : "1.0.8",
"versionCode" : 106, "versionCode" : 108,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -239,7 +239,8 @@
showOaHomeData: false, // showOaHomeData: false, //
}; };
}, },
onLoad() { async onLoad() {
await this.$onLaunched;
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
this.options.data = bj; this.options.data = bj;
// uni.$on('home_initUserInfo', (data=null)=>{ // uni.$on('home_initUserInfo', (data=null)=>{
@ -257,9 +258,10 @@
}); });
// #endif // #endif
}, },
onShow() { async onShow() {
// this.getUserIndex() // this.getUserIndex()
// this.getIndexList() // this.getIndexList()
await this.$onLaunched;
if(uni.getStorageSync('uniMP'))this.uniMP = true; if(uni.getStorageSync('uniMP'))this.uniMP = true;
userInfo().then(({data})=>{ userInfo().then(({data})=>{
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);