Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
姜枫
8 years ago
Commit
90d217963a3822b9f090c445226db3b4cd52413e
2 parents
c9921470
d58f49d8
Merge branch 'feature/vip' into 'master'
修改yoho接口变动 blk没同步更改的问题 See merge request
!7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
63 deletions
apps/passport/controllers/reg.js
apps/passport/models/reg-api.js
apps/product/controllers/shop.js
config/common.js
apps/passport/controllers/reg.js
View file @
90d2179
...
...
@@ -255,7 +255,7 @@ let mobileRegister = (req, res, next) => {
}
/* 手机注册: 调用注册接口*/
let
regResult
=
yield
RegService
.
regMobileAsync
(
area
,
mobile
,
password
,
cookie
.
getShoppingKey
(
req
));
let
regResult
=
yield
RegService
.
regMobileAsync
(
area
,
mobile
,
password
,
co
de
,
co
okie
.
getShoppingKey
(
req
));
if
(
!
regResult
.
code
||
regResult
.
code
!==
200
)
{
data
.
message
=
'注册失败'
;
...
...
apps/passport/models/reg-api.js
View file @
90d2179
...
...
@@ -3,6 +3,7 @@
*/
'use strict'
;
const
api
=
global
.
yoho
.
API
;
const
crypto
=
global
.
yoho
.
crypto
;
/**
* 发送注册验证码
...
...
@@ -31,15 +32,20 @@ let validMobileCodeAsync = (area, mobile, code) => {
return
api
.
post
(
''
,
params
);
};
let
aesPwd
=
(
pwd
)
=>
{
return
crypto
.
encryption
(
'yoho9646yoho9646'
,
pwd
);
};
/**
* 注册帐号
*/
let
regMobileAsync
=
(
area
,
mobile
,
password
,
shoppingKey
)
=>
{
let
regMobileAsync
=
(
area
,
mobile
,
password
,
code
,
shoppingKey
)
=>
{
let
params
=
{
method
:
'app.passport.register'
,
method
:
'app.passport.register
AES
'
,
area
:
area
,
profile
:
mobile
,
password
:
password
password
:
aesPwd
(
password
),
verifyCode
:
code
};
if
(
shoppingKey
)
{
...
...
apps/product/controllers/shop.js
View file @
90d2179
...
...
@@ -115,61 +115,55 @@ const shop = {
data
.
banner
.
banner
=
data
.
banner
.
banner
.
split
(
'?'
)[
0
];
}
if
(
result
.
brandId
)
{
q
.
brand
=
result
.
brandId
;
q
.
shop_id
=
result
.
shopId
;
nav
.
push
({
name
:
result
.
name
});
}
q
.
brand
=
result
.
brandId
;
q
.
shop_id
=
result
.
shopId
;
nav
.
push
({
name
:
result
.
name
});
return
result
.
brandId
;
}).
then
((
brandId
)
=>
{
if
(
brandId
)
{
return
Promise
.
all
([
Search
.
queryAllSort
({
brand
:
q
.
brand
,
shop
:
q
.
shop_id
,
small_sort
:
1
}),
Search
.
queryProductOfBrand
(
q
)]).
then
(
allResult
=>
{
let
allSort
=
allResult
[
0
];
let
result
=
allResult
[
1
];
if
(
result
&&
result
.
code
===
200
&&
result
.
data
)
{
let
ret
=
result
.
data
;
if
(
ret
.
filter
)
{
ret
.
filter
.
standard
=
ret
.
standard
;
ret
.
filter
.
group_sort
=
DataHelper
.
sortConvert
(
allSort
.
data
.
sort
);
ret
.
filter
.
singleBrand
=
true
;
data
.
filter
=
DataHelper
.
filterHandle
(
ret
.
filter
,
q
);
data
.
filter
.
showPrice
=
ret
.
total
>
10
;
data
.
filter
.
showInfo
=
(
data
.
filter
.
style
&&
data
.
filter
.
style
.
length
>
0
)
||
(
ret
.
standard
&&
ret
.
standard
.
length
>
0
);
//eslint-disable-line
}
data
.
paginationData
=
{
page
:
q
.
page
,
limit
:
ret
.
limit
||
45
,
total
:
ret
.
total
,
pageTotal
:
ret
.
page_total
,
queryParams
:
req
.
query
};
data
.
navPath
=
{
nav
:
nav
};
res
.
display
(
'shop-list'
,
_
.
assign
(
data
,
{
products
:
DataHelper
.
handleProductList
(
ret
.
product_list
,
q
,
false
),
order
:
q
.
order
}));
}
else
{
return
Promise
.
reject
(
'query shop index error'
);
return
Promise
.
all
([
Search
.
queryAllSort
({
brand
:
q
.
brand
,
shop
:
q
.
shop_id
,
small_sort
:
1
}),
Search
.
queryProductOfBrand
(
q
)]).
then
(
allResult
=>
{
let
allSort
=
allResult
[
0
];
let
result
=
allResult
[
1
];
if
(
result
&&
result
.
code
===
200
&&
result
.
data
)
{
let
ret
=
result
.
data
;
if
(
ret
.
filter
)
{
ret
.
filter
.
standard
=
ret
.
standard
;
ret
.
filter
.
group_sort
=
DataHelper
.
sortConvert
(
allSort
.
data
.
sort
);
ret
.
filter
.
singleBrand
=
true
;
data
.
filter
=
DataHelper
.
filterHandle
(
ret
.
filter
,
q
);
data
.
filter
.
showPrice
=
ret
.
total
>
10
;
data
.
filter
.
showInfo
=
(
data
.
filter
.
style
&&
data
.
filter
.
style
.
length
>
0
)
||
(
ret
.
standard
&&
ret
.
standard
.
length
>
0
);
//eslint-disable-line
}
});
}
else
{
return
next
();
}
data
.
paginationData
=
{
page
:
q
.
page
,
limit
:
ret
.
limit
||
45
,
total
:
ret
.
total
,
pageTotal
:
ret
.
page_total
,
queryParams
:
req
.
query
};
data
.
navPath
=
{
nav
:
nav
};
res
.
display
(
'shop-list'
,
_
.
assign
(
data
,
{
products
:
DataHelper
.
handleProductList
(
ret
.
product_list
,
q
,
false
),
order
:
q
.
order
}));
}
else
{
return
Promise
.
reject
(
'query shop index error'
);
}
});
}).
catch
(
next
);
},
...
...
config/common.js
View file @
90d2179
...
...
@@ -27,16 +27,16 @@ module.exports = {
// service: 'http://192.168.102.205:8080/gateway/',
// search: 'http://192.168.102.216:8080/yohosearch/'
// singleApi: 'http://single.yoho.cn/',
// api: 'http://api.yoho.yohoops.org/',
// service: 'http://service.yoho.yohoops.org/',
// search: 'http://search.yohoops.org/yohosearch/'
singleApi
:
'http://single.yoho.cn/'
,
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
api
:
'http://api.yoho.cn/'
,
service
:
'http://service.yoho.cn/'
,
search
:
'http://search.yohoops.org/yohosearch/'
// singleApi: 'http://single.yoho.cn/',
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// search: 'http://search.yohoops.org/yohosearch/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/',
...
...
Please
register
or
login
to post a comment