Commit 9057aa8e authored by 姜登's avatar 姜登

gjj展示页接口

parent a83e8db0
Pipeline #3996 passed with stage
in 11 seconds
......@@ -100,7 +100,8 @@ class OrderController extends Controller {
if (data) {
if (data.status === 'success' && (data.appKey === appKey)) {
const result = await service.storage.read(orderId, appKey);
ctx.success(result);
const ret = service.washData.dealData(result);
ctx.success(ret);
return;
}
}
......
......@@ -7,6 +7,8 @@ class WashDataService extends Service {
super(ctx);
const { config } = this;
this.washUrl = config.washAPI.host + config.washAPI.washUrl;
this.clearGjj = ['ID', 'phone', 'birthday', 'email', 'address', 'card', 'deposit_base', 'person_rate', 'company_rate', 'marriage', 'sex', 'company_id'];
this.clearLoan = ['name', 'ID', 'warning_rate', 'fund_date', 'bank', 'phone', 'address', 'past_due', 'past_principle', 'past_interest', 'past_period', 'history_past_period', 'history_past_amount', 'assure_style', 'house_type', 'debit_account', 'left_period'];
}
async wash(data) {
const { app, washUrl, ctx } = this;
......@@ -31,7 +33,7 @@ class WashDataService extends Service {
washData.data.data.general_analyzed_data.overdueClassify = {};
washData.data.data.general_analyzed_data.loanClassify = {};
washData.data.data.general_analyzed_data.blacklist = {};
return washData.data;
}
......@@ -45,6 +47,25 @@ class WashDataService extends Service {
bar.appKey = '';
return bar;
}
dealData(data, passID = false) {
const { clearGjj, clearLoan } = this;
delete data.data.general_analyzed_data;
for (let gjjItem of data.data.gjj_data) {
for (let text of clearGjj) {
if (!(passID && text == 'ID')) {
delete gjjItem.gjj_brief[text];
}
}
delete gjjItem.gjj_account_analyzed_data;
}
for (let loanItem of data.data.loan_data) {
for (let text of clearLoan) {
delete loanItem.loan_brief[text];
}
}
return data;
}
}
module.exports = WashDataService;
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