download kk1

This commit is contained in:
kittapath 2024-11-15 09:29:24 +07:00
parent 0e0cfda81c
commit 4880522497
3 changed files with 10 additions and 34 deletions

View file

@ -143,7 +143,7 @@ export class ProfileEmployeeController extends Controller {
});
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
if (_workflow == false)
if (_workflow == false && req.user.sub != profile.keycloak)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
let ImgUrl: any;
if (profile?.avatar != null && profile?.avatarName != null) {
@ -292,8 +292,6 @@ export class ProfileEmployeeController extends Controller {
reportName: "docx-report",
data: mapData,
});
return new HttpSuccess(mapData);
}
/**
@ -312,13 +310,8 @@ export class ProfileEmployeeController extends Controller {
},
where: { id: id },
});
if (profiles) {
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profiles.id);
}
if (!profiles) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
let ImgUrl: any;
let ImgUrl: any = null;
let _ImgUrl: any = [];
if (profiles?.avatar != null && profiles?.avatarName != null) {
// await new CallAPI()
@ -327,6 +320,7 @@ export class ProfileEmployeeController extends Controller {
// ImgUrl = x.downloadUrl;
// })
// .catch();
let req_: any = req;
const token_ = "Bearer " + req_.headers.authorization.replace("Bearer ", "");