From f7f647a20cca0d106473e6a862b85d89a7a93d19 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期四, 01 十二月 2022 10:59:06 +0800
Subject: [PATCH] 堆栈溢出
---
src/components/uploaderFile/index.vue | 1 -
src/views/facilityManagement/goodsDetailManage/components/checkOut.vue | 2 +-
src/views/intellectInspect/intelligentLine/index.vue | 1 -
src/router/index.ts | 46 +++++++++++++++++++++-------------------------
static/loginPage.js/login.js | 1 -
5 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/src/components/uploaderFile/index.vue b/src/components/uploaderFile/index.vue
index 6fb9848..d747984 100644
--- a/src/components/uploaderFile/index.vue
+++ b/src/components/uploaderFile/index.vue
@@ -65,7 +65,6 @@
goalManagementApi()
.searchFile(uploadFile.name)
.then((res) => {
- debugger
window.open(res.data, "_blank");
})
dialogImageUrl.value = uploadFile.url!;
diff --git a/src/router/index.ts b/src/router/index.ts
index a99ccfb..322d85c 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -66,36 +66,32 @@
// 路由加载前
router.beforeEach(async (to, from, next) => {
- if (to.path === '/intelligentLine') {
+ NProgress.configure({ showSpinner: false });
+ if (to.meta.title) NProgress.start();
+ const token = Session.get('token');
+ if (to.path === '/login' && !token) {
next();
+ NProgress.done();
} else {
- NProgress.configure({ showSpinner: false });
- if (to.meta.title) NProgress.start();
- const token = Session.get('token');
- if (to.path === '/login' && !token) {
- next();
+ if (!token) {
+ next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`);
+ Session.clear();
+ NProgress.done();
+ } else if (token && to.path === '/login') {
+ next('/home');
NProgress.done();
} else {
- if (!token) {
- next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`);
- Session.clear();
- NProgress.done();
- } else if (token && to.path === '/login') {
- next('/home');
- NProgress.done();
- } else {
- const storesRoutesList = useRoutesList(pinia);
- const { routesList } = storeToRefs(storesRoutesList);
- if (routesList.value.length === 0) {
+ const storesRoutesList = useRoutesList(pinia);
+ const { routesList } = storeToRefs(storesRoutesList);
+ if (routesList.value.length === 0) {
- // 后端控制路由:路由数据初始化,防止刷新时丢失
- await initBackEndControlRoutes();
- // 动态添加路由:防止非首页刷新时跳转回首页的问题
- // 确保 addRoute() 时动态添加的路由已经被完全加载上去
- next({ ...to, replace: true });
- } else {
- next();
- }
+ // 后端控制路由:路由数据初始化,防止刷新时丢失
+ await initBackEndControlRoutes();
+ // 动态添加路由:防止非首页刷新时跳转回首页的问题
+ // 确保 addRoute() 时动态添加的路由已经被完全加载上去
+ next({ ...to, replace: true });
+ } else {
+ next();
}
}
}
diff --git a/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue b/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue
index 9f76c17..3d16359 100644
--- a/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue
+++ b/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue
@@ -41,7 +41,7 @@
<script setup lang="ts">
-import {defineEmits, reactive} from "vue";
+import { reactive} from "vue";
import {checkOutStateType, GoodsDetailDataType} from "/@/views/facilityManagement/goodsDetailManage/index";
import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
import {ElMessage} from "element-plus/es";
diff --git a/src/views/intellectInspect/intelligentLine/index.vue b/src/views/intellectInspect/intelligentLine/index.vue
index b3a5411..c5521fe 100644
--- a/src/views/intellectInspect/intelligentLine/index.vue
+++ b/src/views/intellectInspect/intelligentLine/index.vue
@@ -151,7 +151,6 @@
alert('您的浏览器不支持socket');
} else {
// 实例化socket
- debugger
let uid = userInfos.value.uid.toString()
var url = state.path + uid + '*' + id;
console.log(url,'url',uid,'uid')
diff --git a/static/loginPage.js/login.js b/static/loginPage.js/login.js
index 075087b..db81ff6 100644
--- a/static/loginPage.js/login.js
+++ b/static/loginPage.js/login.js
@@ -1520,7 +1520,6 @@
};
window.particlesJS.load = function(tag_id, path_config_json, callback){
-debugger
/* load json config */
var xhr = new XMLHttpRequest();
xhr.open('GET', path_config_json);
--
Gitblit v1.9.2