Commit 93848d85 by 庄冰

sign

parent 5c1d619c
......@@ -415,6 +415,13 @@ module.exports = function (app) {
res.end(JSON.stringify(result));
return;
}
var sign = req.headers["sign"] || "";
if (!sign) {
result.msg = "req headers sign can not be empty";
result.data = null;
res.end(JSON.stringify(result));
return;
}
//1.通过appkey 获取appInfo
var appRes = await signSve.getAppInfoByAppKey(appkey);
if(!appRes || appRes.status!=0){
......@@ -425,6 +432,7 @@ module.exports = function (app) {
}
var appInfo = appRes.data;
//2.通过appsecret 验签
req.body.sign = sign;
var signParams = req.body;
var verifyRes = await signSve.verifySign(req.body,appInfo.uapp_secret);
if(verifyRes && verifyRes.status==0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment