|
|
|
@ -22,7 +22,7 @@ const Service = () => { |
|
|
|
|
{title: '个人中心', src: userInfo, router: '/pages/business/userInfo/userInfo'}, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
const {user, setUser} = Profile.useContainer() |
|
|
|
|
const {token,user, setUser} = Profile.useContainer() |
|
|
|
|
|
|
|
|
|
Taro.useDidShow(async () => { |
|
|
|
|
if (user?.id) { |
|
|
|
@ -33,18 +33,24 @@ const Service = () => { |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
const oldList: List[] = JSON.parse(JSON.stringify(list)) |
|
|
|
|
if ([1, 2].includes(user?.role_type || 0)) { |
|
|
|
|
oldList.unshift(...[ |
|
|
|
|
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'}, |
|
|
|
|
// {title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
|
|
|
|
|
{title: '现场会', src: spotMeeting, router: '/pages/manage/spotMeeting/spotMeeting'}, |
|
|
|
|
{title: '课程管理', src: course, router: '/pages/manage/courseAdmin/courseAdmin'}, |
|
|
|
|
]) |
|
|
|
|
setList(oldList) |
|
|
|
|
if(token){ |
|
|
|
|
if ([1, 2].includes(user?.role_type || 0)) { |
|
|
|
|
oldList.unshift(...[ |
|
|
|
|
{title: '部门管理', src: dep, router: '/pages/manage/depAdmin/depAdmin'}, |
|
|
|
|
// {title: '课程市场', src: buy, router: '/pages/manage/curriculum/curriculum'},
|
|
|
|
|
{title: '现场会', src: spotMeeting, router: '/pages/manage/spotMeeting/spotMeeting'}, |
|
|
|
|
{title: '课程管理', src: course, router: '/pages/manage/courseAdmin/courseAdmin'}, |
|
|
|
|
]) |
|
|
|
|
setList(oldList) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
function jump(url: string) { |
|
|
|
|
if(!token){ |
|
|
|
|
Taro.navigateTo({url:'/pages/login/login'}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
Taro.navigateTo({url}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|