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
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
037de2ef78126afb757b6b6bbdb523ac2e84b9ff
1 parent
88ba75d5
do modify cuxiao coupon huodong js add checkout is logged
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
58 deletions
yohobuy/huodong.m.yohobuy.com/application/Bootstrap.php
yohobuy/huodong.m.yohobuy.com/application/modules/Cuxiao/controllers/Coupon.php
yohobuy/huodong.m.yohobuy.com/application/Bootstrap.php
View file @
037de2e
...
...
@@ -64,46 +64,8 @@ class Bootstrap extends Bootstrap_Abstract
*/
public
function
_initRoute
(
Dispatcher
$dispatcher
)
{
$hostParts
=
explode
(
'.'
,
$dispatcher
->
getRequest
()
->
getServer
(
'HTTP_HOST'
,
''
));
$level
=
count
(
$hostParts
)
-
1
;
/* 根据域名的级别,设置默认的模块、控制器、方法 */
$module
=
'Index'
;
$controller
=
'Index'
;
$action
=
'Index'
;
// 三级域名
if
(
3
===
$level
)
{
$subDomain
=
strval
(
$hostParts
[
0
]);
switch
(
strtolower
(
$subDomain
))
{
case
'm'
:
// 老版(到频道选择)
case
'buy'
:
// 测试环境的域名, 以后可去掉
break
;
case
'new'
:
// 原新版(到男生首页)
$controller
=
'Boys'
;
break
;
case
'search'
:
// 搜索
$controller
=
'Search'
;
$action
=
'List'
;
break
;
case
'guang'
:
// 逛
$module
=
'Guang'
;
break
;
case
'list'
:
// 商品列表
$module
=
'Product'
;
break
;
default
:
// 其它(识别为品牌)
$module
=
'Product'
;
$action
=
'Brand'
;
$dispatcher
->
getRequest
()
->
setParam
(
'named'
,
$subDomain
);
break
;
}
}
$dispatcher
->
getRequest
()
->
module
=
$module
;
$dispatcher
->
getRequest
()
->
controller
=
$controller
;
$dispatcher
->
getRequest
()
->
action
=
$action
;
/* 根据对应模块的配置,添加相应的路由规则 */
$iniFile
=
APPLICATION_PATH
.
'/configs/routes.
'
.
strtolower
(
$module
)
.
'
.ini'
;
$iniFile
=
APPLICATION_PATH
.
'/configs/routes.
index
.ini'
;
if
(
file_exists
(
$iniFile
))
{
$config
=
new
Config\Ini
(
$iniFile
);
if
(
isset
(
$config
->
routes
))
{
...
...
yohobuy/huodong.m.yohobuy.com/application/modules/Cuxiao/controllers/Coupon.php
View file @
037de2e
...
...
@@ -501,32 +501,18 @@ class CouponController extends HuodongAction
{
do
{
/* 判断是否有参数 */
$param
=
$this
->
get
();
if
(
empty
(
$param
))
{
$uid
=
$this
->
get
(
'uid'
);
if
(
empty
(
$uid
)
||
!
is_numeric
(
$uid
)
)
{
break
;
}
/* 判断参数是否有效 */
if
(
!
isset
(
$param
[
'client_secret'
])
||
empty
(
$param
[
'uid'
]))
{
$secret
=
$this
->
get
(
'client_secret'
);
if
(
!
isset
(
$secret
)
)
{
break
;
}
/* 取消无用的参数 */
$uri
=
key
(
$param
);
if
(
false
!==
stripos
(
$uri
,
'cuxiao/'
))
{
unset
(
$param
[
$uri
]);
}
/* 验证公钥是否有效 */
$clientSecret
=
$param
[
'client_secret'
];
$publicParam
=
Yohobuy
::
param
();
$param
[
'private_key'
]
=
$publicParam
[
'private_key'
];
unset
(
$param
[
'client_secret'
]);
if
(
$clientSecret
!==
Sign
::
makeSign
(
$param
))
{
break
;
}
$this
->
setSession
(
self
::
SESSION_UID
,
$param
[
'uid'
]);
$this
->
setSession
(
self
::
SESSION_UID
,
$uid
);
return
true
;
...
...
Please
register
or
login
to post a comment