feat: 完善平台总后台模块
This commit is contained in:
24
frontend/platform_admin/src/app/App.vue
Normal file
24
frontend/platform_admin/src/app/App.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<a-config-provider :locale="locale">
|
||||
<router-view />
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
|
||||
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
||||
import { computed } from 'vue';
|
||||
import useLocale from '@/hooks/locale';
|
||||
|
||||
const { currentLocale } = useLocale();
|
||||
const locale = computed(() => {
|
||||
switch (currentLocale.value) {
|
||||
case 'zh-CN':
|
||||
return zhCN;
|
||||
case 'en-US':
|
||||
return enUS;
|
||||
default:
|
||||
return enUS;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
22
frontend/platform_admin/src/app/env.d.ts
vendored
Normal file
22
frontend/platform_admin/src/app/env.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vue/jsx" />
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
|
||||
const component: DefineComponent<
|
||||
Record<string, unknown>,
|
||||
Record<string, unknown>,
|
||||
unknown
|
||||
>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_BASE_URL: string;
|
||||
readonly VITE_ERROR_REPORT_URL: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
38
frontend/platform_admin/src/app/main.ts
Normal file
38
frontend/platform_admin/src/app/main.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import ArcoVue from '@arco-design/web-vue';
|
||||
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
|
||||
import { createApp } from 'vue';
|
||||
import globalComponents from '@/components';
|
||||
import '@/assets/style/global.less';
|
||||
import { setupHttp } from '@/plugins/http';
|
||||
import directive from '@/directive';
|
||||
import i18n from '@/locale';
|
||||
import router from '@/router';
|
||||
import store from '@/store';
|
||||
import setupErrorReport from '@/utils/error-report';
|
||||
import App from './App.vue';
|
||||
|
||||
async function bootstrap() {
|
||||
if (import.meta.env.DEV) {
|
||||
await import('@/mocks');
|
||||
}
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(ArcoVue, {});
|
||||
app.use(ArcoVueIcon);
|
||||
app.use(router);
|
||||
app.use(store);
|
||||
app.use(i18n);
|
||||
app.use(globalComponents);
|
||||
app.use(directive);
|
||||
|
||||
setupHttp();
|
||||
setupErrorReport(
|
||||
app,
|
||||
import.meta.env.VITE_ERROR_REPORT_URL?.trim() ?? '',
|
||||
);
|
||||
|
||||
app.mount('#app');
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
Reference in New Issue
Block a user