fix 修复 缺少协议头问题

This commit is contained in:
疯狂的狮子Li 2024-06-18 19:08:51 +08:00
parent 72610ab194
commit 4143285ec6

View File

@ -29,7 +29,8 @@ const processResponse = async (res: any) => {
ElMessage.success(res.msg); ElMessage.success(res.msg);
setTimeout(() => { setTimeout(() => {
if (res.data !== null && res.data.domain !== null) { if (res.data !== null && res.data.domain !== null) {
location.href = res.data.domain + import.meta.env.VITE_APP_CONTEXT_PATH + 'index'; let protocol = window.location.protocol === 'https:' ? 'https://' : 'http://';
location.href = protocol + res.data.domain + import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
} else { } else {
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index'; location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
} }