diff --git a/src/config/env.ts b/src/config/env.ts index cf4b9b9..4929c80 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -3,7 +3,7 @@ const development = { // VITE_APP_BASE_URL: 'http://47.100.31.83:8081', // VITE_APP_BASE_URL: 'https://47.100.31.83:8081', // appid: '', - VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn', + VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn', appid: 'wx9251d74fe0e87028', } @@ -13,7 +13,7 @@ const test = { } const production = { - VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn', + VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn', appid: 'wx9251d74fe0e87028', } diff --git a/src/pagesLogin/login/index.vue b/src/pagesLogin/login/index.vue index d43829f..6dda512 100644 --- a/src/pagesLogin/login/index.vue +++ b/src/pagesLogin/login/index.vue @@ -297,8 +297,8 @@ const handleSelect = (v: any) => { state.isShow = false; state.dpObj = v; model1.userInfo.dpName = v.name; - console.log(v.dbIp) - store.setChildPath(v.dbIp) + console.log(v.dbIp); + store.setChildPath(v.dbIp); }; const state = reactive({ @@ -306,13 +306,13 @@ const state = reactive({ isShow: false, dpObj: {}, }); + // 获取基地信息 ProfileApi.getDbInfo({}).then((res) => { if (res.code === 200) { state.dpList = res.data.map((item: any) => { return { name: item.dbName, ...item }; }); - console.log(state.dpList); } }); diff --git a/src/store/modules/member.ts b/src/store/modules/member.ts index 63231c1..a5df776 100644 --- a/src/store/modules/member.ts +++ b/src/store/modules/member.ts @@ -15,7 +15,8 @@ export const useMemberStore = defineStore( }, menusList: [], menusNameList: [], - childPath: '/test/sh0001' + childPath: '/test/sh0001', + err: null }); // 保存会员信息,登录时使用 @@ -28,6 +29,11 @@ export const useMemberStore = defineStore( profile.value.childPath = v } + const setErr= (v: any) => { + profile.value.err = v + } + + // 清理会员信息,退出时使用 const clearProfile = () => { @@ -49,6 +55,7 @@ export const useMemberStore = defineStore( profile, setProfile, setChildPath, + setErr, clearProfile }; }, diff --git a/src/utils/http.ts b/src/utils/http.ts index ad4bb63..4feb01a 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -18,7 +18,7 @@ const obj = { options.timeout = 10000; // 拼接完整路径 if (!options.url.startsWith("http")) { - if ('/prod/gateway/api/db/getDbInfo' !== options.url) { + if (options.url.indexOf('/prod/gateway/api/db/getDbInfo') === -1 ) { options.url = baseUrl + store.profile.childPath + options.url; } else { options.url = baseUrl + options.url; @@ -139,7 +139,9 @@ export const http = (options: UniApp.RequestOptions) => { fail(err) { uni.showToast({ icon: "none", + // title: JSON.stringify(err), title: "网络错误,请检查网络", + }); reject(err); },