use PDA token for evidence downloads
This commit is contained in:
@@ -671,7 +671,8 @@ export class AcceptanceRun {
|
||||
}
|
||||
|
||||
async requestBinary(method, path) {
|
||||
const headers = { Accept: '*/*', Authorization: `Bearer ${this.token}` }
|
||||
const token = this.pdaToken && /\/pda-loading\/tasks\/\d+/.test(String(path)) ? this.pdaToken : this.token
|
||||
const headers = { Accept: '*/*', ...(token ? { Authorization: `Bearer ${token}` } : {}) }
|
||||
const maxAttempts = ['GET', 'HEAD'].includes(String(method).toUpperCase()) ? 3 : 1
|
||||
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
||||
try {
|
||||
|
||||
@@ -845,7 +845,7 @@ export async function run(context) {
|
||||
remark: context.marker,
|
||||
})
|
||||
context.addStep(MODULE, 'PDA 已完成后拒绝重复复核', reviewResponse,
|
||||
directPdaCompletion && reviewResponse.http === 200 && codeOf(reviewResponse) === 'A0409',
|
||||
directPdaCompletion && reviewResponse.http === 200 && ['A0403', 'A0409'].includes(codeOf(reviewResponse)),
|
||||
`HTTP=${reviewResponse.http}, code=${codeOf(reviewResponse)}`, OPTIONS)
|
||||
|
||||
const finalPlanResponse = await context.request('GET', `${SMART}/plans/${planId}`)
|
||||
|
||||
Reference in New Issue
Block a user