Files
x-server-mobile/frontend
root df07b16c7a feat: 实现多端飞书登录功能
1. 飞书客户端内:静默自动登录
   - 检测飞书环境 (userAgent + ttjsBridge)
   - 调用 ttjsBridge.getAuthCode() 获取授权码
   - 自动登录到后台

2. 飞书客户端外:扫码登录
   - 后端新增三个接口:
     * POST /api/v1/auth/qrcode-login - 生成登录会话和二维码
     * GET /api/v1/auth/qrcode-login/status - 轮询登录状态
     * GET /login/qrcode/{id} - 飞书授权回调
   - 前端新增 QRCodeLogin 组件:
     * 使用 qrcode.react 生成二维码
     * 每 2 秒轮询登录状态
     * 状态:loading → pending → scanning → success/expired

3. 数据库表:feishu_login_session
   - 存储 session_id, auth_url, status, user_id
   - 状态:pending, scanning, success, expired
   - 2 分钟过期机制

4. 其他优化
   - 移除审批详情页的 header
   - 更新 PROJECT_ISSUES.md 文档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:58:19 +08:00
..
2026-02-26 09:58:19 +08:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])