Browse Source

fix: 国际化问题修改 (#1872)

pull/1873/head
ssongliu 1 year ago committed by GitHub
parent
commit
075ae253a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      frontend/src/api/index.ts
  2. 2
      frontend/src/lang/modules/en.ts

13
frontend/src/api/index.ts

@ -18,16 +18,13 @@ class RequestHttp {
service: AxiosInstance;
public constructor(config: AxiosRequestConfig) {
this.service = axios.create(config);
let language = globalStore.language === 'tw' ? 'zh-Hant' : globalStore.language;
this.service.interceptors.request.use(
(config: AxiosRequestConfig) => {
if (config.method != 'get') {
config.headers = {
'X-CSRF-TOKEN': globalStore.csrfToken,
'Accept-Language': language,
...config.headers,
};
}
let language = globalStore.language === 'tw' ? 'zh-Hant' : globalStore.language;
config.headers = {
'Accept-Language': language,
...config.headers,
};
return {
...config,
};

2
frontend/src/lang/modules/en.ts

@ -667,6 +667,8 @@ const message = {
startIn: ' to start',
},
cronjob: {
create: 'Create Cronjob',
edit: 'Edit Cronjob',
cronTask: 'Cronjob',
changeStatus: 'Change status',
disableMsg:

Loading…
Cancel
Save