给所有请求都加上jwt,隐藏生成jwt的secret(放到.env中),隐藏app-secret(放在pm2运行配置文件中,后续直接读取环境配置即可)
This commit is contained in:
@@ -482,7 +482,7 @@ export async function getTaskDocuments(taskId: number, page: number = 1, pageSiz
|
||||
* @param auditStatus 审核状态
|
||||
* @returns 更新结果
|
||||
*/
|
||||
export async function updateDocumentAuditStatus(id: string, auditStatus: number): Promise<{
|
||||
export async function updateDocumentAuditStatus(id: string, auditStatus: number, frontendJWT?: string): Promise<{
|
||||
success?: boolean;
|
||||
error?: string;
|
||||
status?: number;
|
||||
@@ -491,13 +491,14 @@ export async function updateDocumentAuditStatus(id: string, auditStatus: number)
|
||||
if (!id) {
|
||||
return { error: '文件ID不能为空', status: 400 };
|
||||
}
|
||||
|
||||
|
||||
const response = await postgrestPut<TaskDocument, Partial<TaskDocument>>(
|
||||
'documents',
|
||||
{ audit_status: auditStatus },
|
||||
{
|
||||
{
|
||||
id: parseInt(id)
|
||||
}
|
||||
},
|
||||
frontendJWT
|
||||
);
|
||||
|
||||
if (response.error) {
|
||||
|
||||
Reference in New Issue
Block a user