|
@@ -3,6 +3,7 @@ import resSend from '../util/resSend.js';
|
|
|
|
|
|
|
|
const proofZhong = (req: any, res: any, next: any) => {
|
|
const proofZhong = (req: any, res: any, next: any) => {
|
|
|
const urlAll: string = req.originalUrl;
|
|
const urlAll: string = req.originalUrl;
|
|
|
|
|
+ const contentType: string = req.headers['content-type'] || '';
|
|
|
|
|
|
|
|
if (urlAll.includes('getProof?proof=4DAGE')) {
|
|
if (urlAll.includes('getProof?proof=4DAGE')) {
|
|
|
next();
|
|
next();
|
|
@@ -22,7 +23,12 @@ const proofZhong = (req: any, res: any, next: any) => {
|
|
|
const timeMiRes = passWordJie(timeMi);
|
|
const timeMiRes = passWordJie(timeMi);
|
|
|
|
|
|
|
|
// 传入proof有效的时间(加密字符串) - 解密
|
|
// 传入proof有效的时间(加密字符串) - 解密
|
|
|
- const timeShiRes = passWordJie(timeShi);
|
|
|
|
|
|
|
+ let timeShiRes = passWordJie(timeShi);
|
|
|
|
|
+
|
|
|
|
|
+ // 动态调整:如果内容是文件上传类型,则延长验证时间
|
|
|
|
|
+ if (contentType.includes('multipart/form-data')) {
|
|
|
|
|
+ timeShiRes = (30 * 60 * 1000).toString();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (timeMiRes !== timeCuo) return resSend(res, 402, 'proof err');
|
|
if (timeMiRes !== timeCuo) return resSend(res, 402, 'proof err');
|
|
|
|
|
|