diff --git a/main.js b/main.js index 26b595e..9858219 100644 --- a/main.js +++ b/main.js @@ -65,14 +65,17 @@ export function createApp () { uni.setStorageSync('apply-userinfo-copy', JSON.stringify(res)); uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id,方便获取 uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号 - G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { - uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 - uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 + if (res.agencyStatus == 1) { + G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { + uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 + uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 + + // 登录跳转到首页的判断 + uni.setStorageSync("SHOW_INVITE", 1); + resolve(res) + }); + } - // 登录跳转到首页的判断 - uni.setStorageSync("SHOW_INVITE", 1); - resolve(res) - }); }, function fail (err) { console.log(err); @@ -91,13 +94,16 @@ export function createApp () { uni.setStorageSync('apply-userinfo-copy', JSON.stringify(res)); uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id,方便获取 uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号 - G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { - uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 - uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 - // 登录跳转到首页的判断 - uni.setStorageSync("SHOW_INVITE", 1); - resolve(res) - }); + if (res.agencyStatus == 1) { + G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { + uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 + uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 + + // 登录跳转到首页的判断 + uni.setStorageSync("SHOW_INVITE", 1); + resolve(res) + }); + } }) }) }, @@ -188,7 +194,7 @@ export function createApp () { }, fail: function (res) { }, }); - } + } }, $sourceType); }, /* 上传图片 @@ -326,7 +332,7 @@ export function createApp () { }); } }); - app.config.globalProperties.F = wyyx; + app.config.globalProperties.F = wyyx; app.use(uView) return { app diff --git a/pages/person/index.vue b/pages/person/index.vue index 19fd559..ff0d28c 100644 --- a/pages/person/index.vue +++ b/pages/person/index.vue @@ -337,8 +337,10 @@ export default { this.getAuthInfo(); this.getData(); this.getNum(); - + if(uni.getStorageSync("apply-userinfo").agencyStatus == 1){ this.getCompanyInfo(); + + } } } else { that.waitNum_ups = 0; diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index be97043..de7e1f4 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -1,7 +1,7 @@