feat: 服务接口地址动态获取
This commit is contained in:
17
src/request/api/config.js
Normal file
17
src/request/api/config.js
Normal 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 };
|
||||
Reference in New Issue
Block a user