¶Ô±ÈÐÂÎļþ |
| | |
| | | import { getMenuListResultModel } from './model/menuModel' |
| | | import { defHttp } from '/@/utils/http/axios' |
| | | |
| | | enum Api { |
| | | GetMenuList = '/sys/permission/getUserPermissionByToken', |
| | | SwitchVue3Menu = '/sys/switchVue3Menu', |
| | | } |
| | | |
| | | /** |
| | | * @description: Get user menu based on id |
| | | */ |
| | | |
| | | export const getMenuList = () => { |
| | | return new Promise((resolve) => { |
| | | //为äºå
¼å®¹mock忥壿°æ® |
| | | defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList }).then((res) => { |
| | | if (Array.isArray(res)) { |
| | | resolve(res) |
| | | } else { |
| | | resolve(res['menu']) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 忢ævue3èå |
| | | */ |
| | | export const switchVue3Menu = () => { |
| | | return new Promise((resolve) => { |
| | | defHttp.get({ url: Api.SwitchVue3Menu }) |
| | | }) |
| | | } |