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