From e15d4b169367e54c6e66e4c7c1d5cf9eb6d36171 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Sun, 10 Dec 2017 12:53:09 +0800 Subject: [PATCH] feat: upgrade nuxt.js to next before 1.0.0 released --- client/assets/styles/main.scss | 3 + client/middleware/check-auth.js | 6 +- client/pages/examples/activity/index.vue | 10 +- client/pages/examples/index.vue | 4 +- client/plugins/axios-defaults.js | 10 +- client/plugins/i18n.js | 4 +- nuxt.config.js | 2 +- package.json | 21 +- server/app.js | 11 +- yarn.lock | 1623 +++++++++------------- 10 files changed, 704 insertions(+), 990 deletions(-) diff --git a/client/assets/styles/main.scss b/client/assets/styles/main.scss index 5df53e55..202df34d 100644 --- a/client/assets/styles/main.scss +++ b/client/assets/styles/main.scss @@ -8,6 +8,9 @@ header, // max-height: 900px; margin: 0 auto; } +#__layout{ + height: 100%; +} body { font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, sans-serif; diff --git a/client/middleware/check-auth.js b/client/middleware/check-auth.js index a4d8ffa7..1cecbd74 100644 --- a/client/middleware/check-auth.js +++ b/client/middleware/check-auth.js @@ -1,9 +1,9 @@ import { user as getUser } from '@/utils/auth' -export default function ({ isServer, store, req, route, redirect }) { +export default function ({ store, req, route, redirect }) { // If nuxt generate, pass this middleware - if (isServer && !req) return - const user = getUser(isServer ? req : null) + if (process.static) return + const user = getUser(process.server ? req : null) if (user && !store.state.authUser) { store.commit('SET_USER', user) } else if (!user && route.name !== 'login') { diff --git a/client/pages/examples/activity/index.vue b/client/pages/examples/activity/index.vue index 0e6dcc0e..bec26cea 100644 --- a/client/pages/examples/activity/index.vue +++ b/client/pages/examples/activity/index.vue @@ -11,7 +11,7 @@ - + @@ -35,7 +35,7 @@ -