code: function generateSign(api, params, method, secretKey){
  
  	//将method转为大写
  	method = method.toUpperCase();
  	if(method !== 'GET' && method !== 'POST'){
  		throw new Error('method is invalid');
  	}
  
  	if(typeof params !== 'object'){
  		throw new Error('params is invalid');
  	}
  
  	//提取host和path
  	var urlParams = url.parse(api);
  	var hostPath  = urlParams.host + urlParams.path;
  
  	//对params里的key进行排序
  	var arrKey = [];
  	for(var key in params){
  		arrKey.push(key);
  	}
  	arrKey.sort();
  
  	//拼接参数字符串
  	var strParams = '';
  	for(var i=0; i < arrKey.length; i++){
  		var value = params[arrKey[i]];
  		strParams += arrKey[i] + '=' + value;
  	}
  
  	return md5(method + hostPath + strParams + secretKey);
  }
docs: 生成sign
  @param  {string} api       api地址
  @param  {object} params    参数对象
  @param  {string} method    请求方法，GET或POST
  @param  {string} secretKey 应用的secretKey
  @return {string}           生成的sign