|
@@ -68,9 +68,7 @@ class WeixinAuthService extends AxiosService {
|
|
|
*/
|
|
|
async jsapiAuth(query) {
|
|
|
let { url } = query;
|
|
|
- console.log(url);
|
|
|
url = decodeURI(url);
|
|
|
- console.log(url);
|
|
|
let jsapi_ticket = await this.app.redis.get(this.jsapiKey);
|
|
|
const { appid, appSecret } = this.wxInfo;
|
|
|
if (!jsapi_ticket) {
|
|
@@ -92,7 +90,6 @@ class WeixinAuthService extends AxiosService {
|
|
|
const noncestr = random(16).toLowerCase();
|
|
|
const timestamp = moment().unix();
|
|
|
const signStr = `jsapi_ticket=${jsapi_ticket}&noncestr=${noncestr}×tamp=${timestamp}&url=${url}`;
|
|
|
- console.log(signStr);
|
|
|
const sign = crypto.createHash('sha1').update(signStr).digest('hex');
|
|
|
return { jsapi_ticket, noncestr, timestamp, sign, appid, url };
|
|
|
}
|