Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
2018f395
提交
2018f395
authored
3月 30, 2022
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 重新规范 pont 模板、Mock 接口、登录参数、环境配置同步、示例接口重新生成等
上级
5e78249b
全部展开
显示空白字符变更
内嵌
并排
正在显示
43 个修改的文件
包含
314 行增加
和
183 行删除
+314
-183
.env.development
.env.development
+5
-4
.env.production
.env.production
+3
-3
menu.ts
mock/sys/menu.ts
+1
-1
user.ts
mock/sys/user.ts
+58
-17
pont-config.json
pont-config.json
+1
-1
pont.template.ts
pont.template.ts
+7
-3
api-lock.json
src/api/services/api-lock.json
+0
-0
api.d.ts
src/api/services/api.d.ts
+80
-41
baseClass.ts
src/api/services/baseClass.ts
+30
-13
login.ts
src/api/services/mods/auth/login.ts
+3
-3
logout.ts
src/api/services/mods/auth/logout.ts
+3
-3
register.ts
src/api/services/mods/auth/register.ts
+5
-5
fail.ts
src/api/services/mods/hello/fail.ts
+3
-3
hello.ts
src/api/services/mods/hello/hello.ts
+3
-3
page.ts
src/api/services/mods/hello/page.ts
+3
-3
upload.ts
src/api/services/mods/minio/upload.ts
+3
-3
add.ts
src/api/services/mods/permission/add.ts
+6
-4
deleted.ts
src/api/services/mods/permission/deleted.ts
+3
-3
find.ts
src/api/services/mods/permission/find.ts
+3
-3
modify.ts
src/api/services/mods/permission/modify.ts
+6
-4
page.ts
src/api/services/mods/permission/page.ts
+3
-3
tree.ts
src/api/services/mods/permission/tree.ts
+3
-3
add.ts
src/api/services/mods/role/add.ts
+3
-3
assign.ts
src/api/services/mods/role/assign.ts
+3
-3
deleted.ts
src/api/services/mods/role/deleted.ts
+3
-3
find.ts
src/api/services/mods/role/find.ts
+3
-3
modify.ts
src/api/services/mods/role/modify.ts
+3
-3
page.ts
src/api/services/mods/role/page.ts
+3
-3
selector.ts
src/api/services/mods/role/selector.ts
+3
-3
assign.ts
src/api/services/mods/user/assign.ts
+3
-3
getMenuList.ts
src/api/services/mods/user/getMenuList.ts
+23
-0
getUserInfo.ts
src/api/services/mods/user/getUserInfo.ts
+3
-3
index.ts
src/api/services/mods/user/index.ts
+3
-2
page.ts
src/api/services/mods/user/page.ts
+3
-3
menu.ts
src/api/sys/menu.ts
+1
-1
userModel.ts
src/api/sys/model/userModel.ts
+5
-4
user.ts
src/api/sys/user.ts
+5
-5
sys.ts
src/locales/lang/en/sys.ts
+1
-1
projectSetting.ts
src/settings/projectSetting.ts
+1
-1
lock.ts
src/store/modules/lock.ts
+1
-1
index.ts
src/utils/http/axios/index.ts
+9
-9
LoginForm.vue
src/views/sys/login/LoginForm.vue
+2
-2
UserService.ts
tests/server/service/UserService.ts
+1
-1
没有找到文件。
.env.development
浏览文件 @
2018f395
...
@@ -14,10 +14,11 @@ VITE_DROP_CONSOLE = false
...
@@ -14,10 +14,11 @@ VITE_DROP_CONSOLE = false
# Basic interface address SPA
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
VITE_GLOB_API_URL=/basic-api
# VITE_GLOB_API_URL=http://localhost:8181/basic-api
# VITE_GLOB_API_URL=http://localhost:8181
# File upload address, optional
VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
VITE_GLOB_API_URL_PREFIX=
# VITE_GLOB_API_URL_PREFIX=/api
# File upload address, optional
VITE_GLOB_UPLOAD_URL=/upload
.env.production
浏览文件 @
2018f395
...
@@ -18,13 +18,13 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
...
@@ -18,13 +18,13 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# Basic interface address SPA
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
VITE_GLOB_API_URL=/basic-api
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
# File upload address, optional
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/upload
VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
# Whether to enable image compression
# Whether to enable image compression
VITE_USE_IMAGEMIN= true
VITE_USE_IMAGEMIN= true
...
...
mock/sys/menu.ts
浏览文件 @
2018f395
...
@@ -225,7 +225,7 @@ const linkRoute = {
...
@@ -225,7 +225,7 @@ const linkRoute = {
export
default
[
export
default
[
{
{
url
:
'/basic-api/getMenuList'
,
url
:
'/basic-api/
user/
getMenuList'
,
timeout
:
1000
,
timeout
:
1000
,
method
:
'get'
,
method
:
'get'
,
response
:
(
request
:
Request
)
=>
{
response
:
(
request
:
Request
)
=>
{
...
...
mock/sys/user.ts
浏览文件 @
2018f395
import
{
IncomingMessage
}
from
'http'
import
Mock
from
'mockjs'
import
qs
from
'qs'
import
{
MockMethod
}
from
'vite-plugin-mock'
import
{
MockMethod
}
from
'vite-plugin-mock'
import
{
Response
,
Request
}
from
'../_util'
import
{
Response
,
Request
}
from
'../_util'
const
parseFormParams
=
(
req
:
IncomingMessage
):
Promise
<
Recordable
>
=>
{
return
new
Promise
((
resolve
)
=>
{
let
body
=
''
req
.
on
(
'data'
,
function
(
chunk
)
{
body
+=
chunk
})
req
.
on
(
'end'
,
function
()
{
resolve
(
qs
.
parse
(
body
)
as
any
)
return
})
})
}
export
function
createFakeUserList
()
{
export
function
createFakeUserList
()
{
return
[
return
[
{
{
userId
:
'1'
,
userId
:
'1'
,
username
:
'basic
'
,
account
:
'admin
'
,
realName
:
'Basic Admin'
,
realName
:
'Basic Admin'
,
avatar
:
'https://q1.qlogo.cn/g?b=qq&nk=190848757&s=640'
,
avatar
:
'https://q1.qlogo.cn/g?b=qq&nk=190848757&s=640'
,
desc
:
'manager'
,
desc
:
'manager'
,
...
@@ -14,14 +30,15 @@ export function createFakeUserList() {
...
@@ -14,14 +30,15 @@ export function createFakeUserList() {
homePath
:
'/dashboard/workbench'
,
homePath
:
'/dashboard/workbench'
,
roles
:
[
roles
:
[
{
{
roleName
:
'Super Admin'
,
name
:
'Super Admin'
,
value
:
'super'
,
uid
:
'super'
,
id
:
'1'
,
},
},
],
],
},
},
{
{
userId
:
'2'
,
userId
:
'2'
,
username
:
'test'
,
account
:
'test'
,
password
:
'123456'
,
password
:
'123456'
,
realName
:
'test user'
,
realName
:
'test user'
,
avatar
:
'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640'
,
avatar
:
'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640'
,
...
@@ -30,8 +47,9 @@ export function createFakeUserList() {
...
@@ -30,8 +47,9 @@ export function createFakeUserList() {
homePath
:
'/dashboard/workbench'
,
homePath
:
'/dashboard/workbench'
,
roles
:
[
roles
:
[
{
{
roleName
:
'Tester'
,
name
:
'Tester'
,
value
:
'test'
,
uid
:
'test'
,
id
:
'2'
,
},
},
],
],
},
},
...
@@ -46,30 +64,53 @@ const fakeCodeList: any = {
...
@@ -46,30 +64,53 @@ const fakeCodeList: any = {
export
default
[
export
default
[
// mock user login
// mock user login
{
{
url
:
'/basic-api/login'
,
url
:
'/basic-api/
auth/
login'
,
timeout
:
200
,
timeout
:
200
,
method
:
'post'
,
method
:
'post'
,
response
:
({
body
})
=>
{
// response: ({ query }) => {
const
{
username
,
password
}
=
body
// const { account, password } = query
// console.log(JSON.stringify(query))
// const checkUser = createFakeUserList().find(
// (item) => item.account === account && password === item.password,
// )
// if (!checkUser) {
// return Response.no('Incorrect account or password!')
// }
// const { userId, account: _account, token, realName, desc, roles } = checkUser
// return Response.ok({
// roles,
// userId,
// account: _account,
// token,
// realName,
// desc,
// })
// },
rawResponse
:
async
(
req
,
res
)
=>
{
const
{
account
,
password
}
=
await
parseFormParams
(
req
)
const
checkUser
=
createFakeUserList
().
find
(
const
checkUser
=
createFakeUserList
().
find
(
(
item
)
=>
item
.
username
===
username
&&
password
===
item
.
password
,
(
item
)
=>
item
.
account
===
account
&&
password
===
item
.
password
,
)
)
if
(
!
checkUser
)
{
if
(
!
checkUser
)
{
return
Response
.
no
(
'Incorrect account or password!'
)
return
Response
.
no
(
'Incorrect account or password!'
)
}
}
const
{
userId
,
username
:
_username
,
token
,
realName
,
desc
,
roles
}
=
checkUser
const
{
userId
,
account
:
_account
,
token
,
realName
,
desc
,
roles
}
=
checkUser
return
Response
.
ok
({
const
response
=
Response
.
ok
({
roles
,
roles
,
userId
,
userId
,
username
:
_username
,
account
:
_account
,
token
,
token
,
realName
,
realName
,
desc
,
desc
,
})
})
res
.
setHeader
(
'Content-Type'
,
'application/json'
)
res
.
statusCode
=
200
res
.
end
(
JSON
.
stringify
(
Mock
.
mock
(
response
)))
},
},
},
},
{
{
url
:
'/basic-api/getUserInfo'
,
url
:
'/basic-api/
user/
getUserInfo'
,
method
:
'get'
,
method
:
'get'
,
response
:
(
request
:
Request
)
=>
{
response
:
(
request
:
Request
)
=>
{
const
token
=
Request
.
getRequestToken
(
request
)
const
token
=
Request
.
getRequestToken
(
request
)
...
@@ -82,7 +123,7 @@ export default [
...
@@ -82,7 +123,7 @@ export default [
},
},
},
},
{
{
url
:
'/basic-api/getPermCode'
,
url
:
'/basic-api/
auth/
getPermCode'
,
timeout
:
200
,
timeout
:
200
,
method
:
'get'
,
method
:
'get'
,
response
:
(
request
:
Request
)
=>
{
response
:
(
request
:
Request
)
=>
{
...
@@ -98,7 +139,7 @@ export default [
...
@@ -98,7 +139,7 @@ export default [
},
},
},
},
{
{
url
:
'/basic-api/logout'
,
url
:
'/basic-api/
auth/
logout'
,
timeout
:
200
,
timeout
:
200
,
method
:
'get'
,
method
:
'get'
,
response
:
(
request
:
Request
)
=>
{
response
:
(
request
:
Request
)
=>
{
...
@@ -112,7 +153,7 @@ export default [
...
@@ -112,7 +153,7 @@ export default [
},
},
},
},
{
{
url
:
'/basic-api/testRetry'
,
url
:
'/basic-api/
auth/
testRetry'
,
statusCode
:
405
,
statusCode
:
405
,
method
:
'get'
,
method
:
'get'
,
response
:
()
=>
{
response
:
()
=>
{
...
...
pont-config.json
浏览文件 @
2018f395
{
{
"originUrl"
:
"http://localhost:8181/
basic-
api/v2/api-docs"
,
"originUrl"
:
"http://localhost:8181/api/v2/api-docs"
,
"templatePath"
:
"./pont.template"
,
"templatePath"
:
"./pont.template"
,
"outDir"
:
"./src/api/services"
,
"outDir"
:
"./src/api/services"
,
"surrounding"
:
"typeScript"
,
"surrounding"
:
"typeScript"
,
...
...
pont.template.ts
浏览文件 @
2018f395
import
{
Interface
,
BaseClass
,
Property
,
CodeGenerator
}
from
'pont-engine'
import
{
Interface
,
BaseClass
,
Property
,
CodeGenerator
}
from
'pont-engine'
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const
API_URL_PREFIX
=
'/api'
export
default
class
BasicGenerator
extends
CodeGenerator
{
export
default
class
BasicGenerator
extends
CodeGenerator
{
getParams
(
inter
:
Interface
)
{
getParams
(
inter
:
Interface
)
{
const
requestParams
=
inter
.
getRequestParams
(
this
.
surrounding
)
const
requestParams
=
inter
.
getRequestParams
(
this
.
surrounding
)
...
@@ -52,15 +56,15 @@ export default class BasicGenerator extends CodeGenerator {
...
@@ -52,15 +56,15 @@ export default class BasicGenerator extends CodeGenerator {
*/
*/
import * as defs from '../../baseClass';
import * as defs from '../../baseClass';
import { Http } from '/@/utils/http/axios'
import {
def
Http } from '/@/utils/http/axios'
export
${
paramsCode
}
export
${
paramsCode
}
export const init =
${
inter
.
response
.
getInitialValue
()}
;
export const init =
${
inter
.
response
.
getInitialValue
()}
;
export function request(
${
requestParams
}
) {
export function request(
${
requestParams
}
) {
return Http.request({
return
def
Http.request({
url: "
${
inter
.
path
}
",
url: "
${
inter
.
path
.
replace
(
API_URL_PREFIX
,
''
)
}
",
method: '
${
method
}
',
method: '
${
method
}
',
${
${
method
===
'GET'
method
===
'GET'
...
...
src/api/services/api-lock.json
浏览文件 @
2018f395
差异被折叠。
点击展开。
src/api/services/api.d.ts
浏览文件 @
2018f395
...
@@ -6,6 +6,29 @@ declare namespace defs {
...
@@ -6,6 +6,29 @@ declare namespace defs {
export
class
LoginVo
{
export
class
LoginVo
{
/** token */
/** token */
token
?:
string
token
?:
string
/** 主键 */
userId
?:
number
}
export
class
MenuVo
{
/** 子权限 */
children
?:
Array
<
defs
.
MenuVo
>
/** 组件 */
component
?:
string
/** 元数据 */
meta
?:
ObjectMap
<
any
,
object
>
/** 标识 */
name
?:
string
/** 路径 */
path
?:
string
/** 权限类型 */
type
?:
'DIR'
|
'MENU'
|
'BUTTON'
}
}
export
class
PageVo
<
T0
=
any
>
{
export
class
PageVo
<
T0
=
any
>
{
...
@@ -38,6 +61,9 @@ declare namespace defs {
...
@@ -38,6 +61,9 @@ declare namespace defs {
/** 主键 */
/** 主键 */
id
?:
number
id
?:
number
/** 元数据 */
meta
?:
ObjectMap
<
any
,
object
>
/** 名称 */
/** 名称 */
name
?:
string
name
?:
string
...
@@ -51,7 +77,7 @@ declare namespace defs {
...
@@ -51,7 +77,7 @@ declare namespace defs {
serial
?:
number
serial
?:
number
/** 权限类型 */
/** 权限类型 */
type
?:
'MENU'
|
'BUTTON'
type
?:
'
DIR'
|
'
MENU'
|
'BUTTON'
/** 标识 */
/** 标识 */
uid
?:
string
uid
?:
string
...
@@ -101,27 +127,18 @@ declare namespace defs {
...
@@ -101,27 +127,18 @@ declare namespace defs {
/** 头像 */
/** 头像 */
avatar
?:
string
avatar
?:
string
/**
邮箱
*/
/**
介绍
*/
email
?:
string
desc
?:
string
/**
主页地址
*/
/**
用户主页
*/
homePath
?:
string
homePath
?:
string
/** 手机号 */
mobile
?:
string
/** 权限 */
permissions
?:
Array
<
defs
.
PermissionVo
>
/** 真实姓名 */
/** 真实姓名 */
realName
?:
string
realName
?:
string
/** 角色 */
/** 角色 */
roles
?:
Array
<
defs
.
RoleVo
>
roles
?:
Array
<
defs
.
RoleVo
>
/** 职称 */
title
?:
string
/** 主键 */
/** 主键 */
userId
?:
number
userId
?:
number
...
@@ -175,7 +192,7 @@ declare namespace API {
...
@@ -175,7 +192,7 @@ declare namespace API {
export
namespace
auth
{
export
namespace
auth
{
/**
/**
* 登录
* 登录
* /
basic-
api/auth/login
* /api/auth/login
*/
*/
export
namespace
login
{
export
namespace
login
{
export
class
Params
{
export
class
Params
{
...
@@ -198,7 +215,7 @@ declare namespace API {
...
@@ -198,7 +215,7 @@ declare namespace API {
/**
/**
* 登出
* 登出
* /
basic-
api/auth/logout
* /api/auth/logout
*/
*/
export
namespace
logout
{
export
namespace
logout
{
export
class
Params
{}
export
class
Params
{}
...
@@ -216,7 +233,7 @@ declare namespace API {
...
@@ -216,7 +233,7 @@ declare namespace API {
/**
/**
* 注册
* 注册
* /
basic-
api/auth/register
* /api/auth/register
*/
*/
export
namespace
register
{
export
namespace
register
{
export
class
Params
{
export
class
Params
{
...
@@ -226,14 +243,14 @@ declare namespace API {
...
@@ -226,14 +243,14 @@ declare namespace API {
email
?:
string
email
?:
string
/** 是否启用 */
/** 是否启用 */
enable
?:
boolean
enable
?:
boolean
/** 简介 */
introduction
?:
string
/** 手机号 */
/** 手机号 */
mobile
:
string
mobile
:
string
/** 密码 */
/** 密码 */
password
:
string
password
:
string
/** 真实姓名 */
/** 真实姓名 */
realName
:
string
realName
:
string
/** 职称 */
title
?:
string
/** 用户名 */
/** 用户名 */
username
:
string
username
:
string
}
}
...
@@ -256,7 +273,7 @@ declare namespace API {
...
@@ -256,7 +273,7 @@ declare namespace API {
export
namespace
hello
{
export
namespace
hello
{
/**
/**
* hello
* hello
* /
basic-
api/hello/
* /api/hello/
*/
*/
export
namespace
hello
{
export
namespace
hello
{
export
class
Params
{}
export
class
Params
{}
...
@@ -274,7 +291,7 @@ declare namespace API {
...
@@ -274,7 +291,7 @@ declare namespace API {
/**
/**
* fail
* fail
* /
basic-
api/hello/fail
* /api/hello/fail
*/
*/
export
namespace
fail
{
export
namespace
fail
{
export
class
Params
{}
export
class
Params
{}
...
@@ -292,7 +309,7 @@ declare namespace API {
...
@@ -292,7 +309,7 @@ declare namespace API {
/**
/**
* page
* page
* /
basic-
api/hello/page
* /api/hello/page
*/
*/
export
namespace
page
{
export
namespace
page
{
export
class
Params
{
export
class
Params
{
...
@@ -324,7 +341,7 @@ declare namespace API {
...
@@ -324,7 +341,7 @@ declare namespace API {
export
namespace
minio
{
export
namespace
minio
{
/**
/**
* 文件上传
* 文件上传
* /
basic-
api/common/minio/upload
* /api/common/minio/upload
*/
*/
export
namespace
upload
{
export
namespace
upload
{
export
class
Params
{}
export
class
Params
{}
...
@@ -348,7 +365,7 @@ declare namespace API {
...
@@ -348,7 +365,7 @@ declare namespace API {
export
namespace
permission
{
export
namespace
permission
{
/**
/**
* 新增
* 新增
* /
basic-
api/manage/permission/add
* /api/manage/permission/add
*/
*/
export
namespace
add
{
export
namespace
add
{
export
class
Params
{
export
class
Params
{
...
@@ -360,6 +377,8 @@ declare namespace API {
...
@@ -360,6 +377,8 @@ declare namespace API {
hidden
?:
boolean
hidden
?:
boolean
/** 图标 */
/** 图标 */
icon
?:
string
icon
?:
string
/** 元数据 */
meta
?:
string
/** 名称 */
/** 名称 */
name
:
string
name
:
string
/** 路径 */
/** 路径 */
...
@@ -369,7 +388,7 @@ declare namespace API {
...
@@ -369,7 +388,7 @@ declare namespace API {
/** 序号 */
/** 序号 */
serial
?:
number
serial
?:
number
/** 权限类型 */
/** 权限类型 */
type
:
'MENU'
|
'BUTTON'
type
:
'
DIR'
|
'
MENU'
|
'BUTTON'
/** 标识 */
/** 标识 */
uid
:
string
uid
:
string
}
}
...
@@ -387,7 +406,7 @@ declare namespace API {
...
@@ -387,7 +406,7 @@ declare namespace API {
/**
/**
* 删除
* 删除
* /
basic-
api/manage/permission/deleted
* /api/manage/permission/deleted
*/
*/
export
namespace
deleted
{
export
namespace
deleted
{
export
class
Params
{
export
class
Params
{
...
@@ -408,7 +427,7 @@ declare namespace API {
...
@@ -408,7 +427,7 @@ declare namespace API {
/**
/**
* 查询
* 查询
* /
basic-
api/manage/permission/find
* /api/manage/permission/find
*/
*/
export
namespace
find
{
export
namespace
find
{
export
class
Params
{
export
class
Params
{
...
@@ -429,7 +448,7 @@ declare namespace API {
...
@@ -429,7 +448,7 @@ declare namespace API {
/**
/**
* 修改
* 修改
* /
basic-
api/manage/permission/modify
* /api/manage/permission/modify
*/
*/
export
namespace
modify
{
export
namespace
modify
{
export
class
Params
{
export
class
Params
{
...
@@ -443,6 +462,8 @@ declare namespace API {
...
@@ -443,6 +462,8 @@ declare namespace API {
icon
?:
string
icon
?:
string
/** id */
/** id */
id
:
number
id
:
number
/** 元数据 */
meta
?:
string
/** 名称 */
/** 名称 */
name
:
string
name
:
string
/** 路径 */
/** 路径 */
...
@@ -452,7 +473,7 @@ declare namespace API {
...
@@ -452,7 +473,7 @@ declare namespace API {
/** 序号 */
/** 序号 */
serial
?:
number
serial
?:
number
/** 权限类型 */
/** 权限类型 */
type
:
'MENU'
|
'BUTTON'
type
:
'
DIR'
|
'
MENU'
|
'BUTTON'
/** 标识 */
/** 标识 */
uid
:
string
uid
:
string
}
}
...
@@ -470,7 +491,7 @@ declare namespace API {
...
@@ -470,7 +491,7 @@ declare namespace API {
/**
/**
* 分页查询
* 分页查询
* /
basic-
api/manage/permission/page
* /api/manage/permission/page
*/
*/
export
namespace
page
{
export
namespace
page
{
export
class
Params
{
export
class
Params
{
...
@@ -497,7 +518,7 @@ declare namespace API {
...
@@ -497,7 +518,7 @@ declare namespace API {
/**
/**
* 树结构查询
* 树结构查询
* /
basic-
api/manage/permission/tree
* /api/manage/permission/tree
*/
*/
export
namespace
tree
{
export
namespace
tree
{
export
class
Params
{
export
class
Params
{
...
@@ -523,7 +544,7 @@ declare namespace API {
...
@@ -523,7 +544,7 @@ declare namespace API {
export
namespace
role
{
export
namespace
role
{
/**
/**
* 新增
* 新增
* /
basic-
api/manage/role/add
* /api/manage/role/add
*/
*/
export
namespace
add
{
export
namespace
add
{
export
class
Params
{
export
class
Params
{
...
@@ -546,7 +567,7 @@ declare namespace API {
...
@@ -546,7 +567,7 @@ declare namespace API {
/**
/**
* 分配权限
* 分配权限
* /
basic-
api/manage/role/assign
* /api/manage/role/assign
*/
*/
export
namespace
assign
{
export
namespace
assign
{
export
class
Params
{
export
class
Params
{
...
@@ -569,7 +590,7 @@ declare namespace API {
...
@@ -569,7 +590,7 @@ declare namespace API {
/**
/**
* 删除
* 删除
* /
basic-
api/manage/role/deleted
* /api/manage/role/deleted
*/
*/
export
namespace
deleted
{
export
namespace
deleted
{
export
class
Params
{
export
class
Params
{
...
@@ -590,7 +611,7 @@ declare namespace API {
...
@@ -590,7 +611,7 @@ declare namespace API {
/**
/**
* 查询
* 查询
* /
basic-
api/manage/role/find
* /api/manage/role/find
*/
*/
export
namespace
find
{
export
namespace
find
{
export
class
Params
{
export
class
Params
{
...
@@ -611,7 +632,7 @@ declare namespace API {
...
@@ -611,7 +632,7 @@ declare namespace API {
/**
/**
* 修改
* 修改
* /
basic-
api/manage/role/modify
* /api/manage/role/modify
*/
*/
export
namespace
modify
{
export
namespace
modify
{
export
class
Params
{
export
class
Params
{
...
@@ -636,7 +657,7 @@ declare namespace API {
...
@@ -636,7 +657,7 @@ declare namespace API {
/**
/**
* 分页查询
* 分页查询
* /
basic-
api/manage/role/page
* /api/manage/role/page
*/
*/
export
namespace
page
{
export
namespace
page
{
export
class
Params
{
export
class
Params
{
...
@@ -663,7 +684,7 @@ declare namespace API {
...
@@ -663,7 +684,7 @@ declare namespace API {
/**
/**
* 选项查询
* 选项查询
* /
basic-
api/manage/role/selector
* /api/manage/role/selector
*/
*/
export
namespace
selector
{
export
namespace
selector
{
export
class
Params
{}
export
class
Params
{}
...
@@ -685,10 +706,28 @@ declare namespace API {
...
@@ -685,10 +706,28 @@ declare namespace API {
*/
*/
export
namespace
user
{
export
namespace
user
{
/**
/**
* 获取用户权限
* /api/user/getMenuList
*/
export
namespace
getMenuList
{
export
class
Params
{}
export
type
Response
=
Array
<
defs
.
MenuVo
>
export
const
init
:
Response
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
,
):
Promise
<
Response
>
}
/**
* 获取登录用户信息
* 获取登录用户信息
* /
basic-api/user/i
nfo
* /
api/user/getUserI
nfo
*/
*/
export
namespace
i
nfo
{
export
namespace
getUserI
nfo
{
export
class
Params
{}
export
class
Params
{}
export
type
Response
=
defs
.
UserInfo
export
type
Response
=
defs
.
UserInfo
...
@@ -704,7 +743,7 @@ declare namespace API {
...
@@ -704,7 +743,7 @@ declare namespace API {
/**
/**
* 分配角色
* 分配角色
* /
basic-
api/user/manage/assign
* /api/user/manage/assign
*/
*/
export
namespace
assign
{
export
namespace
assign
{
export
class
Params
{
export
class
Params
{
...
@@ -727,7 +766,7 @@ declare namespace API {
...
@@ -727,7 +766,7 @@ declare namespace API {
/**
/**
* 分页查询
* 分页查询
* /
basic-
api/user/manage/page
* /api/user/manage/page
*/
*/
export
namespace
page
{
export
namespace
page
{
export
class
Params
{
export
class
Params
{
...
...
src/api/services/baseClass.ts
浏览文件 @
2018f395
export
class
LoginVo
{
export
class
LoginVo
{
/** token */
/** token */
token
=
''
token
=
''
/** 主键 */
userId
=
undefined
}
export
class
MenuVo
{
/** 子权限 */
children
=
[]
/** 组件 */
component
=
''
/** 元数据 */
meta
=
undefined
/** 标识 */
name
=
''
/** 路径 */
path
=
''
/** 权限类型 */
type
=
'DIR'
}
}
export
class
PageVo
{
export
class
PageVo
{
...
@@ -33,6 +56,9 @@ export class PermissionVo {
...
@@ -33,6 +56,9 @@ export class PermissionVo {
/** 主键 */
/** 主键 */
id
=
undefined
id
=
undefined
/** 元数据 */
meta
=
undefined
/** 名称 */
/** 名称 */
name
=
''
name
=
''
...
@@ -46,7 +72,7 @@ export class PermissionVo {
...
@@ -46,7 +72,7 @@ export class PermissionVo {
serial
=
undefined
serial
=
undefined
/** 权限类型 */
/** 权限类型 */
type
=
'
MENU
'
type
=
'
DIR
'
/** 标识 */
/** 标识 */
uid
=
''
uid
=
''
...
@@ -96,27 +122,18 @@ export class UserInfo {
...
@@ -96,27 +122,18 @@ export class UserInfo {
/** 头像 */
/** 头像 */
avatar
=
''
avatar
=
''
/**
邮箱
*/
/**
介绍
*/
email
=
''
desc
=
''
/**
主页地址
*/
/**
用户主页
*/
homePath
=
''
homePath
=
''
/** 手机号 */
mobile
=
''
/** 权限 */
permissions
=
[]
/** 真实姓名 */
/** 真实姓名 */
realName
=
''
realName
=
''
/** 角色 */
/** 角色 */
roles
=
[]
roles
=
[]
/** 职称 */
title
=
''
/** 主键 */
/** 主键 */
userId
=
undefined
userId
=
undefined
...
...
src/api/services/mods/auth/login.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 账号(支持用户名/手机号/邮箱) */
/** 账号(支持用户名/手机号/邮箱) */
...
@@ -15,9 +15,9 @@ export class Params {
...
@@ -15,9 +15,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
auth/login'
,
url
:
'/auth/login'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/auth/logout.ts
浏览文件 @
2018f395
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
auth/logout'
,
url
:
'/auth/logout'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/auth/register.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 头像 */
/** 头像 */
...
@@ -12,14 +12,14 @@ export class Params {
...
@@ -12,14 +12,14 @@ export class Params {
email
?:
string
email
?:
string
/** 是否启用 */
/** 是否启用 */
enable
?:
boolean
enable
?:
boolean
/** 简介 */
introduction
?:
string
/** 手机号 */
/** 手机号 */
mobile
:
string
mobile
:
string
/** 密码 */
/** 密码 */
password
:
string
password
:
string
/** 真实姓名 */
/** 真实姓名 */
realName
:
string
realName
:
string
/** 职称 */
title
?:
string
/** 用户名 */
/** 用户名 */
username
:
string
username
:
string
}
}
...
@@ -27,9 +27,9 @@ export class Params {
...
@@ -27,9 +27,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
auth/register'
,
url
:
'/auth/register'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/hello/fail.ts
浏览文件 @
2018f395
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
hello/fail'
,
url
:
'/hello/fail'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/hello/hello.ts
浏览文件 @
2018f395
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
hello/'
,
url
:
'/hello/'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/hello/page.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 当前页数 */
/** 当前页数 */
...
@@ -19,9 +19,9 @@ export class Params {
...
@@ -19,9 +19,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
hello/page'
,
url
:
'/hello/page'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/minio/upload.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
...
@@ -15,9 +15,9 @@ export function request(
...
@@ -15,9 +15,9 @@ export function request(
config
?:
http
.
RequestConfig
<
Params
|
FormData
>
,
config
?:
http
.
RequestConfig
<
Params
|
FormData
>
,
options
?:
http
.
RequestOptions
,
options
?:
http
.
RequestOptions
,
)
{
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
common/minio/upload'
,
url
:
'/common/minio/upload'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
form
||
params
,
data
:
form
||
params
,
...
...
src/api/services/mods/permission/add.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 组件 */
/** 组件 */
...
@@ -14,6 +14,8 @@ export class Params {
...
@@ -14,6 +14,8 @@ export class Params {
hidden
?:
boolean
hidden
?:
boolean
/** 图标 */
/** 图标 */
icon
?:
string
icon
?:
string
/** 元数据 */
meta
?:
string
/** 名称 */
/** 名称 */
name
:
string
name
:
string
/** 路径 */
/** 路径 */
...
@@ -23,7 +25,7 @@ export class Params {
...
@@ -23,7 +25,7 @@ export class Params {
/** 序号 */
/** 序号 */
serial
?:
number
serial
?:
number
/** 权限类型 */
/** 权限类型 */
type
:
'MENU'
|
'BUTTON'
type
:
'
DIR'
|
'
MENU'
|
'BUTTON'
/** 标识 */
/** 标识 */
uid
:
string
uid
:
string
}
}
...
@@ -31,9 +33,9 @@ export class Params {
...
@@ -31,9 +33,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/add'
,
url
:
'/manage/permission/add'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/permission/deleted.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -13,9 +13,9 @@ export class Params {
...
@@ -13,9 +13,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/deleted'
,
url
:
'/manage/permission/deleted'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/permission/find.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -13,9 +13,9 @@ export class Params {
...
@@ -13,9 +13,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/find'
,
url
:
'/manage/permission/find'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/permission/modify.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 组件 */
/** 组件 */
...
@@ -16,6 +16,8 @@ export class Params {
...
@@ -16,6 +16,8 @@ export class Params {
icon
?:
string
icon
?:
string
/** id */
/** id */
id
:
number
id
:
number
/** 元数据 */
meta
?:
string
/** 名称 */
/** 名称 */
name
:
string
name
:
string
/** 路径 */
/** 路径 */
...
@@ -25,7 +27,7 @@ export class Params {
...
@@ -25,7 +27,7 @@ export class Params {
/** 序号 */
/** 序号 */
serial
?:
number
serial
?:
number
/** 权限类型 */
/** 权限类型 */
type
:
'MENU'
|
'BUTTON'
type
:
'
DIR'
|
'
MENU'
|
'BUTTON'
/** 标识 */
/** 标识 */
uid
:
string
uid
:
string
}
}
...
@@ -33,9 +35,9 @@ export class Params {
...
@@ -33,9 +35,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/modify'
,
url
:
'/manage/permission/modify'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/permission/page.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 当前页数 */
/** 当前页数 */
...
@@ -19,9 +19,9 @@ export class Params {
...
@@ -19,9 +19,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/page'
,
url
:
'/manage/permission/page'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/permission/tree.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 父级 id */
/** 父级 id */
...
@@ -13,9 +13,9 @@ export class Params {
...
@@ -13,9 +13,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/permission/tree'
,
url
:
'/manage/permission/tree'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/role/add.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 名称 */
/** 名称 */
...
@@ -15,9 +15,9 @@ export class Params {
...
@@ -15,9 +15,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/add'
,
url
:
'/manage/role/add'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/role/assign.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -15,9 +15,9 @@ export class Params {
...
@@ -15,9 +15,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/assign'
,
url
:
'/manage/role/assign'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/role/deleted.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -13,9 +13,9 @@ export class Params {
...
@@ -13,9 +13,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/deleted'
,
url
:
'/manage/role/deleted'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/role/find.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -13,9 +13,9 @@ export class Params {
...
@@ -13,9 +13,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/find'
,
url
:
'/manage/role/find'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/role/modify.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -17,9 +17,9 @@ export class Params {
...
@@ -17,9 +17,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/modify'
,
url
:
'/manage/role/modify'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/role/page.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 当前页数 */
/** 当前页数 */
...
@@ -19,9 +19,9 @@ export class Params {
...
@@ -19,9 +19,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/page'
,
url
:
'/manage/role/page'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/role/selector.ts
浏览文件 @
2018f395
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
manage/role/selector'
,
url
:
'/manage/role/selector'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/user/assign.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** id */
/** id */
...
@@ -15,9 +15,9 @@ export class Params {
...
@@ -15,9 +15,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
user/manage/assign'
,
url
:
'/user/manage/assign'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
...
...
src/api/services/mods/user/getMenuList.ts
0 → 100644
浏览文件 @
2018f395
/**
* @desc 获取用户权限
*/
import
*
as
defs
from
'../../baseClass'
import
{
defHttp
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
defHttp
.
request
(
{
url
:
'/user/getMenuList'
,
method
:
'GET'
,
params
,
...
config
,
},
options
,
)
}
src/api/services/mods/user/
i
nfo.ts
→
src/api/services/mods/user/
getUserI
nfo.ts
浏览文件 @
2018f395
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{}
export
class
Params
{}
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/user/i
nfo'
,
url
:
'/
user/getUserI
nfo'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/services/mods/user/index.ts
浏览文件 @
2018f395
/**
/**
* @description
* @description
*/
*/
import
*
as
info
from
'./info'
import
*
as
getMenuList
from
'./getMenuList'
import
*
as
getUserInfo
from
'./getUserInfo'
import
*
as
assign
from
'./assign'
import
*
as
assign
from
'./assign'
import
*
as
page
from
'./page'
import
*
as
page
from
'./page'
export
{
i
nfo
,
assign
,
page
}
export
{
getMenuList
,
getUserI
nfo
,
assign
,
page
}
src/api/services/mods/user/page.ts
浏览文件 @
2018f395
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*/
*/
import
*
as
defs
from
'../../baseClass'
import
*
as
defs
from
'../../baseClass'
import
{
Http
}
from
'/@/utils/http/axios'
import
{
def
Http
}
from
'/@/utils/http/axios'
export
class
Params
{
export
class
Params
{
/** 当前页数 */
/** 当前页数 */
...
@@ -19,9 +19,9 @@ export class Params {
...
@@ -19,9 +19,9 @@ export class Params {
export
const
init
=
new
defs
.
Result
()
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
Http
.
request
(
return
def
Http
.
request
(
{
{
url
:
'/
basic-api/
user/manage/page'
,
url
:
'/user/manage/page'
,
method
:
'GET'
,
method
:
'GET'
,
params
,
params
,
...
...
src/api/sys/menu.ts
浏览文件 @
2018f395
...
@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios'
...
@@ -2,7 +2,7 @@ import { defHttp } from '/@/utils/http/axios'
import
{
getMenuListResultModel
}
from
'./model/menuModel'
import
{
getMenuListResultModel
}
from
'./model/menuModel'
enum
Api
{
enum
Api
{
GetMenuList
=
'/getMenuList'
,
GetMenuList
=
'/
user/
getMenuList'
,
}
}
/**
/**
...
...
src/api/sys/model/userModel.ts
浏览文件 @
2018f395
...
@@ -2,13 +2,14 @@
...
@@ -2,13 +2,14 @@
* @description: Login interface parameters
* @description: Login interface parameters
*/
*/
export
interface
LoginParams
{
export
interface
LoginParams
{
username
:
string
account
:
string
password
:
string
password
:
string
}
}
export
interface
RoleInfo
{
export
interface
RoleInfo
{
roleName
:
string
id
:
string
|
number
value
:
string
uid
:
string
name
:
string
}
}
/**
/**
...
@@ -17,7 +18,7 @@ export interface RoleInfo {
...
@@ -17,7 +18,7 @@ export interface RoleInfo {
export
interface
LoginResultModel
{
export
interface
LoginResultModel
{
userId
:
string
|
number
userId
:
string
|
number
token
:
string
token
:
string
role
:
RoleInfo
role
?
:
RoleInfo
}
}
/**
/**
...
...
src/api/sys/user.ts
浏览文件 @
2018f395
...
@@ -4,11 +4,11 @@ import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userMod
...
@@ -4,11 +4,11 @@ import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userMod
import
{
ErrorMessageMode
}
from
'/#/axios'
import
{
ErrorMessageMode
}
from
'/#/axios'
enum
Api
{
enum
Api
{
Login
=
'/login'
,
Login
=
'/
auth/
login'
,
Logout
=
'/logout'
,
Logout
=
'/
auth/
logout'
,
GetUserInfo
=
'/getUserInfo'
,
GetUserInfo
=
'/
user/
getUserInfo'
,
GetPermCode
=
'/getPermCode'
,
GetPermCode
=
'/
auth/
getPermCode'
,
TestRetry
=
'/testRetry'
,
TestRetry
=
'/
auth/
testRetry'
,
}
}
/**
/**
...
...
src/locales/lang/en/sys.ts
浏览文件 @
2018f395
...
@@ -85,7 +85,7 @@ export default {
...
@@ -85,7 +85,7 @@ export default {
loginSuccessDesc
:
'Welcome back'
,
loginSuccessDesc
:
'Welcome back'
,
// placeholder
// placeholder
accountPlaceholder
:
'Please input
username
'
,
accountPlaceholder
:
'Please input
account
'
,
passwordPlaceholder
:
'Please input password'
,
passwordPlaceholder
:
'Please input password'
,
smsPlaceholder
:
'Please input sms code'
,
smsPlaceholder
:
'Please input sms code'
,
mobilePlaceholder
:
'Please input mobile'
,
mobilePlaceholder
:
'Please input mobile'
,
...
...
src/settings/projectSetting.ts
浏览文件 @
2018f395
...
@@ -70,7 +70,7 @@ const setting: ProjectConfig = {
...
@@ -70,7 +70,7 @@ const setting: ProjectConfig = {
// Whether to show the document button
// Whether to show the document button
showDoc
:
true
,
showDoc
:
true
,
// Whether to show the notification button
// Whether to show the notification button
showNotice
:
tru
e
,
showNotice
:
fals
e
,
// Whether to display the menu search
// Whether to display the menu search
showSearch
:
true
,
showSearch
:
true
,
},
},
...
...
src/store/modules/lock.ts
浏览文件 @
2018f395
...
@@ -40,7 +40,7 @@ export const useLockStore = defineStore({
...
@@ -40,7 +40,7 @@ export const useLockStore = defineStore({
try
{
try
{
const
username
=
userStore
.
getUserInfo
?.
username
const
username
=
userStore
.
getUserInfo
?.
username
const
res
=
await
userStore
.
login
({
const
res
=
await
userStore
.
login
({
username
,
account
:
username
,
password
:
password
!
,
password
:
password
!
,
goHome
:
false
,
goHome
:
false
,
mode
:
'none'
,
mode
:
'none'
,
...
...
src/utils/http/axios/index.ts
浏览文件 @
2018f395
...
@@ -214,9 +214,9 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
...
@@ -214,9 +214,9 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// 基础接口地址
// 基础接口地址
// baseURL: globSetting.apiUrl,
// baseURL: globSetting.apiUrl,
headers
:
{
'Content-Type'
:
ContentTypeEnum
.
JSON
},
//
headers: { 'Content-Type': ContentTypeEnum.JSON },
// 如果是form-data格式
// 如果是form-data格式
//
headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
headers
:
{
'Content-Type'
:
ContentTypeEnum
.
FORM_URLENCODED
},
// 数据处理方式
// 数据处理方式
transform
:
clone
(
transform
),
transform
:
clone
(
transform
),
// 配置项,下面的选项都可以在独立的接口请求中覆盖
// 配置项,下面的选项都可以在独立的接口请求中覆盖
...
@@ -260,13 +260,13 @@ export const defHttp = createAxios()
...
@@ -260,13 +260,13 @@ export const defHttp = createAxios()
// 自定义配置
// 自定义配置
// TODO: 实际项目所需的请求配置
// TODO: 实际项目所需的请求配置
// const { apiUrl } = globSetting
// const { apiUrl } = globSetting
const
apiUrl
=
'http://localhost:8181'
//
const apiUrl = 'http://localhost:8181'
export
const
Http
=
createAxios
({
//
export const Http = createAxios({
headers
:
{
'Content-Type'
:
ContentTypeEnum
.
FORM_URLENCODED
},
//
headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
requestOptions
:
{
//
requestOptions: {
apiUrl
,
//
apiUrl,
},
//
},
})
//
})
// other api url
// other api url
// export const otherHttp = createAxios({
// export const otherHttp = createAxios({
...
...
src/views/sys/login/LoginForm.vue
浏览文件 @
2018f395
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
const
rememberMe
=
ref
(
false
)
const
rememberMe
=
ref
(
false
)
const
formData
=
reactive
({
const
formData
=
reactive
({
account
:
'
basic
'
,
account
:
'
admin
'
,
password
:
'123456'
,
password
:
'123456'
,
})
})
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
loading
.
value
=
true
loading
.
value
=
true
const
userInfo
=
await
userStore
.
login
({
const
userInfo
=
await
userStore
.
login
({
password
:
data
.
password
,
password
:
data
.
password
,
username
:
data
.
account
,
account
:
data
.
account
,
mode
:
'none'
,
//不要默认的错误提示
mode
:
'none'
,
//不要默认的错误提示
})
})
if
(
userInfo
)
{
if
(
userInfo
)
{
...
...
tests/server/service/UserService.ts
浏览文件 @
2018f395
...
@@ -2,7 +2,7 @@ import { Result } from '../utils'
...
@@ -2,7 +2,7 @@ import { Result } from '../utils'
const
fakeUserInfo
=
{
const
fakeUserInfo
=
{
userId
:
'1'
,
userId
:
'1'
,
username
:
'vben'
,
account
:
'vben'
,
realName
:
'Vben Admin'
,
realName
:
'Vben Admin'
,
desc
:
'manager'
,
desc
:
'manager'
,
password
:
'123456'
,
password
:
'123456'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论