提交 b7563731 authored 作者: vipcxj's avatar vipcxj

增加模块页面跳转的钩子

上级 2a832840
......@@ -156,9 +156,8 @@ 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)
.then((uid) => {
const lastModule = histories.getLatest('module', uid);
.then(u => (u ? [u.id, histories.getLatest('module', u.id)] : [null, null]))
.then(([uid, lastModule]) => {
const currentModule = {
name,
showName,
......@@ -188,9 +187,8 @@ 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)
.then((uid) => {
const lastModule = histories.getLatest('module', uid);
.then(u => (u ? [u.id, histories.getLatest('module', u.id)] : [null, null]))
.then(([uid, lastModule]) => {
const currentModule = {
name,
showName,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论