From 10616183b2b5dafef5893b0ff3b09bc7ac05d8d6 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Thu, 31 Jul 2025 18:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 38 ++++++++++++++++++++++---------------- utils/ajax.js | 4 ++-- 2 files changed, 24 insertions(+), 18 deletions(-) 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/utils/ajax.js b/utils/ajax.js index aadb6c7..472fce2 100644 --- a/utils/ajax.js +++ b/utils/ajax.js @@ -1,5 +1,5 @@ -// let ajaxUrl = "http://192.168.3.83:8001"; -let ajaxUrl = "https://daotian.matripe.com.cn"; +let ajaxUrl = "http://192.168.3.83:8001"; +// let ajaxUrl = "https://daotian.matripe.com.cn"; let data = { ajaxUrl: ajaxUrl, Get ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) {