From 0976fe8b38980ae61957b76dccac40e0f9674bd6 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 19 六月 2020 15:57:44 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/common.js | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js index 3e2e453..d3d2813 100644 --- a/src/main/webapp/static/js/common.js +++ b/src/main/webapp/static/js/common.js @@ -104,11 +104,17 @@ url: url, data: data, dataType: 'json', - header: {'Content-Type': 'application/json'}, + header: {'token': localStorage.getItem('token')}, timeout: 10000, cache: false, - success: function (result) { - callback(result); + success: function (res) { + if (res.code === 200){ + callback(res); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg); + } }, error: function (res, type) { -- Gitblit v1.9.1