feat(invite): add invite code registration system

This commit is contained in:
2026-07-06 01:13:07 +08:00
parent a7c5082ff6
commit b58956937e
6 changed files with 335 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
{% extends "base.html" %}
{% block title %}注册 - 星笺{% endblock %}
{% block content %}
<div class="auth-form">
<h2>注册</h2>
<p style="color:var(--text-muted);font-size:.85rem;margin-bottom:1rem">邀请码由已有用户或管理员提供</p>
{% if error %}
<div class="alert alert-error">{{ error }}</div>
{% endif %}
<form method="post" action="/register">
<label>邀请码</label>
<input type="text" name="invite_code" required maxlength="8" placeholder="8位字母数字" style="text-transform:none" autofocus>
<label>用户名</label>
<input type="text" name="username" required maxlength="64">
<label>密码</label>
<input type="password" name="password" required minlength="6">
<label>确认密码</label>
<input type="password" name="confirm_password" required>
<button type="submit" class="btn btn-primary">注册</button>
</form>
<p style="margin-top:1rem;text-align:center;font-size:.85rem">已有账号?<a href="/login">去登录</a></p>
</div>
{% endblock %}