接口更改
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user