feat: add ICP filing number to copyright across app

This commit is contained in:
vben
2026-06-24 10:04:10 +08:00
parent 794edd419e
commit a8c3729850
11 changed files with 26 additions and 11 deletions

View File

@@ -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 =

View File

@@ -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,
});

View File

@@ -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,
});

View File

@@ -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,
});

View File

@@ -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,
});

View File

@@ -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": {

View File

@@ -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: {

View File

@@ -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>

View File

@@ -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 }}

View File

@@ -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';

View File

@@ -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 };