打手端流转记录改为后台配置开关控制,默认关闭

- 新增 WORKER_ORDER_TIMELINE_VISIBLE 配置(默认 false):打手端订单详情不展示流转记录
- 打手端 events 接口按开关拦截(关闭时 403)
- profile 接口下发 orderTimelineVisible 供前端判断
- 管理端流转记录不受影响,始终可见
This commit is contained in:
yml2213
2026-08-16 19:42:16 +08:00
parent 950c4fd578
commit 9ed2e0d4fe
6 changed files with 27 additions and 4 deletions
+1
View File
@@ -151,6 +151,7 @@ PfQTPNA++KsXtwRX9M6Re3vkTDRsutIIWKtj8jqhUbbYS3vzS8GJnAWavUFVkR15
cooldownSeconds: 60,
dailyLimit: 10,
},
orderTimelineVisible: false,
},
}
}
+1
View File
@@ -165,6 +165,7 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
integerEnv('WORKER_SMS_CODE_TTL_SECONDS', ['worker', 'sms', 'codeTtlSeconds']),
integerEnv('WORKER_SMS_COOLDOWN_SECONDS', ['worker', 'sms', 'cooldownSeconds']),
integerEnv('WORKER_SMS_DAILY_LIMIT', ['worker', 'sms', 'dailyLimit']),
booleanEnv('WORKER_ORDER_TIMELINE_VISIBLE', ['worker', 'orderTimelineVisible']),
integerEnv('KUAISHOU_FEIFEI_TIMEOUT_MS', ['platforms', 'kuaishouFeifei', 'timeoutMs']),
stringEnv('KUAISHOU_FEIFEI_NOTIFY_URL', ['platforms', 'kuaishouFeifei', 'notifyUrl']),
kuaishouFeifeiProductRulesEnv('KUAISHOU_FEIFEI_PRODUCT_RULES_JSON', [
@@ -528,6 +528,7 @@ export async function getWorkerProfile(session: WorkerSession) {
},
levelProgress,
financeConfig,
orderTimelineVisible: runtimeConfig.worker.orderTimelineVisible === true,
}
}
@@ -1037,6 +1038,12 @@ export async function listWorkerMyOrders(query: JsonObject = {}, session: Worker
export async function getWorkerMyOrderEvents(workOrderId: number | string, session: WorkerSession) {
requireActiveWorkerSession(session)
if (runtimeConfig.worker.orderTimelineVisible !== true) {
throw createHttpError('流转记录暂未对打手开放', {
statusCode: 403,
errorCode: 'work_order_events_worker_disabled',
})
}
const workOrder = await getRequiredWorkOrder(workOrderId)
const workerId = Number(session.workerId)
const sharingShare = await getWorkOrderShare(workOrder.id, workerId)
+2
View File
@@ -143,6 +143,8 @@ export type RuntimeConfig = {
cooldownSeconds: number
dailyLimit: number
}
/** 打手端订单详情是否展示流转记录(默认关闭,仅后台可见) */
orderTimelineVisible: boolean
}
cors: {
allowedOrigins: string[]