diff --git a/public/index.html b/public/index.html index 826b528..1b2ccea 100644 --- a/public/index.html +++ b/public/index.html @@ -1,45 +1,53 @@ - - - - - - - <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> - - - <% } %> - <%= htmlWebpackPlugin.options.title %> - - - <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> - - <% } %> - - - - - - + + + + + + + <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %> + + + <% } %> + <%= htmlWebpackPlugin.options.title %> + + + <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> + + <% } %> + + + + + + + + \ No newline at end of file diff --git a/src/i18n.js b/src/i18n.js index 386a7d4..966a37b 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -25,7 +25,7 @@ Vue.prototype.$languages = Object.keys(messages).map(langlage => ({ })) export default new VueI18n({ - locale: util.cookies.get('lang') || process.env.VUE_APP_I18N_LOCALE, + locale: util.cookies.get('lang') || window.gdconfig.themeOptions.languages || process.env.VUE_APP_I18N_LOCALE, fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE, messages }) \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 5ae3c47..979b5d8 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,7 +30,7 @@ const router = new VueRouter({ */ router.beforeEach(async (to, from, next) => { console.log("before:"); - console.log(to); + console.log(to,from); next(); }); diff --git a/src/router/routes.js b/src/router/routes.js index ee69890..0d350b7 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,12 +1,50 @@ // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载 const _import = require("@/libs/util.import." + process.env.NODE_ENV); -const frameIn = [ - { path: "/:id:(text)/:path", component: _import("page/GoText"), props: true }, - { path: "/:id:(pdf)/:path", component: _import("page/GoPdf"), props: true }, - { path: "/:id:(video)/:path", component: _import("page/GoVideo") }, - { path: "/:id:(image)/:path", component: _import("page/GoImg") }, - { path: "/:id::cmd?(/?/??.*/)", component: _import("page/GoList") }, +const meta = { + keepAlive: true +} + +const frameIn = [{ + path: "/:id:(text)/:path", + component: _import("page/GoText"), + meta: { + ...meta, + view: 'text' + } + }, + { + path: "/:id:(pdf)/:path", + component: _import("page/GoPdf"), + meta: { + ...meta, + view: 'pdf' + } + }, + { + path: "/:id:(video)/:path", + component: _import("page/GoVideo"), + meta: { + ...meta, + view: 'video' + } + }, + { + path: "/:id:(image)/:path", + component: _import("page/GoImg"), + meta: { + ...meta, + view: 'image' + } + }, + { + path: "/:id::cmd?(/?/??.*)", + component: _import("page/GoList"), + meta: { + ...meta, + view: 'list' + } + }, ]; -export default frameIn; +export default frameIn; \ No newline at end of file diff --git a/src/views/Layout.vue b/src/views/Layout.vue index c54e5ea..3a36d0e 100644 --- a/src/views/Layout.vue +++ b/src/views/Layout.vue @@ -4,9 +4,9 @@
- + - +
diff --git a/src/views/common/Navbar.vue b/src/views/common/Navbar.vue index e1c3202..fcac841 100644 --- a/src/views/common/Navbar.vue +++ b/src/views/common/Navbar.vue @@ -38,7 +38,7 @@ +