Refactor: ts type inference

This commit is contained in:
unitwk 2023-01-29 11:49:53 +08:00
parent ae30f081d6
commit 66bdea83d8
2 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@ export interface IUser {
loginTime?: string;
instances?: Array<any>;
isInit?: boolean;
passWordType?: number;
}
export interface ICompleteUser {

View File

@ -34,7 +34,7 @@ router.del("/", permission({ level: 10 }), async (ctx: Koa.ParameterizedContext)
}
ctx.body = true;
} catch (error) {
ctx.throw(500, $t("router.user.deleteFailure"));
ctx.throw(500, $t("router.user.deleteFailure") as string);
}
});
@ -52,7 +52,7 @@ router.get(
let resultPage = userSystem.getQueryWrapper().selectPage(condition, page, pageSize);
// make a copy, delete redundant
resultPage = JSON.parse(JSON.stringify(resultPage));
resultPage.data.forEach((v) => {
resultPage.data.forEach((v: any) => {
delete v.passWord;
delete v.salt;
});