Implement Casdoor authentication integration, including login and callback routes. Update environment variables for Casdoor configuration. Modify login page to support Casdoor login option and enhance UI styles. Adjust uWSGI port settings and update application logging for user actions.

This commit is contained in:
2025-12-10 15:08:04 +08:00
parent 0f41063688
commit bb39314940
16 changed files with 541 additions and 2148 deletions
+30 -8
View File
@@ -5,17 +5,39 @@
<h2 class="login_title">欢迎使用</h2>
<div class="login_subtitle">大化重点项目工单管理平台</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="login_error">
{% for message in messages %}
{{ message }}
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% if casdoor_enabled %}
<!-- Casdoor 登录按钮 -->
<div class="login_casdoor_section">
<a href="{{ url_for('casdoor_login') }}" class="login_button login_button_casdoor">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-right: 8px;">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>
</svg>
使用 Casdoor 登录
</a>
</div>
<div class="login_divider">
<span></span>
</div>
{% endif %}
<!-- 原有手机号登录表单 -->
<form method="POST" class="login_form">
<div class="login_input_group">
<label for="phone" class="login_label">用户名</label>
<input type="text" id="phone" name="phone" class="login_input" required>
<label for="phone" class="login_label">用户名(手机号)</label>
<input type="text" id="phone" name="phone" class="login_input" placeholder="请输入手机号" required>
</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="login_error">请先登录以访问此页面</div>
{% endif %}
{% endwith %}
<button type="submit" class="login_button">登 录</button>
<button type="submit" class="login_button login_button_phone">手机号登录</button>
</form>
</div>
</div>