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
aeda5238
Commit
aeda5238
authored
6 years ago
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复问题
parent
b269fb75
master
deploy/like-prod
deploy/like-stage
deploy/like-test
dev
like-pre/r01
test
No related merge requests found
Show 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 @
aeda5238
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
# Date: 2018/11/16
# Date: 2018/11/16
from
django.conf
import
settings
from
django.conf
import
settings
from
utils.base
import
APIView
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
from
utils.logger
import
error_logger
...
@@ -53,7 +53,7 @@ class AccountUpdateOrCreateView(APIView):
...
@@ -53,7 +53,7 @@ class AccountUpdateOrCreateView(APIView):
data
=
{
data
=
{
'username'
:
request
.
POST
.
get
(
'username'
),
'username'
:
request
.
POST
.
get
(
'username'
),
'email'
:
request
.
POST
.
get
(
'email'
),
'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'
),
'phone'
:
request
.
POST
.
get
(
'phone'
),
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'is_staff'
:
True
,
'is_staff'
:
True
,
...
@@ -137,7 +137,7 @@ class LogoutView(APIView):
...
@@ -137,7 +137,7 @@ class LogoutView(APIView):
class
ResetPasswordView
(
APIView
):
class
ResetPasswordView
(
APIView
):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
)
id
=
request
.
POST
.
get
(
'id'
)
password
=
make_password
(
settings
.
OPERATOR_PASSWORD
)
password
=
make_password
_own
(
settings
.
OPERATOR_PASSWORD
)
try
:
try
:
self
.
rpc
[
'venus/sun/account/reset_password'
](
id
=
id
,
password
=
password
)
.
unwrap
()
self
.
rpc
[
'venus/sun/account/reset_password'
](
id
=
id
,
password
=
password
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
utils/user_util.py
View file @
aeda5238
...
@@ -41,7 +41,7 @@ def require_login(request, origin=''):
...
@@ -41,7 +41,7 @@ def require_login(request, origin=''):
return
login_require
return
login_require
def
make_password
(
password
):
def
make_password
_own
(
password
):
"""生成密码hash
"""生成密码hash
"""
"""
return
make_password
(
password
,
None
,
'pbkdf2_sha256'
)
return
make_password
(
password
,
None
,
'pbkdf2_sha256'
)
This diff is collapsed.
Click to expand it.
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