release: update 5.1.0

This commit is contained in:
xiaoxian521
2024-03-09 22:45:04 +08:00
parent d543b57e34
commit 70772864ac
152 changed files with 8006 additions and 8599 deletions

View File

@@ -1,4 +1,4 @@
import { App } from "vue";
import type { App } from "vue";
import axios from "axios";
let config: object = {};
@@ -8,7 +8,7 @@ const setConfig = (cfg?: unknown) => {
config = Object.assign(config, cfg);
};
const getConfig = (key?: string): ServerConfigs => {
const getConfig = (key?: string): PlatformConfigs => {
if (typeof key === "string") {
const arr = key.split(".");
if (arr && arr.length) {
@@ -27,11 +27,11 @@ const getConfig = (key?: string): ServerConfigs => {
};
/** 获取项目动态全局配置 */
export const getServerConfig = async (app: App): Promise<undefined> => {
export const getPlatformConfig = async (app: App): Promise<undefined> => {
app.config.globalProperties.$config = getConfig();
return axios({
method: "get",
url: `${VITE_PUBLIC_PATH}serverConfig.json`
url: `${VITE_PUBLIC_PATH}platform-config.json`
})
.then(({ data: config }) => {
let $config = app.config.globalProperties.$config;
@@ -45,7 +45,7 @@ export const getServerConfig = async (app: App): Promise<undefined> => {
return $config;
})
.catch(() => {
throw "请在public文件夹下添加serverConfig.json配置文件";
throw "请在public文件夹下添加platform-config.json配置文件";
});
};