From 220f005bc7f2882962b6f204e5e4e4aa5445a9bc Mon Sep 17 00:00:00 2001 From: unknown <1162963624@qq.com> Date: Mon, 30 Nov 2020 13:53:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 ++-- src/api/index.ts | 4 ++-- src/utils/common.ts | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index d776ca6..9cc09d1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,7 +11,7 @@ import { defineComponent } from "vue"; import router from "./router"; import store from "./store"; -import { getValue } from "./utils/common"; +import { getValue, toindex } from "./utils/common"; import { provideI18n } from "@/utils/i18n"; import i18ninit from "@/i18n/init"; import enUS from "ant-design-vue/es/locale/en_US"; @@ -54,7 +54,7 @@ export default defineComponent({ console.log("ip"); store.dispatch("getip"); store.commit("setWlan"); - router.push("/"); + toindex() } const zh = zhCN; const en = enUS; diff --git a/src/api/index.ts b/src/api/index.ts index fbd9fbc..69c94b0 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,7 @@ import router from '@/router'; import store from '@/store'; import { LiveList, LivelistInfo, LoginData, UserInfo } from '@/types'; -import { getValue, saveValue } from '@/utils/common'; +import { getValue, saveValue, toindex } from '@/utils/common'; import { message } from 'ant-design-vue'; import dayjs from 'dayjs'; import { del, get, post, put, setToken } from './base' @@ -47,7 +47,7 @@ export async function userinfo(){ // console.log(user.data.img) if(user.code == 1001){ saveValue("token","") - router.push("/") + toindex() return '未登录'; } diff --git a/src/utils/common.ts b/src/utils/common.ts index fb48bca..40d2078 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,3 +1,4 @@ +import router from '@/router'; import { message } from 'ant-design-vue'; import { geti18n } from './i18n'; @@ -112,4 +113,26 @@ export function provenvideo(file: any, isvideo?: boolean): boolean{ } message.error(lan.$t("leixingcuowu")) return false; +} +export function toindex(){ + function GetUrlRelativePath() { + const url = document.location.toString(); + const arrUrl = url.split("//"); + + const start = arrUrl[1].indexOf("/"); + let relUrl = arrUrl[1].substring(start); //stop省略,截取从start开始到结尾的所有字符 + + if (relUrl.indexOf("?") != -1) { + relUrl = relUrl.split("?")[0]; + } + return relUrl; + } + const url = GetUrlRelativePath() + const list = ['/wblogin','/wbloginerr','/fblogin','/fbloginerr'] + for(let i in list){ + if(list[i] == url){ + return ; + } + } + router.push("/") } \ No newline at end of file -- 2.39.5 From c0b49a0ab9bfe1f145de1358c81a2a0254c3efeb Mon Sep 17 00:00:00 2001 From: unknown <1162963624@qq.com> Date: Mon, 30 Nov 2020 13:54:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.html | 4 ++-- dist/js/app.77eea2aa.js | 2 ++ dist/js/app.77eea2aa.js.map | 1 + dist/js/app.79504c93.js | 2 -- dist/js/app.79504c93.js.map | 1 - ...{chunk-1abac668.8486ad93.js => chunk-1abac668.22237c3e.js} | 2 +- ...abac668.8486ad93.js.map => chunk-1abac668.22237c3e.js.map} | 2 +- ...{chunk-2a197f09.585cb8ac.js => chunk-2a197f09.0a95447f.js} | 2 +- ...a197f09.585cb8ac.js.map => chunk-2a197f09.0a95447f.js.map} | 2 +- ...{chunk-371ee143.dbf315e3.js => chunk-371ee143.c02f0991.js} | 2 +- ...71ee143.dbf315e3.js.map => chunk-371ee143.c02f0991.js.map} | 2 +- ...{chunk-737c53fe.01b0af65.js => chunk-737c53fe.0d11946a.js} | 2 +- ...37c53fe.01b0af65.js.map => chunk-737c53fe.0d11946a.js.map} | 2 +- ...{chunk-74d6e86d.a8412b66.js => chunk-74d6e86d.511d4db0.js} | 2 +- ...4d6e86d.a8412b66.js.map => chunk-74d6e86d.511d4db0.js.map} | 2 +- src/utils/common.ts | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 dist/js/app.77eea2aa.js create mode 100644 dist/js/app.77eea2aa.js.map delete mode 100644 dist/js/app.79504c93.js delete mode 100644 dist/js/app.79504c93.js.map rename dist/js/{chunk-1abac668.8486ad93.js => chunk-1abac668.22237c3e.js} (99%) rename dist/js/{chunk-1abac668.8486ad93.js.map => chunk-1abac668.22237c3e.js.map} (99%) rename dist/js/{chunk-2a197f09.585cb8ac.js => chunk-2a197f09.0a95447f.js} (99%) rename dist/js/{chunk-2a197f09.585cb8ac.js.map => chunk-2a197f09.0a95447f.js.map} (99%) rename dist/js/{chunk-371ee143.dbf315e3.js => chunk-371ee143.c02f0991.js} (99%) rename dist/js/{chunk-371ee143.dbf315e3.js.map => chunk-371ee143.c02f0991.js.map} (99%) rename dist/js/{chunk-737c53fe.01b0af65.js => chunk-737c53fe.0d11946a.js} (99%) rename dist/js/{chunk-737c53fe.01b0af65.js.map => chunk-737c53fe.0d11946a.js.map} (99%) rename dist/js/{chunk-74d6e86d.a8412b66.js => chunk-74d6e86d.511d4db0.js} (99%) rename dist/js/{chunk-74d6e86d.a8412b66.js.map => chunk-74d6e86d.511d4db0.js.map} (99%) diff --git a/dist/index.html b/dist/index.html index 5adb2d8..9967e94 100644 --- a/dist/index.html +++ b/dist/index.html @@ -61,11 +61,11 @@ left: 0; z-index: 1001; display: none; - }