代理后端出版

This commit is contained in:
2025-09-05 16:49:23 +08:00
parent e704c8abca
commit 141d1313d6
27 changed files with 6395 additions and 49 deletions

View File

@@ -14,9 +14,9 @@ const JWT_SECRET = process.env.JWT_SECRET || 'agent_jwt_secret_key_2024';
*/
router.post('/login', async (req, res) => {
try {
const { phone, password } = req.body;
const { username, password } = req.body;
if (!phone || !password) {
if (!username || !password) {
return res.status(400).json({
success: false,
message: '请输入手机号和密码'
@@ -43,7 +43,7 @@ router.post('/login', async (req, res) => {
LEFT JOIN users u ON ra.user_id = u.id
LEFT JOIN zhejiang_regions zr ON ra.region_id = zr.id
WHERE u.phone = ? AND ra.status = 'active'
`, [phone]);
`, [username]);
if (agents.length === 0) {
return res.status(401).json({