update module export data csv

This commit is contained in:
2024-11-30 09:38:23 +07:00
parent b75213da15
commit 37aa7842fd
8 changed files with 382 additions and 23 deletions

View File

@ -73,4 +73,12 @@ export default class CommonHelper {
return '';
}
static getKeyEnum(obj: any, key: any): any {
try {
return Object.values(obj)[Object.keys(obj)[key]]
} catch (e: any) {
return '';
}
}
}

View File

@ -15,7 +15,15 @@ export default class JwtHelper {
app.use(
expressjwt({
secret: publicKey, algorithms: ["RS256"]
secret: publicKey, algorithms: ["RS256"],
getToken: function fromHeaderOrQuerystring(req): any {
if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {
return req.headers.authorization.split(' ')[1];
} else if (req.query && req.query.token) {
return req.query.token;
}
return null;
},
}).unless({ path: ["/token"] }),
function (req: Request, res: Response, next: NextFunction) {
if (!req.auth?.data.id) {