|
...
|
...
|
@@ -104,7 +104,18 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
|
|
}
|
|
|
|
if (RMT.check(cache_key)) return RMT.get(cache_key)
|
|
|
|
RMT.set(cache_key)
|
|
|
|
return new Promise((success, fail) => {
|
|
|
|
return new Promise(async(success, fail) => {
|
|
|
|
if(api.msgSecCheck){//数据安全检查
|
|
|
|
try{
|
|
|
|
await msgSecCheck(host,data)
|
|
|
|
}catch (e){
|
|
|
|
wx.showToast({
|
|
|
|
title:'内容含有违法违规内容',
|
|
|
|
icon:'none'
|
|
|
|
})
|
|
|
|
return fail()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let openid = wx.getStorageSync('customer_openid');
|
|
|
|
let formids = wx.getStorageSync('formids');
|
|
|
|
if (formids) {
|
|
...
|
...
|
@@ -248,5 +259,30 @@ function cache(key, val = -99999, timeout = -1) { |
|
|
|
return -99999
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function msgSecCheck(host,params){
|
|
|
|
let content=JSON.stringify(params);
|
|
|
|
return new Promise(function(success,fail){
|
|
|
|
wx.request({
|
|
|
|
url: host + 'App.Wechat.MsgSecCheck',
|
|
|
|
method: 'POST',
|
|
|
|
data: {content:content},
|
|
|
|
header: {
|
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
},
|
|
|
|
success: res => {
|
|
|
|
if(res.data.data.errcode==0){
|
|
|
|
success()
|
|
|
|
}else{
|
|
|
|
fail()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fail: res => {
|
|
|
|
fail()
|
|
|
|
},
|
|
|
|
complete:res=>{
|
|
|
|
wx.hideLoading();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
export default __api(); |
|
|
\ No newline at end of file |
...
|
...
|
|