From a1b6e56427fa7279e65afc880b7124c6cf289177 Mon Sep 17 00:00:00 2001
From: mk1990 <153958232@qq.com>
Date: 星期一, 28 三月 2022 10:11:13 +0800
Subject: [PATCH] 1. 修改control.vue 报Invalid prop: type check failed for prop "column". Expected Number with value 1, got String with value "1". 2. 修改control.vue Error: [vue-clipboards] Invalid value. Please use a valid value. 3. 修改DeviceList.vue 刷新时报 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "loading"

---
 web_src/src/main.js |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/web_src/src/main.js b/web_src/src/main.js
index ed1f36c..d534d5f 100644
--- a/web_src/src/main.js
+++ b/web_src/src/main.js
@@ -12,6 +12,7 @@
 import { Notification } from 'element-ui';
 import Fingerprint2 from 'fingerprintjs2';
 import VueClipboards from 'vue-clipboards';
+import Contextmenu from "vue-contextmenujs"
 
 
 // 鐢熸垚鍞竴ID
@@ -37,11 +38,24 @@
 Vue.use(VueClipboards);
 Vue.prototype.$axios = axios;
 Vue.prototype.$notify = Notification;
+Vue.use(Contextmenu);
 
 axios.defaults.baseURL = (process.env.NODE_ENV === 'development') ? process.env.BASE_API : "";
 
-Vue.prototype.$cookies.config(60*30);
+// api 杩斿洖401鑷姩鍥炵櫥闄嗛〉闈�
+axios.interceptors.response.use(function (response) {
+  // 瀵瑰搷搴旀暟鎹仛鐐逛粈涔�
+  return response;
+}, function (error) {
+  // 瀵瑰搷搴旈敊璇仛鐐逛粈涔�
+  if (error.response.status === 401) {
+    console.log("Received 401 Response")
+    router.push('/login');
+  }
+  return Promise.reject(error);
+});
 
+Vue.prototype.$cookies.config(60*30);
 
 new Vue({
 	router: router,

--
Gitblit v1.8.0