Commit 960f6545 authored by 任国军's avatar 任国军

add log

parent 072b0710
Pipeline #24517 passed with stage
in 4 seconds
......@@ -8,6 +8,7 @@ module.exports = {
get_jwt() {
const { ctx } = this;
const bearerToken = ctx.request.header.authorization;
ctx.logger.info('course_headers: ' + JSON.stringify(ctx.request.header));
if (!bearerToken) {
ctx.throw(401, 'error auth');
}
......@@ -18,6 +19,7 @@ module.exports = {
async verify_token(ctx) {
const token = this.get_jwt(ctx);
const decode_res = await ctx.service.jwt.decode_token(token);
ctx.logger.info('course_decode_res: ' + JSON.stringify(decode_res));
if (ctx.isEmpty(decode_res)) {
ctx.throw(401, 'jwt校验失败');
}
......
......@@ -376,6 +376,8 @@ class WechatService extends Service {
}
arr.sort();
let sign = ctx.helper.md5(arr.join('&') + '&key=xuepenQuXuanKeweixinzhifu2020063');
ctx.logger.info('course_sign_str: ' + arr.join('&') + '&key=xuepenQuXuanKeweixinzhifu2020063');
sign = sign.toUpperCase();
return sign;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment