From d2d11072237892aa90323d0bd252dcf975a51967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Tue, 29 May 2018 11:08:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=90=8E=E5=8F=B0=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/axiosPlugin.js | 4 ++-- fangija-zsyf/main.html | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/js/axiosPlugin.js b/fangija-zsyf/js/axiosPlugin.js index 75db793..b622781 100644 --- a/fangija-zsyf/js/axiosPlugin.js +++ b/fangija-zsyf/js/axiosPlugin.js @@ -11,8 +11,8 @@ document.addEventListener('plusready', function() { // 添加请求拦截器 axios.interceptors.request.use(function (config) { - // 对所有POST请加密,必须是json数据提交,不支持表单 - if (config.method == "post") { + // 对所有POST请加密,必须是json数据提交,不支持表单,可通过后台控制是否要开启加密 + if (config.method == "post" && localStorage.getItem("encrypt") == "true") { config.data = EncryptData(JSON.stringify(config.data)); } var token = localStorage.getItem("user_token"); diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index b1dca64..9e81c35 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -192,11 +192,13 @@ localStorage.setItem("guidePageUrls",JSON.stringify(data.guideImgs)); } + localStorage.setItem("encrypt", data.encrypt); //存入localStorage Boolean类型变成String //加载菜单信息,控制是否显示贷款菜单 localStorage.setItem("showLoanMenu", data.showLoanMenu); } else { localStorage.setItem("showLoanMenu", false); + localStorage.setItem("encrypt", false); } }, error: function(XMLHttpRequest, textStatus, errorThrown) {