feat: add ICP filing number to copyright across app
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
appCopyrightPreferences,
|
||||
defineOverridesPreferences,
|
||||
definePreferencesExtension,
|
||||
} from '@vben/preferences';
|
||||
@@ -20,6 +21,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
export const preferencesExtension =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineOverridesPreferences } from '@vben/preferences';
|
||||
import { appCopyrightPreferences, defineOverridesPreferences } from '@vben/preferences';
|
||||
|
||||
/**
|
||||
* @description 项目配置文件
|
||||
@@ -10,4 +10,5 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineOverridesPreferences } from '@vben/preferences';
|
||||
import { appCopyrightPreferences, defineOverridesPreferences } from '@vben/preferences';
|
||||
|
||||
/**
|
||||
* @description 项目配置文件
|
||||
@@ -10,4 +10,5 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineOverridesPreferences } from '@vben/preferences';
|
||||
import { appCopyrightPreferences, defineOverridesPreferences } from '@vben/preferences';
|
||||
|
||||
/**
|
||||
* @description 项目配置文件
|
||||
@@ -10,4 +10,5 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineOverridesPreferences } from '@vben/preferences';
|
||||
import { appCopyrightPreferences, defineOverridesPreferences } from '@vben/preferences';
|
||||
|
||||
/**
|
||||
* @description 项目配置文件
|
||||
@@ -10,4 +10,5 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
@@ -47,8 +47,8 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"companySiteLink": "https://www.vben.pro",
|
||||
"date": "2024",
|
||||
"enable": true,
|
||||
"icp": "",
|
||||
"icpLink": "",
|
||||
"icp": "闽ICP备19024351号",
|
||||
"icpLink": "https://beian.miit.gov.cn/",
|
||||
"settingShow": true,
|
||||
},
|
||||
"footer": {
|
||||
|
||||
@@ -47,8 +47,8 @@ const defaultPreferences: Preferences = {
|
||||
companySiteLink: 'https://www.vben.pro',
|
||||
date: '2024',
|
||||
enable: true,
|
||||
icp: '',
|
||||
icpLink: '',
|
||||
icp: '闽ICP备19024351号',
|
||||
icpLink: 'https://beian.miit.gov.cn/',
|
||||
settingShow: true,
|
||||
},
|
||||
footer: {
|
||||
|
||||
@@ -30,7 +30,7 @@ defineProps<{
|
||||
<!-- Footer Copyright -->
|
||||
|
||||
<div
|
||||
class="absolute bottom-3 flex text-center text-xs text-muted-foreground"
|
||||
class="absolute right-0 bottom-3 left-0 flex justify-center text-center text-xs text-muted-foreground"
|
||||
>
|
||||
<slot name="copyright"> </slot>
|
||||
</div>
|
||||
|
||||
@@ -25,8 +25,9 @@ withDefaults(defineProps<Props>(), {
|
||||
<!-- ICP Link -->
|
||||
<a
|
||||
v-if="icp"
|
||||
:href="icpLink || 'javascript:void(0)'"
|
||||
:href="icpLink || 'https://beian.miit.gov.cn/'"
|
||||
class="mx-1 hover:text-primary-hover"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
{{ icp }}
|
||||
|
||||
@@ -22,6 +22,12 @@ function definePreferencesExtension<
|
||||
return extension;
|
||||
}
|
||||
|
||||
export { defineOverridesPreferences, definePreferencesExtension };
|
||||
/** 应用级 ICP 备案配置,供各 app 的 preferences 覆盖使用 */
|
||||
const appCopyrightPreferences = {
|
||||
icp: '闽ICP备19024351号',
|
||||
icpLink: 'https://beian.miit.gov.cn/',
|
||||
} satisfies DeepPartial<Preferences>['copyright'];
|
||||
|
||||
export { appCopyrightPreferences, defineOverridesPreferences, definePreferencesExtension };
|
||||
|
||||
export * from '@vben-core/preferences';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
appCopyrightPreferences,
|
||||
defineOverridesPreferences,
|
||||
definePreferencesExtension,
|
||||
} from '@vben/preferences';
|
||||
@@ -20,6 +21,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
||||
app: {
|
||||
name: import.meta.env.VITE_APP_TITLE,
|
||||
},
|
||||
copyright: appCopyrightPreferences,
|
||||
});
|
||||
|
||||
export type { PlaygroundPreferencesExtension };
|
||||
|
||||
Reference in New Issue
Block a user