mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
接口提示信息国际化
This commit is contained in:
@@ -19,6 +19,7 @@ import { shareStore } from '../shared/store';
|
||||
import Logger from './logger';
|
||||
import { AppModel } from '../data/open';
|
||||
import { InstanceStatus, RunningInstanceModel } from '../data/runningInstance';
|
||||
import { setLang } from '../shared/i18n';
|
||||
|
||||
export default async () => {
|
||||
const cronService = Container.get(CronService);
|
||||
@@ -224,6 +225,17 @@ export default async () => {
|
||||
|
||||
// 初始化保存一次ck和定时任务数据
|
||||
await cronService.autosave_crontab();
|
||||
|
||||
// 确保 lang_env.sh 存在,提供默认 QL_LANG
|
||||
try {
|
||||
const langEnvExist = await fileExist(config.langEnvFile);
|
||||
if (!langEnvExist) {
|
||||
const lang = systemConfig.info?.lang || 'zh';
|
||||
await writeFile(config.langEnvFile, `export QL_LANG='${lang}'\n`);
|
||||
}
|
||||
} catch {}
|
||||
setLang(systemConfig.info?.lang || 'zh');
|
||||
|
||||
await envService.set_envs();
|
||||
|
||||
const authInfo = await userService.getAuthInfo();
|
||||
|
||||
Reference in New Issue
Block a user