Skip to content

Commit 2f418c6

Browse files
authored
Merge pull request #9 from imalasong/develop
匿名登录
2 parents 390699d + 67f8dae commit 2f418c6

21 files changed

+75
-55
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11+
"@fingerprintjs/fingerprintjs": "^3.4.1",
1112
"axios": "^1.1.3",
1213
"core-js": "^3.6.5",
1314
"element-ui": "^2.15.10",

src/api/httpRequest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ http.interceptors.response.use(async response => {
3535
} else if (response.data.code == 400) {
3636
router.replace("/login");
3737
} else if (response.data.code == 401) {
38-
console.log("token失效,尝试重新获取")
3938
let refreshToken = sessionStorage.getItem("refreshToken");
4039
if (!refreshToken) {
4140
router.replace("/login");

src/api/wssocket.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ let initWebSocket = async () => {
2626
if (sendInfo.cmd == 0) {
2727
hasLogin = true;
2828
heartCheck.start()
29-
console.log('WebSocket登录成功')
3029
// 登录成功才算连接完成
3130
openCallBack && openCallBack();
3231
}
@@ -39,11 +38,9 @@ let initWebSocket = async () => {
3938
}
4039
}
4140
websock.onclose = function(e) {
42-
console.log('WebSocket连接关闭')
4341
isConnect = false; //断开后修改标识
4442
}
4543
websock.onopen = function() {
46-
console.log("WebSocket连接成功");
4744
isConnect = true;
4845
// 发送登录命令
4946
let loginInfo = {
@@ -56,12 +53,10 @@ let initWebSocket = async () => {
5653

5754
// 连接发生错误的回调方法
5855
websock.onerror = function() {
59-
console.log('WebSocket连接发生错误')
6056
isConnect = false; //连接断开修改标识
6157
reConnect();
6258
}
6359
} catch (e) {
64-
console.log("尝试创建连接失败",e);
6560
reConnect(); //如果无法连接上webSocket 那么重新连接!可能会因为服务器重新部署,或者短暂断网等导致无法创建连接
6661
}
6762
};
@@ -73,14 +68,12 @@ let findWsUrl = () =>{
7368
method: 'get'
7469
}).then((data) => {
7570
url ="ws://"+data.ip+":"+data.port+"/im";
76-
console.log("ws地址",url);
7771
return Promise.resolve(url);
7872
})
7973
}
8074

8175
//定义重连函数
8276
let reConnect = () => {
83-
console.log("尝试重新连接");
8477
if (isConnect) return; //如果已经连上就不在重连了
8578
rec && clearTimeout(rec);
8679
rec = setTimeout(function() { // 延迟5秒重连 避免过多次过频繁请求重连
@@ -99,7 +92,6 @@ var heartCheck = {
9992
timeoutObj: null, //延时发送消息对象(启动心跳新建这个对象,收到消息后重置对象)
10093
start: function() {
10194
if(isConnect){
102-
console.log('发送WebSocket心跳')
10395
let heartBeat = {
10496
cmd: 1,
10597
data: {
@@ -123,7 +115,6 @@ var heartCheck = {
123115

124116
// 实际调用的方法
125117
function sendMessage(agentData) {
126-
// console.log(globalCallback)
127118
if (websock.readyState === websock.OPEN) {
128119
// 若是ws开启状态
129120
websock.send(JSON.stringify(agentData))

src/assets/icons/2.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/chat/ChatBox.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@
219219
this.showVoice = false;
220220
},
221221
showVideoBox() {
222-
console.log(this.friend)
223222
this.$store.commit("showChatPrivateVideoBox", {
224223
friend: this.friend,
225224
master: true
@@ -340,9 +339,7 @@
340339
this.group = group;
341340
this.$store.commit("updateChatFromGroup", group);
342341
this.$store.commit("updateGroup", group);
343-
344342
});
345-
346343
this.$http({
347344
url: `/group/members/${groupId}`,
348345
method: 'get'
@@ -357,7 +354,6 @@
357354
method: 'get'
358355
}).then((friend) => {
359356
this.friend = friend;
360-
console.log(this.friend)
361357
this.$store.commit("updateChatFromFriend", friend);
362358
this.$store.commit("updateFriend", friend);
363359
})

src/components/chat/ChatItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88
<div class="mid">
99
<div>{{ chat.showName}}</div>
10-
<div class="msg-text" v-html="$emo.transform(chat.lastContent)"></div>
10+
<div class="msg-text" v-if="chat.lastContent!=null" v-html="$emo.transform(chat.lastContent)"></div>
1111
</div>
1212
<div class="right ">
1313
<div @click.stop="onClickClose()"><i class="el-icon-close close" style="border: none; font-size: 20px;color: black;" title="关闭"></i></div>

src/components/chat/ChatMessageItem.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
}
157157
},
158158
mounted() {
159-
//console.log(this.msgInfo);
160159
}
161160
}
162161
</script>

src/components/chat/ChatPrivateVideo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
},
9090
(stream) => {
9191
this.stream = stream;
92-
console.log(this.stream)
9392
this.$refs.mineVideo.srcObject = stream;
9493
this.$refs.mineVideo.muted = true;
9594
callback(stream)
@@ -132,7 +131,6 @@
132131
}
133132
this.peerConnection.oniceconnectionstatechange = (event) => {
134133
let state = event.target.iceConnectionState;
135-
console.log("ICE connection status changed : " + state)
136134
if(state == 'connected'){
137135
this.resetTime();
138136
}

src/components/chat/ChatVideoAcceptor.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
this.close();
5656
},
5757
onCall(msgInfo){
58-
console.log("onCall")
5958
this.offer = JSON.parse(msgInfo.content);
6059
if(this.$store.state.userStore.state == this.$enums.USER_STATE.BUSY){
6160
this.failed("对方正忙,暂时无法接听");

src/components/chat/ChatVoice.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
this.state = 'RUNNING';
6161
this.stateTip = "正在录音...";
6262
}).catch(error => {
63-
console.log(error);
6463
this.$message.error(error);
65-
console.log(error);
6664
});
6765
6866
@@ -90,7 +88,6 @@
9088
this.mode = 'PLAY';
9189
},
9290
handleStopAudio() {
93-
console.log(this.$refs.audio);
9491
this.$refs.audio.pause();
9592
this.mode = 'RECORD';
9693
},

0 commit comments

Comments
 (0)