支持已绑定设备追加 NFC 卡

- 新增已绑定设备追加卡会话和小程序入口

- 允许同设备多张 active 卡,保留 card_uuid 唯一并补齐老库迁移

- 收紧未知卡自动绑定和跨设备卡复用

验证:talkingq-url/.venv/bin/python -m pytest tests;compileall;npm run build:weapp
This commit is contained in:
stu2not
2026-06-04 09:55:35 +08:00
parent 482fbf351f
commit 82c15b6abc
18 changed files with 646 additions and 92 deletions

View File

@@ -87,6 +87,8 @@ CREATE TABLE IF NOT EXISTS device_bind_sessions (
max_attempt_count TINYINT UNSIGNED NOT NULL DEFAULT 5,
attempt_count TINYINT UNSIGNED NOT NULL DEFAULT 0,
status TINYINT NOT NULL DEFAULT 1,
bind_mode TINYINT NOT NULL DEFAULT 1,
card_uuid VARCHAR(64),
confirmed_at DATETIME,
consumed_at DATETIME,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -111,7 +113,7 @@ CREATE TABLE IF NOT EXISTS device_bind_history (
CREATE TABLE IF NOT EXISTS cards (
card_id BIGINT PRIMARY KEY AUTO_INCREMENT,
card_uuid VARCHAR(64) UNIQUE NOT NULL,
device_id VARCHAR(64) UNIQUE,
device_id VARCHAR(64),
card_name VARCHAR(64),
status TINYINT NOT NULL DEFAULT 0,
total_swaps INT NOT NULL DEFAULT 0,