Commit 74f3a983 by 匡雅琴

Merge branch 'v3.2.1' into 'v3.3.0'

新增加密

See merge request !40
2 parents c17b38e4 d0c0c467
...@@ -55,26 +55,33 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) { ...@@ -55,26 +55,33 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
function request(params, success, config, noSignAttr, isOtherUrl) { function request(params, success, config, noSignAttr, isOtherUrl) {
noSignAttr = noSignAttr || [] noSignAttr = noSignAttr || []
params = params || {} params = params || {}
params.sessionAuth = 'st'
config = config || {} config = config || {}
var common = store.getEx('external') var common = store.getEx('external')
var settings = helper.clone(true, defaultSettings) var settings = helper.clone(true, defaultSettings)
var data = helper.clone(true, { var data = helper.clone(
true,
{
timestamp: new Date().getTime() timestamp: new Date().getTime()
}, common.params, params) },
common.params,
params
)
if (isOtherUrl) { if (isOtherUrl) {
data.app_key = data.appKey data.app_key = data.appKey
delete settings.beforeSend delete settings.beforeSend
delete data.appKey delete data.appKey
} }
data.sign = sign(data, common.secret, noSignAttr, isOtherUrl) data.sign = sign(data, common.secret, noSignAttr, isOtherUrl)
settings.url = isOtherUrl ? (common.fileUploadURL + '?method=' + params.method) : common.baseURL settings.url = isOtherUrl ? common.fileUploadURL + '?method=' + params.method : common.baseURL
settings.data = data settings.data = data
settings.success = function (result) { settings.success = function (result) {
if (result.code == '0' || result.returnCode == '0') { if (result.code == '0' || result.returnCode == '0') {
success && success(result) success && success(result)
} else { } else {
msg(result.message) msg(result.message)
if (result.errId == '21') { //TGT失效 if (result.errId == '21') {
//TGT失效
goLogin && goLogin() goLogin && goLogin()
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!