Skip to content

Commit

Permalink
refactor: Demo server, prohibit operation
Browse files Browse the repository at this point in the history
  • Loading branch information
lan-yonghui committed Dec 18, 2024
1 parent 063a071 commit 8be0107
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion frontend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class RequestHttp {
response.status,
response.data && response.data['message'] ? response.data['message'] : '',
);
return;
return Promise.reject(error);
default:
globalStore.isLogin = false;
globalStore.errStatus = 'code-' + response.status;
Expand Down
48 changes: 24 additions & 24 deletions frontend/src/views/setting/panel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -440,36 +440,36 @@ const onChangeThemeColor = () => {
const onSave = async (key: string, val: any) => {
loading.value = true;
if (key === 'Language') {
i18n.locale.value = val;
globalStore.updateLanguage(val);
}
if (key === 'Theme') {
globalStore.themeConfig.theme = val;
switchTheme();
if (globalStore.isProductPro) {
await updateXpackSettingByKey('Theme', val);
let color: string;
const themeColor: ThemeColor = JSON.parse(globalStore.themeConfig.themeColor);
if (val === 'auto') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
color = prefersDark.matches ? themeColor.dark : themeColor.light;
} else {
color = val === 'dark' ? themeColor.dark : themeColor.light;
}
globalStore.themeConfig.primary = color;
setPrimaryColor(color);
}
}
if (key === 'MenuTabs') {
globalStore.setOpenMenuTabs(val === 'enable');
}
let param = {
key: key,
value: val + '',
};
await updateSetting(param)
.then(async () => {
if (key === 'Language') {
i18n.locale.value = val;
globalStore.updateLanguage(val);
}
if (key === 'Theme') {
globalStore.themeConfig.theme = val;
switchTheme();
if (globalStore.isProductPro) {
await updateXpackSettingByKey('Theme', val);
let color: string;
const themeColor: ThemeColor = JSON.parse(globalStore.themeConfig.themeColor);
if (val === 'auto') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
color = prefersDark.matches ? themeColor.dark : themeColor.light;
} else {
color = val === 'dark' ? themeColor.dark : themeColor.light;
}
globalStore.themeConfig.primary = color;
setPrimaryColor(color);
}
}
if (key === 'MenuTabs') {
globalStore.setOpenMenuTabs(val === 'enable');
}
if (param.key === 'Language') {
location.reload();
}
Expand Down

0 comments on commit 8be0107

Please sign in to comment.