| | |
| | | var help = require('../../util/help.js'); |
| | | var http = require('../../util/http.js'); |
| | | Page({ |
| | | data: { |
| | | showLogout: true |
| | |
| | | borderBottomColor: "#0080FF" |
| | | }); |
| | | |
| | | |
| | | http.postApi('http://www.baidu.com', {}, function (res) { }, function (e) { }, null, true); |
| | | |
| | | }, |
| | | |
| | | onGetAuthorize(res) { |
| | | var that=this; |
| | | var that = this; |
| | | my.getOpenUserInfo({ |
| | | fail: (res) => { |
| | | }, |
| | |
| | | if (showLoading) { |
| | | my.showLoading(); |
| | | } |
| | | |
| | | console.log("请求参数:"+JSON.stringify(params)); |
| | | |
| | | my.request({ |
| | | url: url, |
| | |
| | | } |
| | | }, |
| | | fail: function (res) { |
| | | fail(res); |
| | | if (fail != null) |
| | | fail(res); |
| | | }, |
| | | complete: function (res) { |
| | | my.hideLoading(); |
| | | complete(res); |
| | | if (complete != null) |
| | | complete(res); |
| | | } |
| | | }); |
| | | }); |
| | |
| | | getSign(params) { |
| | | if (params == null) |
| | | params = {}; |
| | | params.timestamp = new Date().getMilliseconds(); |
| | | params.timestamp = new Date().getTime(); |
| | | params.appKey = getApp().appKey; |
| | | |
| | | var array = new Array(); |
| | | for (k, v in params) { |
| | | array.push(k + "=" + v); |
| | | for (var key in params) { |
| | | array.push(key + "=" + params[key]); |
| | | } |
| | | |
| | | //排序 |
| | |
| | | } |
| | | |
| | | str += SECRET; |
| | | console.log("签名前字符串:"+str); |
| | | return md5.md5(str); |
| | | } |
| | | }; |