Commit b545974e authored by fengyuncheng's avatar fengyuncheng

init: 删掉多余依赖和代码

parent 555e5dea
...@@ -2,6 +2,6 @@ VITE_API_BASEURL = http://127.0.0.1:8080/api/v1 ...@@ -2,6 +2,6 @@ VITE_API_BASEURL = http://127.0.0.1:8080/api/v1
VITE_BASE = / VITE_BASE = /
VITE_APP_TITLE = AronaConfigWebUI VITE_APP_TITLE = TestSite
VITE_APP_DESCRIPTION = A zero-config Vue3 template includes Vite3、Vue3 and TypeScript VITE_APP_DESCRIPTION = A Test Site for Test vue3 renren
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -23,10 +23,6 @@ const axiosInstance: AxiosInstance = axios.create({ ...@@ -23,10 +23,6 @@ const axiosInstance: AxiosInstance = axios.create({
// 请求拦截器 // 请求拦截器
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
(config: IRequestConfig) => { (config: IRequestConfig) => {
if (!config.version) {
config.version = "v1";
config.baseURL = `${config.baseURL}/api/${config.version}/`;
}
config.showServerResponseError = config.showServerResponseError || true; config.showServerResponseError = config.showServerResponseError || true;
return config; return config;
}, },
...@@ -114,14 +110,4 @@ function buildFileUploadHeader(fileName: string) { ...@@ -114,14 +110,4 @@ function buildFileUploadHeader(fileName: string) {
"arona-file-name": fileName, "arona-file-name": fileName,
}; };
} }
export function updateAPIService(host: string, port: number) {
axiosInstance.defaults.baseURL = currentAPI(host, port);
}
export function currentAPI(host?: string, port?: number) {
if (!host || !port) {
return axiosInstance.defaults.baseURL;
}
return `${host}:${port}`;
}
export default LocalhostService; export default LocalhostService;
...@@ -3,15 +3,6 @@ ...@@ -3,15 +3,6 @@
@import '@/assets/styles/dark.scss'; @import '@/assets/styles/dark.scss';
@import "@/assets/styles/variables.scss"; @import "@/assets/styles/variables.scss";
@font-face {
font-family: "Game Font";
src: url("/font/U-OTF-ShinMGoUpr-Medium.woff");
}
@font-face {
font-family: "Chinese Game Font";
src: url("/font/ResourceHanRoundedCN-Medium.woff");
}
#app { #app {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
...@@ -51,25 +42,3 @@ ...@@ -51,25 +42,3 @@
} }
} }
} }
// 主配置文件连接
.config-drag-item {
background-color: white;
border: 1px solid #346789;
text-align: center;
cursor: pointer;
box-shadow: 2px 2px 19px #aaa;
border-radius: 6px;
position: absolute;
color: black;
width: 140px;
height: 60px;
line-height: 1;
user-select: none;
}
.dialog-body-padding-bottom-0 {
.el-dialog__body {
padding-bottom: 0;
}
}
...@@ -10,7 +10,6 @@ export interface IRequestConfig<D = any> extends AxiosRequestConfig<D> { ...@@ -10,7 +10,6 @@ export interface IRequestConfig<D = any> extends AxiosRequestConfig<D> {
showServerResponseError?: boolean; showServerResponseError?: boolean;
// 返回值是否是文件流 // 返回值是否是文件流
isBlob?: boolean; isBlob?: boolean;
version?: "v1" | "v2";
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
......
...@@ -12,7 +12,6 @@ import "virtual:windi.css"; ...@@ -12,7 +12,6 @@ import "virtual:windi.css";
import "virtual:windi-devtools"; import "virtual:windi-devtools";
import "@/assets/styles/index.scss"; import "@/assets/styles/index.scss";
import "element-plus/dist/index.css"; import "element-plus/dist/index.css";
import { setApp } from "@/utils/vueTools";
const i18n = createI18n({ const i18n = createI18n({
locale: "zh-cn", locale: "zh-cn",
...@@ -27,5 +26,3 @@ app.use(router).use(store); ...@@ -27,5 +26,3 @@ app.use(router).use(store);
app.use(i18n); app.use(i18n);
app.mount("#app"); app.mount("#app");
setApp(app);
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { NetworkAdapterType } from "@/interface/http"; import { NetworkAdapterType } from "@/interface/http";
import { updateAPIService } from "@/api/adapter/localhost";
import { BaseStoreState } from "@/store/type"; import { BaseStoreState } from "@/store/type";
const useBaseStore = defineStore({ const useBaseStore = defineStore({
...@@ -26,11 +25,6 @@ const useBaseStore = defineStore({ ...@@ -26,11 +25,6 @@ const useBaseStore = defineStore({
}, },
persist: { persist: {
key: "setting", key: "setting",
afterRestore: (ctx) => {
if (ctx.store.isRestoreBackend) {
updateAPIService(ctx.store.api.host, ctx.store.api.port);
}
},
}, },
}); });
......
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { ElMessageBoxOptions, MessageBoxData } from "element-plus/es/components/message-box/src/message-box.type"; import { ElMessageBoxOptions, MessageBoxData } from "element-plus/es/components/message-box/src/message-box.type";
import { MessageTypedFn } from "element-plus/es/components/message/src/message";
export function infoMessage(info: any) { type IMessage = Parameters<MessageTypedFn>[0];
export function infoMessage(info: IMessage) {
return ElMessage.info(info); return ElMessage.info(info);
} }
export function successMessage(info: any) { export function successMessage(info: IMessage) {
return ElMessage.success(info); return ElMessage.success(info);
} }
export function warningMessage(info: any) { export function warningMessage(info: IMessage) {
return ElMessage.warning(info); return ElMessage.warning(info);
} }
export function errorMessage(info: any) { export function errorMessage(info: IMessage) {
return ElMessage.error(info); return ElMessage.error(info);
} }
......
import { App, createVNode, defineAsyncComponent, render } from "vue";
import { VNodeProps } from "@vue/runtime-core";
type NodeEventListener<K extends keyof HTMLElementEventMap> = {
type: K;
handler: (ev: HTMLElementEventMap[K]) => void;
};
export function mountAsyncComponent(
loader: Parameters<typeof defineAsyncComponent>[0],
props?: (Record<string, unknown> & VNodeProps) | null,
hook?: NodeEventListener<keyof HTMLElementEventMap>[],
): HTMLElement {
const component = defineAsyncComponent(loader);
const componentVNode = createVNode(component, props);
componentVNode.appContext = _app._context;
const container = document.createElement("div");
if (hook) {
hook.forEach((it) => container.addEventListener(it.type, it.handler));
}
render(componentVNode, container);
return container;
}
let _app: App;
export function setApp(app: App) {
_app = app;
}
export function useApp() {
return _app;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment