From 6a07a94dd00c798b248e1776c0de69bd51005e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CzhenQin=E2=80=9D?= <705597001@qq.com> Date: Fri, 9 Dec 2016 23:02:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=81=8A=E5=A4=A9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=9B=B4=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=98=B5=E7=A7=B0=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scripts/client.js | 12 +++++++++++- app/styles/main.css | 13 +++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/scripts/client.js b/app/scripts/client.js index 7d5959a..71bea97 100644 --- a/app/scripts/client.js +++ b/app/scripts/client.js @@ -48,10 +48,11 @@ HiChat.prototype = { }); document.getElementById('loginBtn').addEventListener('click', function() { var nickName = document.getElementById('nicknameInput').value; - if (nickName.trim().length != 0) { + if (nickName.trim().length != 0&&nickName.trim()!="我") { that.socket.emit('login', nickName); } else { document.getElementById('nicknameInput').focus(); + document.getElementById('info').textContent = '请输入昵称,昵称不能为空不能为’我'; }; }, false); document.getElementById('nicknameInput').addEventListener('keyup', function(e) { @@ -147,6 +148,11 @@ HiChat.prototype = { msgDiv="