feat: 服务接口地址动态获取

This commit is contained in:
duanshuwen
2025-11-13 19:43:03 +08:00
parent 48932e3851
commit 1028e20d42
14 changed files with 44 additions and 55 deletions

17
src/request/api/config.js Normal file
View File

@@ -0,0 +1,17 @@
import request from "../base/request";
import { isProd } from "@/constant/base";
import { useAppStore } from "@/store";
// 获取服务地址
const getEvnUrl = (args) => {
if (isProd) {
const appStore = useAppStore();
request.post("/hotelBiz/mainScene/getServiceUrl", args).then(({ data }) => {
console.log("🚀 ~ getEvnUrl ~ data:", data);
appStore.setServerConfig(data);
});
}
};
export { getEvnUrl };