From fa677dec1c55db004a31beefb1e346e18c7858c2 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 20 二月 2025 18:41:29 +0800
Subject: [PATCH] bug修改

---
 src/main/resources/static/agent/js/http.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/static/agent/js/http.js b/src/main/resources/static/agent/js/http.js
index 3603d72..a8ca2bb 100644
--- a/src/main/resources/static/agent/js/http.js
+++ b/src/main/resources/static/agent/js/http.js
@@ -1,9 +1,21 @@
-var httputil={
-	post:function(url,params,success_callback,fail_callback){
-		$.post(url,params,function(response){
-			success_callback(response);
-		},'json').fail(function(jqXHR, textStatus, errorThrown){
+var http_util = {
+	post: function(url, params, success_callback, fail_callback) {
+		$.post(url, params, function(response) {
+			if (response.code == 1001) {
+				window.location.replace("login.html?redirect="+encodeURIComponent(window.location.href));
+			} else {
+				success_callback(response);
+			}
+		}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
 			fail_callback("缃戠粶璇锋眰澶辫触");
 		});
 	},
+	getQueryString:function(name) {
+	    console.log(window.location.search)
+	    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+	    var r = window.location.search.substr(1).match(reg);
+	    if (r != null)
+	        return unescape(decodeURI(r[2]));
+	    return null;
+	}
 };
\ No newline at end of file

--
Gitblit v1.8.0