Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tour_business
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏强
tour_business
Commits
d20e5ab0
Commit
d20e5ab0
authored
Apr 17, 2020
by
魏强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update;
parent
f4ec99b4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletions
+23
-1
Controller/ToolController.py
+21
-0
app.py
+2
-1
No files found.
Controller/ToolController.py
View file @
d20e5ab0
...
...
@@ -99,3 +99,24 @@ def take_out_multiple():
time
.
sleep
(
3
)
return
jsonify
(
BASE_RESPONSE
(
data
=
data
)
.
to_dict
())
@route_tool.route
(
'/reset'
)
def
tool_reset
():
mac_no
=
request
.
args
.
get
(
'mac_no'
,
''
)
if
not
mac_no
:
return
jsonify
({
'code'
:
-
1
,
'msg'
:
'mac no null'
})
machine_info
=
Machine
.
query
.
filter_by
(
mac_no
=
mac_no
)
.
first
()
if
not
machine_info
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
power_info
=
Power
.
query
.
filter_by
(
machine_id
=
machine_info
.
id
,
status
=
7
)
.
all
()
for
power
in
power_info
:
power
.
status
=
2
db
.
session
.
commit
()
return
jsonify
(
BASE_RESPONSE
()
.
to_dict
())
app.py
View file @
d20e5ab0
...
...
@@ -48,7 +48,8 @@ def verify_auth_token():
用户登录验证token
:return:
'''
NO_AUTH_CHECK_URL
=
[
url_for
(
'account.test'
),
url_for
(
'account.login'
),
url_for
(
'account.send_code'
)]
NO_AUTH_CHECK_URL
=
[
url_for
(
'account.test'
),
url_for
(
'account.login'
),
url_for
(
'account.send_code'
),
url_for
(
'tool.tool_reset'
)]
if
request
.
path
not
in
NO_AUTH_CHECK_URL
:
token
=
request
.
headers
.
get
(
'token'
)
if
not
token
:
...
...
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