Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
9b7092d450b900b7477c2ca40e83113a43fcd8bf
2 parents
bcd587fc
dae9d5ff
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
19 deletions
library/Api/Yohobuy.php
library/LibModels/Wap/Passport/LoginData.php
template/m.yohobuy.com/partials/cart/cart-content.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
library/Api/Yohobuy.php
View file @
9b7092d
...
...
@@ -23,18 +23,17 @@ class Yohobuy
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
/* 测试环境 */
const
API_URL
=
'http://testapi.yoho.cn:28078/'
;
const
SERVICE_URL
=
'http://testservice.yoho.cn:28077/'
;
const
API_URL
=
'http://apih5.yoho.cn/'
;
const
API_URL2
=
'http://apih5.yoho.cn/'
;
const
SERVICE_URL
=
'http://serviceh5.yoho.cn/'
;
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
const
API_OLD
=
'http://
test
2.open.yohobuy.com/'
;
const
API_OLD
=
'http://
api
2.open.yohobuy.com/'
;
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
/**
* 私钥列表
...
...
library/LibModels/Wap/Passport/LoginData.php
View file @
9b7092d
...
...
@@ -24,15 +24,20 @@ class LoginData
* @param string $area 地区编号
* @param string $profile 邮箱或手机号
* @param string $password 密码
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
* @return array
*/
public
static
function
signin
(
$area
,
$profile
,
$password
)
public
static
function
signin
(
$area
,
$profile
,
$password
,
$shoppingKey
=
null
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.passport.signin'
;
$param
[
'area'
]
=
$area
;
$param
[
'profile'
]
=
$profile
;
$param
[
'password'
]
=
$password
;
if
(
!
empty
(
$shoppingKey
))
{
$param
[
'shopping_key'
]
=
$shoppingKey
;
}
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
);
...
...
@@ -59,9 +64,10 @@ class LoginData
* @param string $nickname 姓名
* @param string $openId 第三方唯一识别码
* @param string $sourceType 登录方式
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
* @return array 登录返回结果
*/
public
static
function
signinByOpenID
(
$nickname
,
$openId
,
$sourceType
)
public
static
function
signinByOpenID
(
$nickname
,
$openId
,
$sourceType
,
$shoppingKey
=
null
)
{
// 构建必传参数
$param
=
Yohobuy
::
param
();
...
...
@@ -71,6 +77,9 @@ class LoginData
$param
[
'source_type'
]
=
$sourceType
;
$param
[
'nickname'
]
=
$nickname
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
if
(
!
empty
(
$shoppingKey
))
{
$param
[
'shopping_key'
]
=
$shoppingKey
;
}
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
...
...
template/m.yohobuy.com/partials/cart/cart-content.phtml
View file @
9b7092d
...
...
@@ -14,7 +14,7 @@
{{#if freebieOrAdvanceBuy}}
<ul class="freebie-and-advance-buy">
{{# freebie}}
{{#
if
freebie}}
<li class="freebie">
<a href="/cart/index/gift?cartType={{cartType}}">
<span class="iconfont"></span>
...
...
@@ -23,7 +23,7 @@
<span class="count">{{giftCount}}</span>
</a>
</li>
{{/
freebie
}}
{{/
if
}}
{{#if advanceBuy}}
<li class="advance-buy">
<a href="/cart/index/advanceBuy?cartType={{cartType}}">
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
9b7092d
...
...
@@ -782,7 +782,7 @@ class HomeController extends AbstractAction
$this
->
auditJumpLogin
();
$this
->
setTitle
(
'支付中心'
);
$this
->
setNavHeader
(
'支付中心'
,
Helpers
::
url
(
'/
cart/index/index'
)
);
$this
->
setNavHeader
(
'支付中心'
,
Helpers
::
url
(
'/
home/orders'
),
''
);
$orderCode
=
$this
->
get
(
'order_code'
);
if
(
empty
(
$orderCode
))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
9b7092d
...
...
@@ -124,7 +124,9 @@ class LoginController extends AbstractAction
}
/* 调用登录接口进行登录 */
$data
=
LoginData
::
signin
(
$area
,
$profile
,
$password
);
// 获取未登录时的唯一识别码
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$data
=
LoginData
::
signin
(
$area
,
$profile
,
$password
,
$shoppingKey
);
if
(
!
isset
(
$data
[
'code'
])
||
$data
[
'code'
]
!=
200
||
!
isset
(
$data
[
'data'
][
'uid'
]))
{
break
;
}
...
...
@@ -191,7 +193,8 @@ class LoginController extends AbstractAction
$result
=
array
();
if
(
isset
(
$realName
,
$email
,
$userId
))
{
$result
=
LoginData
::
signinByOpenID
(
$realName
,
$userId
,
'alipay'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$realName
,
$userId
,
'alipay'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
...
...
@@ -227,7 +230,8 @@ class LoginController extends AbstractAction
$partnerInfo
=
$qqconnect
->
getUserInfo
(
$access
);
$result
=
array
();
if
(
!
empty
(
$partnerInfo
)
&&
isset
(
$partnerInfo
[
'nickname'
]))
{
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'nickname'
],
$access
[
'openid'
],
'qq'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'nickname'
],
$access
[
'openid'
],
'qq'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
...
...
@@ -264,7 +268,8 @@ class LoginController extends AbstractAction
$result
=
array
();
if
(
$partnerInfo
&&
is_array
(
$partnerInfo
))
{
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'screen_name'
],
$access
[
'uid'
],
'sina'
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
LoginData
::
signinByOpenID
(
$partnerInfo
[
'screen_name'
],
$access
[
'uid'
],
'sina'
,
$shoppingKey
);
}
//判定是否需要绑定手机号
if
(
isset
(
$result
[
'data'
][
'is_bind'
])
&&
$result
[
'data'
][
'is_bind'
]
==
'N'
)
{
...
...
Please
register
or
login
to post a comment