mpbile .gitigore app chat login register theme

This commit is contained in:
2026-02-27 20:15:07 +08:00
parent 7976f11cf4
commit 17a4415cd2
5 changed files with 10 additions and 6 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ venv/
dist/ dist/
build/ build/
node_modules/ node_modules/
model/

1
app.py
View File

@@ -1789,7 +1789,6 @@ def api_send_sms():
resp_data = {'success': True, 'message': '验证码发送成功'} resp_data = {'success': True, 'message': '验证码发送成功'}
model = result.get('Model', {}) model = result.get('Model', {})
if model.get('VerifyCode'): if model.get('VerifyCode'):
resp_data['mockCode'] = model['VerifyCode']
print(f'验证码: {model["VerifyCode"]}') print(f'验证码: {model["VerifyCode"]}')
return jsonify(resp_data) return jsonify(resp_data)
else: else:

View File

@@ -922,6 +922,12 @@ function markRead(roomId) {
// ========== 创建群聊 ========== // ========== 创建群聊 ==========
async function showCreateGroup() { async function showCreateGroup() {
document.getElementById('createGroupModal').classList.remove('hidden'); document.getElementById('createGroupModal').classList.remove('hidden');
// 重置弹窗标题和按钮(防止被邀请好友功能覆盖)
document.querySelector('#createGroupModal h3').textContent = '创建群聊';
const createBtn = document.querySelector('#createGroupModal .bg-primary');
createBtn.textContent = '创建';
createBtn.onclick = createGroup;
document.getElementById('groupName').value = '';
const res = await fetch('/api/user/friends'); const res = await fetch('/api/user/friends');
const data = await res.json(); const data = await res.json();
const list = document.getElementById('friendListForGroup'); const list = document.getElementById('friendListForGroup');

View File

@@ -102,8 +102,7 @@ async function handleSendSms() {
if (data.success) { if (data.success) {
countdown = 60; countdown = 60;
countdownTimer = setInterval(() => { countdown--; btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码'; if(countdown<=0){clearInterval(countdownTimer);btn.disabled=false;} }, 1000); countdownTimer = setInterval(() => { countdown--; btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码'; if(countdown<=0){clearInterval(countdownTimer);btn.disabled=false;} }, 1000);
if (data.mockCode) alert('验证码已发送: ' + data.mockCode); alert('验证码已发送');
else alert('验证码已发送');
} else { alert(data.message); btn.disabled = false; if(data.refreshCaptcha) fetchCaptcha('phone'); } } else { alert(data.message); btn.disabled = false; if(data.refreshCaptcha) fetchCaptcha('phone'); }
} catch(e) { alert('发送失败,请确保后端已启动'); btn.disabled = false; } } catch(e) { alert('发送失败,请确保后端已启动'); btn.disabled = false; }
fetchCaptcha('phone'); fetchCaptcha('phone');

View File

@@ -148,8 +148,7 @@ async function handleSendSmsPhone() {
btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码'; btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码';
if(countdown<=0){clearInterval(timer);btn.disabled=false;} if(countdown<=0){clearInterval(timer);btn.disabled=false;}
}, 1000); }, 1000);
if (data.mockCode) alert('验证码已发送: ' + data.mockCode); alert('验证码已发送');
else alert('验证码已发送');
} else { } else {
alert(data.message); alert(data.message);
btn.disabled = false; btn.disabled = false;