feat: init project
This commit is contained in:
32
server/routes/user/info.ts
Normal file
32
server/routes/user/info.ts
Normal file
@ -0,0 +1,32 @@
|
||||
export interface UserInfo {
|
||||
id: number
|
||||
username: string
|
||||
nickname?: string
|
||||
email?: string
|
||||
mobile?: string
|
||||
avatar?: string
|
||||
signature?: string
|
||||
realName?: string
|
||||
money?: number
|
||||
birth?: string
|
||||
}
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
const userInfo: UserInfo = {
|
||||
id: 1,
|
||||
username: 'admin',
|
||||
nickname: 'admin',
|
||||
email: 'test@qq.com',
|
||||
mobile: '13000000000',
|
||||
avatar: 'https://avatars.githubusercontent.com/u/21073088',
|
||||
signature: '海纳百川,有容乃大',
|
||||
realName: '张三',
|
||||
money: 10000,
|
||||
birth: '1990-01-01',
|
||||
}
|
||||
return {
|
||||
code: 200,
|
||||
data: userInfo,
|
||||
msg: '获取成功',
|
||||
}
|
||||
})
|
9
server/routes/user/login.ts
Normal file
9
server/routes/user/login.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: {
|
||||
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.UQmqAUhUrpDVV2ST7mZKyLTomVfg7sYkEjmdDI5XF8Q',
|
||||
},
|
||||
msg: '登录成功',
|
||||
}
|
||||
})
|
45
server/routes/user/menu-lang.ts
Normal file
45
server/routes/user/menu-lang.ts
Normal file
@ -0,0 +1,45 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
pid: null,
|
||||
path: '/dashboard',
|
||||
redirect: '/dashboard/analysis',
|
||||
name: 'Dashboard',
|
||||
icon: 'AppstoreOutlined',
|
||||
title: 'pages.dashboard.title',
|
||||
component: 'RouteView',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
pid: 1,
|
||||
path: '/dashboard/analysis',
|
||||
name: 'DashboardAnalysis',
|
||||
component: 'DashboardAnalysis',
|
||||
title: 'pages.dashboard.analysis.title',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
pid: 1,
|
||||
name: 'DashboardWorkspace',
|
||||
component: 'DashboardWorkspace',
|
||||
path: '/dashboard/workspace',
|
||||
title: 'pages.dashboard.workspace.title',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
pid: null,
|
||||
name: 'FullPath',
|
||||
path: 'https://www.baidu.com',
|
||||
component: 'BlankRoute',
|
||||
title: 'pages.jump.baidu',
|
||||
icon: 'LinkOutlined',
|
||||
},
|
||||
],
|
||||
msg: '获取成功',
|
||||
}
|
||||
})
|
45
server/routes/user/menus.ts
Normal file
45
server/routes/user/menus.ts
Normal file
@ -0,0 +1,45 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
pid: null,
|
||||
path: '/',
|
||||
redirect: '/home',
|
||||
name: 'Home',
|
||||
icon: 'AppstoreOutlined',
|
||||
title: '工作区',
|
||||
component: 'RouteView',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
pid: 1,
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
component: 'Home',
|
||||
title: 'Home',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
pid: 1,
|
||||
name: 'workspace',
|
||||
component: 'Workspace',
|
||||
path: '/workspace',
|
||||
title: '工作台',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
pid: null,
|
||||
name: 'FullPath',
|
||||
path: 'https://www.baidu.com',
|
||||
component: 'BlankRoute',
|
||||
title: '跳转百度',
|
||||
icon: 'LinkOutlined',
|
||||
},
|
||||
],
|
||||
msg: '获取成功',
|
||||
}
|
||||
})
|
109
server/routes/user/menus1.ts
Normal file
109
server/routes/user/menus1.ts
Normal file
@ -0,0 +1,109 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
pid: null,
|
||||
path: '/dashboard',
|
||||
redirect: '/dashboard/analysis',
|
||||
name: 'Dashboard',
|
||||
icon: 'AppstoreOutlined',
|
||||
title: 'pages.dashboard.title',
|
||||
component: 'RouteView',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
pid: 1,
|
||||
path: '/dashboard/analysis',
|
||||
name: 'DashboardAnalysis',
|
||||
component: 'DashboardAnalysis',
|
||||
title: 'pages.dashboard.analysis.title',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
pid: 1,
|
||||
name: 'DashboardWorkspace',
|
||||
component: 'DashboardWorkspace',
|
||||
path: '/dashboard/workspace',
|
||||
title: 'pages.dashboard.workspace.title',
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
pid: null,
|
||||
component: 'RouteView',
|
||||
name: 'Menu1',
|
||||
path: '/menu1',
|
||||
redirect: '/menu1/1-1',
|
||||
title: 'pages.menu.title',
|
||||
icon: 'MenuOutlined',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
pid: 5,
|
||||
name: 'Menu1-1',
|
||||
component: 'RouteView',
|
||||
redirect: '/menu1/1-1/1-1-1',
|
||||
title: 'pages.menu.menu1.title',
|
||||
path: '/menu1/1-1',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
pid: 6,
|
||||
name: 'Menu1-1-1',
|
||||
component: 'Menu11',
|
||||
title: 'pages.menu.menu11.title',
|
||||
path: '/menu1/1-1/1-1-1',
|
||||
keepAlive: false,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
pid: 6,
|
||||
name: 'Menu1-1-2',
|
||||
component: 'Menu12',
|
||||
title: 'pages.menu.menu12.title',
|
||||
path: '/menu1/1-1/1-1-2',
|
||||
keepAlive: false,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
pid: null,
|
||||
name: 'Menu1-2',
|
||||
path: '/menu1/1-2',
|
||||
component: 'RouteView',
|
||||
redirect: '/menu1/1-2/1-2-1',
|
||||
title: 'pages.menu.menu2.title',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
pid: 8,
|
||||
name: 'Menu1-2-1',
|
||||
path: '/menu1/1-2/1-2-1',
|
||||
component: 'Menu21',
|
||||
redirect: null,
|
||||
title: 'pages.menu.menu2.title',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
pid: 8,
|
||||
name: 'Menu1-2-2',
|
||||
path: '/menu1/1-2/1-2-2',
|
||||
component: 'Menu22',
|
||||
redirect: null,
|
||||
title: 'pages.menu.menu2.title',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
pid: null,
|
||||
name: 'FullPath',
|
||||
path: 'https://www.baidu.com',
|
||||
component: 'BlankRoute',
|
||||
title: 'pages.jump.baidu',
|
||||
icon: 'LinkOutlined',
|
||||
},
|
||||
],
|
||||
msg: '获取成功',
|
||||
}
|
||||
})
|
9
server/routes/user/send-code.ts
Normal file
9
server/routes/user/send-code.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return {
|
||||
code: 200,
|
||||
data: {
|
||||
code: '123456',
|
||||
},
|
||||
msg: '发送成功',
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user