2023-12-03 21:09:35 +08:00
|
|
|
|
# IDMesh API
|
2023-11-16 18:03:05 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
op.api 对 IDMesh API 进行了封装。op.api 会自行对请求进行签名,因此使用前需要先通过 op.api.init 设置开发者账号。
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
## op.api.init
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
|
|
|
|
/** 注意!!
|
|
|
|
|
* 在使用任何 op.api 封装的接口之前,
|
|
|
|
|
* 你需要使用 op.api.init 初始化接口
|
|
|
|
|
* AK、SK 来自开发者账号
|
|
|
|
|
*/
|
|
|
|
|
const onSyncTask = async (config, env, op, eventData) => {
|
|
|
|
|
op.api.init('<AK>', '<SK>');
|
|
|
|
|
op.api.user.disable({ id: '<User_ID>' });
|
|
|
|
|
};
|
|
|
|
|
```
|
2023-11-16 18:03:05 +08:00
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
## api
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
### user
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 创建用户
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.create(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
POST /v1/users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 用户名,唯一,不传后台自动生成
|
|
|
|
|
username?: string;
|
|
|
|
|
// 密码,不传后台生成默认密码
|
|
|
|
|
password?: string;
|
|
|
|
|
// 密码状态(valid/invalid)
|
|
|
|
|
password_status?: string;
|
|
|
|
|
// 显示名称
|
|
|
|
|
display_name?: string;
|
|
|
|
|
// 名
|
|
|
|
|
firstname?: string;
|
|
|
|
|
// 姓
|
|
|
|
|
lastname?: string;
|
|
|
|
|
// 真实姓名
|
|
|
|
|
realname?: string;
|
|
|
|
|
// 拼音
|
|
|
|
|
pinyin?: string;
|
|
|
|
|
// 昵称
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// 用户类型,不传后台设置系统默认类型
|
|
|
|
|
user_type?: string;
|
|
|
|
|
// 手机
|
|
|
|
|
mobile?: string;
|
|
|
|
|
// 邮箱
|
|
|
|
|
email?: string;
|
|
|
|
|
// 性别
|
|
|
|
|
gender?: string;
|
|
|
|
|
// 证件类型
|
|
|
|
|
cert_type?: string;
|
|
|
|
|
// 证件号
|
|
|
|
|
cert_number?: string;
|
|
|
|
|
// 区域
|
|
|
|
|
region?: string;
|
|
|
|
|
// 加入时间
|
|
|
|
|
work_time?: string;
|
|
|
|
|
// 职位
|
|
|
|
|
work_title?: string;
|
|
|
|
|
// 身份源ID,作为创建时记录,不做更新
|
|
|
|
|
idp_config_id: number;
|
|
|
|
|
// 系统扩展属性,json对象{"age": 18, "love": "足球"}
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// 自由扩展属性,json对象
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// 是否通知:默认不传false不通知,true通知
|
|
|
|
|
is_notify?: boolean;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 返回用户id
|
|
|
|
|
data: {
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 锁定用户(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.disable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
PATCH /v1/users/{id}/disable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 返回用户id
|
|
|
|
|
data?: boolean;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 解锁用户(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.enable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
PATCH /v1/users/{id}/enable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 返回用户id
|
|
|
|
|
data?: boolean;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 批量锁定用户(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.batchDisable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/jobs/users-disable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
effect_rows: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 批量解锁用户(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.batchEnable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/jobs/users-enable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
effect_rows: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 编辑用户
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.modify(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
PATCH /v1/users/{id}
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 用户名,验证唯一
|
|
|
|
|
username?: string;
|
|
|
|
|
// 显示名称
|
|
|
|
|
display_name?: string;
|
|
|
|
|
// 名
|
|
|
|
|
firstname?: string;
|
|
|
|
|
// 姓
|
|
|
|
|
lastname?: string;
|
|
|
|
|
// 真实姓名
|
|
|
|
|
realname?: string;
|
|
|
|
|
// 拼音
|
|
|
|
|
pinyin?: string;
|
|
|
|
|
// 昵称
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// 手机
|
|
|
|
|
mobile?: string;
|
|
|
|
|
// 邮箱
|
|
|
|
|
email?: string;
|
|
|
|
|
// 性别:1男,0女
|
|
|
|
|
gender?: string;
|
|
|
|
|
// 证件类型
|
|
|
|
|
cert_type?: string;
|
|
|
|
|
// 证件号
|
|
|
|
|
cert_number?: string;
|
|
|
|
|
// 区域
|
|
|
|
|
region?: string;
|
|
|
|
|
// 加入时间
|
|
|
|
|
work_time?: string;
|
|
|
|
|
// 职位
|
|
|
|
|
work_title?: string;
|
|
|
|
|
// 上次登录IP
|
|
|
|
|
last_login_ipaddr?: string;
|
|
|
|
|
// 上次登录时间
|
|
|
|
|
last_login_time?: string;
|
|
|
|
|
// 系统扩展信息,json对象{"age": 18, "love": "足球"}
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// 自由扩展属性,json对象
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 返回用户id
|
|
|
|
|
data: {
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 删除用户
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.delete(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
DELETE /v1/users/{id}
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 用户id
|
|
|
|
|
data: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 批量删除用户(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.batchDelete(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
DELETE /v1/users
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
effect_rows: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询用户列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.list(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/users
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
page_size?: integer;
|
|
|
|
|
page_num?: integer;
|
|
|
|
|
search_type?: string;
|
|
|
|
|
keyword?: string;
|
|
|
|
|
time_modified_from?: string;
|
|
|
|
|
time_modified_to?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
data: {
|
|
|
|
|
// 用户id标识
|
|
|
|
|
id?: number;
|
|
|
|
|
// 用户名,唯一
|
|
|
|
|
username: string;
|
|
|
|
|
// 密码
|
|
|
|
|
password: string;
|
|
|
|
|
// 显示名称
|
|
|
|
|
display_name?: string;
|
|
|
|
|
// 名
|
|
|
|
|
firstname?: string;
|
|
|
|
|
// 姓
|
|
|
|
|
lastname?: string;
|
|
|
|
|
// 真实姓名
|
|
|
|
|
realname?: string;
|
|
|
|
|
// 拼音
|
|
|
|
|
pinyin?: string;
|
|
|
|
|
// 昵称
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// 用户类型
|
|
|
|
|
user_type: string;
|
|
|
|
|
// 手机
|
|
|
|
|
mobile?: string;
|
|
|
|
|
// 邮箱
|
|
|
|
|
email?: string;
|
|
|
|
|
// 性别
|
|
|
|
|
gender?: string;
|
|
|
|
|
// 证件类型
|
|
|
|
|
cert_type?: string;
|
|
|
|
|
// 证件号
|
|
|
|
|
cert_number?: string;
|
|
|
|
|
// 区域
|
|
|
|
|
region?: string;
|
|
|
|
|
// 加入时间
|
|
|
|
|
work_time?: date;
|
|
|
|
|
// 职位
|
|
|
|
|
work_title?: string;
|
|
|
|
|
// 扩展信息,json对象{"age": 18, "love": "足球"}
|
|
|
|
|
ext_prop?: json;
|
|
|
|
|
// arn
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 身份源ID
|
|
|
|
|
id_provider_connection: number;
|
|
|
|
|
// 开发者id
|
|
|
|
|
developer_id?: number;
|
|
|
|
|
// 租户id
|
|
|
|
|
tenant_id?: number;
|
|
|
|
|
// 上次登录IP
|
|
|
|
|
last_login_ipaddr?: string;
|
|
|
|
|
// 上次登录时间
|
|
|
|
|
last_login_time?: datetime;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: datetime;
|
|
|
|
|
// 修改时间
|
|
|
|
|
time_modified?: number;
|
|
|
|
|
// 状态:1正常,0禁用
|
|
|
|
|
status: string;
|
|
|
|
|
}[];
|
|
|
|
|
// 总数
|
|
|
|
|
total_num?: number;
|
|
|
|
|
// 当前页
|
|
|
|
|
page_num?: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询用户详情
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.get(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/users/{id}
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 用户id标识
|
|
|
|
|
id?: number;
|
|
|
|
|
// 用户名,唯一
|
|
|
|
|
username?: string;
|
|
|
|
|
// 密码
|
|
|
|
|
password?: string;
|
|
|
|
|
// 显示名称
|
|
|
|
|
display_name?: string;
|
|
|
|
|
// 名
|
|
|
|
|
firstname?: string;
|
|
|
|
|
// 姓
|
|
|
|
|
lastname?: string;
|
|
|
|
|
// 真实姓名
|
|
|
|
|
realname?: string;
|
|
|
|
|
// 拼音
|
|
|
|
|
pinyin?: string;
|
|
|
|
|
// 昵称
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// 用户类型
|
|
|
|
|
user_type?: string;
|
|
|
|
|
// 手机
|
|
|
|
|
mobile?: string;
|
|
|
|
|
// 邮箱
|
|
|
|
|
email?: string;
|
|
|
|
|
// 性别
|
|
|
|
|
gender?: string;
|
|
|
|
|
// 证件类型
|
|
|
|
|
cert_type?: string;
|
|
|
|
|
// 证件号
|
|
|
|
|
cert_number?: string;
|
|
|
|
|
// 区域
|
|
|
|
|
region?: string;
|
|
|
|
|
// 加入时间
|
|
|
|
|
work_time?: date;
|
|
|
|
|
// 职位
|
|
|
|
|
work_title?: string;
|
|
|
|
|
// 扩展信息,json对象{"age": 18, "love": "足球"}
|
|
|
|
|
ext_prop?: json;
|
|
|
|
|
// arn
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 身份源ID
|
|
|
|
|
id_provider_connection?: number;
|
|
|
|
|
// 开发者id
|
|
|
|
|
developer_id?: number;
|
|
|
|
|
// 租户id
|
|
|
|
|
tenant_id?: number;
|
|
|
|
|
// 上次登录IP
|
|
|
|
|
last_login_ipaddr?: string;
|
|
|
|
|
// 上次登录时间
|
|
|
|
|
last_login_time?: datetime;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: datetime;
|
|
|
|
|
// 修改时间
|
|
|
|
|
time_modified?: number;
|
|
|
|
|
// 状态:1正常,0禁用
|
|
|
|
|
status?: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 修改密码(旧)
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.modifyPassword(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
PATCH /v1/users/{id}/passwords
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
old_password: string;
|
|
|
|
|
new_password: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- Examples
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"summary": "成功示例",
|
|
|
|
|
"value": true
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询用户存储凭证列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.getStoredCredentials(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/user-stored-credentials
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
user_id?: number;
|
|
|
|
|
provider_code?: string;
|
|
|
|
|
idp_config_id?: number;
|
|
|
|
|
id1?: string;
|
|
|
|
|
id2?: string;
|
|
|
|
|
metadata?: string;
|
|
|
|
|
status?: string;
|
|
|
|
|
username?: string;
|
|
|
|
|
display_name?: string;
|
|
|
|
|
page_size?: integer;
|
|
|
|
|
page_num?: integer;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
data: {
|
|
|
|
|
id?: integer;
|
|
|
|
|
username?: string;
|
|
|
|
|
password?: string;
|
|
|
|
|
display_name?: string;
|
|
|
|
|
firstname?: string;
|
|
|
|
|
lastname?: string;
|
|
|
|
|
realname?: string;
|
|
|
|
|
pinyin?: string;
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// json对象
|
|
|
|
|
avatar: {
|
|
|
|
|
}
|
|
|
|
|
user_type?: string;
|
|
|
|
|
mobile?: string;
|
|
|
|
|
email?: string;
|
|
|
|
|
gender?: string;
|
|
|
|
|
cert_type?: string;
|
|
|
|
|
cert_number?: string;
|
|
|
|
|
region?: string;
|
|
|
|
|
work_time?: null;
|
|
|
|
|
work_title?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
idp_config_id?: integer;
|
|
|
|
|
developer_id?: integer;
|
|
|
|
|
tenant_id?: integer;
|
|
|
|
|
last_login_ipaddr?: string;
|
|
|
|
|
last_login_time?: null;
|
|
|
|
|
time_created?: null;
|
|
|
|
|
time_modified?: integer;
|
|
|
|
|
status?: string;
|
|
|
|
|
// json对象
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// json对象
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}[];
|
|
|
|
|
total_num: integer;
|
|
|
|
|
page_num: integer;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 创建用户存储凭证
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.user.createStoreCredential(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/user-stored-credentials
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 社会化身份源code
|
|
|
|
|
provider_code: string;
|
|
|
|
|
// 社会化登录配置的ID
|
|
|
|
|
idp_config_id: number;
|
|
|
|
|
// 社会化身份标识1,如openid
|
|
|
|
|
id1: string;
|
|
|
|
|
// 社会化身份标识2,如unionid
|
|
|
|
|
id2?: string;
|
|
|
|
|
// 更多社会化身份标识
|
|
|
|
|
metadata?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 昵称
|
|
|
|
|
nickname?: string;
|
|
|
|
|
// 头像
|
|
|
|
|
avatar?: string;
|
|
|
|
|
// 真实姓名
|
|
|
|
|
realname?: string;
|
|
|
|
|
// 手机
|
|
|
|
|
mobile?: string;
|
|
|
|
|
// 邮箱
|
|
|
|
|
email?: string;
|
|
|
|
|
// 性别
|
|
|
|
|
gender?: string;
|
|
|
|
|
id_provider_connection?: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// http状态码,成功不显示
|
|
|
|
|
code?: number;
|
|
|
|
|
// 返回错误码
|
|
|
|
|
errno: number;
|
|
|
|
|
// 返回描述
|
|
|
|
|
message: string;
|
|
|
|
|
// 返回id标识
|
|
|
|
|
data?: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
### authentication
|
|
|
|
|
|
|
|
|
|
### app
|
|
|
|
|
|
|
|
|
|
#### 创建应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.create(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/applications
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: string;
|
|
|
|
|
// 1,自建应用,2模板应用(市场应用)
|
|
|
|
|
type: string;
|
|
|
|
|
// 域名
|
|
|
|
|
domain_sn: string;
|
|
|
|
|
// 不填写则代表自建应用
|
|
|
|
|
template_id?: string;
|
|
|
|
|
// 1 标准web应用,2单页web应用,3客户端应用,4后端服务
|
|
|
|
|
category: string;
|
|
|
|
|
descr?: string;
|
|
|
|
|
// 格式为:http://ip:port/logo.png
|
|
|
|
|
logo?: string;
|
|
|
|
|
login_url?: string;
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
// 1启用,0不启用,启用后单点登录返回
|
|
|
|
|
sub_account_policy?: string;
|
|
|
|
|
// kv字典数据
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// kv字典数据
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// 默认 oidc
|
|
|
|
|
protocol_type?: string;
|
|
|
|
|
// 默认 oidc 相关配置
|
|
|
|
|
protocol_prop: {
|
|
|
|
|
acs_url?: string;
|
|
|
|
|
sp_entity?: string;
|
|
|
|
|
response_attr: {
|
|
|
|
|
value: string;
|
|
|
|
|
attribute: string;
|
|
|
|
|
nameFormat: string;
|
|
|
|
|
}[];
|
|
|
|
|
digest_algorithm?: string;
|
|
|
|
|
lifetime_in_seconds?: number;
|
|
|
|
|
signature_algorithm?: string;
|
|
|
|
|
name_identifier_format?: string;
|
|
|
|
|
authn_context_class_ref?: string;
|
|
|
|
|
saml_response_signing_key?: string;
|
|
|
|
|
saml_response_signing_cert?: string;
|
|
|
|
|
saml_response_signing_cert_fingerprint?: string;
|
|
|
|
|
}
|
|
|
|
|
config_prop: {
|
|
|
|
|
status?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
mfa_config: {
|
|
|
|
|
}
|
|
|
|
|
reg_policy?: string;[];
|
|
|
|
|
mfa_enabled?: string;
|
|
|
|
|
sso_enabled?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
access_policy: {
|
|
|
|
|
forget_password?: string;[];
|
|
|
|
|
}
|
|
|
|
|
allowed_reg_method: {
|
|
|
|
|
}
|
|
|
|
|
default_reg_method?: string;
|
|
|
|
|
allowed_login_method: {
|
|
|
|
|
name?: string;
|
|
|
|
|
}
|
|
|
|
|
default_login_method?: string;
|
|
|
|
|
allowed_social_login_provider: {
|
|
|
|
|
wechat_scan_qr?: number;
|
|
|
|
|
dingding_scan_qr?: number;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 更新应用基本信息
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.modify(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
PATCH /v1/applications/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
name?: string;
|
|
|
|
|
domain_sn?: string;
|
|
|
|
|
// 1自建应用,2市场应用
|
|
|
|
|
type?: string;
|
|
|
|
|
app_id?: string;
|
|
|
|
|
app_secret?: string;
|
|
|
|
|
category?: string;
|
|
|
|
|
descr?: string;
|
|
|
|
|
logo?: null;
|
|
|
|
|
login_url?: string;
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
sub_account_policy?: string;
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
// 状态,0禁用,1启用
|
|
|
|
|
status?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询应用模板列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.getTemplate(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/application-templates
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
name: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
current_page?: number;
|
|
|
|
|
data: {
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
// 应用名称
|
|
|
|
|
name?: string;
|
|
|
|
|
// 应用类型,1自建应用,2市场应用
|
|
|
|
|
type?: string;
|
|
|
|
|
// 应用分类
|
|
|
|
|
category?: string;
|
|
|
|
|
// 应用描述
|
|
|
|
|
descr?: string;
|
|
|
|
|
// logo路径
|
|
|
|
|
logo?: string;
|
|
|
|
|
// 登录路径
|
|
|
|
|
login_url?: string;
|
|
|
|
|
// 重定向路径
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
// 登出路径
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
// 子账号策略,1启用,2不启用
|
|
|
|
|
sub_account_policy?: string;
|
|
|
|
|
// 扩展属性
|
|
|
|
|
prop: {
|
|
|
|
|
}
|
|
|
|
|
// 单点登录协议属性
|
|
|
|
|
protocol_prop: {
|
|
|
|
|
acs_url?: string;
|
|
|
|
|
sp_entity?: string;
|
|
|
|
|
response_attr: {
|
|
|
|
|
value: string;
|
|
|
|
|
attribute: string;
|
|
|
|
|
nameFormat: string;
|
|
|
|
|
}[];
|
|
|
|
|
digest_algorithm?: string;
|
|
|
|
|
lifetime_in_seconds?: number;
|
|
|
|
|
signature_algorithm?: string;
|
|
|
|
|
name_identifier_format?: string;
|
|
|
|
|
authn_context_class_ref?: string;
|
|
|
|
|
saml_response_signing_key?: string;
|
|
|
|
|
saml_response_signing_cert?: string;
|
|
|
|
|
saml_response_signing_cert_fingerprint?: string;
|
|
|
|
|
}
|
|
|
|
|
// 应用配置属性
|
|
|
|
|
config_prop: {
|
|
|
|
|
status?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
mfa_config: {
|
|
|
|
|
}
|
|
|
|
|
reg_policy?: number;
|
|
|
|
|
mfa_enabled?: string;
|
|
|
|
|
sso_enabled?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
access_policy: {
|
|
|
|
|
forget_password?: string;[];
|
|
|
|
|
}
|
|
|
|
|
allowed_reg_method: {
|
|
|
|
|
}
|
|
|
|
|
default_reg_method?: string;
|
|
|
|
|
allowed_login_method: {
|
|
|
|
|
name?: string;
|
|
|
|
|
}
|
|
|
|
|
default_login_method?: string;
|
|
|
|
|
allowed_id_provider: {
|
|
|
|
|
wechat_scan_qr?: number;
|
|
|
|
|
dingding_scan_qr?: number;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 创建事件
|
|
|
|
|
time_created?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
status?: string;
|
|
|
|
|
}[];
|
|
|
|
|
total_num?: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询应用列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.list(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/applications
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
name?: string;
|
|
|
|
|
type?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
types?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
data: {
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
// 应用名称
|
|
|
|
|
name?: string;
|
|
|
|
|
// 应用类型,1自建应用,2市场应用
|
|
|
|
|
type?: string;
|
|
|
|
|
// APPID
|
|
|
|
|
app_id?: string;
|
|
|
|
|
// 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务
|
|
|
|
|
category?: string;
|
|
|
|
|
// APPSEC,开发者用户调用返回
|
|
|
|
|
app_secret?: string;
|
|
|
|
|
// 应用描述
|
|
|
|
|
descr?: string;
|
|
|
|
|
// logo路径
|
|
|
|
|
logo?: string;
|
|
|
|
|
// 登录路径
|
|
|
|
|
login_url?: string;
|
|
|
|
|
// 应用绑定的唯一域名
|
|
|
|
|
domain?: string;
|
|
|
|
|
// 重定向url
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
// 登出url
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
// 子账号策略
|
|
|
|
|
sub_account_policy?: integer;
|
|
|
|
|
// 扩展属性
|
|
|
|
|
prop: {
|
|
|
|
|
}
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 更新时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 状态,1启用,0禁用
|
|
|
|
|
status?: string;
|
|
|
|
|
allowed_provider_id: {
|
|
|
|
|
config_id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
provider_type: string;
|
|
|
|
|
}[];
|
|
|
|
|
}[];
|
|
|
|
|
total_num?: number;
|
|
|
|
|
current_page?: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 按条件查询应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.getByDomain(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/application
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
domain?: string;
|
|
|
|
|
domain_sn?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
// 应用名称
|
|
|
|
|
name?: string;
|
|
|
|
|
// 应用类型,1自建应用,2市场应用
|
|
|
|
|
type?: string;
|
|
|
|
|
// APPID
|
|
|
|
|
app_id?: string;
|
|
|
|
|
// 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务
|
|
|
|
|
category?: string;
|
|
|
|
|
// APPSEC,开发者用户调用返回
|
|
|
|
|
app_secret?: string;
|
|
|
|
|
// 应用描述
|
|
|
|
|
descr?: string;
|
|
|
|
|
// logo路径
|
|
|
|
|
logo?: string;
|
|
|
|
|
// 登录路径
|
|
|
|
|
login_url?: string;
|
|
|
|
|
// 应用绑定的唯一域名
|
|
|
|
|
domain?: string;
|
|
|
|
|
// 应用域名 SN
|
|
|
|
|
domain_sn?: string;
|
|
|
|
|
// 重定向url
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
// 登出url
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
// 子账号策略
|
|
|
|
|
sub_account_policy?: integer;
|
|
|
|
|
// 扩展属性
|
|
|
|
|
prop: {
|
|
|
|
|
}
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 更新时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 状态,1启用,0禁用
|
|
|
|
|
status?: string;
|
|
|
|
|
config: {
|
|
|
|
|
id: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
// 格式为:["password", "vercode"]
|
|
|
|
|
allowed_login_method?: string;
|
|
|
|
|
// 格式为:password
|
|
|
|
|
default_login_method?: string;
|
|
|
|
|
// 格式为:["mobile", "email"]
|
|
|
|
|
allowed_reg_method?: string;
|
|
|
|
|
// 格式为:mobile
|
|
|
|
|
default_reg_method?: string;
|
|
|
|
|
// permitted,all
|
|
|
|
|
access_policy?: string;
|
|
|
|
|
reg_policy?: string;
|
|
|
|
|
// 格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2}
|
|
|
|
|
allowed_id_provider: {
|
|
|
|
|
id: string;
|
|
|
|
|
idp_code: string;
|
|
|
|
|
idp_config_id: string;
|
|
|
|
|
auth_method_code: string;
|
|
|
|
|
auth_method_display_name: string;
|
|
|
|
|
}
|
|
|
|
|
sso_enabled: boolean;
|
|
|
|
|
mfa_enabled: boolean;
|
|
|
|
|
mfa_config: {
|
|
|
|
|
name: string;
|
|
|
|
|
provider_type: string;
|
|
|
|
|
config_id: string;
|
|
|
|
|
scenarios?: string;[];
|
|
|
|
|
}
|
|
|
|
|
access_control_enabled: boolean;
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
// 1启用,0禁用
|
|
|
|
|
status: string;
|
|
|
|
|
}
|
|
|
|
|
protocols: {
|
|
|
|
|
}[];
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 按 ID 查询应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.get(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/applications/{id}
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
// 应用名称
|
|
|
|
|
name?: string;
|
|
|
|
|
// 应用类型,1自建应用,2市场应用
|
|
|
|
|
type?: string;
|
|
|
|
|
// APPID
|
|
|
|
|
app_id?: string;
|
|
|
|
|
// 应用分类,1 标准web应用,2单页web应用,3客户端应用,4后端服务
|
|
|
|
|
category?: string;
|
|
|
|
|
// APPSEC,开发者用户调用返回
|
|
|
|
|
app_secret?: string;
|
|
|
|
|
// 应用描述
|
|
|
|
|
descr?: string;
|
|
|
|
|
// logo路径
|
|
|
|
|
logo?: string;
|
|
|
|
|
// 登录路径
|
|
|
|
|
login_url?: string;
|
|
|
|
|
// 应用绑定的唯一域名
|
|
|
|
|
domain?: string;
|
|
|
|
|
// 应用域名 SN
|
|
|
|
|
domain_sn?: string;
|
|
|
|
|
// 重定向url
|
|
|
|
|
redirect_url?: string;
|
|
|
|
|
// 登出url
|
|
|
|
|
logout_url?: string;
|
|
|
|
|
// 子账号策略
|
|
|
|
|
sub_account_policy?: integer;
|
|
|
|
|
// 扩展属性
|
|
|
|
|
prop: {
|
|
|
|
|
}
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 更新时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 状态,1启用,0禁用
|
|
|
|
|
status?: string;
|
|
|
|
|
config: {
|
|
|
|
|
id: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
// 格式为:["password", "vercode"]
|
|
|
|
|
allowed_login_method?: string;
|
|
|
|
|
// 格式为:password
|
|
|
|
|
default_login_method?: string;
|
|
|
|
|
// 格式为:["mobile", "email"]
|
|
|
|
|
allowed_reg_method?: string;
|
|
|
|
|
// 格式为:mobile
|
|
|
|
|
default_reg_method?: string;
|
|
|
|
|
// permitted,all
|
|
|
|
|
access_policy?: string;
|
|
|
|
|
reg_policy?: string;
|
|
|
|
|
// 格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2}
|
|
|
|
|
allowed_id_provider: {
|
|
|
|
|
id: string;
|
|
|
|
|
idp_code: string;
|
|
|
|
|
idp_config_id: string;
|
|
|
|
|
auth_method_code: string;
|
|
|
|
|
auth_method_display_name: string;
|
|
|
|
|
}
|
|
|
|
|
sso_enabled: boolean;
|
|
|
|
|
mfa_enabled: boolean;
|
|
|
|
|
mfa_config: {
|
|
|
|
|
name: string;
|
|
|
|
|
provider_type: string;
|
|
|
|
|
config_id: string;
|
|
|
|
|
scenarios?: string;[];
|
|
|
|
|
}
|
|
|
|
|
access_control_enabled: boolean;
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
// 1启用,0禁用
|
|
|
|
|
status: string;
|
|
|
|
|
}
|
|
|
|
|
protocols: {
|
|
|
|
|
}[];
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 启用应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.enable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/applications/{id}/enable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message: string;
|
|
|
|
|
// 操作ID
|
|
|
|
|
data: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 禁用应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.disable(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/applications/{id}/disable
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
// 操作ID
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 删除应用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.delete(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
DELETE /v1/applications/{id}
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
// 结果标识true/false
|
|
|
|
|
data: {
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 刷新应用安全码
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.createSecrets(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/applications/{id}/secrets
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 操作结果
|
|
|
|
|
message?: string;
|
|
|
|
|
data: {
|
|
|
|
|
// 安全码
|
|
|
|
|
appSecret?: string;
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询应用配置信息
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.app.getConfig(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/applications/{id}/configs
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 唯一标识
|
|
|
|
|
id: string;
|
|
|
|
|
// 应用ID
|
|
|
|
|
app_id: string;
|
|
|
|
|
// 允许的登录方式,格式为:["password", "vercode"]
|
|
|
|
|
allowed_login_method?: string;
|
|
|
|
|
// 默认登录方式,格式为:password
|
|
|
|
|
default_login_method: string;
|
|
|
|
|
// 允许注册方式,格式为:["mobile", "email"]
|
|
|
|
|
allowed_reg_method?: string;
|
|
|
|
|
// 默认注册方式,格式为:mobile
|
|
|
|
|
default_reg_method: string;
|
|
|
|
|
// 应用级访问控制权限,格式为:{"password_recovery": ["email"]}
|
|
|
|
|
access_policy?: string;
|
|
|
|
|
// 新用户注册策略(是否允许自动注册,注册验证方式等),1是,2否,
|
|
|
|
|
reg_policy?: string;
|
|
|
|
|
// 允许的登录身份提供商,格式为:{"wechat_scan_qr": 1, "dingding_scan_qr": 2}
|
|
|
|
|
allowed_id_provider?: string;
|
|
|
|
|
// 是否允许SSO
|
|
|
|
|
sso_enabled: boolean;
|
|
|
|
|
// 是否开启MFA
|
|
|
|
|
mfa_enabled?: boolean;
|
|
|
|
|
// 开启的MFA配置
|
|
|
|
|
mfa_config: {
|
|
|
|
|
name: string;
|
|
|
|
|
provider_type: string;
|
|
|
|
|
config_id: string;
|
|
|
|
|
}
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 状态,1启用,0禁用
|
|
|
|
|
status?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新应用配置
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.modifyConfig(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PATCH /v1/applications/{id}/configs
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 允许的登录方式,格式为:["password", "vercode"]
|
|
|
|
|
allowed_login_method?: string;
|
|
|
|
|
// 默认登录方式,格式为:password
|
|
|
|
|
default_login_method?: string;
|
|
|
|
|
// 允许注册方式,格式为:["mobile", "email"]
|
|
|
|
|
allowed_reg_method?: string;
|
|
|
|
|
// 默认注册方式,格式为:mobile
|
|
|
|
|
default_reg_method?: string;
|
|
|
|
|
// 默认登录协议
|
|
|
|
|
default_protocol?: string;
|
|
|
|
|
// 应用级访问控制权限,all: 所有人可访问 permitted: 拒绝未授权访问
|
|
|
|
|
access_policy?: string;
|
|
|
|
|
reg_policy?: string;[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 禁用应用单点登录
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.disableSSO(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{id}/sso/disable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 启用应用单点登录
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.enableSSO(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{id}/sso/enable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建应用多因素认证配置
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.createMFA(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{id}/mfa
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 已配置的idp conn id
|
|
|
|
|
config_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 删除应用多因素认证配置
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.deleteMFA(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/applications/{app_id}/mfa/{config_id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
config_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建应用认证源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.createIDP(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{id}/idp
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 已配置的idp conn id
|
|
|
|
|
config_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 删除应用认证源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.deleteIDPConfig(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/applications/{app_id}/idp/{config_id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
config_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 启用应用认证协议
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.enableProtocol(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{app_id}/protocols/{protocol_type}/enable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
protocol_type: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 禁用应用认证协议
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.disableProtocol(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{app_id}/protocols/{protocol_type}/disable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
protocol_type: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询应用认证协议列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.getProtocols(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/applications/{id}/protocols
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
status?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询应用认证协议
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.getProtocol(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/applications/{app_id}/protocols/{protocol_type}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
protocol_type: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新应用认证协议
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.modifyProtocol(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/applications/{app_id}/protocols/{protocol_type}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
protocol_type: string;
|
|
|
|
|
// 配置参数
|
|
|
|
|
config_content: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.createAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{id}/accounts
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
user_id: string;
|
|
|
|
|
username: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
acc_name: string;
|
|
|
|
|
acc_name_displayed?: string;
|
|
|
|
|
acc_source?: string;
|
|
|
|
|
acc_password: string;
|
|
|
|
|
// 1启用,0禁用
|
|
|
|
|
acc_status: string;
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.modifyAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/applications/{app_id}/accounts/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
user_id?: string;
|
|
|
|
|
app_id?: string;
|
|
|
|
|
acc_name?: string;
|
|
|
|
|
acc_name_displayed?: string;
|
|
|
|
|
acc_source?: string;
|
|
|
|
|
acc_password?: string;
|
|
|
|
|
// 1启用,0禁用
|
|
|
|
|
acc_status?: string;
|
|
|
|
|
sys_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
free_ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
message?: string;
|
|
|
|
|
data?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 启用应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.enableAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{app_id}/accounts/{id}/enable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 禁用应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.disableAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/applications/{app_id}/accounts/{id}/disable
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 删除应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.deleteAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/applications/{app_id}/accounts/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 APP ID 查询应用子账号列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.getAccountsByApp(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/applications/{app_id}/accounts
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
user_id?: string;
|
|
|
|
|
acc_status?: string;
|
|
|
|
|
acc_name?: string;
|
|
|
|
|
page_num?: integer;
|
|
|
|
|
page_size?: integer;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
records: {
|
|
|
|
|
id: string;
|
|
|
|
|
user_id: string;
|
|
|
|
|
username: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
app_name: string;
|
|
|
|
|
acc_name: string;
|
|
|
|
|
acc_name_displayed: string;
|
|
|
|
|
acc_source: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
acc_password: string;
|
|
|
|
|
acc_status: string;
|
|
|
|
|
acc_sync_status: string;
|
|
|
|
|
acc_prop: {
|
|
|
|
|
}
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
total?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询应用子账号列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.getAccounts(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/application-accounts
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id?: string;
|
|
|
|
|
user_id?: string;
|
|
|
|
|
acc_status?: string;
|
|
|
|
|
acc_name?: string;
|
|
|
|
|
page_num?: integer;
|
|
|
|
|
page_size?: integer;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
records: {
|
|
|
|
|
id: string;
|
|
|
|
|
user_id: string;
|
|
|
|
|
username: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
app_name: string;
|
|
|
|
|
acc_name: string;
|
|
|
|
|
acc_name_displayed: string;
|
|
|
|
|
acc_source: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
acc_password: string;
|
|
|
|
|
acc_status: string;
|
|
|
|
|
acc_sync_status: string;
|
|
|
|
|
acc_prop: {
|
|
|
|
|
}
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
total?: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 ID 查询应用子账号
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.app.getAccount(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/applications/{app_id}/accounts/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
app_id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
user_id: string;
|
|
|
|
|
username: string;
|
|
|
|
|
app_id: string;
|
|
|
|
|
app_name: string;
|
|
|
|
|
acc_name: string;
|
|
|
|
|
acc_name_displayed: string;
|
|
|
|
|
acc_source: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
acc_password: string;
|
|
|
|
|
acc_status: string;
|
|
|
|
|
acc_sync_status: string;
|
|
|
|
|
acc_prop: {
|
|
|
|
|
}
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### permission
|
|
|
|
|
|
|
|
|
|
#### 获取权限列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getPrivileges(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/privileges
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
identity_id?: string;
|
|
|
|
|
identity_type?: string;
|
|
|
|
|
identity_name?: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
object_type?: string;
|
|
|
|
|
object_code?: string;
|
|
|
|
|
affect?: string;
|
|
|
|
|
page_num?: string;
|
|
|
|
|
page_size?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 数据总数
|
|
|
|
|
total_num?: number;
|
|
|
|
|
// 当前页数(废弃)
|
|
|
|
|
current_page?: number;
|
|
|
|
|
data: {
|
|
|
|
|
id: number;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
auth_unit_rule_id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
object_type: string;
|
|
|
|
|
object_code: string;
|
|
|
|
|
affect_scope: string;
|
|
|
|
|
affect: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 获取授权单元列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getAuthUnits(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/auth-units
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
identity_id?: string;
|
|
|
|
|
identity_type?: string;
|
|
|
|
|
identity_name?: string;
|
|
|
|
|
page_num?: string;
|
|
|
|
|
page_size?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 总数量
|
|
|
|
|
total_num?: number;
|
|
|
|
|
data: {
|
|
|
|
|
id: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
// user 用户 ,programmer 编程者,node 组织/自定义关系
|
|
|
|
|
identity_type: string;
|
|
|
|
|
rules: {
|
|
|
|
|
id: string;
|
|
|
|
|
auth_unit_id: string;
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
applicatioin_name: string;
|
|
|
|
|
is_global: boolean;
|
|
|
|
|
description: string;
|
|
|
|
|
type: string;
|
|
|
|
|
code: string;
|
|
|
|
|
uri?: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
selected_actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
members: {
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
// 当resource存在时
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
// 当 resource 存在时表示 resource_code
|
|
|
|
|
//
|
|
|
|
|
// 当 resource_set存在时表示 resource_set_code
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
application_name: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
inherited: boolean;
|
|
|
|
|
}[];
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 ID 查询授权单元
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getAuthUnit(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/auth-units/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
// user 用户 ,programmer 编程者,node 组织/自定义关系
|
|
|
|
|
identity_type: string;
|
|
|
|
|
rules: {
|
|
|
|
|
id: string;
|
|
|
|
|
auth_unit_id: string;
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
applicatioin_name: string;
|
|
|
|
|
is_global: boolean;
|
|
|
|
|
description: string;
|
|
|
|
|
type: string;
|
|
|
|
|
code: string;
|
|
|
|
|
uri?: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
selected_actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
members: {
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
// 当resource存在时
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
// 当 resource 存在时表示 resource_code
|
|
|
|
|
//
|
|
|
|
|
// 当 resource_set存在时表示 resource_set_code
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
application_name: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
inherited: boolean;
|
|
|
|
|
}[];
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 批量创建授权规则
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.createAuthUnitRules(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/batch/auth-unit-rules
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
identities: {
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
// user 用户 ,programmer 编程者,node 组织/自定义关系
|
|
|
|
|
identity_type: string;
|
|
|
|
|
}[];
|
|
|
|
|
rules: {
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
// 当match_all_resources=true时必填
|
|
|
|
|
application_id?: string;
|
|
|
|
|
// 当match_all_resources=true时必填
|
|
|
|
|
application_name?: string;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
application: {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
// 用于标识应用(尤其是在使用全局资源的场景下)
|
|
|
|
|
owner_app_id: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新授权规则
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.modifyAuthUnit(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/auth-units/{rid}/rules/{tid}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
rid: string;
|
|
|
|
|
tid: string;
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
// 当match_all_resources=true时必填
|
|
|
|
|
application_id?: string;
|
|
|
|
|
// 当match_all_resources=true时必填
|
|
|
|
|
application_name?: string;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
application: {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询授权单元下的授权规则列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getAuthUnitsRules(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/auth-units/{rid}/rules
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
rid: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
type?: string;
|
|
|
|
|
code?: string;
|
|
|
|
|
self_only?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
resource_match_all_resources?: string;
|
|
|
|
|
resource_match_all_actions?: string;
|
|
|
|
|
resource_set_id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
auth_unit_id: string;
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
applicatioin_name: string;
|
|
|
|
|
is_global: boolean;
|
|
|
|
|
description: string;
|
|
|
|
|
type: string;
|
|
|
|
|
code: string;
|
|
|
|
|
uri?: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
selected_actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
members: {
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
// 当resource存在时
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
// 当 resource 存在时表示 resource_code
|
|
|
|
|
//
|
|
|
|
|
// 当 resource_set存在时表示 resource_set_code
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
application_name: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
inherited: boolean;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询授权规则列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.queryAuthUnitsRules(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/auth-unit-rules
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
application_id?: string;
|
|
|
|
|
type?: string;
|
|
|
|
|
code?: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_name?: string;
|
|
|
|
|
self_only?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
resource_match_all_resources?: string;
|
|
|
|
|
resource_match_all_actions?: string;
|
|
|
|
|
resource_set_id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
auth_unit_id: string;
|
|
|
|
|
resource: {
|
|
|
|
|
id: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
applicatioin_name: string;
|
|
|
|
|
is_global: boolean;
|
|
|
|
|
description: string;
|
|
|
|
|
type: string;
|
|
|
|
|
code: string;
|
|
|
|
|
uri?: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
selected_actions?: string;[];
|
|
|
|
|
match_all_actions?: boolean;
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
resource_set: {
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
members: {
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
match_all_resources?: boolean;
|
|
|
|
|
}
|
|
|
|
|
// allow/deny
|
|
|
|
|
affect: string;
|
|
|
|
|
// 当resource存在时
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
// 当 resource 存在时表示 resource_code
|
|
|
|
|
//
|
|
|
|
|
// 当 resource_set存在时表示 resource_set_code
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
application_name: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
inherited: boolean;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 批量删除授权规则
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.deleteAuthUnitRules(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/batch/auth-unit-rules
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建资源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.createResource(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/resources
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 资源代码
|
|
|
|
|
code: string;
|
|
|
|
|
// 应用id
|
|
|
|
|
application_id: number;
|
|
|
|
|
// 资源类型,data/api/ui
|
|
|
|
|
type: string;
|
|
|
|
|
// 资源URI, 当type=api/ui 时有效
|
|
|
|
|
uri?: string;
|
|
|
|
|
actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 资源id
|
|
|
|
|
resource_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新资源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.modifyResource(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/resources/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 资源URI, 当type=api/ui 时有效
|
|
|
|
|
uri?: string;
|
|
|
|
|
actions: {
|
|
|
|
|
// 如果不携带id,会认为是新创建的code
|
|
|
|
|
id?: string;
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询资源列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResources(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resources
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
application_id: string;
|
|
|
|
|
type?: string;
|
|
|
|
|
code?: string;
|
|
|
|
|
include_global?: string;
|
|
|
|
|
page_num?: string;
|
|
|
|
|
page_size?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 数据总数
|
|
|
|
|
total_num?: number;
|
|
|
|
|
data: {
|
|
|
|
|
// 资源id
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者id
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户id
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
// 应用id
|
|
|
|
|
application_id?: string;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 类型
|
|
|
|
|
type?: string;
|
|
|
|
|
// 代码
|
|
|
|
|
code?: string;
|
|
|
|
|
// 修改时间 rfc3339
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 创建时间 rfc3339
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 ID 查询资源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResource(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resources/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 资源id
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者id
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户id
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
// 应用id
|
|
|
|
|
application_id?: string;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 类型
|
|
|
|
|
type?: string;
|
|
|
|
|
// 代码
|
|
|
|
|
code?: string;
|
|
|
|
|
// 修改时间 rfc3339
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// 创建时间 rfc3339
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 删除资源
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.deleteResources(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/batch/resources
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建资源集合
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.createResourceSet(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/resource-sets
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
X-Tenant-id: string;
|
|
|
|
|
// 应用id
|
|
|
|
|
application_id: string;
|
|
|
|
|
// 集合代码
|
|
|
|
|
code: string;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: number;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新资源集合
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.modifyResourceSet(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/resource-sets/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
X-Tenant-Id: string;
|
|
|
|
|
id: string;
|
|
|
|
|
// 集合代码
|
|
|
|
|
code: string;
|
|
|
|
|
// 描述
|
|
|
|
|
description: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询资源集合列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResourceSets(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resource-sets
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
code?: string;
|
|
|
|
|
application_id: string;
|
|
|
|
|
include_global?: string;
|
|
|
|
|
page_num?: string;
|
|
|
|
|
page_size?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 数据总数
|
|
|
|
|
total_num?: number;
|
|
|
|
|
data: {
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 ID 查询资源集合
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResourceSet(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resource-sets/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
code?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 创建资源集合成员
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.createResourceSetMember(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
POST /v1/resource-sets/{id}/members
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
resource_id: number;
|
|
|
|
|
resource_scope: string;
|
|
|
|
|
resource_actions?: string;[];
|
|
|
|
|
match_all_actions: boolean;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 成员id
|
|
|
|
|
member_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 更新资源集合成员
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.modifyResourceSetMember(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
PUT /v1/resource-sets/{sid}/members/{mid}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
sid: string;
|
|
|
|
|
mid: string;
|
|
|
|
|
resource_id: number;
|
|
|
|
|
resource_scope: string;
|
|
|
|
|
ResourceActions: {
|
|
|
|
|
// 操作id
|
|
|
|
|
id: number;
|
|
|
|
|
// 操作代码
|
|
|
|
|
code: string;
|
|
|
|
|
}[];
|
|
|
|
|
match_all_actions: boolean;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 查询资源集合成员列表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResourceMembers(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resource-sets/{sid}/members
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
sid: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
page_num?: string;
|
|
|
|
|
page_size?: string;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 数据总数
|
|
|
|
|
total_num?: number;
|
|
|
|
|
data: {
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 按 ID 查询资源集合成员
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.getResourceMember(params);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/resource-sets/{sid}/members/{mid}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
sid: string;
|
|
|
|
|
mid: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
set_id?: string;
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
resource_id?: string;
|
|
|
|
|
application_id?: string;
|
|
|
|
|
application_name?: string;
|
|
|
|
|
is_global?: boolean;
|
|
|
|
|
resource_type?: string;
|
|
|
|
|
resource_code?: string;
|
|
|
|
|
resource_scope?: string;
|
|
|
|
|
resource_actions: {
|
|
|
|
|
code: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
selected_resource_actions?: string;[];
|
|
|
|
|
match_all_resource_actions: boolean;
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
time_created?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 授权应用
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.permission.authorizeApplications(params);
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/batch/authz-apps
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
X-Tenant-Id: string;
|
|
|
|
|
identities: {
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_name: string;
|
|
|
|
|
// user 用户 ,programmer 编程者,node 组织/自定义关系
|
|
|
|
|
identity_type: string;
|
|
|
|
|
}[];
|
|
|
|
|
application_id: string;
|
|
|
|
|
// allow, deny
|
|
|
|
|
affect: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
`application/json`
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
#### 查询已授权应用列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.permission.listAuthorizedApplications(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
GET /v1/authz-apps
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
{
|
|
|
|
|
X-Tenant-Id: string;
|
|
|
|
|
identity_id: string;
|
|
|
|
|
identity_type: string;
|
|
|
|
|
type?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
developer_id: string;
|
|
|
|
|
tenant_id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
// - 0 默认应用
|
|
|
|
|
// - 1 自建应用
|
|
|
|
|
// - 2 模板应用
|
|
|
|
|
// - 3 组件应用
|
|
|
|
|
type: string;
|
|
|
|
|
access_policy: string;
|
|
|
|
|
decr?: string;
|
|
|
|
|
// base64编码
|
|
|
|
|
logo: string;
|
|
|
|
|
access_url: string;
|
|
|
|
|
enabled_protocols?: string;[];
|
|
|
|
|
// rfc3339
|
|
|
|
|
time_modified: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
time_created: string;
|
|
|
|
|
}[];
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
### organization
|
|
|
|
|
|
|
|
|
|
#### 创建组织关系
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.createOrganization(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
POST /v1/core-objects
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
object_display_name: string;
|
|
|
|
|
// 固定值:tree
|
|
|
|
|
object_type: string;
|
|
|
|
|
// 唯一,不可改,外键关联引用
|
|
|
|
|
object_code: string;
|
|
|
|
|
object_props: string;
|
|
|
|
|
// 是否默认组织关系,1是,0否
|
|
|
|
|
is_default: string;
|
|
|
|
|
status: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 创建ID
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 查询父节点
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getNodeParent(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/tree-nodes/{id}/parent
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 删除节点
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteNode(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/tree-nodes/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
object_code: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 获取组织关系列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getOrganizations(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/core-objects
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
object_display_name: string;
|
|
|
|
|
// 固定值:tree
|
|
|
|
|
object_type: string;
|
|
|
|
|
// 唯一,不可改,外键关联引用
|
|
|
|
|
object_code: string;
|
|
|
|
|
object_props: string;
|
|
|
|
|
// 是否默认组织关系,1是,0否
|
|
|
|
|
is_default: string;
|
|
|
|
|
status: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 修改组织关系基本信息
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.updateOrganization(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
PATCH /v1/core-objects/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
object_display_name: string;
|
|
|
|
|
// 固定值:tree
|
|
|
|
|
object_type: string;
|
|
|
|
|
// 唯一,不可改,外键关联引用
|
|
|
|
|
object_code: string;
|
|
|
|
|
object_props: string;
|
|
|
|
|
// 是否默认组织关系,1是,0否
|
|
|
|
|
is_default: string;
|
|
|
|
|
status: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 获取组织关系基本信息
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getOrganization(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/core-objects/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
code: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
object_display_name: string;
|
|
|
|
|
// 固定值:tree
|
|
|
|
|
object_type: string;
|
|
|
|
|
// 唯一,不可改,外键关联引用
|
|
|
|
|
object_code: string;
|
|
|
|
|
object_props: string;
|
|
|
|
|
// 是否默认组织关系,1是,0否
|
|
|
|
|
is_default: string;
|
|
|
|
|
status: string;
|
|
|
|
|
time_created: string;
|
|
|
|
|
time_modified: string;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 删除组织关系
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteOrganization(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/core-objects/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
#### 添加用户到节点 TODO
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.addUserToNode(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
POST /v1/tree-users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 关联扩展信息
|
|
|
|
|
relation_data?: string;
|
|
|
|
|
// user_id
|
|
|
|
|
user_ids?: string;[];
|
|
|
|
|
// 用于区分多重关联
|
|
|
|
|
relation_type?: string;
|
|
|
|
|
// 1是,0否
|
|
|
|
|
is_default?: string;
|
|
|
|
|
node_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 更新用户节点
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.updateMember(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
PATCH /v1/tree-users/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 移动节点move, 设置为默认关系as-default
|
|
|
|
|
action: string;
|
|
|
|
|
// 1是,0否
|
|
|
|
|
is_default?: string;
|
|
|
|
|
// 移动前节点ID
|
|
|
|
|
source_node_id?: string;
|
|
|
|
|
// 移动后节点ID
|
|
|
|
|
dest_node_id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 获取与用户关联的组织关系列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getMembers(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/tree-users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
user_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 全局唯一ID
|
|
|
|
|
id: string;
|
|
|
|
|
// 节点ID
|
|
|
|
|
node_id: string;
|
|
|
|
|
// 用户ID
|
|
|
|
|
user_id: string;
|
|
|
|
|
// 所属组织关系路径
|
|
|
|
|
path: string;
|
|
|
|
|
// 显示名
|
|
|
|
|
display_name: string;
|
|
|
|
|
// 用户名
|
|
|
|
|
username: string;
|
|
|
|
|
// 关联类型(用于区分多重关联)
|
|
|
|
|
relation_type?: string;
|
|
|
|
|
// 关联扩展信息
|
|
|
|
|
relation_data?: string;
|
|
|
|
|
// 是否默认关系
|
|
|
|
|
is_default?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created: string;
|
|
|
|
|
// 修改时间
|
|
|
|
|
time_modified: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status: string;
|
|
|
|
|
tree_node: {
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 获取成员信息列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getNodeMembers(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/tree-nodes/{id}/tree-users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
relation_type?: string;
|
|
|
|
|
is_default?: string;
|
|
|
|
|
display_name?: string;
|
|
|
|
|
username?: string;
|
|
|
|
|
mode?: string;
|
|
|
|
|
page_num?: integer;
|
|
|
|
|
page_size?: integer;
|
|
|
|
|
page_sort?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 总数
|
|
|
|
|
total_num: integer;
|
|
|
|
|
// 当前页码
|
|
|
|
|
current_page: integer;
|
|
|
|
|
data: {
|
|
|
|
|
// 用户ID
|
|
|
|
|
user_id: string;
|
|
|
|
|
// 用户名
|
|
|
|
|
username: string;
|
|
|
|
|
// 用户显示名
|
|
|
|
|
display_name: string;
|
|
|
|
|
node_info: {
|
|
|
|
|
// 全局唯一ID
|
|
|
|
|
id: string;
|
|
|
|
|
// 节点ID
|
|
|
|
|
node_id: string;
|
|
|
|
|
// 用户ID
|
|
|
|
|
user_id: string;
|
|
|
|
|
// 所属组织关系路径
|
|
|
|
|
path: string;
|
|
|
|
|
// 显示名
|
|
|
|
|
display_name: string;
|
|
|
|
|
// 用户名
|
|
|
|
|
username: string;
|
|
|
|
|
// 关联类型(用于区分多重关联)
|
|
|
|
|
relation_type?: string;
|
|
|
|
|
// 关联扩展信息
|
|
|
|
|
relation_data?: string;
|
|
|
|
|
// 是否默认关系
|
|
|
|
|
is_default?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created: string;
|
|
|
|
|
// 修改时间
|
|
|
|
|
time_modified: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status: string;
|
|
|
|
|
}[];
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 批量从组织关系中移除用户-内部使用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteNodeMembers(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/tree-nodes/{node_id}/tree-users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
node_id: string;
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// node_id
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 从组织关系中移除用户-内部使用
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteMember(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/tree-users/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
ids?: string;[];
|
|
|
|
|
// 节点ID
|
|
|
|
|
node_id: string;
|
|
|
|
|
// 用户原始ID
|
|
|
|
|
user_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 从节点移除用户
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteMembers(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/tree-users
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
node_id: string;
|
|
|
|
|
// 用户原始ID
|
|
|
|
|
user_id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 创建节点
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.createNode(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
POST /v1/tree-nodes
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 编辑节点
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.updateNode(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
PATCH /v1/tree-nodes/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 系统分配的用于处理树型关系的编码
|
|
|
|
|
sys_code?: string;
|
|
|
|
|
// 节点代码
|
|
|
|
|
code?: string;
|
|
|
|
|
// 是否指针节点(0普通结点,1指针结点)
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 操作人ID
|
|
|
|
|
operator_id?: number;
|
|
|
|
|
// 备注
|
|
|
|
|
description?: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: number;
|
|
|
|
|
// 动态节点的条件(如满足某后缀表达式)
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 源上级节点ID(根为0)
|
|
|
|
|
source_parent_id?: number;
|
|
|
|
|
// 目标上级节点ID(根为0)
|
|
|
|
|
dest_parent_id?: number;
|
|
|
|
|
// 节点名称
|
|
|
|
|
name?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 节点类型(OBJ_ID,组织,角色,岗位,职级等)
|
|
|
|
|
object_code?: string;
|
|
|
|
|
// ARN
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 显示顺序
|
|
|
|
|
seq?: number;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
#### 删除节点 TODO
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.deleteChildrenNodes(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
DELETE /v1/tree-nodes/{id}/children
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
object_code: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 查询节点信息列表
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getNodes(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/tree-nodes
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
object_code: string;
|
|
|
|
|
name?: string;
|
|
|
|
|
code?: string;
|
|
|
|
|
tag?: string;
|
|
|
|
|
time_modified_from?: string;
|
|
|
|
|
time_modified_to?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 查询节点信息
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getNode(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
|
|
|
|
GET /v1/tree-nodes/{id}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
#### 获取子节点列表
|
2023-11-16 19:38:44 +08:00
|
|
|
|
|
2023-12-03 21:09:35 +08:00
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.organization.getChildrenNodes(params);
|
2023-12-03 21:09:35 +08:00
|
|
|
|
```
|
2023-11-16 19:38:44 +08:00
|
|
|
|
|
2023-12-03 15:59:54 +08:00
|
|
|
|
GET /v1/tree-nodes/{id}/children
|
2023-11-16 19:38:44 +08:00
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
mode: string;
|
|
|
|
|
object_code: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// 节点ID
|
|
|
|
|
id?: string;
|
|
|
|
|
// 开发者ID
|
|
|
|
|
developer_id?: string;
|
|
|
|
|
// 租户ID
|
|
|
|
|
tenant_id?: string;
|
|
|
|
|
arn?: string;
|
|
|
|
|
// 创建时间
|
|
|
|
|
time_created?: string;
|
|
|
|
|
// 用于定义节点类型,目前支持:org(组织),role(角色),position(岗位),group(组)
|
|
|
|
|
tag?: string;
|
|
|
|
|
// 状态
|
|
|
|
|
status?: string;
|
|
|
|
|
// 是否指针类型
|
|
|
|
|
is_pointer?: string;
|
|
|
|
|
// 节点code
|
|
|
|
|
code: string;
|
|
|
|
|
// 节点名字
|
|
|
|
|
name: string;
|
|
|
|
|
// 抽象权限容器的ARN
|
|
|
|
|
perm_namespace_arn?: string;
|
|
|
|
|
condition?: string;
|
|
|
|
|
// 是否动态节点(0普通结点,1动态结点)
|
|
|
|
|
is_dynamic?: string;
|
|
|
|
|
// 系统code
|
|
|
|
|
sys_code: string;
|
|
|
|
|
// 操作者id
|
|
|
|
|
operator_id?: string;
|
|
|
|
|
// 指针指向的实体节点
|
|
|
|
|
pointer_id?: string;
|
|
|
|
|
// 序号
|
|
|
|
|
seq?: integer;
|
|
|
|
|
// 描述
|
|
|
|
|
description?: string;
|
|
|
|
|
// 最后修改时间
|
|
|
|
|
time_modified?: string;
|
|
|
|
|
// OBJ_ID,组织,角色,岗位,职级等
|
|
|
|
|
object_code: string;
|
|
|
|
|
// 父节点id
|
|
|
|
|
parent_id?: string;
|
|
|
|
|
// 额外属性
|
|
|
|
|
ext_props: {
|
|
|
|
|
}
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### storage
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 获取 Bucket 列表
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.getBuckets(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/buckets
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
last?: string;
|
|
|
|
|
limit?: integer;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
// 单位:byte
|
|
|
|
|
data_size: integer;
|
|
|
|
|
object_count: integer;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 获取 Object 列表
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.getObjects(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/buckets/{bucket}/objects
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
last?: string;
|
|
|
|
|
limit?: integer;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
updated_at: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
created_at: string;
|
|
|
|
|
}[];
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 获取 Bucket 详情
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.getBucket(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/buckets/{bucket}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
// 单位:byte
|
|
|
|
|
data_size: integer;
|
|
|
|
|
object_count: integer;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 删除 Bucket
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.deleteBucket(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/buckets/{bucket}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 创建 Object
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.saveObject(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
POST /v1/buckets/{bucket}/objects
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 获取 Object 详情
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.getObject(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/buckets/{bucket}/objects/{key}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
updated_at: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
created_at: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2023-12-04 16:18:51 +08:00
|
|
|
|
|
|
|
|
|
#### 删除 Object
|
|
|
|
|
|
|
|
|
|
``` js
|
2023-12-06 19:08:25 +08:00
|
|
|
|
const { data } = await op.api.storage.deleteObject(params);
|
2023-12-04 16:18:51 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
DELETE /v1/buckets/{bucket}/objects/{key}
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 参数
|
|
|
|
|
|
2023-12-06 19:08:25 +08:00
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
key_as_prefix?: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2023-12-06 19:14:55 +08:00
|
|
|
|
##### 响应
|
2023-12-06 19:08:25 +08:00
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
bucket: string;
|
|
|
|
|
key: string;
|
|
|
|
|
value: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
updated_at: string;
|
|
|
|
|
// rfc3339
|
|
|
|
|
created_at: string;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-20 11:15:47 +08:00
|
|
|
|
### system
|
|
|
|
|
|
|
|
|
|
#### 获取租户环境变量字典表
|
|
|
|
|
|
|
|
|
|
``` js
|
|
|
|
|
const { data } = await op.api.user.listEnvVariables();
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
GET /v1/system/dictionaries/tenant?category=env_variables
|
|
|
|
|
|
|
|
|
|
##### 参数
|
|
|
|
|
|
|
|
|
|
无
|
|
|
|
|
|
|
|
|
|
##### 响应
|
|
|
|
|
|
|
|
|
|
- 200 成功
|
|
|
|
|
|
|
|
|
|
`application/json`
|
|
|
|
|
|
|
|
|
|
``` ts
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
keycode: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}[]
|
|
|
|
|
```
|