Authored by 郭成尧

isnumric

... ... @@ -17,6 +17,7 @@ const helpers = global.yoho.helpers;
const _ = require('lodash');
const co = require('bluebird').coroutine;
const logger = global.yoho.logger;
const stringProcess = require(`${global.utils}/string-process`);
// 支付方式
const payments = {
... ... @@ -55,7 +56,7 @@ const _getOthersBuy2 = (param) => {
// 订单信息
const _getOtherDetail = (param) => {
if (!param.uid || !param.orderCode || !_.isNumber(param.orderCode)) {
if (!param.uid || !param.orderCode || !stringProcess.isNumeric(param.orderCode)) {
return Promise.resolve({});
}
... ...
... ... @@ -12,6 +12,7 @@ const helpers = global.yoho.helpers;
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const logger = global.yoho.logger;
const stringProcess = require(`${global.utils}/string-process`);
const API_TIMEOUT = 10000;
const codeContent = {
openN: '0876085ff46bed27f1a1eb6ee8b68987',
... ... @@ -423,7 +424,7 @@ const getBankCards = (uid) => {
const getInstallmentOrderDetail = (params) => {
const method = 'app.SpaceOrders.installDetail';
if (!params.uid || !params.orderCode || !_.isNumber(params.orderCode)) {
if (!params.uid || !params.orderCode || !stringProcess.isNumeric(params.orderCode)) {
return Promise.resolve({});
}
... ...
... ... @@ -10,6 +10,7 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const camelCase = global.yoho.camelCase;
const logger = global.yoho.logger;
const stringProcess = require(`${global.utils}/string-process`);
const CODE_LOGISTIC_BANNER = '1fc9b2484fcd559049f2f7e0db313f20'; // 物流详情banner资源码
... ... @@ -143,7 +144,7 @@ const _getOrderStatus = (order, showLogistics) => {
const orderDetailData = (uid, orderCode) => {
if (!uid || !orderCode || !_.isNumber(orderCode)) {
if (!uid || !orderCode || !stringProcess.isNumeric(orderCode)) {
return Promise.resolve({});
}
... ...
... ... @@ -11,6 +11,7 @@ const helpers = global.yoho.helpers;
const api = global.yoho.API;
const searchModel = require('./search');
const productProcess = require(`${utils}/product-process`);
const stringProcess = require(`${global.utils}/string-process`);
/**
* 频道
... ... @@ -127,7 +128,7 @@ const _getShopInfo = (shopId, uid) => {
shop_id: shopId,
};
if (!shopId || !_.isNumber(shopId)) {
if (!shopId || !stringProcess.isNumeric(shopId)) {
return Promise.resolve({});
}
... ... @@ -152,7 +153,7 @@ const getShopIntro = (shopId, uid) => {
shop_id: shopId
};
if (!shopId || !_.isNumber(shopId)) {
if (!shopId || !stringProcess.isNumeric(shopId)) {
return Promise.resolve({});
}
... ...
... ... @@ -3,9 +3,9 @@
*/
'use strict';
const _ = require('lodash');
const api = global.yoho.API;
const singleAPI = global.yoho.SingleAPI;
const stringProcess = require(`${global.utils}/string-process`);
/**
* 频道
... ... @@ -42,7 +42,7 @@ exports.getIntro = shopId => {
shop_id: shopId
};
if (!shopId || !_.isNumber(shopId)) {
if (!shopId || !stringProcess.isNumeric(shopId)) {
return Promise.resolve({});
}
... ...