feat(api): 添加域名查询授权和租户码查询租户的接口
- 在 domain 模块中添加 getByDomain 函数,用于根据域名查询授权信息 - 在 tenant 模块中添加 getByCode函数,用于根据租户码查询租户信息
This commit is contained in:
@@ -104,3 +104,16 @@ export async function getDomain(id: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据域名查询授权
|
||||||
|
*/
|
||||||
|
export async function getByDomain(domain: string) {
|
||||||
|
const res = await request.get<ApiResult<Domain>>(
|
||||||
|
SERVER_API_URL + '/system/domain/getByDomain/' + domain
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -176,3 +176,16 @@ export async function initialization(roleId?: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code查询租户
|
||||||
|
*/
|
||||||
|
export async function getByCode(code: string) {
|
||||||
|
const res = await request.get<Tenant>(
|
||||||
|
SERVER_API_URL + '/system/tenant/getByCode/' + code
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user