接口更改

This commit is contained in:
dzl
2025-10-10 17:30:49 +08:00
parent 83af2cefd6
commit 2aa0e9d884
10 changed files with 284 additions and 81 deletions

View File

@@ -52,14 +52,6 @@ const auth = async (req, res, next) => {
}
};
// 管理员认证中间件
const adminAuth = (req, res, next) => {
if (req.user.role !== 'admin') {
return res.status(403).json({ success: false, message: '需要管理员权限' });
}
next();
};
/**
* 支付认证中间件
* 只验证JWT令牌和用户状态不检查支付状态
@@ -107,4 +99,4 @@ const paymentAuth = async (req, res, next) => {
}
};
module.exports = { auth, adminAuth, paymentAuth, JWT_SECRET };
module.exports = { paymentAuth, JWT_SECRET };