Authored by huangyCode

md5方法

import md5 from '../vendors/md5';
import Promise from '../vendors/es6-promise';
import objectAssign from '../vendors/object-assign';
import trimObject from '../utils/trimObject';
... ... @@ -64,6 +65,7 @@ function request(method = 'GET') {
return getPrivateKey()
.then(key => {
return new Promise(function (resolve, reject) {
let app = getApp();
if (params && !params.hasOwnProperty('uid')) {
let uid = app && app.globalData && app.globalData.userInfo && app.globalData.userInfo.uid ? app.globalData.userInfo.uid : 0;
... ... @@ -85,7 +87,6 @@ function request(method = 'GET') {
}
params.udid = udid;
}
let body = _createBody(params);
let queryStrigPair = _signParam(body, true);
let data = '';
... ... @@ -354,6 +355,7 @@ function _signParam(params,opt) {
allParams = trimObject(allParams); // 去除首尾空格
let paramsPair = queryString.stringify(allParams, {encode: false});
debugger
let client_secret = md5(paramsPair);
delete allParams.private_key;
... ...