Skip to content

Commit f15f368

Browse files
oneyouziyucongshuang
andauthored
纯卡片项目刷新会报pathName错误,界面显示404 (#125)
* 纯卡片项目刷新会报pathName错误,界面显示404 * 格式修改 * 增加备注 --------- Co-authored-by: yucongshuang <v-yucongshuang@oppo.com>
1 parent d45cca4 commit f15f368

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/hap-server/src/preview/create-router.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export default async function createRouter(previewTarget) {
196196
const pathname = page || manifest.router.entry
197197
ctx.redirect(`/preview/${pathname}`)
198198
} else {
199-
await next()
199+
// 纯卡片项目的时候需要去获取当前编译模式里面存的id,不然刷新会默认首页报404
200+
const page = getLaunchPage()
201+
ctx.redirect(`/preview/${page}`)
200202
}
201203
})
202204

0 commit comments

Comments
 (0)