支持后台控制是否开启加密
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user