Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
bab8631d7166e5d408d9ba95ca5c92b3f1aa47c1
1 parent
d6bc8eb6
下单接口添加IP
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
23 deletions
app.js
apps/cart/controllers/order.js
apps/cart/controllers/seckill.js
apps/cart/models/buynow.js
apps/cart/models/cart.js
apps/cart/models/seckill.js
apps/home/models/installment.js
apps/serverAPI/order/shopping.js
package.json
app.js
View file @
bab8631
...
...
@@ -46,6 +46,8 @@ app.set('subdomain offset', 3);
app
.
set
(
'etag'
,
false
);
app
.
enable
(
'trust proxy'
);
// 全局注册library
yohoLib
.
global
(
config
);
...
...
apps/cart/controllers/order.js
View file @
bab8631
...
...
@@ -236,6 +236,7 @@ exports.orderSub = (req, res, next) => {
return
co
(
function
*
()
{
let
result
;
let
ip
=
req
.
ip
||
''
;
/* tar modified 161206 套餐 */
if
(
req
.
body
.
cartType
===
'bundle'
)
{
...
...
@@ -243,11 +244,11 @@ exports.orderSub = (req, res, next) => {
result
=
yield
cartModel
.
orderSub
(
uid
,
addressId
,
'bundle'
,
deliveryTimeId
,
deliveryId
,
invoices
,
paymentTypeId
,
paymentType
,
msg
,
couponCode
,
yohoCoin
,
null
,
unionKey
,
userAgent
,
times
,
activityInfo
);
yohoCoin
,
null
,
unionKey
,
userAgent
,
times
,
activityInfo
,
ip
);
}
else
{
result
=
yield
cartModel
.
orderSub
(
uid
,
addressId
,
cartType
,
deliveryTimeId
,
deliveryId
,
invoices
,
paymentTypeId
,
paymentType
,
msg
,
couponCode
,
yohoCoin
,
skuList
,
unionKey
,
userAgent
);
yohoCoin
,
skuList
,
unionKey
,
userAgent
,
null
,
null
,
ip
);
}
if
(
unionInfo
&&
result
.
data
)
{
...
...
apps/cart/controllers/seckill.js
View file @
bab8631
...
...
@@ -203,7 +203,8 @@ exports.submit = (req, res, next) => {
payment_type
:
paymentType
,
product_sku
:
sku
,
activity_id
:
activityId
,
uid
uid
,
ip
:
req
.
ip
||
''
};
return
seckillModel
.
submit
(
options
)
...
...
apps/cart/models/buynow.js
View file @
bab8631
...
...
@@ -38,5 +38,7 @@ exports.submit = options => {
method
:
'app.Buynow.submit'
},
options
);
return
API
.
post
(
url
,
queryData
);
return
API
.
post
(
url
,
queryData
,
{
headers
:
{
'X-Forwarded-For'
:
options
.
ip
||
''
}
});
};
...
...
apps/cart/models/cart.js
View file @
bab8631
...
...
@@ -183,7 +183,7 @@ exports.ticketsOrderCompute = (uid, productSku, buyNumber, yohoCoin) => {
exports
.
orderSub
=
(
uid
,
addressId
,
cartType
,
deliveryTime
,
deliveryWay
,
invoices
,
paymentId
,
paymentType
,
remark
,
couponCode
,
yohoCoin
,
skuList
,
qhyUnio
,
userAgent
,
times
,
activityInfo
)
=>
{
userAgent
,
times
,
activityInfo
,
ip
)
=>
{
if
(
!
qhyUnio
)
{
qhyUnio
=
''
;
}
...
...
@@ -215,7 +215,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
return
shoppingAPI
.
orderSub
(
uid
,
addressId
,
cartType
,
deliveryTime
,
deliveryWay
,
invoices
,
paymentId
,
paymentType
,
remark
,
couponCode
,
yohoCoin
,
skuList
,
qhyUnio
,
userAgent
,
times
,
activityInfo
).
then
(
orderSubRes
=>
{
userAgent
,
times
,
activityInfo
,
ip
).
then
(
orderSubRes
=>
{
let
finalResult
=
{};
if
(
orderSubRes
&&
orderSubRes
.
data
&&
orderSubRes
.
data
.
is_hint
===
'Y'
)
{
...
...
apps/cart/models/seckill.js
View file @
bab8631
...
...
@@ -55,5 +55,7 @@ exports.submit = options => {
method
:
'app.Seckill.submit'
},
options
);
return
API
.
post
(
url
,
queryData
);
return
API
.
post
(
url
,
queryData
,
{
headers
:
{
'X-Forwarded-For'
:
options
.
ip
||
''
}
});
};
...
...
apps/home/models/installment.js
View file @
bab8631
...
...
@@ -324,8 +324,7 @@ const sendVerifyCode = (uid, mobile) => {
*/
const
activateService
=
(
params
)
=>
{
return
api
.
get
(
''
,
Object
.
assign
({
method
:
'user.instalment.activate'
,
debug
:
'XYZ'
// TODO: remove this
method
:
'user.instalment.activate'
},
params
),
{
timeout
:
30000
});
...
...
@@ -367,8 +366,7 @@ const getInstallmentOrders = (params) => {
uid
:
params
.
uid
,
type
:
params
.
type
||
1
,
page
:
params
.
page
||
1
,
limit
:
params
.
limit
||
10
,
debug
:
'XYZ'
limit
:
params
.
limit
||
10
},
{
timeout
:
API_TIMEOUT
}).
then
((
result
)
=>
{
...
...
@@ -427,8 +425,7 @@ const getInstallmentOrderDetail = (params) => {
return
api
.
get
(
''
,
{
method
:
method
,
uid
:
params
.
uid
,
order_code
:
params
.
orderCode
,
debug
:
'XYZ'
order_code
:
params
.
orderCode
},
{
timeout
:
API_TIMEOUT
}).
then
((
result
)
=>
{
...
...
@@ -448,8 +445,7 @@ const totalAmount = (params) => {
return
api
.
get
(
''
,
{
method
:
method
,
prices
:
params
,
debug
:
'XYZ'
prices
:
params
},
{
timeout
:
API_TIMEOUT
}).
then
((
result
)
=>
{
...
...
@@ -466,8 +462,7 @@ const checkVerifyCode = (uid, mobile, code) => {
method
:
method
,
mobile
:
mobile
,
snsCheckCode
:
code
,
codeType
:
1
,
// 授信
debug
:
'XYZ'
codeType
:
1
// 授信
},
{
timeout
:
API_TIMEOUT
}).
then
((
result
)
=>
{
...
...
@@ -478,8 +473,7 @@ const checkVerifyCode = (uid, mobile, code) => {
// 添加银行卡请求
const
postAccount
=
(
params
)
=>
{
return
api
.
get
(
''
,
_
.
assign
({
method
:
'user.instalment.bindingCards'
,
debug
:
'XYZ'
method
:
'user.instalment.bindingCards'
},
params
),
{
timeout
:
6000
});
...
...
apps/serverAPI/order/shopping.js
View file @
bab8631
...
...
@@ -157,13 +157,12 @@ exports.checkTickets = (uid, productSku, buyNumber, useYohoCoin, yohoCoinMode) =
*/
exports
.
orderSub
=
(
uid
,
addressId
,
cartType
,
deliveryTime
,
deliveryWay
,
invoices
,
paymentId
,
paymentType
,
remark
,
couponCode
,
yohoCoin
,
skuList
,
qhyUnion
,
userAgent
,
times
,
activityInfo
)
=>
{
yohoCoin
,
skuList
,
qhyUnion
,
userAgent
,
times
,
activityInfo
,
ip
)
=>
{
if
(
!
activityInfo
)
{
activityInfo
=
null
;
}
let
params
=
{
debug
:
'Y'
,
private_key
:
privateKeyList
.
h5
,
method
:
activityInfo
?
'app.Shopping.easySubmit'
:
'app.Shopping.submit'
,
address_id
:
addressId
,
...
...
@@ -227,7 +226,9 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
params
.
qhy_union
=
qhyUnion
;
}
return
api
.
get
(
''
,
params
);
return
api
.
get
(
''
,
params
,
{
headers
:
{
'X-Forwarded-For'
:
ip
||
''
}
});
};
...
...
package.json
View file @
bab8631
...
...
@@ -47,7 +47,7 @@
"uuid"
:
"^2.0.3"
,
"xml2js"
:
"^0.4.17"
,
"yoho-express-session"
:
"^2.0.0"
,
"yoho-node-lib"
:
"^0.2.
7
"
,
"yoho-node-lib"
:
"^0.2.
8
"
,
"yoho-zookeeper"
:
"^1.0.6"
},
"devDependencies"
:
{
...
...
Please
register
or
login
to post a comment