fix(api): 修复根据code查询租户时类型定义错误
- 修改getByCode函数中请求返回类型为ApiResult<Tenant> - 修正对返回数据的访问以匹配新的类型结构 - 确保类型安全和避免潜在运行时错误
This commit is contained in:
@@ -181,7 +181,7 @@ export async function initialization(roleId?: number) {
|
||||
* 根据code查询租户
|
||||
*/
|
||||
export async function getByCode(code: string) {
|
||||
const res = await request.get<Tenant>(
|
||||
const res = await request.get<ApiResult<Tenant>>(
|
||||
SERVER_API_URL + '/system/tenant/getByCode/' + code
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
|
||||
Reference in New Issue
Block a user