Files
YGChatCS/src/request/base/config.js

29 lines
764 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { isZhiNian } from "@/constant/base";
import { useAppStore } from "@/store";
import { devUrl, wssDevUrl } from "./baseUrl";
import { getServiceUrl } from "../api/GetServiceUrlApi";
/// 版本号, 每次发版本前增加
const versionValue = "1.1.1";
/// 是否是测试版本, 测试版本为true 发布版本为false
const developVersion = true;
// 获取服务地址
const getEvnUrl = async () => {
/// 不需要获取环境地址
if (developVersion) {
const appStore = useAppStore();
appStore.setServerConfig({
baseUrl: devUrl, // 服务器基础地址
wssUrl: wssDevUrl, // 服务器wss地址
});
return;
}
/// 正式环境获取服务地址
await getServiceUrl(versionValue);
};
export { getEvnUrl };