支持速率限制

然后把oauth单独放一个页面
一些UI调整
This commit is contained in:
2025-07-30 12:19:38 -07:00
parent b965f90c97
commit 9262ef4076
11 changed files with 745 additions and 404 deletions

View File

@ -8,6 +8,7 @@ const OAuthToken = require('./models/OAuthToken');
const authRoutes = require('./routes/auth');
const oauthRoutes = require('./routes/oauth');
const oauthClientRoutes = require('./routes/oauth-clients');
const { generalLimiter } = require('./middleware/rateLimit');
const app = express();
const PORT = process.env.PORT || 3000;
@ -17,6 +18,9 @@ app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// 应用通用速率限制
app.use(generalLimiter);
// 请求日志中间件
app.use((req, res, next) => {
console.log(`${new Date().toISOString()} - ${req.method} ${req.path}`);