Next.js + Mantine mock SSO service providing account/password, phone verify-code, and Feishu QR login. Issues a one-time sso_code that the external app exchanges for user info. Includes: - Feishu callback fix: guard against duplicate/concurrent /api/login submissions of the same single-use authorization code (feishuLogin once-guard + memoized onLoginSuccess to stop effect re-fire). - ADAPTATION_GUIDE.md: how to switch from the in-memory code store to the real backend auth/index + inner_get_user_info endpoints. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 lines
540 B
TypeScript
16 lines
540 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
/**
|
|
* Mock 用户列表接口(用于测试)
|
|
* GET /api/mock/users
|
|
*/
|
|
export async function GET() {
|
|
const users = [
|
|
{ account: 'admin', password: '123456', name: '管理员', phone: '13800138000', roles: ['admin'] },
|
|
{ account: 'user01', password: '123456', name: '测试用户', phone: '13900139000', roles: ['user'] },
|
|
{ account: 'zhangsan', password: '123456', name: '张三', phone: '13700137000', roles: ['user', 'editor'] },
|
|
]
|
|
|
|
return NextResponse.json({ users })
|
|
}
|