update: saas版本配置

This commit is contained in:
admin 2024-06-14 09:55:32 +08:00
parent 7f89c108cf
commit 041fb9f51b
3 changed files with 19 additions and 19 deletions

View File

@ -3,7 +3,7 @@ const development = {
// VITE_APP_BASE_URL: 'http://47.100.31.83:8081', // VITE_APP_BASE_URL: 'http://47.100.31.83:8081',
// VITE_APP_BASE_URL: 'https://47.100.31.83:8081', // VITE_APP_BASE_URL: 'https://47.100.31.83:8081',
// appid: '', // appid: '',
VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn', VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas',
appid: 'wx9251d74fe0e87028', appid: 'wx9251d74fe0e87028',
} }
@ -13,7 +13,7 @@ const test = {
} }
const production = { const production = {
VITE_APP_BASE_URL: 'https://cloud.52zaisheng.cn', VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas',
appid: 'wx9251d74fe0e87028', appid: 'wx9251d74fe0e87028',
} }

View File

@ -9,7 +9,7 @@
ref="loginForm" ref="loginForm"
:labelWidth="0" :labelWidth="0"
> >
<u-form-item prop="userInfo.dpName" @click="state.isShow = true"> <!-- <u-form-item prop="userInfo.dpName" @click="state.isShow = true">
<u-input <u-input
v-model="model1.userInfo.dpName" v-model="model1.userInfo.dpName"
:placeholder="`请选择基地名称`" :placeholder="`请选择基地名称`"
@ -19,13 +19,11 @@
:disabledColor="''" :disabledColor="''"
:disabled="true" :disabled="true"
> >
<!-- @change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)" -->
</u-input> </u-input>
<template #right> <template #right>
<u-icon name="arrow-right" color="#dadbde"></u-icon> <u-icon name="arrow-right" color="#dadbde"></u-icon>
</template> </template>
</u-form-item> </u-form-item> -->
<u-form-item prop="userInfo.userName"> <u-form-item prop="userInfo.userName">
<u-input <u-input
v-model="model1.userInfo.userName" v-model="model1.userInfo.userName"
@ -307,14 +305,14 @@ const state = reactive({
dpObj: {}, dpObj: {},
}); });
// // //
ProfileApi.getDbInfo({}).then((res) => { // ProfileApi.getDbInfo({}).then((res) => {
if (res.code === 200) { // if (res.code === 200) {
state.dpList = res.data.map((item: any) => { // state.dpList = res.data.map((item: any) => {
return { name: item.dbName, ...item }; // return { name: item.dbName, ...item };
}); // });
} // }
}); // });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -19,12 +19,8 @@ const obj = {
options.timeout = 10000; options.timeout = 10000;
// 拼接完整路径 // 拼接完整路径
if (!options.url.startsWith("http")) { if (!options.url.startsWith("http")) {
if (options.url.indexOf("/prod/gateway/api/db/getDbInfo") === -1) {
options.url = baseUrl + store.profile.childPath + options.url;
} else {
options.url = baseUrl + options.url; options.url = baseUrl + options.url;
} }
}
// 请求头标识 // 请求头标识
// 1.小程序唯一标识 // 1.小程序唯一标识
// 'source-client' 'miniapp' // 'source-client' 'miniapp'
@ -36,6 +32,7 @@ const obj = {
if (token) { if (token) {
options.header["x-userToken"] = token; options.header["x-userToken"] = token;
} }
options.header["code"] = 'hoe-cs';
}, },
}; };
// 请求拦截器 // 请求拦截器
@ -182,6 +179,11 @@ export const http = <T>(options: UniApp.RequestOptions) => {
icon: "none", icon: "none",
title: (res1 as Data<T>).message || "请求失败", title: (res1 as Data<T>).message || "请求失败",
}); });
} else if (res1.code === 500) {
uni.showToast({
icon: "none",
title: (res1 as Data<T>).message || "请求失败",
});
} }
resolve(res1 as Data<T>); resolve(res1 as Data<T>);
} else { } else {