Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
wanli
evm-store
Commits
efdcd111
Commit
efdcd111
authored
Jul 22, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(设备管理模块): 设备管理权限划分
parent
150b6bc7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
tools/build_out/controllers/device.py
tools/build_out/controllers/device.py
+7
-3
tools/build_out/views/device.py
tools/build_out/views/device.py
+2
-1
tools/frontend/src/views/Application/Device.vue
tools/frontend/src/views/Application/Device.vue
+3
-0
No files found.
tools/build_out/controllers/device.py
View file @
efdcd111
'''
Author: your name
Date: 2021-07-15 09:33:39
LastEditTime: 2021-07-
19 18:21:58
LastEditTime: 2021-07-
22 10:27:05
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath:
\
evm-store
\t
ools
\b
uild_out
\
controllers
\
device.py
...
...
@@ -28,10 +28,14 @@ class DeviceResource(object):
return
result
,
ResponseCode
.
HTTP_SUCCESS
return
None
,
ResponseCode
.
HTTP_NOT_FOUND
def
getList
(
self
,
params
):
def
getList
(
self
,
params
,
jwt
=
{}
):
# handle business
user
=
UserModel
.
query
.
filter
(
UserModel
.
uuid
==
jwt
.
get
(
"uuid"
),
UserModel
.
is_delete
==
False
)
.
one_or_none
()
if
not
user
:
return
False
,
ResponseCode
.
USER_NOT_EXISTS
logger
.
warn
(
params
)
filters
=
[
DeviceModel
.
is_delete
==
False
]
filters
=
[
DeviceModel
.
is_delete
==
False
,
DeviceModel
.
create_by
==
user
.
id
]
if
params
.
get
(
"type"
):
filters
.
append
(
DeviceModel
.
type
==
params
.
get
(
"type"
))
if
params
.
get
(
"name"
):
filters
.
append
(
DeviceModel
.
name
==
params
.
get
(
"name"
))
if
params
.
get
(
"imei"
):
filters
.
append
(
DeviceModel
.
imei
==
params
.
get
(
"imei"
))
...
...
tools/build_out/views/device.py
View file @
efdcd111
...
...
@@ -26,6 +26,7 @@ class DeviceResourceList(Resource):
args
=
self
.
parser
.
parse_args
()
try
:
jwt
=
get_jwt_identity
()
data
=
dict
()
for
key
,
value
in
args
.
items
():
if
value
!=
None
:
...
...
@@ -34,7 +35,7 @@ class DeviceResourceList(Resource):
# logger.warn(json_payload)
# data = getListDeviceSchema.load(json_payload)
logger
.
info
(
data
)
result
,
message
=
signalManager
.
actionGetListDevice
.
emit
(
data
)
result
,
message
=
signalManager
.
actionGetListDevice
.
emit
(
data
,
jwt
)
json_dumps
=
getListDeviceSchema
.
dump
(
result
)
if
result
:
json_dumps
=
getListDevicesSchema
.
dump
(
result
.
items
)
...
...
tools/frontend/src/views/Application/Device.vue
View file @
efdcd111
...
...
@@ -209,6 +209,9 @@ export default {
},
handleTableChange
(
pagination
,
filters
,
sorter
)
{
console
.
log
(
pagination
,
filters
,
sorter
);
this
.
post
.
page
=
pagination
.
current
;
this
.
post
.
pageSize
=
pagination
.
pageSize
;
this
.
getDataList
();
},
getDataList
()
{
this
.
loading
=
true
;
...
...
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