Files
weibo_signin/frontend
Jeason e514a11e62 注册码 + 管理员系统:
User 模型新增 is_admin 字段
新增 InviteCode 模型(邀请码表)
注册接口必须提供有效邀请码,使用后自动标记
管理员接口:查看所有用户、启用/禁用用户、生成/删除邀请码
前端新增管理面板页面 /admin,导航栏对管理员显示入口
注册页面新增邀请码输入框
选择性超话签到:

新增 GET /api/v1/accounts/{id}/topics 接口获取超话列表
POST /signin 接口支持 {"topic_indices": [0,1,3]} 选择性签到
新增超话选择页面 /accounts/{id}/topics,支持全选/手动勾选
账号详情页新增"选择超话签到"按钮
2026-03-17 17:05:28 +08:00
..
2026-03-17 17:05:28 +08:00
2026-03-17 10:29:22 +08:00
2026-03-09 16:10:29 +08:00
2026-03-09 16:10:29 +08:00
2026-03-17 17:05:28 +08:00
2026-03-17 12:11:28 +08:00
2026-03-09 16:10:29 +08:00
2026-03-09 16:10:29 +08:00

Weibo-HotSign Frontend

Flask-based web frontend for the Weibo-HotSign multi-user signin system.

Features

  • User registration and login with JWT authentication
  • Weibo account management (add, edit, delete)
  • Signin task configuration with Cron expressions
  • Signin log viewing with pagination and filtering
  • Responsive design with clean UI

Setup

Prerequisites

  • Python 3.8+
  • pip

Installation

  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create .env file from .env.example:
cp .env.example .env
  1. Update .env with your configuration:
FLASK_ENV=development
FLASK_DEBUG=True
SECRET_KEY=your-secret-key-here
API_BASE_URL=http://localhost:8000
AUTH_BASE_URL=http://localhost:8001

Running

python app.py

The application will be available at http://localhost:5000

Project Structure

frontend/
├── app.py                 # Main Flask application
├── requirements.txt       # Python dependencies
├── .env.example          # Environment variables template
├── templates/            # HTML templates
│   ├── base.html         # Base template with navigation
│   ├── login.html        # Login page
│   ├── register.html     # Registration page
│   ├── dashboard.html    # Account list
│   ├── add_account.html  # Add account form
│   ├── edit_account.html # Edit account form
│   ├── account_detail.html # Account details with tasks and logs
│   ├── add_task.html     # Add task form
│   ├── 404.html          # 404 error page
│   └── 500.html          # 500 error page
└── README.md             # This file

API Integration

The frontend communicates with two backend services:

  • Auth Service (default: http://localhost:8001)

    • /auth/register - User registration
    • /auth/login - User login
    • /auth/refresh - Token refresh
    • /auth/me - Get current user
  • API Service (default: http://localhost:8000)

    • /api/v1/accounts - Account CRUD operations
    • /api/v1/accounts/{id}/tasks - Task management
    • /api/v1/accounts/{id}/signin-logs - Signin logs

Features

Authentication

  • User registration with password strength validation
  • Login with email and password
  • JWT token-based authentication
  • Automatic token refresh on expiration

Account Management

  • Add multiple Weibo accounts with encrypted cookies
  • View account list with status indicators
  • Edit account details and cookies
  • Delete accounts with cascade deletion

Task Configuration

  • Create signin tasks with Cron expressions
  • Enable/disable tasks
  • Delete tasks
  • View task status

Signin Logs

  • View signin history for each account
  • Pagination support
  • Status filtering
  • Reward information display

Security

  • Passwords are validated for strength (uppercase, lowercase, number, special char, 8+ chars)
  • Cookies are encrypted on the backend
  • JWT tokens are used for authentication
  • Session-based state management
  • CSRF protection via Flask-Session

Styling

The frontend uses a custom CSS framework with:

  • Responsive grid layout
  • Card-based design
  • Color-coded status badges
  • Mobile-friendly navigation
  • Smooth transitions and hover effects

Error Handling

  • Graceful error messages for API failures
  • Connection error handling
  • Form validation
  • 404 and 500 error pages

Development

To enable debug mode and auto-reload:

export FLASK_ENV=development
export FLASK_DEBUG=True
python app.py

License

MIT