From d0dd64c1f0e835f179c8310023c3c9b9af671b0a Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 24 Jul 2020 11:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8Drouter=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=B8=BAroutes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 5e43716f2dbe86ff7ebf0ed15389da715ee19f51 Former-commit-id: eeb64770c8361a713ad549b46ecbb4c5ffb000b2 --- projects/WebMVC/wwwroot/js/axios.js | 2 +- projects/WebMVC/wwwroot/js/components.js | 10 ++-- projects/WebMVC/wwwroot/js/form.js | 2 +- projects/WebMVC/wwwroot/js/route.js | 8 +-- .../admin/command/detail.html | 0 .../admin/command/edit.html | 0 .../admin/command/index.html | 0 .../{router => routes}/admin/index.html | 4 +- .../admin/setting/detail.html | 0 .../admin/setting/edit.html | 0 .../admin/setting/index.html | 0 .../wwwroot/{router => routes}/device.html | 0 .../wwwroot/{router => routes}/home.html | 2 +- .../wwwroot/{router => routes}/login.html | 0 .../wwwroot/{router => routes}/node.html | 2 +- .../wwwroot/{router => routes}/nodes.html | 2 +- .../wwwroot/{router => routes}/organs.html | 2 +- .../wwwroot/{router => routes}/product.html | 2 +- .../{router => routes}/shared/add.html | 0 .../{router => routes}/shared/detail.html | 0 .../{router => routes}/shared/display.html | 0 .../shared/display/boolean.html | 0 .../shared/display/cron.html | 0 .../shared/display/html.html | 0 .../shared/display/imageurl.html | 0 .../shared/display/integer.html | 0 .../shared/display/multilinetext.html | 0 .../shared/display/multiselectlist.html | 0 .../shared/display/selectlist.html | 0 .../shared/display/string.html | 0 .../{router => routes}/shared/edit.html | 0 .../shared/edit/boolean.html | 0 .../{router => routes}/shared/edit/cron.html | 0 .../{router => routes}/shared/edit/html.html | 0 .../shared/edit/imageurl.html | 0 .../shared/edit/multilinetext.html | 0 .../shared/edit/multiselectlist.html | 0 .../shared/edit/password.html | 0 .../shared/edit/selectlist.html | 0 .../shared/edit/string.html | 0 .../{router => routes}/shared/index.html | 0 .../{router => routes}/shared/layout.html | 60 +++++++++---------- .../{router => routes}/shared/list.html | 0 .../{router => routes}/shared/pagination.html | 0 .../{router => routes}/shared/redirect.html | 0 .../{router => routes}/shared/update.html | 0 46 files changed, 48 insertions(+), 48 deletions(-) rename projects/WebMVC/wwwroot/{router => routes}/admin/command/detail.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/admin/command/edit.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/admin/command/index.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/admin/index.html (95%) rename projects/WebMVC/wwwroot/{router => routes}/admin/setting/detail.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/admin/setting/edit.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/admin/setting/index.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/device.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/home.html (97%) rename projects/WebMVC/wwwroot/{router => routes}/login.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/node.html (99%) rename projects/WebMVC/wwwroot/{router => routes}/nodes.html (98%) rename projects/WebMVC/wwwroot/{router => routes}/organs.html (95%) rename projects/WebMVC/wwwroot/{router => routes}/product.html (99%) rename projects/WebMVC/wwwroot/{router => routes}/shared/add.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/detail.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/boolean.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/cron.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/html.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/imageurl.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/integer.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/multilinetext.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/multiselectlist.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/selectlist.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/display/string.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/boolean.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/cron.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/html.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/imageurl.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/multilinetext.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/multiselectlist.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/password.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/selectlist.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/edit/string.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/index.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/layout.html (91%) rename projects/WebMVC/wwwroot/{router => routes}/shared/list.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/pagination.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/redirect.html (100%) rename projects/WebMVC/wwwroot/{router => routes}/shared/update.html (100%) diff --git a/projects/WebMVC/wwwroot/js/axios.js b/projects/WebMVC/wwwroot/js/axios.js index f0f7ef7d..cb711ded 100644 --- a/projects/WebMVC/wwwroot/js/axios.js +++ b/projects/WebMVC/wwwroot/js/axios.js @@ -35,7 +35,7 @@ axios.interceptors.response.use(function (response) { .catch(function (error) { if (error.response.status === 401) { console.log('refreshToken 已过期'); - router.push('/router/login'); + router.push('/routes/login.html'); } else { console.error(error); diff --git a/projects/WebMVC/wwwroot/js/components.js b/projects/WebMVC/wwwroot/js/components.js index 03f1bfe1..1b8aa852 100644 --- a/projects/WebMVC/wwwroot/js/components.js +++ b/projects/WebMVC/wwwroot/js/components.js @@ -1,25 +1,25 @@ Vue.component('pagination', function (resolve, reject) { - axios.get("/router/shared/pagination.html").then(function (response) { + axios.get("/routes/shared/pagination.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('layout', function (resolve, reject) { - axios.get("/router/shared/layout.html").then(function (response) { + axios.get("/routes/shared/layout.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('list', function (resolve, reject) { - axios.get("/router/shared/list.html").then(function (response) { + axios.get("/routes/shared/list.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('display', function (resolve, reject) { - axios.get("/router/shared/display.html").then(function (response) { + axios.get("/routes/shared/display.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('update', function (resolve, reject) { - axios.get("/router/shared/update.html").then(function (response) { + axios.get("/routes/shared/update.html").then(function (response) { resolve(parseModel(response)); }); }); \ No newline at end of file diff --git a/projects/WebMVC/wwwroot/js/form.js b/projects/WebMVC/wwwroot/js/form.js index 848490c1..aff94c2f 100644 --- a/projects/WebMVC/wwwroot/js/form.js +++ b/projects/WebMVC/wwwroot/js/form.js @@ -21,6 +21,6 @@ ]; for (var i = 0; i < formComponents.length; i++) { var name = formComponents[i]; - var url = "/router/shared/" + name.replace('-', '/') + ".html"; + var url = "/routes/shared/" + name.replace('-', '/') + ".html"; vueComponent(name, url); } \ No newline at end of file diff --git a/projects/WebMVC/wwwroot/js/route.js b/projects/WebMVC/wwwroot/js/route.js index 22551892..278762e5 100644 --- a/projects/WebMVC/wwwroot/js/route.js +++ b/projects/WebMVC/wwwroot/js/route.js @@ -1,7 +1,7 @@ var routes = []; const router = new VueRouter(); router.beforeEach((to, from, next) => { - if (to.path !== '/router/login.html') { + if (to.path !== '/routes/login.html') { var isAuthenticated = false; if (store.state.token.accessToken) { var jwt = jwt_decode(store.state.token.accessToken); @@ -10,12 +10,12 @@ router.beforeEach((to, from, next) => { if (!isAuthenticated) { store.commit('logout'); setTimeout(function () { - router.push('/router/login.html'); + router.push('/routes/login.html'); }, 1000); return; } } - var url = to.path === '/' ? '/router/home.html' : to.path; + var url = to.path === '/' ? '/routes/home.html' : to.path; var name = url.replace(/\//g, "-").replace(/\./g, "-").substring(1); var route = routes[name]; if (!route) { @@ -34,7 +34,7 @@ router.beforeEach((to, from, next) => { } else { if (to.path === from.path) { - router.push({ path: '/router/shared/redirect.html', query: { url: to.fullPath } }) + router.push({ path: '/routes/shared/redirect.html', query: { url: to.fullPath } }) } else { next(); diff --git a/projects/WebMVC/wwwroot/router/admin/command/detail.html b/projects/WebMVC/wwwroot/routes/admin/command/detail.html similarity index 100% rename from projects/WebMVC/wwwroot/router/admin/command/detail.html rename to projects/WebMVC/wwwroot/routes/admin/command/detail.html diff --git a/projects/WebMVC/wwwroot/router/admin/command/edit.html b/projects/WebMVC/wwwroot/routes/admin/command/edit.html similarity index 100% rename from projects/WebMVC/wwwroot/router/admin/command/edit.html rename to projects/WebMVC/wwwroot/routes/admin/command/edit.html diff --git a/projects/WebMVC/wwwroot/router/admin/command/index.html b/projects/WebMVC/wwwroot/routes/admin/command/index.html similarity index 100% rename from projects/WebMVC/wwwroot/router/admin/command/index.html rename to projects/WebMVC/wwwroot/routes/admin/command/index.html diff --git a/projects/WebMVC/wwwroot/router/admin/index.html b/projects/WebMVC/wwwroot/routes/admin/index.html similarity index 95% rename from projects/WebMVC/wwwroot/router/admin/index.html rename to projects/WebMVC/wwwroot/routes/admin/index.html index 6a8d9862..7aa248fb 100644 --- a/projects/WebMVC/wwwroot/router/admin/index.html +++ b/projects/WebMVC/wwwroot/routes/admin/index.html @@ -9,7 +9,7 @@