Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
钟尚武
sun
Commits
8e78d5e5
Commit
8e78d5e5
authored
Dec 06, 2018
by
zhanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/bug01' into 'master'
修复问题 See merge request
alpha/sun!5
parents
b269fb75
aeda5238
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
account.py
api/account.py
+3
-3
user_util.py
utils/user_util.py
+1
-1
No files found.
api/account.py
View file @
8e78d5e5
...
...
@@ -4,7 +4,7 @@
# Date: 2018/11/16
from
django.conf
import
settings
from
utils.base
import
APIView
from
utils.user_util
import
make_password
from
utils.user_util
import
make_password
_own
from
utils.logger
import
error_logger
...
...
@@ -53,7 +53,7 @@ class AccountUpdateOrCreateView(APIView):
data
=
{
'username'
:
request
.
POST
.
get
(
'username'
),
'email'
:
request
.
POST
.
get
(
'email'
),
'password'
:
make_password
(
request
.
POST
.
get
(
'password'
)),
'password'
:
make_password
_own
(
request
.
POST
.
get
(
'password'
)),
'phone'
:
request
.
POST
.
get
(
'phone'
),
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'is_staff'
:
True
,
...
...
@@ -137,7 +137,7 @@ class LogoutView(APIView):
class
ResetPasswordView
(
APIView
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
)
password
=
make_password
(
settings
.
OPERATOR_PASSWORD
)
password
=
make_password
_own
(
settings
.
OPERATOR_PASSWORD
)
try
:
self
.
rpc
[
'venus/sun/account/reset_password'
](
id
=
id
,
password
=
password
)
.
unwrap
()
except
Exception
as
e
:
...
...
utils/user_util.py
View file @
8e78d5e5
...
...
@@ -41,7 +41,7 @@ def require_login(request, origin=''):
return
login_require
def
make_password
(
password
):
def
make_password
_own
(
password
):
"""生成密码hash
"""
return
make_password
(
password
,
None
,
'pbkdf2_sha256'
)
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