@simplysm/sd-cli 14.1.17 → 14.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/commands/init/templates/client/src/app/home/master/user.detail.ts.hbs +4 -0
- package/src/commands/init/templates/client/src/app/home/master/user.list.ts.hbs +4 -0
- package/src/commands/init/templates/server/src/services/auth.service.ts.hbs +2 -2
- package/src/commands/init/templates/server/src/services/user.service.ts.hbs +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/sd-cli",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.18",
|
|
4
4
|
"description": "Simplysm package - CLI tool",
|
|
5
5
|
"author": "simplysm",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"ws": "^8.21.0",
|
|
45
45
|
"yaml": "^2.9.0",
|
|
46
46
|
"yargs": "^18.0.0",
|
|
47
|
-
"@simplysm/core-common": "14.1.
|
|
48
|
-
"@simplysm/storage": "14.1.
|
|
49
|
-
"@simplysm/core-node": "14.1.
|
|
47
|
+
"@simplysm/core-common": "14.1.18",
|
|
48
|
+
"@simplysm/storage": "14.1.18",
|
|
49
|
+
"@simplysm/core-node": "14.1.18"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@angular/core": "^22.0.6",
|
|
@@ -237,6 +237,8 @@ export class {{userEntityPascal}}Detail implements SdModalContentDef<{ id: numbe
|
|
|
237
237
|
});
|
|
238
238
|
|
|
239
239
|
await this._appSharedData.emitAsync("{{userEntityLabel}}", [{{userEntityCamel}}Id]);
|
|
240
|
+
// 삭제된 {{userEntityLabel}} 세션에 인증정보 변경 통지 → tryReloadAuth 재검증(삭제 계정은 로그아웃 귀결)
|
|
241
|
+
await this._appService.authInfoChangedEvent.emit((info) => info.{{userEntityCamel}}Id === {{userEntityCamel}}Id, undefined);
|
|
240
242
|
this._sdToast.success("삭제되었습니다.");
|
|
241
243
|
this.close.emit({ id: {{userEntityCamel}}Id });
|
|
242
244
|
});
|
|
@@ -279,6 +281,8 @@ export class {{userEntityPascal}}Detail implements SdModalContentDef<{ id: numbe
|
|
|
279
281
|
});
|
|
280
282
|
|
|
281
283
|
await this._appSharedData.emitAsync("{{userEntityLabel}}", [{{userEntityCamel}}Id]);
|
|
284
|
+
// 복구된 {{userEntityLabel}} 세션에 인증정보 변경 통지 → authInfo·권한 재로드
|
|
285
|
+
await this._appService.authInfoChangedEvent.emit((info) => info.{{userEntityCamel}}Id === {{userEntityCamel}}Id, undefined);
|
|
282
286
|
this._sdToast.success("복구되었습니다.");
|
|
283
287
|
await this._refresh();
|
|
284
288
|
});
|
|
@@ -415,6 +415,8 @@ export class {{userEntityPascal}}List {
|
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
417
|
await this._appSharedData.emitAsync("{{userEntityLabel}}", ids);
|
|
418
|
+
// 삭제된 {{userEntityLabel}} 세션에 인증정보 변경 통지 → tryReloadAuth 재검증(삭제 계정은 로그아웃 귀결)
|
|
419
|
+
await this._appService.authInfoChangedEvent.emit((info) => ids.includes(info.{{userEntityCamel}}Id), undefined);
|
|
418
420
|
this._sdToast.success("삭제되었습니다.");
|
|
419
421
|
await this._refresh();
|
|
420
422
|
});
|
|
@@ -456,6 +458,8 @@ export class {{userEntityPascal}}List {
|
|
|
456
458
|
}
|
|
457
459
|
});
|
|
458
460
|
await this._appSharedData.emitAsync("{{userEntityLabel}}", ids);
|
|
461
|
+
// 복구된 {{userEntityLabel}} 세션에 인증정보 변경 통지 → authInfo·권한 재로드
|
|
462
|
+
await this._appService.authInfoChangedEvent.emit((info) => ids.includes(info.{{userEntityCamel}}Id), undefined);
|
|
459
463
|
this._sdToast.success("복구되었습니다.");
|
|
460
464
|
await this._refresh();
|
|
461
465
|
});
|
|
@@ -79,7 +79,7 @@ export const AuthService = defineService("AuthService", (ctx) => {
|
|
|
79
79
|
return orm.connect(async (db) => {
|
|
80
80
|
const {{userEntityCamel}} = await db
|
|
81
81
|
.{{userEntityCamel}}()
|
|
82
|
-
.where((c) => [expr.eq(c.loginId, loginId)])
|
|
82
|
+
.where((c) => [expr.eq(c.loginId, loginId), expr.eq(c.isDeleted, false)])
|
|
83
83
|
.include((item) => item.role)
|
|
84
84
|
.join("permissions", (qr, e) =>
|
|
85
85
|
qr
|
|
@@ -142,7 +142,7 @@ export const AuthService = defineService("AuthService", (ctx) => {
|
|
|
142
142
|
const {{userEntityCamel}} = await db
|
|
143
143
|
.{{userEntityCamel}}()
|
|
144
144
|
.include((item) => item.role)
|
|
145
|
-
.where((c) => [expr.eq(c.id, currentAuth.{{userEntityCamel}}Id)])
|
|
145
|
+
.where((c) => [expr.eq(c.id, currentAuth.{{userEntityCamel}}Id), expr.eq(c.isDeleted, false)])
|
|
146
146
|
.join("permissions", (qr, e) =>
|
|
147
147
|
qr
|
|
148
148
|
.from(RolePermission)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { auth, defineService, type ServiceMethods } from "@simplysm/service-server";
|
|
2
2
|
import { expr } from "@simplysm/orm-common";
|
|
3
|
+
import { AuthInfoChangedEvent } from "@{{workspaceName}}/common";
|
|
3
4
|
import bcrypt from "bcrypt";
|
|
4
5
|
import { getOrm } from "../utils/orm.utils";
|
|
5
6
|
import type { IAuthData } from "./auth.service";
|
|
@@ -76,7 +77,7 @@ export const {{userEntityPascal}}Service = defineService("{{userEntityPascal}}Se
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
const orm = await getOrm(ctx);
|
|
79
|
-
|
|
80
|
+
const saved = await orm.connect(async (db) => {
|
|
80
81
|
const results: { id: number }[] = [];
|
|
81
82
|
const activeNames: string[] = [];
|
|
82
83
|
|
|
@@ -184,6 +185,18 @@ export const {{userEntityPascal}}Service = defineService("{{userEntityPascal}}Se
|
|
|
184
185
|
|
|
185
186
|
return results;
|
|
186
187
|
});
|
|
188
|
+
|
|
189
|
+
// 저장으로 역할/로그인ID/비밀번호가 바뀌었을 수 있으므로, 저장된 각 사용자 세션에 인증정보 변경 통지
|
|
190
|
+
// → 해당 세션이 authInfo·권한을 재로드. roleId 는 이번 저장으로 바뀔 수 있어 {{userEntityCamel}}Id 로 타겟.
|
|
191
|
+
for (const { id } of saved) {
|
|
192
|
+
await ctx.server.emitEvent(
|
|
193
|
+
AuthInfoChangedEvent,
|
|
194
|
+
(info) => info.{{userEntityCamel}}Id === id,
|
|
195
|
+
undefined,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return saved;
|
|
187
200
|
}),
|
|
188
201
|
};
|
|
189
202
|
});
|