Parcourir la source

fix 修复 缺少协议头问题

疯狂的狮子Li il y a 1 an
Parent
commit
4143285ec6
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/layout/components/SocialCallback/index.vue

+ 2 - 1
src/layout/components/SocialCallback/index.vue

@@ -29,7 +29,8 @@ const processResponse = async (res: any) => {
   ElMessage.success(res.msg);
   setTimeout(() => {
     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 {
       location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
     }