zhizhi/src/routes/hli/auth/login.js

26 lines
608 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// src/routes/hli/auth/login.js
// HLI-AUTH-001: 用户登录
const express = require('express');
const router = express.Router();
router.post('/', async (req, res) => {
try {
const { username, password } = req.body;
// TODO: 实现登录逻辑(查询数据库,验证密码,生成 token
res.json({
hli_id: 'HLI-AUTH-001',
token: '',
user_id: '',
persona_id: '',
expires_at: new Date().toISOString(),
});
} catch (err) {
res.status(500).json({ error: true, code: 'AUTH_LOGIN_ERROR', message: err.message });
}
});
module.exports = router;