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 | 41 ++++++++++++++++++++++++++++++++++++++--- 1 files changed, 38 insertions(+), 3 deletions(-) diff --git a/web_src/src/main.js b/web_src/src/main.js index ae2baee..d534d5f 100644 --- a/web_src/src/main.js +++ b/web_src/src/main.js @@ -8,19 +8,54 @@ import VueCookies from 'vue-cookies'; import echarts from 'echarts'; -import VueClipboard from 'vue-clipboard2' +import VueClipboard from 'vue-clipboard2'; import { Notification } from 'element-ui'; +import Fingerprint2 from 'fingerprintjs2'; +import VueClipboards from 'vue-clipboards'; +import Contextmenu from "vue-contextmenujs" -Vue.use(VueClipboard) + +// 鐢熸垚鍞竴ID +Fingerprint2.get(function(components) { + const values = components.map(function(component,index) { + if (index === 0) { //鎶婂井淇℃祻瑙堝櫒閲孶A鐨剋ifi鎴�4G绛夌綉缁滄浛鎹㈡垚绌�,涓嶇劧鍒囨崲缃戠粶浼欼D涓嶄竴鏍� + return component.value.replace(/\bNetType\/\w+\b/, ''); + } + return component.value; + }) + //console.log(values) //浣跨敤鐨勬祻瑙堝櫒淇℃伅npm + // 鐢熸垚鏈�缁坕d + let port = window.location.port; + console.log(port); + const fingerPrint = Fingerprint2.x64hash128(values.join(port), 31) + Vue.prototype.$browserId = fingerPrint; + console.log("鍞竴鏍囪瘑鐮侊細" + fingerPrint); +}); + +Vue.use(VueClipboard); Vue.use(ElementUI); Vue.use(VueCookies); +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