mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
fix: 升级mysql驱动,支持mysql8最新版本的认证
This commit is contained in:
@@ -6,7 +6,7 @@ typeorm:
|
||||
default:
|
||||
type: mysql # mariadb
|
||||
host: localhost
|
||||
port: 3306
|
||||
port: 3309
|
||||
username: root
|
||||
password: root
|
||||
database: certd
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
"mitt": "^3.0.1",
|
||||
"mwts": "^1.3.0",
|
||||
"mwtsc": "^1.15.1",
|
||||
"mysql": "^2.18.1",
|
||||
"mysql2": "^3.14.0",
|
||||
"nanoid": "^5.0.7",
|
||||
"node-forge": "^1.3.1",
|
||||
"nodemailer": "^6.9.16",
|
||||
|
||||
@@ -43,7 +43,7 @@ export class RoleService extends BaseService<RoleEntity> {
|
||||
async getByUserIds(ids: any) {
|
||||
return await this.userRoleService.find({
|
||||
where: {
|
||||
userId: In(ids),
|
||||
userId: In<number>(ids) as any,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -131,6 +131,7 @@ export class RoleService extends BaseService<RoleEntity> {
|
||||
|
||||
async delete(id: any) {
|
||||
const idArr = this.resolveIdArr(id);
|
||||
//@ts-ignore
|
||||
const urs = await this.userRoleService.find({ where: { roleId: In(idArr) } });
|
||||
if (urs.length > 0) {
|
||||
throw new Error('该角色已被用户使用,无法删除');
|
||||
|
||||
Reference in New Issue
Block a user