fix: 前端设置存储保存分离、硬编码文案接入 i18n、C 端恢复隐私说明
Settings 存储卡片加提示说明不随保存生效;Install 文案迁入全局 locale; ArtworkEdit 默认节点标题走 i18n;C 端本地化出库记录节点并恢复渲染隐私说明; TraceCodePanel/Outbound 适配 outImages 去除 outImage 兼容。
This commit is contained in:
@@ -116,81 +116,10 @@ interface InstallForm {
|
||||
};
|
||||
}
|
||||
|
||||
const messages = {
|
||||
'zh-CN': {
|
||||
subtitle: '首次运行,请完成系统初始化',
|
||||
start: '开始安装',
|
||||
installing: '安装中…',
|
||||
alreadyInstalled: '系统已完成初始化',
|
||||
gotoAdmin: '可直接进入管理后台。',
|
||||
enterAdmin: '进入后台',
|
||||
base: '基础',
|
||||
appName: '平台名称',
|
||||
baseUrl: '对外访问地址',
|
||||
listenPort: '监听端口',
|
||||
baseUrlHint: '三端共用此地址:后台 /admin、客户端 /trace、接口 /api。域名与 HTTPS 建议由 Nginx/宝塔/1Panel 反代到监听端口。',
|
||||
host: '主机',
|
||||
port: '端口',
|
||||
database: '数据库',
|
||||
username: '账号',
|
||||
password: '密码',
|
||||
adminUser: '建库管理员账号(可选)',
|
||||
adminPass: '建库管理员密码(可选)',
|
||||
mysqlAdminHint: '仅当业务账号无建库权限时填写;系统会自动创建数据库并初始化表结构与数据。',
|
||||
admin: '管理员',
|
||||
realName: '姓名',
|
||||
storage: '存储',
|
||||
driver: '方式',
|
||||
local: '本地',
|
||||
localDir: '本地目录',
|
||||
cdnBaseUrl: 'CDN 地址',
|
||||
failed: '安装失败',
|
||||
done: '初始化完成,服务正在重启,请稍候…',
|
||||
loadFailed: '读取安装状态失败',
|
||||
defaultAppName: '艺术品溯源平台',
|
||||
defaultAdminName: '管理员',
|
||||
},
|
||||
'en-US': {
|
||||
subtitle: 'First run — please complete the setup',
|
||||
start: 'Start Install',
|
||||
installing: 'Installing…',
|
||||
alreadyInstalled: 'The system has already been initialized',
|
||||
gotoAdmin: 'You can open the admin console now.',
|
||||
enterAdmin: 'Open Admin',
|
||||
base: 'Base',
|
||||
appName: 'Platform Name',
|
||||
baseUrl: 'Public URL',
|
||||
listenPort: 'Listen Port',
|
||||
baseUrlHint: 'All three apps share this URL: admin at /admin, client at /trace, API at /api. Use Nginx / a control panel to reverse-proxy the domain and HTTPS to the listen port.',
|
||||
host: 'Host',
|
||||
port: 'Port',
|
||||
database: 'Database',
|
||||
username: 'Username',
|
||||
password: 'Password',
|
||||
adminUser: 'DB admin user (optional)',
|
||||
adminPass: 'DB admin password (optional)',
|
||||
mysqlAdminHint: 'Only needed if the business account cannot create databases; the database, tables and data are created automatically.',
|
||||
admin: 'Admin',
|
||||
realName: 'Name',
|
||||
storage: 'Storage',
|
||||
driver: 'Driver',
|
||||
local: 'Local',
|
||||
localDir: 'Local Directory',
|
||||
cdnBaseUrl: 'CDN URL',
|
||||
failed: 'Installation failed',
|
||||
done: 'Initialized. The service is restarting, please wait…',
|
||||
loadFailed: 'Failed to read installation status',
|
||||
defaultAppName: 'Artwork Traceability Platform',
|
||||
defaultAdminName: 'Administrator',
|
||||
},
|
||||
} as const;
|
||||
|
||||
type MessageKey = keyof (typeof messages)['zh-CN'];
|
||||
|
||||
const { locale } = useI18n();
|
||||
const lang = computed<'zh-CN' | 'en-US'>(() => (String(locale.value).startsWith('en') ? 'en-US' : 'zh-CN'));
|
||||
function tt(key: MessageKey): string {
|
||||
return messages[lang.value][key] || messages['zh-CN'][key];
|
||||
const { t } = useI18n();
|
||||
// 安装向导文案统一走全局 locale(pages.install.*),保持与后台其它页面一致
|
||||
function tt(key: string): string {
|
||||
return t(`pages.install.${key}`);
|
||||
}
|
||||
|
||||
const driverOptions = computed(() => [
|
||||
@@ -199,7 +128,7 @@ const driverOptions = computed(() => [
|
||||
]);
|
||||
|
||||
const form = reactive<InstallForm>({
|
||||
appName: messages[lang.value].defaultAppName,
|
||||
appName: tt('defaultAppName'),
|
||||
baseUrl: location.origin,
|
||||
port: 3000,
|
||||
mysql: {
|
||||
@@ -212,7 +141,7 @@ const form = reactive<InstallForm>({
|
||||
adminPassword: '',
|
||||
},
|
||||
redis: { host: '127.0.0.1', port: 6379, password: '' },
|
||||
admin: { username: 'admin', password: '', realName: messages[lang.value].defaultAdminName },
|
||||
admin: { username: 'admin', password: '', realName: tt('defaultAdminName') },
|
||||
storage: {
|
||||
driver: 'local',
|
||||
localDir: './storage',
|
||||
|
||||
Reference in New Issue
Block a user