|
@@ -1,7 +1,7 @@
|
|
|
### 创建用户
|
|
|
- 请求方法 `POST`
|
|
|
|
|
|
-- 请求url:~/p/createUser
|
|
|
+- 请求url:~/admin/createUser
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -43,7 +43,7 @@
|
|
|
### 修改用户信息
|
|
|
- 请求方法 `POST` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/modifyUser
|
|
|
+- 请求url:~/admin/modifyUser
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -77,7 +77,7 @@
|
|
|
### 删除用户
|
|
|
- 请求方法 `GET` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/deleteUser
|
|
|
+- 请求url:~/admin/deleteUser
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -283,7 +283,7 @@
|
|
|
|
|
|
- 请求方法 `POST` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/createRole
|
|
|
+- 请求url:~/admin/createRole
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -320,7 +320,7 @@
|
|
|
|
|
|
- 请求方法 `POST` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/modifyRole
|
|
|
+- 请求url:~/admin/modifyRole
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -343,7 +343,12 @@
|
|
|
{
|
|
|
"code": 0,
|
|
|
"message": "success",
|
|
|
- "data": "success"
|
|
|
+ "data": {
|
|
|
+ "id": 11,
|
|
|
+ "name": "admin",
|
|
|
+ "description": "",
|
|
|
+ "status": "normal"
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
@@ -353,7 +358,7 @@
|
|
|
|
|
|
- 请求方法 `GET` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/deleteRole
|
|
|
+- 请求url:~/admin/deleteRole
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -384,7 +389,7 @@
|
|
|
|
|
|
- 请求方法 `GET` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/listRole
|
|
|
+- 请求url:~/admin/listRole
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -405,39 +410,36 @@
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
- "current_page":1,
|
|
|
- "data":[
|
|
|
- {
|
|
|
- "name":"hal",
|
|
|
- "description":"haloteacher"
|
|
|
- }
|
|
|
- ],
|
|
|
- "first_page_url":"http://local.pc:8888/repair_lite/p/listRole?page=1",
|
|
|
- "from":1,
|
|
|
- "last_page":7,
|
|
|
- "last_page_url":"http://local.pc:8888/repair_lite/p/listRole?page=7",
|
|
|
- "next_page_url":"http://local.pc:8888/repair_lite/p/listRole?page=2",
|
|
|
- "path":"http://local.pc:8888/repair_lite/p/listRole",
|
|
|
- "per_page":1,
|
|
|
- "prev_page_url":null,
|
|
|
- "to":1,
|
|
|
- "total":7
|
|
|
+ "code": 0,
|
|
|
+ "message": "success",
|
|
|
+ "data": {
|
|
|
+ "current_page": 1,
|
|
|
+ "per_page": 1,
|
|
|
+ "total": 10,
|
|
|
+ "roles": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "a",
|
|
|
+ "description": null
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
-### 配置某个用户为某角色,该方法未更新
|
|
|
+### 配置某个用户的角色
|
|
|
- 请求方法 `GET` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/assignUserRole
|
|
|
+- 请求url:~/admin/assignUserRole?userId=1&roleIds=2,3
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
|
|字段名|描述|必选|
|
|
|
|:-:|:-:|:-:|
|
|
|
-| uid | 配置角色的用户id | 是 |
|
|
|
-| barIds | 配置的菜单id,多个用逗号隔开 | 是 |
|
|
|
+| userId | 配置角色的用户id | 是 |
|
|
|
+| roleIds | 配置的角色id,多个用逗号隔开 | 是 |
|
|
|
|
|
|
- 返回结果
|
|
|
|
|
@@ -445,7 +447,6 @@
|
|
|
|:-:|:-:|
|
|
|
| code | 错误码,0: success, 非0:异常 |
|
|
|
| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
-| data.id | 菜单的id |
|
|
|
|
|
|
- 实例
|
|
|
|
|
@@ -453,19 +454,427 @@
|
|
|
{
|
|
|
"code": 0,
|
|
|
"message": "success",
|
|
|
- "data": "success"
|
|
|
+ "data": {
|
|
|
+ "roles": [
|
|
|
+ {
|
|
|
+ "id": 69,
|
|
|
+ "user_id": 1,
|
|
|
+ "role_id": 2,
|
|
|
+ "status": "normal"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 70,
|
|
|
+ "user_id": 1,
|
|
|
+ "role_id": 3,
|
|
|
+ "status": "normal"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "roleInfo": {
|
|
|
+ "2": {
|
|
|
+ "id": 2,
|
|
|
+ "name": "b",
|
|
|
+ "description": null,
|
|
|
+ "status": null
|
|
|
+ },
|
|
|
+ "3": {
|
|
|
+ "id": 3,
|
|
|
+ "name": "c",
|
|
|
+ "description": null,
|
|
|
+ "status": null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
|
---
|
|
|
|
|
|
### 配置某个角色下的用户
|
|
|
-暂无
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/admin/assignRoleUser?roleId=1&userIds=1,2
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+| roleId | 配置角色的角色id | 是 |
|
|
|
+| userIds | 配置的用户id,多个用逗号隔开 | 是 |
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code": 0,
|
|
|
+ "message": "success",
|
|
|
+ "data": {
|
|
|
+ "users": [
|
|
|
+ {
|
|
|
+ "id": 82,
|
|
|
+ "user_id": 1,
|
|
|
+ "role_id": 1,
|
|
|
+ "status": "normal"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 83,
|
|
|
+ "user_id": 2,
|
|
|
+ "role_id": 1,
|
|
|
+ "status": "normal"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "userInfo": {
|
|
|
+ "1": {
|
|
|
+ "id": 1,
|
|
|
+ "username": "11",
|
|
|
+ "nickname": "11",
|
|
|
+ "icon": null
|
|
|
+ },
|
|
|
+ "2": {
|
|
|
+ "id": 2,
|
|
|
+ "username": "123",
|
|
|
+ "nickname": "123",
|
|
|
+ "icon": null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+
|
|
|
+### 列出角色下的用户
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/admin/loadRoleUsers?page=1&pageCount=1
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+| page | 角色的页数 | 否 |
|
|
|
+| pageCount | 角色的每页条数 | 否 |
|
|
|
+| keyword | 角色的关键字搜索 | 否 |
|
|
|
+
|
|
|
+> 这里是否需要对角色下的用户分页,待定。
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+| roles | 角色的信息 |
|
|
|
+| roleUsers | 角色下的用户,用角色id当做key |
|
|
|
+| total | 角色的总数 |
|
|
|
+
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code": 0,
|
|
|
+ "message": "success",
|
|
|
+ "data": {
|
|
|
+ "roles": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "a",
|
|
|
+ "description": null
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "roleUser": {
|
|
|
+ "1": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "username": "11",
|
|
|
+ "nickname": "11",
|
|
|
+ "icon": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 2,
|
|
|
+ "username": "123",
|
|
|
+ "nickname": "123",
|
|
|
+ "icon": null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 3,
|
|
|
+ "username": "1234",
|
|
|
+ "nickname": "1234",
|
|
|
+ "icon": null
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "total": 11
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 用户加载自己的角色信息
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/loadRole
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+
|
|
|
+> 这个接口只要登录了即可获取角色信息
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+| roleUsers | 角色用户的数据 |
|
|
|
+| roleUsers.user_id | 用户id |
|
|
|
+| roleUsers.role_id | 角色id |
|
|
|
+| roleInfo | 角色信息,用角色id当做key |
|
|
|
+
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code":0,
|
|
|
+ "message":"success",
|
|
|
+ "data":{
|
|
|
+ "roleUsers":[
|
|
|
+ {
|
|
|
+ "id":70,
|
|
|
+ "user_id":1,
|
|
|
+ "role_id":3,
|
|
|
+ "status":"normal"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":91,
|
|
|
+ "user_id":1,
|
|
|
+ "role_id":1,
|
|
|
+ "status":"normal"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "roleInfo":{
|
|
|
+ "1":{
|
|
|
+ "id":1,
|
|
|
+ "name":"a",
|
|
|
+ "description":null,
|
|
|
+ "status":null
|
|
|
+ },
|
|
|
+ "3":{
|
|
|
+ "id":3,
|
|
|
+ "name":"c",
|
|
|
+ "description":null,
|
|
|
+ "status":null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 管理员加载用户的角色信息
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/admin/loadRole?userId=1
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+| userId | 用户id| 是 |
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+| roleUsers | 角色用户的数据 |
|
|
|
+| roleUsers.user_id | 用户id |
|
|
|
+| roleUsers.role_id | 角色id |
|
|
|
+| roleInfo | 角色信息,用角色id当做key |
|
|
|
+
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code":0,
|
|
|
+ "message":"success",
|
|
|
+ "data":{
|
|
|
+ "roleUsers":[
|
|
|
+ {
|
|
|
+ "id":70,
|
|
|
+ "user_id":1,
|
|
|
+ "role_id":3,
|
|
|
+ "status":"normal"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":91,
|
|
|
+ "user_id":1,
|
|
|
+ "role_id":1,
|
|
|
+ "status":"normal"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "roleInfo":{
|
|
|
+ "1":{
|
|
|
+ "id":1,
|
|
|
+ "name":"a",
|
|
|
+ "description":null,
|
|
|
+ "status":null
|
|
|
+ },
|
|
|
+ "3":{
|
|
|
+ "id":3,
|
|
|
+ "name":"c",
|
|
|
+ "description":null,
|
|
|
+ "status":null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+
|
|
|
+### 管理员分配用户菜单,分配角色菜单
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/admin/assignActionBars?ownerType=user&ownerId=1&barIds=1,2,3,4,5
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+| ownerType | 拥有者类型,可选值user/role | 是 |
|
|
|
+| ownerId | 拥有者id | 是 |
|
|
|
+| barIds | 菜单id,多个用逗号隔开 | 是 |
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code": 0,
|
|
|
+ "message": "success",
|
|
|
+ "data": "success"
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+
|
|
|
+### 加載角色下的菜单
|
|
|
+- 请求方法 `GET` 需要登录
|
|
|
+
|
|
|
+- 请求url:~/admin/assignActionBars?ownerType=user&ownerId=1&barIds=1,2,3,4,5
|
|
|
+
|
|
|
+- 请求参数
|
|
|
+
|
|
|
+|字段名|描述|必选|
|
|
|
+|:-:|:-:|:-:|
|
|
|
+| keyword | 关键字搜索 | 否 |
|
|
|
+
|
|
|
+- 返回结果
|
|
|
+
|
|
|
+|字段名|描述|
|
|
|
+|:-:|:-:|
|
|
|
+| code | 错误码,0: success, 非0:异常 |
|
|
|
+| message | 错误码不为0时,该字段为错误码的描述 |
|
|
|
+- 实例
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "code":0,
|
|
|
+ "message":"success",
|
|
|
+ "data":{
|
|
|
+ "roles":[
|
|
|
+ {
|
|
|
+ "id":2,
|
|
|
+ "name":"f",
|
|
|
+ "description":null
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "roleActionBar":{
|
|
|
+ "2":{
|
|
|
+ "0":[
|
|
|
+ {
|
|
|
+ "id":1,
|
|
|
+ "parent":0,
|
|
|
+ "name":"abdfdf",
|
|
|
+ "description":null,
|
|
|
+ "icon":"hhhe",
|
|
|
+ "link_type":null,
|
|
|
+ "link":null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":2,
|
|
|
+ "parent":0,
|
|
|
+ "name":"abc",
|
|
|
+ "description":null,
|
|
|
+ "icon":"hhhe",
|
|
|
+ "link_type":null,
|
|
|
+ "link":null
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "1":[
|
|
|
+ {
|
|
|
+ "id":3,
|
|
|
+ "parent":1,
|
|
|
+ "name":"second1",
|
|
|
+ "description":null,
|
|
|
+ "icon":null,
|
|
|
+ "link_type":null,
|
|
|
+ "link":null
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id":4,
|
|
|
+ "parent":1,
|
|
|
+ "name":"second2",
|
|
|
+ "description":null,
|
|
|
+ "icon":null,
|
|
|
+ "link_type":null,
|
|
|
+ "link":null
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "3":[
|
|
|
+ {
|
|
|
+ "id":5,
|
|
|
+ "parent":3,
|
|
|
+ "name":"third1",
|
|
|
+ "description":null,
|
|
|
+ "icon":null,
|
|
|
+ "link_type":null,
|
|
|
+ "link":null
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
|
|
|
### 创建菜单
|
|
|
- 请求方法 `POST` 需要登录
|
|
|
|
|
|
-- 请求url:~/p/addActionBar
|
|
|
+- 请求url:~/admin/addActionBar
|
|
|
|
|
|
- 请求参数
|
|
|
|
|
@@ -624,4 +1033,4 @@
|
|
|
}
|
|
|
```
|
|
|
|
|
|
----
|
|
|
+---
|