Commit 30915f55 authored by mengwenhao's avatar mengwenhao
parents 4f99e4ea ffba0da7
...@@ -20,7 +20,6 @@ app.use(router.routes(), router.allowedMethods()); ...@@ -20,7 +20,6 @@ app.use(router.routes(), router.allowedMethods());
app.use(serve(path.join(__dirname, './public'))); app.use(serve(path.join(__dirname, './public')));
app.listen(config.port, () => { app.listen(config.port, () => {
console.info( console.info(
'Listening on port %s in %s mode, Open up http://127.0.0.1:%s/ in your browser.', 'Listening on port %s in %s mode, Open up http://127.0.0.1:%s/ in your browser.',
......
...@@ -11,7 +11,7 @@ exports.auditList = async ctx => { ...@@ -11,7 +11,7 @@ exports.auditList = async ctx => {
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
// 企业认证获取验证码 // 企业认证获取验证码
...@@ -67,7 +67,7 @@ exports.getRecordInfo = async ctx => { ...@@ -67,7 +67,7 @@ exports.getRecordInfo = async ctx => {
} else { } else {
request.result.record.sensitiveWord = true; // 是否有查看敏感词权限 request.result.record.sensitiveWord = true; // 是否有查看敏感词权限
} }
ctx.body = request; ctx.body = JSON.stringify(request);
}; };
// 历史提交审核日志详情页 // 历史提交审核日志详情页
......
...@@ -11,7 +11,7 @@ exports.get_life_list = async (ctx, next) => { ...@@ -11,7 +11,7 @@ exports.get_life_list = async (ctx, next) => {
qs: ctx.request.query qs: ctx.request.query
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
//生活号详情 //生活号详情
exports.get_life_info = async (ctx, next) => { exports.get_life_info = async (ctx, next) => {
...@@ -23,5 +23,5 @@ exports.get_life_info = async (ctx, next) => { ...@@ -23,5 +23,5 @@ exports.get_life_info = async (ctx, next) => {
timeout: 8000, timeout: 8000,
body: ctx.request.body body: ctx.request.body
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
...@@ -15,7 +15,7 @@ exports.getRole_list = async (ctx, next) => { ...@@ -15,7 +15,7 @@ exports.getRole_list = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body body: ctx.request.body
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
exports.getAdd_role = async (ctx, next) => { exports.getAdd_role = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/add_role`; var url = `${API_INTERNAL_URI}/merchant/authority/add_role`;
......
...@@ -46,7 +46,7 @@ exports.user_list = async (ctx, next) => { ...@@ -46,7 +46,7 @@ exports.user_list = async (ctx, next) => {
method: "GET", method: "GET",
qs: ctx.request.query, qs: ctx.request.query,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_detail = async (ctx, next) => { exports.user_detail = async (ctx, next) => {
...@@ -56,7 +56,7 @@ exports.user_detail = async (ctx, next) => { ...@@ -56,7 +56,7 @@ exports.user_detail = async (ctx, next) => {
method: "GET", method: "GET",
qs: ctx.request.query, qs: ctx.request.query,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_edit = async (ctx, next) => { exports.user_edit = async (ctx, next) => {
...@@ -67,7 +67,7 @@ exports.user_edit = async (ctx, next) => { ...@@ -67,7 +67,7 @@ exports.user_edit = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body, body: ctx.request.body,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_new = async (ctx, next) => { exports.user_new = async (ctx, next) => {
...@@ -78,6 +78,6 @@ exports.user_new = async (ctx, next) => { ...@@ -78,6 +78,6 @@ exports.user_new = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body, body: ctx.request.body,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
...@@ -20,7 +20,7 @@ exports.httpReq = (ctx, opts) => { ...@@ -20,7 +20,7 @@ exports.httpReq = (ctx, opts) => {
console.info(`[Api] httpReq (${ctx.request.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`) console.info(`[Api] httpReq (${ctx.request.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`)
if (!err) { if (!err) {
resolve(JSON.stringify(body)) resolve(body)
} else { } else {
reject(err) reject(err)
console.error(opts.url, err) console.error(opts.url, err)
......
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