Showing
5 changed files
with
11 additions
and
7 deletions
@@ -17,6 +17,7 @@ const helpers = global.yoho.helpers; | @@ -17,6 +17,7 @@ const helpers = global.yoho.helpers; | ||
17 | const _ = require('lodash'); | 17 | const _ = require('lodash'); |
18 | const co = require('bluebird').coroutine; | 18 | const co = require('bluebird').coroutine; |
19 | const logger = global.yoho.logger; | 19 | const logger = global.yoho.logger; |
20 | +const stringProcess = require(`${global.utils}/string-process`); | ||
20 | 21 | ||
21 | // 支付方式 | 22 | // 支付方式 |
22 | const payments = { | 23 | const payments = { |
@@ -55,7 +56,7 @@ const _getOthersBuy2 = (param) => { | @@ -55,7 +56,7 @@ const _getOthersBuy2 = (param) => { | ||
55 | 56 | ||
56 | // 订单信息 | 57 | // 订单信息 |
57 | const _getOtherDetail = (param) => { | 58 | const _getOtherDetail = (param) => { |
58 | - if (!param.uid || !param.orderCode || !_.isNumber(param.orderCode)) { | 59 | + if (!param.uid || !param.orderCode || !stringProcess.isNumeric(param.orderCode)) { |
59 | return Promise.resolve({}); | 60 | return Promise.resolve({}); |
60 | } | 61 | } |
61 | 62 |
@@ -12,6 +12,7 @@ const helpers = global.yoho.helpers; | @@ -12,6 +12,7 @@ const helpers = global.yoho.helpers; | ||
12 | const api = global.yoho.API; | 12 | const api = global.yoho.API; |
13 | const serviceAPI = global.yoho.ServiceAPI; | 13 | const serviceAPI = global.yoho.ServiceAPI; |
14 | const logger = global.yoho.logger; | 14 | const logger = global.yoho.logger; |
15 | +const stringProcess = require(`${global.utils}/string-process`); | ||
15 | const API_TIMEOUT = 10000; | 16 | const API_TIMEOUT = 10000; |
16 | const codeContent = { | 17 | const codeContent = { |
17 | openN: '0876085ff46bed27f1a1eb6ee8b68987', | 18 | openN: '0876085ff46bed27f1a1eb6ee8b68987', |
@@ -423,7 +424,7 @@ const getBankCards = (uid) => { | @@ -423,7 +424,7 @@ const getBankCards = (uid) => { | ||
423 | const getInstallmentOrderDetail = (params) => { | 424 | const getInstallmentOrderDetail = (params) => { |
424 | const method = 'app.SpaceOrders.installDetail'; | 425 | const method = 'app.SpaceOrders.installDetail'; |
425 | 426 | ||
426 | - if (!params.uid || !params.orderCode || !_.isNumber(params.orderCode)) { | 427 | + if (!params.uid || !params.orderCode || !stringProcess.isNumeric(params.orderCode)) { |
427 | return Promise.resolve({}); | 428 | return Promise.resolve({}); |
428 | } | 429 | } |
429 | 430 |
@@ -10,6 +10,7 @@ const _ = require('lodash'); | @@ -10,6 +10,7 @@ const _ = require('lodash'); | ||
10 | const helpers = global.yoho.helpers; | 10 | const helpers = global.yoho.helpers; |
11 | const camelCase = global.yoho.camelCase; | 11 | const camelCase = global.yoho.camelCase; |
12 | const logger = global.yoho.logger; | 12 | const logger = global.yoho.logger; |
13 | +const stringProcess = require(`${global.utils}/string-process`); | ||
13 | 14 | ||
14 | const CODE_LOGISTIC_BANNER = '1fc9b2484fcd559049f2f7e0db313f20'; // 物流详情banner资源码 | 15 | const CODE_LOGISTIC_BANNER = '1fc9b2484fcd559049f2f7e0db313f20'; // 物流详情banner资源码 |
15 | 16 | ||
@@ -143,7 +144,7 @@ const _getOrderStatus = (order, showLogistics) => { | @@ -143,7 +144,7 @@ const _getOrderStatus = (order, showLogistics) => { | ||
143 | 144 | ||
144 | const orderDetailData = (uid, orderCode) => { | 145 | const orderDetailData = (uid, orderCode) => { |
145 | 146 | ||
146 | - if (!uid || !orderCode || !_.isNumber(orderCode)) { | 147 | + if (!uid || !orderCode || !stringProcess.isNumeric(orderCode)) { |
147 | return Promise.resolve({}); | 148 | return Promise.resolve({}); |
148 | } | 149 | } |
149 | 150 |
@@ -11,6 +11,7 @@ const helpers = global.yoho.helpers; | @@ -11,6 +11,7 @@ const helpers = global.yoho.helpers; | ||
11 | const api = global.yoho.API; | 11 | const api = global.yoho.API; |
12 | const searchModel = require('./search'); | 12 | const searchModel = require('./search'); |
13 | const productProcess = require(`${utils}/product-process`); | 13 | const productProcess = require(`${utils}/product-process`); |
14 | +const stringProcess = require(`${global.utils}/string-process`); | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * 频道 | 17 | * 频道 |
@@ -127,7 +128,7 @@ const _getShopInfo = (shopId, uid) => { | @@ -127,7 +128,7 @@ const _getShopInfo = (shopId, uid) => { | ||
127 | shop_id: shopId, | 128 | shop_id: shopId, |
128 | }; | 129 | }; |
129 | 130 | ||
130 | - if (!shopId || !_.isNumber(shopId)) { | 131 | + if (!shopId || !stringProcess.isNumeric(shopId)) { |
131 | return Promise.resolve({}); | 132 | return Promise.resolve({}); |
132 | } | 133 | } |
133 | 134 | ||
@@ -152,7 +153,7 @@ const getShopIntro = (shopId, uid) => { | @@ -152,7 +153,7 @@ const getShopIntro = (shopId, uid) => { | ||
152 | shop_id: shopId | 153 | shop_id: shopId |
153 | }; | 154 | }; |
154 | 155 | ||
155 | - if (!shopId || !_.isNumber(shopId)) { | 156 | + if (!shopId || !stringProcess.isNumeric(shopId)) { |
156 | return Promise.resolve({}); | 157 | return Promise.resolve({}); |
157 | } | 158 | } |
158 | 159 |
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | */ | 3 | */ |
4 | 'use strict'; | 4 | 'use strict'; |
5 | 5 | ||
6 | -const _ = require('lodash'); | ||
7 | const api = global.yoho.API; | 6 | const api = global.yoho.API; |
8 | const singleAPI = global.yoho.SingleAPI; | 7 | const singleAPI = global.yoho.SingleAPI; |
8 | +const stringProcess = require(`${global.utils}/string-process`); | ||
9 | 9 | ||
10 | /** | 10 | /** |
11 | * 频道 | 11 | * 频道 |
@@ -42,7 +42,7 @@ exports.getIntro = shopId => { | @@ -42,7 +42,7 @@ exports.getIntro = shopId => { | ||
42 | shop_id: shopId | 42 | shop_id: shopId |
43 | }; | 43 | }; |
44 | 44 | ||
45 | - if (!shopId || !_.isNumber(shopId)) { | 45 | + if (!shopId || !stringProcess.isNumeric(shopId)) { |
46 | return Promise.resolve({}); | 46 | return Promise.resolve({}); |
47 | } | 47 | } |
48 | 48 |
-
Please register or login to post a comment