Merge branch 'v2-dev' into v2-plugin

This commit is contained in:
xiaojunnuo
2025-04-10 11:48:45 +08:00
12 changed files with 102 additions and 49 deletions
@@ -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('该角色已被用户使用,无法删除');
@@ -15,6 +15,7 @@ const defaultFilePrefix = 'db-backup';
icon: 'lucide:database-backup',
desc: '仅支持备份SQLite数据库',
group: pluginGroups.other.key,
showRunStrategy: true,
default: {
strategy: {
runStrategy: RunStrategy.AlwaysRun,
@@ -12,6 +12,7 @@ export type CustomScriptContext = {
icon: 'ri:javascript-line',
desc: '【仅管理员】运行自定义js脚本执行',
group: pluginGroups.other.key,
showRunStrategy:true,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,
@@ -6,6 +6,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput
icon: 'ri:rest-time-line',
desc: '等待一段时间',
group: pluginGroups.other.key,
showRunStrategy:true,
default: {
strategy: {
runStrategy: RunStrategy.SkipWhenSucceed,