Skip to content
关注公众号,获取新课通知

查看角色权限


接口URL

http://demonuxtapi.dishait.cn/admin/role/read?id=2

请求方式

GET

Content-Type

application/x-www-form-urlencoded

请求Header参数

参数名示例值参数类型是否必填参数描述
tokeneyj...NjString用户token

请求Query参数

参数名示例值参数类型是否必填参数描述
id2Number角色id

成功响应示例

json5
{
	"msg": "ok",
	"data": {
		"id": 2,
		"name": "超级管理员",
		"role_id": "admin",
		"desc": "描述",
		"status": 1,
		"created_time": "2021-02-21T17:23:14.000Z",
		"updated_time": "2021-02-21T17:23:14.000Z",
		"menus": [
			{
				"id": 3,
				"title": "工具",
				"access_id": 0,
				"children": [
					{
						"id": 14,
						"title": "小社群",
						"access_id": 3,
						"children": []
					},
					// ...
				]
			},
			// ...
		],
		"accesses": [
			{
				"id": 32,
				"title": "课程模块",
				"access_id": 0,
				"children": [
					{
						"id": 46,
						"title": "新增课程",
						"access_id": 32,
						"children": []
					},
					// ...
				]
			},
			// ...
		]
	},
	"code": 20000
}

错误响应示例

json5
{
	"msg": "fail",
	"data": "Token 令牌不合法!"
}