fix: 优化登录页图片替换
This commit is contained in:
parent
f3b8068044
commit
06d8c03dd0
|
|
@ -19,12 +19,7 @@ import DefaultSetting from '../config/config'
|
||||||
const system = useSystem();
|
const system = useSystem();
|
||||||
const {configInfo} = storeToRefs(system);
|
const {configInfo} = storeToRefs(system);
|
||||||
|
|
||||||
watchEffect(() => {
|
system.setDocumentTitle()
|
||||||
const ico: any = document.querySelector('link[rel="icon"]');
|
|
||||||
if(ico !== null){
|
|
||||||
ico.href = configInfo.value?.front?.ico || DefaultSetting?.logo
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,15 @@ export const useSystem = defineStore('system', {
|
||||||
const ico: any = document.querySelector('link[rel="icon"]');
|
const ico: any = document.querySelector('link[rel="icon"]');
|
||||||
ico.href = res.result.ico;
|
ico.href = res.result.ico;
|
||||||
document.title = res.result.title || '';
|
document.title = res.result.title || '';
|
||||||
|
this.configInfo['front'] = res.result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setDocumentTitle() {
|
||||||
|
const _data = this.configInfo['front']
|
||||||
|
if (_data) {
|
||||||
|
const ico: any = document.querySelector('link[rel="icon"]');
|
||||||
|
ico.href = _data.ico;
|
||||||
|
document.title = _data.title || '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getSystemConfig() {
|
async getSystemConfig() {
|
||||||
|
|
@ -47,12 +56,13 @@ export const useSystem = defineStore('system', {
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
params.forEach((key: string) => {
|
params.forEach((key: string) => {
|
||||||
this.configInfo[key] = { ...result.find((item: any) => item.scope === key)?.properties }
|
this.configInfo[key] = { ...result.find((item: any) => item.scope === key)?.properties }
|
||||||
if (key === 'front') {
|
// if (key === 'front') {
|
||||||
const data = result.find((item: any) => item.scope === key).properties
|
// const data = result.find((item: any) => item.scope === key).properties
|
||||||
const ico: any = document.querySelector('link[rel="icon"]');
|
// const ico: any = document.querySelector('link[rel="icon"]');
|
||||||
ico.href = data.ico;
|
// ico.href = data.ico;
|
||||||
document.title = data.title || '';
|
// document.title = data.title || '';
|
||||||
}
|
// }
|
||||||
|
this.setDocumentTitle()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ const codeConfig = ref(false);
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const bindings = ref<any[]>();
|
const bindings = ref<any[]>();
|
||||||
const basis = ref<any>({});
|
// const basis = ref<any>({});
|
||||||
|
|
||||||
const defaultImg = getImage('/apply/provider1.png');
|
const defaultImg = getImage('/apply/provider1.png');
|
||||||
const iconMap = new Map();
|
const iconMap = new Map();
|
||||||
|
|
@ -266,7 +266,8 @@ const onFinish = async () => {
|
||||||
if (userResp.result?.username === 'admin') {
|
if (userResp.result?.username === 'admin') {
|
||||||
const resp: any = await getInitSet();
|
const resp: any = await getInitSet();
|
||||||
if (resp.status === 200 && !resp.result.length) {
|
if (resp.status === 200 && !resp.result.length) {
|
||||||
window.location.href = '/#/init-home';
|
// window.location.href = '/#/init-home';
|
||||||
|
router.push('/init-home')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -275,7 +276,8 @@ const onFinish = async () => {
|
||||||
...res.result
|
...res.result
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
window.location.href = '/';
|
// window.location.href = '/';
|
||||||
|
router.push('/')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
form.verifyCode = '';
|
form.verifyCode = '';
|
||||||
|
|
@ -315,6 +317,9 @@ const getOpen = () => {
|
||||||
systemStore.getFront()
|
systemStore.getFront()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const basis = computed(() => {
|
||||||
|
return systemStore.configInfo['front'] || {}
|
||||||
|
})
|
||||||
const handleClickOther = (item: any) => {
|
const handleClickOther = (item: any) => {
|
||||||
LocalStore.set('onLogin', 'no');
|
LocalStore.set('onLogin', 'no');
|
||||||
window.open(`${BASE_API_PATH}/application/sso/${item.id}/login`);
|
window.open(`${BASE_API_PATH}/application/sso/${item.id}/login`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue