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
yangyang
9 years ago
Commit
988ac731be718344cac7de1c3e76a3e2fefb2684
2 parents
bc78d70e
e8c7ce0d
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into feature/web-list
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
19 deletions
library/Plugin/Pay/aliwap/AliwapConfig.php
library/WebPlugin/HelperSearch.php
web-static/js/common.js
web-static/js/header.js
yohobuy/m.yohobuy.com/configs/application.developer.ini
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Login.php
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Register.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
library/Plugin/Pay/aliwap/AliwapConfig.php
View file @
988ac73
...
...
@@ -32,7 +32,7 @@ class AliwapConfig
* Enter description here ...
* @var String
*/
var
$notify_url
=
'http://testservice.yoho.cn:28077/payment/alipay_notify'
;
//"http://m.yohobuy.com/shopping/pay/aliwapnotice";
var
$notify_url
=
'http://testservice.yoho.cn:28077/payment/alipay
wap
_notify'
;
//"http://m.yohobuy.com/shopping/pay/aliwapnotice";
/**
* 浏览器的返回
...
...
library/WebPlugin/HelperSearch.php
View file @
988ac73
...
...
@@ -71,8 +71,7 @@ class HelperSearch
$result
=
array
();
self
::
$params
=
$_GET
;
self
::
$options
=
$options
;
// unset(self::$params['/']);
// unset(self::$params['page']);
unset
(
self
::
$params
[
'page'
]);
self
::
$filter
=
isset
(
$data
[
'product'
][
'filter'
])
?
$data
[
'product'
][
'filter'
]
:
array
();
//产品列表
$result
[
'goods'
]
=
isset
(
$data
[
'product'
][
'product_list'
])
?
self
::
getProductList
(
$data
[
'product'
][
'product_list'
],
$options
[
'imgSize'
])
:
array
();
...
...
@@ -555,6 +554,7 @@ class HelperSearch
$result
=
array
();
$color
=
$filter
[
'color'
];
foreach
(
$color
as
$v
)
{
$checked
=
false
;
//设置已选中
if
(
$v
[
'color_id'
]
==
$colorId
)
{
$background
=
empty
(
$v
[
'color_value'
])
?
'#'
.
$v
[
'color_code'
]
:
"url("
.
$v
[
'color_value'
]
.
")"
;
...
...
@@ -562,6 +562,7 @@ class HelperSearch
'color'
=>
$background
,
'href'
=>
self
::
buildUrl
(
$params
)
);
$checked
=
true
;
}
$result
[]
=
array
(
'name'
=>
$v
[
'color_name'
],
...
...
@@ -569,6 +570,7 @@ class HelperSearch
'href' => self::buildUrl(array_merge(
$params
, array(
'color' =>
$v['color_id']
))) ,
'checked' =>
$checked
);
}
if (self::checkSearch('color')) {
...
...
@@ -663,6 +665,7 @@ class HelperSearch
$styleNum
= 0;
$styleName
= '';
foreach (
$style
as
$v
) {
$checked
= false;
//选中的筛选条件
if (in_array(
$v['style_id']
,
$styleIds
)) {
if (!
$styleNum
) {
...
...
@@ -681,6 +684,7 @@ class HelperSearch
$url
= self::buildUrl(array_merge(
$params
, array(
'style' => implode(',',
$selectedStyle
)
)));
$checked
= true;
}
//该风格url参数中添加该风格的id
else {
...
...
@@ -693,6 +697,7 @@ class HelperSearch
'id' =>
$v['style_id']
,
'name' =>
$v['style_name']
,
'href' =>
$url
,
'checked' =>
$checked
);
}
if (isset(self::
$params['style']
) && !empty(self::
$params['style']
)) {
...
...
@@ -1281,16 +1286,41 @@ class HelperSearch
*/
public static function fromPram(
$url
,
$position
,
$abEnabled
= false)
{
$type
= '';
$itemFrom
= ChannelConfig::
$itemFromStats
;
$controller
= isset(self::
$options['controller']
) ? strtolower(self::
$options['controller']
) : '';
$action
= isset(self::
$options['action']
) ? strtolower(self::
$options['action']
) : '';
//列表页面
if (
$controller
== 'list' &&
$action
== 'index') {
$type
= isset(self::
$params['msort']
) && self::
$params['msort']
? self::
$params['msort']
: '';
}
//新品到着
elseif (
$controller
== 'list' &&
$action
== 'new') {
if (isset(self::
$params['shelve_time']
)) {
$date
= explode(',', self::
$params['shelve_time']
);
$date
= date('Y-m-d',
$date[0]
);
}
$type
=
$date
;
}
//list - sale
elseif (
$controller
== 'list' &&
$action
== 'sale') {
$type
= isset(self::
$params['discount']
) && self::
$params['discount']
? self::
$params['discount']
: '0,0.9';
}
// 品牌
elseif (
$controller
== 'list' &&
$action
== 'sale') {
$type
= isset(self::
$params['brandId']
) && self::
$params['brandId']
? self::
$params['brandId']
: '';
}
// 搜索
elseif (
$controller
== 'search') {
$type
= isset(self::
$params['query']
) && self::
$params['query']
? self::
$params['query']
: '';
}
$itemIndex
=
$controller
."
_
".
$action
;
//获取domain-module-
$keyword_page_position
{
ab
}
$ab
= (isset(
$_COOKIE['ab_5']
) &&
$abEnabled
== true) ? '_'.
$_COOKIE['ab_5']
: '';
$page
= self::
$page
;
$keyword
= isset(self::
$options['query']
) ? self::
$options['query']
: '';
if (isset(
$itemFrom[$itemIndex]
)) {
$url
.= "
?
from
=
{
$itemFrom
[
$itemIndex
][
'domain'
]}
-
{
$itemFrom
[
$itemIndex
][
'module'
]}
-
{
$
keyword
}
_
{
$page
}
_
{
$position
}{
$ab
}
";
$url
.= "
?
from
=
{
$itemFrom
[
$itemIndex
][
'domain'
]}
-
{
$itemFrom
[
$itemIndex
][
'module'
]}
-
{
$
type
}
_
{
$page
}
_
{
$position
}{
$ab
}
";
}
return
$url
;
}
...
...
web-static/js/common.js
View file @
988ac73
...
...
@@ -6,7 +6,8 @@
var
$
=
require
(
'yoho.jquery'
);
require
(
'./footer'
);
require
(
'./simple-header'
);
function
cookie
(
name
)
{
...
...
@@ -131,5 +132,9 @@ window.getUser = getUser;
window
.
getUid
=
getUid
;
window
.
getShoppingKey
=
getShoppingKey
;
if
(
$
(
'.simple-header'
).
hasClass
(
'simple-header'
)){
require
(
'./simple-header'
);
}
else
{
require
(
'./header'
);
}
require
(
'./header'
);
...
...
web-static/js/header.js
View file @
988ac73
...
...
@@ -773,8 +773,8 @@ function actionTipPic() {
var
$img
=
''
;
var
$title
=
''
;
var
$link
=
''
;
var
link
=
''
;
var
logolink
=
''
;
$
(
document
).
on
(
'mouseenter'
,
'.sub-nav-item'
,
function
()
{
$contentcode
=
$
(
this
).
find
(
'.showdetail'
).
attr
(
'data-code'
);
if
(
$contentcode
)
{
...
...
@@ -791,7 +791,7 @@ function actionTipPic() {
}
}
});
link
=
$
(
'.first-nav-list .cur'
).
find
(
'a'
).
attr
(
'href'
);
l
ogol
ink
=
$
(
'.first-nav-list .cur'
).
find
(
'a'
).
attr
(
'href'
);
$
(
'.main-link'
).
attr
(
'href'
,
link
);
}
...
...
yohobuy/m.yohobuy.com/configs/application.developer.ini
View file @
988ac73
...
...
@@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
;;website library
application.library
=
ROOT_PATH "/library"
;;模块配置
application.modules
=
"Index,Category,Channel,Guang,Passport,Product,Cart
,Shopping
"
application.modules
=
"Index,Category,Channel,Guang,Passport,Product,Cart"
;;加载
application.bootstrap
=
APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
...
...
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
988ac73
...
...
@@ -6,6 +6,7 @@ use LibModels\Web\Passport\LoginData;
use
Passport\PassportModel
as
PassportModel
;
use
Configs\ChannelConfig
;
use
WebPlugin\Helpers
;
use
WebPlugin\Cache
;
class
LoginController
extends
WebAction
{
...
...
@@ -61,8 +62,7 @@ class LoginController extends WebAction
*/
public
function
authAction
()
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
'账号或密码不正确'
,
'data'
=>
''
);
$data
=
array
(
'code'
=>
400
,
'message'
=>
'您输入的密码及账户名不匹配,是否忘记密码?'
,
'data'
=>
''
);
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
...
...
@@ -91,10 +91,29 @@ class LoginController extends WebAction
break
;
}
/*
调用登录接口进行登录
*/
/*
购物车
*/
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
/*
* 登录-防恶意机制
* 同一用户名登录密码错误次数超10次,需30分钟后尝试
* 同一ip登录密码错误次数超100次,需1小时后尝试 , ip错误提示语:您尝试的次数过多,账号已被暂时锁定,请稍后再试
*/
$ip
=
Helpers
::
getClientIp
();
$ipKey
=
md5
(
'ip_signin_'
.
$ip
);
$accountKey
=
md5
(
'account_signin_'
.
$account
);
$accountTimes
=
Cache
::
increment
(
$accountKey
,
1
,
0
,
1800
);
$ipTimes
=
Cache
::
increment
(
$ipKey
,
1
,
0
,
3600
);
if
(
$accountTimes
>
10
)
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
'您输入的密码及账户名不匹配,是否忘记密码?'
,
'data'
=>
''
);
break
;
}
if
(
$ipTimes
>
100
)
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
'您尝试的次数过多,账号已被暂时锁定,请稍后再试'
,
'data'
=>
''
);
break
;
}
$data
=
LoginData
::
signin
(
$area
,
$account
,
$password
,
$shoppingKey
);
if
(
!
isset
(
$data
[
'code'
])
||
$data
[
'code'
]
!=
200
||
!
isset
(
$data
[
'data'
][
'uid'
]))
{
$data
=
array
(
'code'
=>
400
,
'message'
=>
'您输入的密码及账户名不匹配,是否忘记密码?'
,
'data'
=>
''
);
break
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Register.php
View file @
988ac73
...
...
@@ -59,7 +59,7 @@ class RegisterController extends WebAction
$data
[
'message'
]
=
'手机号码格式不正确'
;
break
;
}
if
(
$ip_times
>=
10
00
)
{
if
(
$ip_times
>=
5
00
)
{
$data
[
'message'
]
=
'由于你IP受限无法注册'
;
break
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Search.php
View file @
988ac73
...
...
@@ -6,8 +6,8 @@ class SearchController extends WebAction
public
function
indexAction
()
{
//当前控制器
$options
[
'controller'
]
=
$this
->
_request
->
controller
;
$options
[
'action'
]
=
$this
->
_request
->
action
;
$options
[
'controller'
]
=
'Search'
;
$options
[
'action'
]
=
'index'
;
//浏览记录数
$options
[
'reviewNum'
]
=
7
;
$searchData
=
SearchModel
::
searchData
(
array
(),
$options
);
...
...
@@ -16,8 +16,6 @@ class SearchController extends WebAction
'searchListPage'
=>
true
,
'search'
=>
$searchData
);
// $this->setTitle();
// $this->setTitle();
$this
->
setWebNavHeader
();
$this
->
_view
->
display
(
'search'
,
$data
);
}
...
...
Please
register
or
login
to post a comment