Commit 33c8236b authored by mengwenhao's avatar mengwenhao
parents 16fb3887 c1917881
...@@ -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 = JSON.stringify(request); ctx.body = 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 = JSON.stringify(await req(ctx, opts)) ctx.body = 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 = JSON.stringify(await req(ctx, opts)) ctx.body = 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 = JSON.stringify(await req(ctx, opts)) ctx.body = 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 = JSON.stringify(await req(ctx, opts)); ctx.body = 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 = JSON.stringify(await req(ctx, opts)); ctx.body = 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 = JSON.stringify(await req(ctx, opts)); ctx.body = 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 = JSON.stringify(await req(ctx, opts)); ctx.body = await req(ctx, opts);
}; };
...@@ -17,7 +17,7 @@ exports.httpReq = (ctx, opts) => { ...@@ -17,7 +17,7 @@ exports.httpReq = (ctx, opts) => {
opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs}; opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs};
request(opts, (err, res, body) => { request(opts, (err, res, body) => {
console.info(`[Api] httpReq (${ctx.request.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`) console.info(`[Api] httpReq (${opts.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`)
if (!err) { if (!err) {
resolve(body) resolve(body)
......
import axios from "axios"; import axios from "axios";
import store from "@/store" import store from "@/store"
import { v1 as uuidv1 } from 'uuid'; import { v1 as uuidv1 } from 'uuid';
import jsonBig from 'json-bigint' // import jsonBig from 'json-bigint'
// import { ElMessage } from "element-plus"; // import { ElMessage } from "element-plus";
// import { APP_URI } from "../config/app.config"; // import { APP_URI } from "../config/app.config";
...@@ -99,12 +99,14 @@ instance.interceptors.response.use( ...@@ -99,12 +99,14 @@ instance.interceptors.response.use(
// showClose: true // showClose: true
// }); // });
// } // }
try { // try {
return jsonBig.parse(data); // return jsonBig.parse(data);
} catch (err) { // } catch (err) {
console.log('转换失败', err) // console.log('转换失败', err)
// return data;
// }
return data; return data;
}
}, },
// function (error) { // function (error) {
// if (!(error.code && error.code === -1)) error.message = "接口请求错误"; // if (!(error.code && error.code === -1)) error.message = "接口请求错误";
......
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