提交 529cc368 authored 作者: vipcxj's avatar vipcxj

增加模块页面跳转的钩子

上级 b7563731
......@@ -156,7 +156,7 @@ const createRoutes = async (app, modules, groups, basePath) => {
route.onEnter = (nextState, replace, cb) => {
if (get(nextState, 'location.pathname') === route.fullPath) {
getUser()
.then(u => (u ? [u.id, histories.getLatest('module', u.id)] : [null, null]))
.then(u => (u ? histories.getLatest('module', u.id).then(m => [u.id, m]) : [null, null]))
.then(([uid, lastModule]) => {
const currentModule = {
name,
......@@ -187,7 +187,7 @@ const createRoutes = async (app, modules, groups, basePath) => {
route.onEnter = (nextState, replace, cb) => {
if (get(nextState, 'location.pathname') === route.fullPath) {
getUser()
.then(u => (u ? [u.id, histories.getLatest('module', u.id)] : [null, null]))
.then(u => (u ? histories.getLatest('module', u.id).then(m => [u.id, m]) : [null, null]))
.then(([uid, lastModule]) => {
const currentModule = {
name,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论