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

This commit is contained in:
ssongliu 2023-08-08 14:48:11 +08:00 committed by GitHub
parent fc57256197
commit 075ae253a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View file

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

View file

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