Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-system
Project
Project
Details
Activity
Releases
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
xianyang
financial-system
Commits
17568c47
Commit
17568c47
authored
Mar 29, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化账户config_key重复报错
parent
823c2f32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
crud.py
app/api/account/crud.py
+4
-2
views.py
app/api/account/views.py
+2
-2
No files found.
app/api/account/crud.py
View file @
17568c47
...
@@ -126,8 +126,10 @@ def create_account(param):
...
@@ -126,8 +126,10 @@ def create_account(param):
account
=
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
sql
)
account
=
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
sql
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
if
'config_key'
in
str
(
e
):
return
'config_key重复'
return
e
return
''
return
''
return
account
def
update_account_info
(
old_data
):
def
update_account_info
(
old_data
):
...
...
app/api/account/views.py
View file @
17568c47
...
@@ -17,9 +17,9 @@ def create_account(data: schemas.AccountCreate, token=Depends(login_required)):
...
@@ -17,9 +17,9 @@ def create_account(data: schemas.AccountCreate, token=Depends(login_required)):
if
db_info
:
if
db_info
:
return
HttpResultResponse
(
code
=
400
,
msg
=
HttpMessage
.
ACCOUNT_EXIST
)
return
HttpResultResponse
(
code
=
400
,
msg
=
HttpMessage
.
ACCOUNT_EXIST
)
res
=
crud
.
create_account
(
data
)
res
=
crud
.
create_account
(
data
)
if
not
res
:
if
res
:
return
HttpResultResponse
(
code
=
500
,
msg
=
res
)
return
HttpResultResponse
(
code
=
500
,
msg
=
res
)
return
HttpResultResponse
(
data
=
res
)
return
HttpResultResponse
()
@
router
.
get
(
"/list"
)
@
router
.
get
(
"/list"
)
...
...
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