Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
9ada6060a04fb641d7790155f2aadc916cac8224
1 parent
8c66934b
fix privacy protection
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
apps/home/models/account-service.js
apps/home/models/account-service.js
View file @
9ada606
...
...
@@ -14,6 +14,14 @@ const crypto = global.yoho.crypto;
const
AccountApi
=
require
(
'./account-api'
);
const
CaptchaImgService
=
require
(
'../../passport/models/captcha-img-service'
);
const
_privacyProtection
=
(
str
,
start
=
0
,
end
=
0
)
=>
{
if
(
!
str
||
!
(
end
-
start
>
0
))
{
return
''
;
}
return
`
$
{
str
.
slice
(
0
,
3
)}
****
$
{
str
.
slice
(
7
)}
`
;
}
module
.
exports
=
class
extends
global
.
yoho
.
BaseModel
{
constructor
(
ctx
)
{
super
(
ctx
);
...
...
@@ -104,11 +112,12 @@ module.exports = class extends global.yoho.BaseModel {
name
:
'password'
}
];
let
formData2
=
[
{
// 只验证手机号
inputTxt
:
'已验证的手机号'
,
isVerify
:
true
,
verifyAccount
:
data
.
mobile
.
slice
(
0
,
3
)
+
'****'
+
data
.
mobile
.
slice
(
7
),
verifyAccount
:
_privacyProtection
(
data
.
mobile
,
3
,
7
),
realAccount
:
data
.
mobile
}
];
...
...
@@ -117,7 +126,7 @@ module.exports = class extends global.yoho.BaseModel {
{
// 只验证邮箱
inputTxt
:
'已验证邮箱'
,
isVerify
:
true
,
verifyAccount
:
data
.
email
.
slice
(
0
,
2
)
+
'****'
+
data
.
email
.
slice
(
6
),
verifyAccount
:
_privacyProtection
(
data
.
email
,
2
,
6
),
realAccount
:
data
.
email
}
];
...
...
@@ -351,7 +360,7 @@ module.exports = class extends global.yoho.BaseModel {
resq
[
1
].
icon
=
verifyData
.
mobileVerify
===
'N'
?
'warning'
:
'ok'
;
resq
[
1
].
isValid
=
verifyData
.
mobileVerify
===
'N'
?
false
:
true
;
resq
[
1
].
tip
=
verifyData
.
mobileVerify
===
'N'
?
'验证后,可用于找回登录密码。'
:
'您验证的手机:'
+
verifyData
.
mobile
.
slice
(
0
,
3
)
+
'****'
+
verifyData
.
mobile
.
slice
(
7
);
'您验证的手机:'
+
_privacyProtection
(
verifyData
.
mobile
,
3
,
7
);
}
return
resq
;
...
...
@@ -661,7 +670,7 @@ module.exports = class extends global.yoho.BaseModel {
],
returnInfo
:
true
,
sendEmail
:
{
emailInfo
:
email
.
slice
(
0
,
2
)
+
'****'
+
email
.
slice
(
6
),
emailInfo
:
_privacyProtection
(
email
,
2
,
6
),
emailUrl
:
emailDomain
}
};
...
...
Please
register
or
login
to post a comment