Commit bcbf0ca7 authored by 任国军's avatar 任国军

add notify log

parent 070657f3
Pipeline #24537 passed with stage
in 4 seconds
...@@ -89,7 +89,6 @@ class WechatController extends Controller { ...@@ -89,7 +89,6 @@ class WechatController extends Controller {
async payNotify() { async payNotify() {
const { ctx } = this; const { ctx } = this;
ctx.set('Content-Type', 'text/xml'); ctx.set('Content-Type', 'text/xml');
ctx.logger.info('pay_no');
// 组装xml数据 // 组装xml数据
let xmlData = '<xml>'; let xmlData = '<xml>';
xmlData += '<return_code><![CDATA[SUCCESS]]></return_code>'; xmlData += '<return_code><![CDATA[SUCCESS]]></return_code>';
...@@ -97,8 +96,6 @@ class WechatController extends Controller { ...@@ -97,8 +96,6 @@ class WechatController extends Controller {
xmlData += '</xml>'; xmlData += '</xml>';
ctx.body = xmlData; ctx.body = xmlData;
ctx.logger.info(ctx.req);
let data = ''; let data = '';
ctx.req.setEncoding('utf8'); ctx.req.setEncoding('utf8');
ctx.req.on('data', function(chunk) { ctx.req.on('data', function(chunk) {
......
'use strict';
module.exports = () => {
return async function(ctx, next) {
const bodyParser = require('body-parser');
ctx.app.use(bodyParser.urlencoded({
extended: true,
}));
await next();
};
};
...@@ -4,6 +4,7 @@ module.exports = app => { ...@@ -4,6 +4,7 @@ module.exports = app => {
const router = app.router.namespace(app.config.projectRootPath + '/course/v5'); const router = app.router.namespace(app.config.projectRootPath + '/course/v5');
// const miniAuth = app.middleware.miniAuthV5();// 因为不跟现有的用户中心系统,所以使用单独的登录中间件 // const miniAuth = app.middleware.miniAuthV5();// 因为不跟现有的用户中心系统,所以使用单独的登录中间件
const auth = app.middleware.verifyAuth; const auth = app.middleware.verifyAuth;
const xmlparse = app.middleware.xmlparse();
router.post('third', '/verification_code', 'course.v5.user.sendVerificationCode');// 发送验证码 router.post('third', '/verification_code', 'course.v5.user.sendVerificationCode');// 发送验证码
router.post('third', '/login/phone', 'course.v5.user.loginByPhone');// 手机号登录 router.post('third', '/login/phone', 'course.v5.user.loginByPhone');// 手机号登录
...@@ -25,7 +26,7 @@ module.exports = app => { ...@@ -25,7 +26,7 @@ module.exports = app => {
router.get('third', '/wechat/callbackAction', 'course.v5.wechat.check'); router.get('third', '/wechat/callbackAction', 'course.v5.wechat.check');
router.post('third', '/wechat/callbackAction', 'course.v5.wechat.callbackAction'); router.post('third', '/wechat/callbackAction', 'course.v5.wechat.callbackAction');
router.post('third', '/wechat/test', 'course.v5.wechat.test'); router.post('third', '/wechat/test', 'course.v5.wechat.test');
router.post('third', '/wechat/pay/notify', 'course.v5.wechat.payNotify'); router.post('third', '/wechat/pay/notify', xmlparse, 'course.v5.wechat.payNotify');
router.post('third', '/questionnaire', auth({ is_force: 1 }), 'course.v5.option.addQuestionnaire');// 填写问卷 router.post('third', '/questionnaire', auth({ is_force: 1 }), 'course.v5.option.addQuestionnaire');// 填写问卷
router.get('third', '/questionnaire', 'course.v5.option.getQuestionnaire');// 获取问卷 router.get('third', '/questionnaire', 'course.v5.option.getQuestionnaire');// 获取问卷
router.post('third', '/channel/unlimited_code', 'course.v5.option.addUnlimitedCodeByChannel');// 保存渠道小程序码 router.post('third', '/channel/unlimited_code', 'course.v5.option.addUnlimitedCodeByChannel');// 保存渠道小程序码
......
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