路由懒加载全部改为一次性加载

This commit is contained in:
fangxiang 2023-01-05 10:00:21 +08:00
parent 7d9c28917b
commit cc8a36708d
4 changed files with 53 additions and 42 deletions

View File

@ -9,8 +9,8 @@
"test": "echo \"No test specified\" && exit 0" "test": "echo \"No test specified\" && exit 0"
}, },
"dependencies": { "dependencies": {
"@quasar/cli": "^1.3.2", "@quasar/cli": "^1.4.0",
"@quasar/extras": "^1.15.6", "@quasar/extras": "^1.15.9",
"@tinymce/tinymce-vue": "4", "@tinymce/tinymce-vue": "4",
"@types/element-resize-detector": "^1.1.3", "@types/element-resize-detector": "^1.1.3",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
@ -18,7 +18,7 @@
"core-js": "^3.21.0", "core-js": "^3.21.0",
"element-resize-detector": "^1.2.4", "element-resize-detector": "^1.2.4",
"qrcode.vue": "^3.3.3", "qrcode.vue": "^3.3.3",
"quasar": "^2.10.2", "quasar": "^2.11.3",
"reconnecting-websocket": "^4.4.0", "reconnecting-websocket": "^4.4.0",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"to": "^0.2.9", "to": "^0.2.9",

View File

@ -47,10 +47,10 @@ export default route<StateInterface>(function (/* { store, ssrContext } */) {
if (auth_obj) { if (auth_obj) {
const auth = parseInt(auth_obj); const auth = parseInt(auth_obj);
const target_auth = parseInt(<string>to.meta.permission_level); const target_auth = parseInt(<string>to.meta.permission_level);
if (target_auth == NaN) { if (isNaN(target_auth)) {
next(); next();
return; return;
} else if (auth != NaN) { } else {
if (auth > target_auth) { if (auth > target_auth) {
next(); next();
return; return;

View File

@ -2,26 +2,37 @@ import { RouteRecordRaw } from "vue-router";
import PermissionLevel from "src/entities/PermissionLevel"; import PermissionLevel from "src/entities/PermissionLevel";
import RedirectPage from "src/RedirectPage.vue";
import Login from "pages/Login.vue";
import MainLayout from "layouts/MainLayout.vue";
import Index from "pages/Index.vue";
import PadLogin from "src/pad/Login.vue";
import PadMainLayout from "src/pad/MainLayout.vue";
import PadIndex from "src/pad/Index.vue";
import Error404 from "pages/Error404.vue";
const routes: RouteRecordRaw[] = [ const routes: RouteRecordRaw[] = [
{ {
path: "/", path: "/",
meta: {}, meta: {},
component: () => import("src/RedirectPage.vue"), component: RedirectPage,
}, },
{ {
path: "/pc/login", path: "/pc/login",
component: () => import("pages/Login.vue"), component: Login,
}, },
{ {
path: "/pc", path: "/pc",
meta: { meta: {
permission_level: PermissionLevel.User, permission_level: PermissionLevel.User,
}, },
component: () => import("layouts/MainLayout.vue"), component: MainLayout,
children: [ children: [
{ {
path: "", path: "",
component: () => import("pages/Index.vue"), component: Index,
meta: { meta: {
permission_level: PermissionLevel.User, permission_level: PermissionLevel.User,
}, },
@ -30,18 +41,18 @@ const routes: RouteRecordRaw[] = [
}, },
{ {
path: "/pad/login", path: "/pad/login",
component: () => import("src/pad/Login.vue"), component: PadLogin,
}, },
{ {
path: "/pad", path: "/pad",
meta: { meta: {
permission_level: PermissionLevel.User, permission_level: PermissionLevel.User,
}, },
component: () => import("src/pad/MainLayout.vue"), component: PadMainLayout,
children: [ children: [
{ {
path: "", path: "",
component: () => import("src/pad/Index.vue"), component: PadIndex,
meta: { meta: {
permission_level: PermissionLevel.User, permission_level: PermissionLevel.User,
}, },
@ -53,7 +64,7 @@ const routes: RouteRecordRaw[] = [
// but you can also remove it // but you can also remove it
{ {
path: "/:catchAll(.*)*", path: "/:catchAll(.*)*",
component: () => import("pages/Error404.vue"), component: Error404,
}, },
]; ];

View File

@ -1197,28 +1197,28 @@
core-js "^3.6.5" core-js "^3.6.5"
core-js-compat "^3.6.5" core-js-compat "^3.6.5"
"@quasar/cli@^1.3.2": "@quasar/cli@^1.4.0":
version "1.3.2" version "1.4.0"
resolved "https://registry.npmmirror.com/@quasar/cli/-/cli-1.3.2.tgz#168fb936927da58dd6ea2323b3ea6b6db2561951" resolved "https://registry.npmmirror.com/@quasar/cli/-/cli-1.4.0.tgz#6fec28141009c318b0a0c691c8e20b1992191d5e"
integrity sha512-/3mCwBgtCNuf+/yAWjemeO8H6BdWGAKNpndLXVt9/pIGwaxJiNedtpF3DngIfTqog13UMP/OBlerwOhXvsjw3g== integrity sha512-RxEuHu8iUKVzwCbiKmFzkfsq+8v6MSYJ2WYFydwJHzAD2R7miWas1+YAoJQYRMJWtYlXU5xMx09knTrpJ11aAg==
dependencies: dependencies:
async "^3.2.3" async "^3.2.4"
ci-info "^3.3.0" ci-info "^3.7.1"
compression "^1.7.4" compression "^1.7.4"
connect-history-api-fallback "^1.6.0" connect-history-api-fallback "^1.6.0"
consolidate "0.16.0" consolidate "0.16.0"
cors "^2.8.5" cors "^2.8.5"
cross-spawn "^7.0.3" cross-spawn "^7.0.3"
download-git-repo "^3.0.2" download-git-repo "^3.0.2"
express "^4.17.3" express "^4.18.2"
fs-extra "^10.0.0" fs-extra "^10.0.0"
handlebars "^4.7.7" handlebars "^4.7.7"
http-proxy-middleware "^2.0.3" http-proxy-middleware "^2.0.6"
inquirer "^8.2.0" inquirer "^8.2.0"
kolorist "^1.5.1" kolorist "^1.6.0"
metalsmith "^2.4.2" metalsmith "^2.5.1"
minimatch "^3.0.4" minimatch "^3.0.4"
minimist "^1.2.6" minimist "^1.2.7"
multimatch "^5.0.0" multimatch "^5.0.0"
open "7.0.4" open "7.0.4"
ora "5.4.0" ora "5.4.0"
@ -1230,10 +1230,10 @@
update-notifier "^5.1.0" update-notifier "^5.1.0"
validate-npm-package-name "^3.0.0" validate-npm-package-name "^3.0.0"
"@quasar/extras@^1.15.6": "@quasar/extras@^1.15.9":
version "1.15.6" version "1.15.9"
resolved "https://registry.npmmirror.com/@quasar/extras/-/extras-1.15.6.tgz#0bbcd0df9d403355cf7c82a4f3d287f4e1e98b7c" resolved "https://registry.npmmirror.com/@quasar/extras/-/extras-1.15.9.tgz#78b6a0f3dce982dd6da160e86f7f5c681bd81e1e"
integrity sha512-lG3wrcz47c86N/j1ULZugmyVfwpmnsJpjtSWh+LhaFfe0g1kTMdAnxkWGKsa3ouZ4QBcnkrNan0kYSnKc3MiBg== integrity sha512-2y0KKTRol5FsqxhJH19pG5qU9ve+AUdPzQDSh/d7XxBZGJASOAcglKH/W1dCdChLJzyJDOJ4DmM2sxWQkosVWw==
"@quasar/fastclick@1.1.4": "@quasar/fastclick@1.1.4":
version "1.1.4" version "1.1.4"
@ -2448,7 +2448,7 @@ async@^2.6.4:
dependencies: dependencies:
lodash "^4.17.14" lodash "^4.17.14"
async@^3.2.0, async@^3.2.3: async@^3.2.0, async@^3.2.3, async@^3.2.4:
version "3.2.4" version "3.2.4"
resolved "https://registry.npmmirror.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" resolved "https://registry.npmmirror.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c"
integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==
@ -3318,10 +3318,10 @@ ci-info@^2.0.0:
resolved "https://registry.npmmirror.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" resolved "https://registry.npmmirror.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
ci-info@^3.3.0: ci-info@^3.7.1:
version "3.7.0" version "3.7.1"
resolved "https://registry.npmmirror.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" resolved "https://registry.npmmirror.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f"
integrity sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog== integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w==
class-utils@^0.3.2, class-utils@^0.3.5: class-utils@^0.3.2, class-utils@^0.3.5:
version "0.3.6" version "0.3.6"
@ -4767,7 +4767,7 @@ express@4.17.2:
utils-merge "1.0.1" utils-merge "1.0.1"
vary "~1.1.2" vary "~1.1.2"
express@^4.17.1, express@^4.17.3: express@^4.17.1, express@^4.18.2:
version "4.18.2" version "4.18.2"
resolved "https://registry.npmmirror.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" resolved "https://registry.npmmirror.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
@ -5948,7 +5948,7 @@ http-parser-js@>=0.5.1:
resolved "https://registry.npmmirror.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" resolved "https://registry.npmmirror.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3"
integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==
http-proxy-middleware@^2.0.0, http-proxy-middleware@^2.0.3: http-proxy-middleware@^2.0.0, http-proxy-middleware@^2.0.6:
version "2.0.6" version "2.0.6"
resolved "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" resolved "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f"
integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==
@ -6896,7 +6896,7 @@ klona@^2.0.4, klona@^2.0.5:
resolved "https://registry.npmmirror.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" resolved "https://registry.npmmirror.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc"
integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==
kolorist@^1.5.1: kolorist@^1.6.0:
version "1.6.0" version "1.6.0"
resolved "https://registry.npmmirror.com/kolorist/-/kolorist-1.6.0.tgz#f43ac794305b30032a5bedcae7799d0f91d2ff36" resolved "https://registry.npmmirror.com/kolorist/-/kolorist-1.6.0.tgz#f43ac794305b30032a5bedcae7799d0f91d2ff36"
integrity sha512-dLkz37Ab97HWMx9KTes3Tbi3D1ln9fCAy2zr2YVExJasDRPGRaKcoE4fycWNtnCAJfjFqe0cnY+f8KT2JePEXQ== integrity sha512-dLkz37Ab97HWMx9KTes3Tbi3D1ln9fCAy2zr2YVExJasDRPGRaKcoE4fycWNtnCAJfjFqe0cnY+f8KT2JePEXQ==
@ -7604,7 +7604,7 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" resolved "https://registry.npmmirror.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
metalsmith@^2.4.2: metalsmith@^2.5.1:
version "2.5.1" version "2.5.1"
resolved "https://registry.npmmirror.com/metalsmith/-/metalsmith-2.5.1.tgz#253b1a29084da759cde06eff773ae1817a1ba629" resolved "https://registry.npmmirror.com/metalsmith/-/metalsmith-2.5.1.tgz#253b1a29084da759cde06eff773ae1817a1ba629"
integrity sha512-/jpf9JXYAvA16VlJDRlZRktcsjTgMHDwusiNLo1byU7ocUNWm2F7zQukrVtBslNNNi1gWnXbcxTINYdsi5zrAA== integrity sha512-/jpf9JXYAvA16VlJDRlZRktcsjTgMHDwusiNLo1byU7ocUNWm2F7zQukrVtBslNNNi1gWnXbcxTINYdsi5zrAA==
@ -7711,7 +7711,7 @@ minimist@1.2.5:
resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.7:
version "1.2.7" version "1.2.7"
resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
@ -8900,10 +8900,10 @@ qs@6.9.6:
resolved "https://registry.npmmirror.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" resolved "https://registry.npmmirror.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee"
integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==
quasar@^2.10.2: quasar@^2.11.3:
version "2.10.2" version "2.11.3"
resolved "https://registry.npmmirror.com/quasar/-/quasar-2.10.2.tgz#0a35d654a645d33fbe7dc537ea3be52917fa543d" resolved "https://registry.npmmirror.com/quasar/-/quasar-2.11.3.tgz#99cac489e931e3adf94c4350541d6a516322c4c3"
integrity sha512-y6suu0f2hJKrnFPHzx+p2EBVGzDF6xHaqYGkDIsMNkhxsrO9Qi2+dZCjq1J6+48EJiqPEOn8t9X/gT7yLSSnLw== integrity sha512-a+PApE126fwtCsuPvbDLuSSgcFUy5bGu9WjqvVRP3z0xw+7pH93Hva2M+QQLMsYs4a5tpT4N/qXlsI591nxuxA==
query-string@^5.0.1: query-string@^5.0.1:
version "5.1.1" version "5.1.1"