diff --git a/CloudBuilder/CloudBuilder.Web.Entry/Dockerfile b/CloudBuilder/CloudBuilder.Web.Entry/Dockerfile
index 9ea4821..eaa0b8d 100644
--- a/CloudBuilder/CloudBuilder.Web.Entry/Dockerfile
+++ b/CloudBuilder/CloudBuilder.Web.Entry/Dockerfile
@@ -26,4 +26,24 @@ FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
COPY ./dist ./dist
-ENTRYPOINT ["dotnet", "CloudBuilder.Web.Entry.dll"]
\ No newline at end of file
+ENTRYPOINT ["dotnet", "CloudBuilder.Web.Entry.dll"]
+
+#version: "3"
+#services:
+ #cb:
+ #image: mcr.microsoft.com/dotnet/runtime-deps:8.0
+ #container_name: CloudBuilder.Web.Entry
+ #restart: always
+ #ports:
+ #- "5200:8080"
+ #volumes:
+ #- ./:/app
+ #- /vol1/1000/Docker/NET8/publish/data:/app/data
+ #working_dir: /app
+ #environment:
+ #- ASPNETCORE_URLS=http://+:8080
+ #- ASPNETCORE_ENVIRONMENT=Production
+ #- TZ=Asia/Shanghai # 新增时区环境变量
+ #command: >
+ #sh -c "chmod +x ./CloudBuilder.Web.Entry && ./CloudBuilder.Web.Entry"
+#
\ No newline at end of file
diff --git a/CloudBuilder/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile3.pubxml.user b/CloudBuilder/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile3.pubxml.user
index f25b4b1..57b2f35 100644
--- a/CloudBuilder/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile3.pubxml.user
+++ b/CloudBuilder/CloudBuilder.Web.Entry/Properties/PublishProfiles/FolderProfile3.pubxml.user
@@ -3,7 +3,7 @@
<_PublishTargetUrl>C:\inetpub\wwwroot\dockwebapi2
- True|2026-09-02T02:58:16.8081797Z||;True|2026-08-26T13:34:12.3805892+08:00||;True|2026-08-25T08:31:30.7787234+08:00||;True|2026-08-20T13:10:46.4725468+08:00||;True|2026-08-20T13:10:28.3142576+08:00||;True|2026-08-19T16:10:27.3362887+08:00||;True|2026-08-19T16:01:12.6234971+08:00||;True|2026-08-19T15:42:46.6576265+08:00||;True|2026-08-19T13:39:59.9363522+08:00||;True|2026-08-19T13:36:53.0379313+08:00||;True|2026-08-19T13:31:36.0841398+08:00||;True|2026-08-19T11:44:37.5319626+08:00||;True|2026-08-19T09:36:45.6000047+08:00||;True|2026-08-19T09:34:36.8468631+08:00||;True|2026-08-19T08:35:41.2202300+08:00||;True|2026-08-18T16:20:59.0170916+08:00||;
+ True|2026-09-02T03:08:23.8720038Z||;True|2026-09-02T10:58:16.8081797+08:00||;True|2026-08-26T13:34:12.3805892+08:00||;True|2026-08-25T08:31:30.7787234+08:00||;True|2026-08-20T13:10:46.4725468+08:00||;True|2026-08-20T13:10:28.3142576+08:00||;True|2026-08-19T16:10:27.3362887+08:00||;True|2026-08-19T16:01:12.6234971+08:00||;True|2026-08-19T15:42:46.6576265+08:00||;True|2026-08-19T13:39:59.9363522+08:00||;True|2026-08-19T13:36:53.0379313+08:00||;True|2026-08-19T13:31:36.0841398+08:00||;True|2026-08-19T11:44:37.5319626+08:00||;True|2026-08-19T09:36:45.6000047+08:00||;True|2026-08-19T09:34:36.8468631+08:00||;True|2026-08-19T08:35:41.2202300+08:00||;True|2026-08-18T16:20:59.0170916+08:00||;
\ No newline at end of file
diff --git a/CloudBuilder/CloudBuilder.Web.Entry/appsettings.json b/CloudBuilder/CloudBuilder.Web.Entry/appsettings.json
index a830772..24674a7 100644
--- a/CloudBuilder/CloudBuilder.Web.Entry/appsettings.json
+++ b/CloudBuilder/CloudBuilder.Web.Entry/appsettings.json
@@ -10,16 +10,17 @@
"DbContexts": {
"MasterDbContext": {
"DbContextTypeName": "MasterDbContext",
- "ConnectionString": "Server=localhost\\SQLEXPRESS;Database=Furion;User=sa;Password=owen123456;MultipleActiveResultSets=True;TrustServerCertificate=true",
- "DatabaseType": "SqlServer",
+ "ConnectionString": "server=nas.youjiala.com;port=3307;database=Furion;uid=root;pwd=Root@1237890;CharSet=utf8mb4;",
+ "DatabaseType": "MySql",
+
"LazyLoadingProxiesEnabled": true,
"AuditEntityEnabled": true,
"AutoMigrationEnabled": true
},
"SecondaryDbContext": {
"DbContextTypeName": "SecondaryDbContext",
- "ConnectionString": "server=nas.youjiala.com;port=3307;database=Furion;uid=root;pwd=Root@1237890;CharSet=utf8mb4;",
- "DatabaseType": "MySql",
+ "ConnectionString": "Server=localhost\\SQLEXPRESS;Database=Furion;User=sa;Password=owen123456;MultipleActiveResultSets=True;TrustServerCertificate=true",
+ "DatabaseType": "SqlServer",
"LazyLoadingProxiesEnabled": true,
"AuditEntityEnabled": true,
"AutoMigrationEnabled": true
diff --git a/WebVue/src/locales/index.ts b/WebVue/src/locales/index.ts
index 6a6ff1c..976564b 100644
--- a/WebVue/src/locales/index.ts
+++ b/WebVue/src/locales/index.ts
@@ -2,7 +2,11 @@ import { createI18n } from 'vue-i18n'
import type { I18nOptions } from 'vue-i18n';
import type { App } from 'vue';
import { set } from 'lodash-es';
+import axios from 'axios';
import type { LocaleEntity } from '@/data/auto/localeEntity';
+import { WebSitePolicy } from '@/policy/custom/webSitePolicy';
+import en from './lang/en.ts';
+import cn from './lang/zh-cn.ts';
//这儿使用await,需要如下两步处理
//npm install vite-plugin-top-level-await -D
@@ -15,16 +19,14 @@ const i18n:any =createI18n( options)
async function createI18nOptions(): Promise {
const locale:string='zh-cn';
- const en = await import(`./lang/en.ts`);
- const cn = await import(`./lang/zh-cn.ts`);
return {
legacy: false,
globalInjection: true, //全局生效$t
locale: locale, // 默认cn翻译
messages: {
- ['zh-cn']: cn.default?.message,
- ['en']: en.default?.message,
+ ['zh-cn']: cn?.message,
+ ['en']: en?.message,
},
sync: true, //If you don’t want to inherit locale from global scope, you need to set sync of i18n component option to false.
silentTranslationWarn: true, // true - warning off
@@ -36,6 +38,10 @@ async function createI18nOptions(): Promise {
// setup i18n instance with global
export async function setupI18n(app: App) {
app.use(i18n);
+ // 初始化 i18n 后拉取数据库翻译并合并。
+ // 注意:不能 await,否则接口慢/挂起会阻塞 app.mount 导致白屏;
+ // mergeLocaleMessage 是响应式的,合并完成界面文案会自动更新,失败只 warn。
+ mergeDbLocaleMessages();
}
/**
@@ -46,12 +52,24 @@ export async function setupI18n(app: App) {
* GroupName -> 顶层分组(对应 json 文件名的 key,如 layout / login / request)
* Name -> 点分隔的翻译 key(如 header.logout)
* Value -> 翻译文本
- * 需在应用启动后调用;内部使用动态 import,避免与 utils/request 形成循环依赖。
+ * 需在应用启动后调用;参考 router/insideLayout.ts,直接使用 axios 裸调接口,
+ * 不经过 utils/request 封装,避免与其形成循环依赖。
*/
export async function mergeDbLocaleMessages() {
try {
- const { default: localeService } = await import('@/service/security/localeService');
- const list = await localeService.FindAll();
+ // 参考 router/insideLayout.ts 的 axios 调用方式
+ if (process.env.NODE_ENV === "development") {
+ axios.defaults.baseURL = WebSitePolicy.WebApiRootDev;
+ axios.defaults.withCredentials = true;
+ } else {
+ axios.defaults.baseURL = WebSitePolicy.WebApiRoot;
+ }
+ const response = await axios.create().request({
+ url: "/Locale/FindAll",
+ method: "get",
+ });
+
+ const list: LocaleEntity[] = response.status == 200 ? response.data : [];
if (!list || list.length === 0) return;
// 按语言分组,并将 GroupName.Name 铺平成嵌套对象
diff --git a/WebVue/src/locales/lang/en/login.json b/WebVue/src/locales/lang/en/login.json
index 54960c1..e6d89c2 100644
--- a/WebVue/src/locales/lang/en/login.json
+++ b/WebVue/src/locales/lang/en/login.json
@@ -1,15 +1,17 @@
{
+ "login": {
+ "login": "Login"
+ },
"register": {
"twoDifferentPasswords": "Two different passwords",
"pleaseEnterYourConfirmationPassword": "Please enter your confirmation password"
},
"changePassword": {
"changePassword": "Change Password",
- "oldPassword":"Old Password",
- "newPassword":"New Password",
- "confirmPassword":"Confirm Password",
- "pleaseInputOldPassword":"Please input old password",
- "pleaseInputNewPassword":"Please input new password"
-
+ "oldPassword": "Old Password",
+ "newPassword": "New Password",
+ "confirmPassword": "Confirm Password",
+ "pleaseInputOldPassword": "Please input old password",
+ "pleaseInputNewPassword": "Please input new password"
}
}
\ No newline at end of file
diff --git a/WebVue/src/locales/lang/zh-cn/login.json b/WebVue/src/locales/lang/zh-cn/login.json
index d523034..4fb9aae 100644
--- a/WebVue/src/locales/lang/zh-cn/login.json
+++ b/WebVue/src/locales/lang/zh-cn/login.json
@@ -1,14 +1,17 @@
{
+ "login": {
+ "login": "登录"
+ },
"register": {
"pleaseEnterYourConfirmationPassword": "请输入确认密码",
"twoDifferentPasswords": "两次密码不一样"
},
"changePassword": {
"changePassword": "修改密码",
- "oldPassword":"旧密码",
- "newPassword":"新密码",
- "confirmPassword":"确认密码",
- "pleaseInputOldPassword":"请输入旧密码",
- "pleaseInputNewPassword":"请输入新密码"
-}
-}
+ "oldPassword": "旧密码",
+ "newPassword": "新密码",
+ "confirmPassword": "确认密码",
+ "pleaseInputOldPassword": "请输入旧密码",
+ "pleaseInputNewPassword": "请输入新密码"
+ }
+}
\ No newline at end of file
diff --git a/WebVue/src/main.ts b/WebVue/src/main.ts
index 379c6bf..ffba198 100644
--- a/WebVue/src/main.ts
+++ b/WebVue/src/main.ts
@@ -5,7 +5,7 @@ import App from "./App.vue";
import { setupStore } from "./store";
//使用了Top await
import { setupRouter } from "./router";
-import { mergeDbLocaleMessages } from "./locales";
+import { setupI18n } from "./locales";
import {
setupAntd,
@@ -33,11 +33,10 @@ function setupPlugins() {
async function setupApp() {
// 挂载pinia状态管理
setupStore(app);
- // 并行加载数据库 locale 表内容作为中英文翻译补充
- const dbLocale = mergeDbLocaleMessages();
// 挂载路由
await setupRouter(app);
- await dbLocale;
+ // 初始化 i18n(内部会异步拉取数据库翻译补充,不阻塞挂载)
+ await setupI18n(app);
app.mount("#app");
}
diff --git a/WebVue/src/views/login/index.vue b/WebVue/src/views/login/index.vue
index 0cea62f..09ceed1 100644
--- a/WebVue/src/views/login/index.vue
+++ b/WebVue/src/views/login/index.vue
@@ -17,10 +17,10 @@
- 登录
+ {{ t('login.login.login')}}
-