Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue_django_test
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周田
vue_django_test
Commits
490f4f0f
Commit
490f4f0f
authored
Sep 18, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:改为 hash 路由,防止页面刷新 404
parent
f300f599
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
index.ts
frontend/src/router/index.ts
+2
-2
mqtt.py
mqtt/mqtt.py
+1
-0
urls.py
vue_django/urls.py
+1
-1
No files found.
frontend/src/router/index.ts
View file @
490f4f0f
import
{
createRouter
,
createWebHistory
}
from
'vue-router'
;
import
{
createRouter
,
createWebH
ashH
istory
}
from
'vue-router'
;
const
router
=
createRouter
({
history
:
createWebHistory
(),
history
:
createWebH
ashH
istory
(),
routes
:
[
{
path
:
'/'
,
...
...
mqtt/mqtt.py
View file @
490f4f0f
...
...
@@ -9,6 +9,7 @@ from device_data_op.models import TableXproAllDevinfo
def
on_connect
(
mqtt_client
,
userdata
,
flags
,
rc
):
if
rc
==
0
:
print
(
'Connected successfully'
)
# TODO: 不能一次性订阅这么多,检测哪个站就订阅哪个站,不然往下27行报错
mqtt_client
.
subscribe
([(
'/1/0/0/6'
,
2
),
(
'/1/1/0/6'
,
2
),
(
'/1/1/1/6'
,
2
)])
...
...
vue_django/urls.py
View file @
490f4f0f
...
...
@@ -34,7 +34,6 @@ schema_view = get_schema_view(
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
""
,
index
),
path
(
"test/upload/"
,
upload
),
path
(
"test/download/"
,
download
),
path
(
"api/mqtt/"
,
include
(
"mqtt.urls"
)),
...
...
@@ -47,5 +46,6 @@ urlpatterns = [
re_path
(
r'^assets/(?P<path>.*)/$'
,
serve
,
{
'document_root'
:
settings
.
STATIC_ROOT
}),
re_path
(
r'^swagger/$'
,
schema_view
.
with_ui
(
'swagger'
,
cache_timeout
=
0
),
name
=
'schema-swagger-ui'
),
re_path
(
r'^[a-zA-Z]*'
,
index
),
]
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