From 6be8ee1cd73e28f65b1b1649a221d673fb767c39 Mon Sep 17 00:00:00 2001
From: hotleave <hotleave@gmail.com>
Date: 星期五, 18 六月 2021 11:51:09 +0800
Subject: [PATCH] 解决录像回放无法获取编码信息问题

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

diff --git a/web_src/src/main.js b/web_src/src/main.js
index ed1f36c..472a5f6 100644
--- a/web_src/src/main.js
+++ b/web_src/src/main.js
@@ -40,8 +40,20 @@
 
 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((1111))
+    router.push('/login');
+  }
+  return Promise.reject(error);
+});
 
+Vue.prototype.$cookies.config(60*30);
 
 new Vue({
 	router: router,

--
Gitblit v1.8.0