feat: 环境地址配置

This commit is contained in:
2026-01-16 10:25:55 +08:00
parent 5aba9afdd5
commit ff9227c3b8
4 changed files with 22 additions and 11 deletions

View File

@@ -0,0 +1,13 @@
import request from "../base/request";
import { proUrl } from "../base/baseUrl";
import { useAppStore } from "@/store";
export const getServiceUrl = async (versionValue) => {
const apiUrl = proUrl + "/hotelBiz/mainScene/getServiceUrl";
const res = await request.post(apiUrl, { versionValue: versionValue });
if (res && res.code == 0 && res.data) {
const appStore = useAppStore();
appStore.setServerConfig(res.data);
}
};

View File

@@ -1,29 +0,0 @@
import request from "../base/request";
import { isZhiNian } from "@/constant/base";
import { useAppStore } from "@/store";
import { devUrl, proUrl, wssDevUrl } from "../base/baseUrl";
/// 版本号, 每次发版本前增加
const versionValue = "1.0.4";
// 获取服务地址
const getEvnUrl = async () => {
/// 智念客户端不需要获取环境地址
if (isZhiNian) {
const appStore = useAppStore();
appStore.setServerConfig({
baseUrl: devUrl, // 服务器基础地址
wssUrl: wssDevUrl, // 服务器wss地址
});
return;
}
const apiUrl = proUrl + "/hotelBiz/mainScene/getServiceUrl";
const res = await request.post(apiUrl, { versionValue: versionValue });
if (res && res.code == 0 && res.data) {
const appStore = useAppStore();
appStore.setServerConfig(res.data);
}
};
export { getEvnUrl };