- 新增 .editorconfig 文件统一代码风格配置 - 新增 .env 环境变量配置文件 - 添加开发和生产环境的环境变量配置 - 配置 ESLint 忽略规则文件 - 设置代码检查配置文件 .eslintrc.js - 添加 Git 忽略文件规则 - 创建 Prettier 格式化忽略规则 - 添加隐私政策和服务协议HTML文件 - 实现访问密钥编辑组件基础结构
56 lines
1.4 KiB
Vue
56 lines
1.4 KiB
Vue
<template>
|
|
<ele-config-provider
|
|
:map-key="MAP_KEY"
|
|
:keep-alive="keepAlive"
|
|
:license="LICENSE_CODE"
|
|
>
|
|
<a-config-provider :locale="antLocale">
|
|
<router-view />
|
|
</a-config-provider>
|
|
</ele-config-provider>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { unref, computed } from 'vue';
|
|
import { storeToRefs } from 'pinia';
|
|
import { useThemeStore } from '@/store/modules/theme';
|
|
import {
|
|
MAP_KEY,
|
|
MAP_CODE,
|
|
LICENSE_CODE,
|
|
TAB_KEEP_ALIVE
|
|
} from '@/config/setting';
|
|
import { useSetDocumentTitle } from '@/utils/document-title-util';
|
|
import { useLocale } from '@/i18n/use-locale';
|
|
import {configWebsiteField} from "@/api/cms/cmsWebsiteField";
|
|
|
|
const themeStore = useThemeStore();
|
|
const { showTabs } = storeToRefs(themeStore);
|
|
|
|
// 恢复主题
|
|
themeStore.recoverTheme();
|
|
|
|
// 切换路由自动更新浏览器页签标题
|
|
useSetDocumentTitle();
|
|
|
|
// 国际化配置
|
|
const { antLocale } = useLocale();
|
|
|
|
// 读取产品模板信息
|
|
if(!sessionStorage.getItem('LICENSE_CODE')){
|
|
configWebsiteField({}).then((data) => {
|
|
// @ts-ignore
|
|
const code = "mp" + data.VITE_LICENSE_CODE;
|
|
if(code){
|
|
sessionStorage.setItem('LICENSE_CODE', code)
|
|
}
|
|
});
|
|
}
|
|
|
|
// 用于内链 iframe 组件获取 KeepAlive
|
|
const keepAlive = computed(() => TAB_KEEP_ALIVE && unref(showTabs));
|
|
window._AMapSecurityConfig = {
|
|
securityJsCode: MAP_CODE
|
|
};
|
|
</script>
|