💥 兼容setting接口的新版本,影响内容site_name与custom_code

This commit is contained in:
hi2hi 2024-12-30 05:04:03 +00:00
parent 718b0138b0
commit 963c06dfce
3 changed files with 6 additions and 2 deletions

View File

@ -46,6 +46,9 @@ const store = useStore();
const dynamicContentRef = ref();
const dynamicContent = computed(() => {
if (store.state.setting?.config?.custom_code) {
return store.state.setting.config.custom_code;
}
if (store.state.setting?.custom_code) {
return store.state.setting.custom_code;
}

View File

@ -118,7 +118,7 @@ const store = createStore({
commit('SET_SETTING', res);
// 如果自定义配置没有设置title使用站点名称
if (!window.$$nazhuaConfig.title) {
config.nazhua.title = res.site_name;
config.nazhua.title = res.config?.site_name || res.site_name;
if (route?.name === 'Home' || !route) {
document.title = config.nazhua.title;
}

View File

@ -26,7 +26,8 @@ export const loadServerGroup = async () => request({
/**
* 加载网站配置
*
* 暂时只使用site_name
* 暂时只使用site_name\custom_code
* 哪吒v1.4.9之后上面的参数调整至data.config
*/
export const loadSetting = async () => request({
url: config.nazhua.v1ApiSettingPath,