Commit 490f4f0f by 周田

fix:改为 hash 路由,防止页面刷新 404

parent f300f599
import { createRouter, createWebHistory } from 'vue-router';
import { createRouter, createWebHashHistory } from 'vue-router';
const router = createRouter({
history: createWebHistory(),
history: createWebHashHistory(),
routes: [
{
path: '/',
......
......@@ -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)])
......
......@@ -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),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment