Skip to content

Commit

Permalink
fix: render bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ihoey committed Jun 3, 2019
1 parent 9577e0d commit 134cc5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/ssr-page-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const pageConfigs = [{
// 控制是否开启服务端渲染
const isEnableServerRender = true
// 控制是否开启用户校验服务端渲染,开启 用户登录走前端渲染,未登录走服务端渲染
const isEnableUserLoginCheck = true
const isEnableUserLoginCheck = false

module.exports = function isServerRenderPage(ctx, cookies) {
// 关闭服务端渲染
Expand All @@ -29,10 +29,10 @@ module.exports = function isServerRenderPage(ctx, cookies) {
} else if (isEnableUserLoginCheck && userId && userToken) {
return false
} else {
let isSSR = true
let isSSR = false
pageConfigs.forEach(item => {
if (isSSR) {
isSSR = !item.regExp.test(ctx.path)
if (!isSSR) {
isSSR = item.regExp.test(ctx.path)
}
})
return isSSR
Expand Down

0 comments on commit 134cc5d

Please sign in to comment.