Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
c0b0b78d
Commit
c0b0b78d
authored
Dec 15, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
密码长度为题
parent
8e7d2b58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
Validate.php
application/library/Our/Validate.php
+9
-0
Member.php
application/models/DAO/Member.php
+4
-1
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
No files found.
application/library/Our/Validate.php
View file @
c0b0b78d
...
...
@@ -85,6 +85,15 @@ class Validate{
return
true
;
}
public
static
function
checkPasswordLen
(
$password
,
$minLen
=
6
,
$maxLen
=
16
){
if
(
!
$password
){
return
false
;
}
if
(
strlen
(
$password
)
>=
$minLen
&&
strlen
(
$password
)
<=
$maxLen
){
return
true
;
}
return
false
;
}
public
static
function
checkPassword
(
$password
){
if
(
!
$password
){
...
...
application/models/DAO/Member.php
View file @
c0b0b78d
...
...
@@ -384,8 +384,11 @@ class MemberModel extends \DAO\AbstractModel
if
(
!
$where
[
'password'
])
{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyPassword
);
}
if
(
!
\Our\Validate
::
checkPassword
(
$where
[
'password'
]))
{
/*
if (!\Our\Validate::checkPassword($where['password'])) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLimit);
}*/
if
(
!
\Our\Validate
::
checkPasswordLen
(
$where
[
'password'
]))
{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
passwordLenLimit
);
}
if
(
!
$where
[
'deviceType'
])
{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyDeviceType
);
...
...
application/models/Error/CodeConfig.php
View file @
c0b0b78d
...
...
@@ -104,6 +104,7 @@ class CodeConfigModel
const
sellerNameUpdateFailed
=
10116
;
const
notHaveAccess
=
10117
;
const
sellerJoinUpdateFailed
=
10118
;
const
passwordLenLimit
=
10119
;
//访问错误
const
illegalAccess
=
200001
;
...
...
@@ -536,6 +537,7 @@ class CodeConfigModel
self
::
sellerNameUpdateFailed
=>
'更换手机时卖家手机号码更新失败'
,
self
::
notHaveAccess
=>
'您没有权限使用'
,
self
::
sellerJoinUpdateFailed
=>
'更换手机时卖家手机号码更新失败'
,
self
::
passwordLenLimit
=>
'密码为6~16位的数字或字母组合'
,
//商品相关
self
::
emptyCommonId
=>
'商品主键不能为空'
,
self
::
goodsNotExist
=>
'商品不存在'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment