mpbile .gitigore app chat login register theme
This commit is contained in:
@@ -922,6 +922,12 @@ function markRead(roomId) {
|
||||
// ========== 创建群聊 ==========
|
||||
async function showCreateGroup() {
|
||||
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 data = await res.json();
|
||||
const list = document.getElementById('friendListForGroup');
|
||||
|
||||
@@ -102,8 +102,7 @@ async function handleSendSms() {
|
||||
if (data.success) {
|
||||
countdown = 60;
|
||||
countdownTimer = setInterval(() => { countdown--; btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码'; if(countdown<=0){clearInterval(countdownTimer);btn.disabled=false;} }, 1000);
|
||||
if (data.mockCode) alert('验证码已发送: ' + data.mockCode);
|
||||
else alert('验证码已发送');
|
||||
alert('验证码已发送');
|
||||
} else { alert(data.message); btn.disabled = false; if(data.refreshCaptcha) fetchCaptcha('phone'); }
|
||||
} catch(e) { alert('发送失败,请确保后端已启动'); btn.disabled = false; }
|
||||
fetchCaptcha('phone');
|
||||
|
||||
@@ -148,8 +148,7 @@ async function handleSendSmsPhone() {
|
||||
btn.textContent = countdown > 0 ? countdown+'s后重发' : '获取验证码';
|
||||
if(countdown<=0){clearInterval(timer);btn.disabled=false;}
|
||||
}, 1000);
|
||||
if (data.mockCode) alert('验证码已发送: ' + data.mockCode);
|
||||
else alert('验证码已发送');
|
||||
alert('验证码已发送');
|
||||
} else {
|
||||
alert(data.message);
|
||||
btn.disabled = false;
|
||||
|
||||
Reference in New Issue
Block a user