tangning недель назад: 2
Родитель
Сommit
8a0a8013a2

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "version": "0.0.0",
   "version": "0.0.0",
   "type": "module",
   "type": "module",
   "scripts": {
   "scripts": {
-    "dev": "vite --mode=fire",
+    "dev": "vite --mode=criminal",
     "devxm": "vite --mode=xmfire",
     "devxm": "vite --mode=xmfire",
     "devcjz": "vite --mode=cjzfire",
     "devcjz": "vite --mode=cjzfire",
     "dev-offline": "vite --mode=offline",
     "dev-offline": "vite --mode=offline",

+ 10 - 1
src/app/cjzfire/view/login/index.vue

@@ -130,6 +130,11 @@ const imgKey = ref(guid());
 const refer = () => (imgKey.value = guid());
 const refer = () => (imgKey.value = guid());
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 
 
+function isHttpHttpsUrl(path) {
+  // 严格匹配:以http:// 开头  或者  以https:// 开头
+  return path && (path.startsWith('http://') || path.startsWith('https://'))
+}
+
 // 表单提交
 // 表单提交
 const submitClick = async () => {
 const submitClick = async () => {
   if (verification.phone && verification.phone !== "88888888888") {
   if (verification.phone && verification.phone !== "88888888888") {
@@ -177,7 +182,11 @@ const submitClick = async () => {
       url.searchParams.delete("token");
       url.searchParams.delete("token");
       // url.searchParams.append("token", user.value.token);
       // url.searchParams.append("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
-      window.location.replace(url);
+      if(isHttpHttpsUrl(resolved)){ //判断内链还是外链
+        window.location.replace(url);
+      }else{
+        router.push(resolved);
+      }
     } else {
     } else {
       router.replace({ name: RouteName.dispatch });
       router.replace({ name: RouteName.dispatch });
     }
     }

+ 9 - 2
src/app/criminal/view/login/index.vue

@@ -101,7 +101,10 @@ watch(
 const imgKey = ref(guid());
 const imgKey = ref(guid());
 const refer = () => (imgKey.value = guid());
 const refer = () => (imgKey.value = guid());
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
-
+function isHttpHttpsUrl(path) {
+  // 严格匹配:以http:// 开头  或者  以https:// 开头
+  return path && (path.startsWith('http://') || path.startsWith('https://'))
+}
 // 表单提交
 // 表单提交
 const submitClick = async () => {
 const submitClick = async () => {
   if (verification.phone && verification.phone !== "88888888888") {
   if (verification.phone && verification.phone !== "88888888888") {
@@ -149,7 +152,11 @@ const submitClick = async () => {
       url.searchParams.delete("token");
       url.searchParams.delete("token");
       // url.searchParams.append("token", user.value.token);
       // url.searchParams.append("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
-      window.location.replace(url);
+      if(isHttpHttpsUrl(resolved)){ //判断内链还是外链
+        window.location.replace(url);
+      }else{
+        router.push(resolved);
+      }
     } else {
     } else {
       router.replace({ name: RouteName.example });
       router.replace({ name: RouteName.example });
     }
     }

+ 10 - 1
src/app/ga/view/login/index.vue

@@ -122,6 +122,11 @@ const imgKey = ref(guid());
 const refer = () => (imgKey.value = guid());
 const refer = () => (imgKey.value = guid());
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 
 
+function isHttpHttpsUrl(path) {
+  // 严格匹配:以http:// 开头  或者  以https:// 开头
+  return path && (path.startsWith('http://') || path.startsWith('https://'))
+}
+
 // 表单提交
 // 表单提交
 const submitClick = async () => {
 const submitClick = async () => {
   if (verification.phone && verification.phone !== "88888888888") {
   if (verification.phone && verification.phone !== "88888888888") {
@@ -149,7 +154,11 @@ const submitClick = async () => {
       url.searchParams.delete("token");
       url.searchParams.delete("token");
       url.searchParams.append("token", user.value.token);
       url.searchParams.append("token", user.value.token);
       window.localStorage.setItem('token', user.value.token)
       window.localStorage.setItem('token', user.value.token)
-      window.location.replace(url);
+      if(isHttpHttpsUrl(url)){ //判断内链还是外链
+        window.location.replace(url);
+      }else{
+        router.push(url);
+      }
     } else {
     } else {
       router.replace({ name: RouteName.scene });
       router.replace({ name: RouteName.scene });
     }
     }

+ 9 - 1
src/app/xmfire/view/login/index.vue

@@ -127,6 +127,10 @@ const imgKey = ref(guid());
 const refer = () => (imgKey.value = guid());
 const refer = () => (imgKey.value = guid());
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
 
 
+function isHttpHttpsUrl(path) {
+  // 严格匹配:以http:// 开头  或者  以https:// 开头
+  return path && (path.startsWith('http://') || path.startsWith('https://'))
+}
 // 表单提交
 // 表单提交
 const submitClick = async () => {
 const submitClick = async () => {
   if (verification.phone && verification.phone !== "88888888888") {
   if (verification.phone && verification.phone !== "88888888888") {
@@ -174,7 +178,11 @@ const submitClick = async () => {
       url.searchParams.delete("token");
       url.searchParams.delete("token");
       // url.searchParams.append("token", user.value.token);
       // url.searchParams.append("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
       window.localStorage.setItem("token", user.value.token);
-      window.location.replace(url);
+      if(isHttpHttpsUrl(resolved)){ //判断内链还是外链
+        window.location.replace(url);
+      }else{
+        router.push(resolved);
+      }
     } else {
     } else {
       router.replace({ name: RouteName.dispatch });
       router.replace({ name: RouteName.dispatch });
     }
     }

+ 2 - 0
src/view/system/login.vue

@@ -122,6 +122,8 @@ function isHttpHttpsUrl(path) {
 }
 }
 // 表单提交
 // 表单提交
 const submitClick = async () => {
 const submitClick = async () => {
+    const params: any = router.currentRoute.value.query;
+      console.log('isHttpHttpsUrl', isHttpHttpsUrl(params.redirect));
   
   
   if (verification.phone && verification.phone !== "88888888888") {
   if (verification.phone && verification.phone !== "88888888888") {
     return openErrorMsg(verification.phone);
     return openErrorMsg(verification.phone);