mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化代码
This commit is contained in:
parent
00123276b7
commit
bbe6322bc3
@ -64,11 +64,16 @@ export function createSign(_reqObj) {
|
||||
if (_reqObj.method == 'GET') {
|
||||
reqInfo += '?';
|
||||
for (let key in _reqObj.data) {
|
||||
// #ifdef MP-WEIXIN
|
||||
reqInfo += (key + '=' + _reqObj.data[key] + '&');
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
if (_reqObj.data[key]) {
|
||||
reqInfo += (key + '=' + _reqObj.data[key] + '&');
|
||||
} else {
|
||||
reqInfo += (key + '=' + '&');
|
||||
}
|
||||
// #endif
|
||||
|
||||
}
|
||||
if (reqInfo.endsWith('&')) {
|
||||
@ -85,6 +90,7 @@ export function createSign(_reqObj) {
|
||||
}
|
||||
}
|
||||
reqInfo += "whoisyoudad!!!"
|
||||
console.log(reqInfo)
|
||||
let _sign = md5(reqInfo);
|
||||
_reqObj.header.sign = _sign;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user