java-bookstore/ui/src/utils/utils.ts
2025-02-24 15:40:03 +08:00

89 lines
1.6 KiB
TypeScript

/**
* 获取uuid
*/
export const getUuid = (): string => {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
};
export const getAdminList = () => {
const routes =[
{
"path": "/admin",
"name": "首页",
"icon": "HomeFilled" // 首页
},
{
"path": "/admin/item",
"name": "图书管理",
"icon": "VideoCamera" // 电影管理
},
{
"path": "/admin/cate",
"name": "类别管理",
"icon": "VideoCamera" // 电影管理
},
{
"path": "/admin/slides",
"name": "轮播管理",
"icon": "Picture" // 轮播图管理
},
{
"path": "/admin/comment",
"name": "评论管理",
"icon": "ChatLineRound" // 评论管理
},
{
"path": "/admin/order",
"name": "订单管理",
"icon": "Edit" // 更换为 Edit 图标
},
// {
// "path": "/admin/leaderboard",
// "name": "文创管理",
// "icon": "Trophy" // 更换为 Trophy 图标
// },
{
"path": "/admin/user",
"name": "用户管理",
"icon": "User" // 用户管理
}
]
return routes;
}
export const getFrontList = () => {
const routes = [
{
"path": "/",
"name": "首页",
"icon": "House",
},
{
"path": "/list",
"name": "找图书",
"icon": "House",
},
{
"path": "/leaderboard",
"name": "排行榜",
"icon": "House",
},
// {
// "path": "/topic",
// "name": "话题专区",
// "icon": "House",
// },
// {
// "path": "/cultural",
// "name": "文创专区",
// "icon": "House",
// },
]
return routes;
}