refactor: 重命名客户端工程

This commit is contained in:
Nixevol
2026-07-03 03:08:05 +08:00
parent b9e2b78fcd
commit 70a8528f41
35 changed files with 64 additions and 61 deletions
+4 -4
View File
@@ -5,7 +5,7 @@ export interface AppConfig {
baseUrl: string;
publicTracePath: string;
adminOrigin: string;
h5Origin: string;
clientOrigin: string;
traceUrlTemplate: string;
jwt: { secret: string; expiresIn: string };
redis: { host: string; port: number; password?: string };
@@ -33,7 +33,7 @@ export interface AppConfig {
}
export default (): AppConfig => {
const h5Origin = process.env.H5_ORIGIN || 'http://localhost:5174';
const clientOrigin = process.env.CLIENT_ORIGIN || 'http://localhost:5174';
return {
appName: process.env.APP_NAME || '艺术品可信溯源与认证平台',
env: process.env.NODE_ENV || 'development',
@@ -41,9 +41,9 @@ export default (): AppConfig => {
baseUrl: process.env.BASE_URL || 'http://localhost:3000',
publicTracePath: process.env.PUBLIC_TRACE_PATH || '/t',
adminOrigin: process.env.ADMIN_ORIGIN || 'http://localhost:5173',
h5Origin,
clientOrigin,
// 短链跳转到 C 端溯源页的地址模板,{code} 会被替换为短码
traceUrlTemplate: process.env.TRACE_URL_TEMPLATE || `${h5Origin}/#/trace/{code}`,
traceUrlTemplate: process.env.TRACE_URL_TEMPLATE || `${clientOrigin}/#/trace/{code}`,
jwt: {
secret: process.env.JWT_SECRET || 'artveris_dev_secret',
expiresIn: process.env.JWT_EXPIRES_IN || '7d',
+1 -1
View File
@@ -29,7 +29,7 @@ async function bootstrap(): Promise<void> {
app.enableCors({
origin: [
config.get<string>('adminOrigin') as string,
config.get<string>('h5Origin') as string,
config.get<string>('clientOrigin') as string,
/^http:\/\/localhost(:\d+)?$/,
/^http:\/\/127\.0\.0\.1(:\d+)?$/,
],