feature/worker #111

Merged
primakov merged 190 commits from feature/worker into master 2025-12-05 16:59:42 +03:00
Showing only changes of commit 4ef4dd3c1b - Show all commits

View File

@@ -0,0 +1,11 @@
// 简单token认证中间件支持token-3格式
module.exports = function (req, res, next) {
const auth = req.headers.authorization;
if (auth && auth.startsWith('Bearer token-')) {
const id = parseInt(auth.replace('Bearer token-', ''));
if (!isNaN(id)) {
req.user = { id };
}
}
next();
};