Commit c97a05d6 authored by 姜登's avatar 姜登

yys

parent 274a9930
......@@ -65,13 +65,13 @@ class OrderController extends Controller {
async create() {
const { ctx, service } = this;
ctx.validate(this.createRule);
const { appKey, userId, notifyUrl, backUrl, orderId, phone, netMark } = ctx.request.body;
let { appKey, userId, notifyUrl, backUrl, orderId, phone, netMark } = ctx.request.body;
const appKeyInfo = await service.partner.fetchInfo(appKey);
if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableYys === true)) {
return ctx.fail('未开通此服务');
}
if (netMark !== 1) {
netMark === 0;
netMark = 0;
}
const areaInfo = await service.task.phoneArea(phone);
const object = {
......
......@@ -146,8 +146,10 @@ class ScriptsService extends Service {
contentType: 'json',
});
ctx.logger.info(`fetchScriptByCityName,${baseURL + fetchScriptByCityNameUrl + '?name=' + name}`, 'result:', JSON.stringify(result.data));
return result.data;
if (result.stauts === 200) {
return result.data.scriptId;
}
ctx.throw(400, '手机号码区域验证失败');
}
async fetchScriptName(scriptId) {
......
......@@ -43,7 +43,7 @@ class StorageService extends Service {
}
async read(orderId, appKey) {
const { readUrl, readDataKey, ctx } = this;
const { readUrl, ctx } = this;
const result = await this._request(`${readUrl}/${orderId}`, {
method: 'get',
contentType: 'json',
......@@ -57,9 +57,9 @@ class StorageService extends Service {
await ctx.model.Cusdata.create({
appKey,
orderId,
type: 'gjj',
type: 'yys',
});
return result.data.data[readDataKey];
return result.data.data;
}
}
......
......@@ -54,13 +54,13 @@ module.exports = () => {
alhost: 'https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=',
};
// config.storageAPI = {
// host: 'http://tv.51gjj.com:11252',
// writeUrl: '/data',
// readUrl: '/gjj',
// writeType: 'gjj',
// readDataKey: 'gjjData',
// };
config.storageAPI = {
host: 'http://tv.51gjj.com:11252',
writeUrl: '/data',
readUrl: '/order',
writeType: 'thxd',
readDataKey: 'thxdData',
};
config.washAPI = {
host: 'http://t.51gjj.com:3007',
......
......@@ -45,13 +45,13 @@ module.exports = () => {
alhost: 'https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=',
};
// config.storageAPI = {
// host: process.env.STORAGEAPI_HOST || 'http://tv.51gjj.com:11252',
// writeUrl: '/data',
// readUrl: '/gjj',
// writeType: 'gjj',
// readDataKey: 'gjjData',
// };
config.storageAPI = {
host: process.env.STORAGEAPI_HOST || 'http://tv.51gjj.com:11252',
writeUrl: '/data',
readUrl: '/order',
writeType: 'order',
readDataKey: 'thxdData',
};
config.washAPI = {
host: process.env.WASHAPI_HOST || 'http://t.51gjj.com:3007',
......
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