Commit 51acf130 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/madara

parents 35d3981b 340b946e
......@@ -328,9 +328,14 @@ export default {
.querySelector(".msg-text").innerText;
this.$electron.ipcRenderer.send("setClipboard", text, 1);
} else if (this.msg.type == "image") {
let url = this.msg.file.url;
if (url.indexOf('nim.nosdn.127.net') !== -1) {
url = url.replace('nim.nosdn.127.net', 'nim-nosdn.netease.im')
//url += `?createTime=&`
}
this.$electron.ipcRenderer.send(
"getNetworkImage",
this.msg.file.url.replace("https://", "http://")
url.replace("https://", "http://")
);
}
},
......
......@@ -426,12 +426,21 @@ export default {
return isplay;
},
createSession(obj){
console.log('obj.id', obj.id)
console.log('this.createSessions', this.createSessions)
let h=null
this.sessionlist.forEach(x=>{
if(x.id==obj.id){
h=x
}
})
if(!h) {
this.createSessions.forEach(x=>{
if(x.id==obj.id){
h=x
}
})
}
if(h) {
this.enterChat(h)
} else {
......
......@@ -38,12 +38,20 @@ export default {
},
mounted: function() {
this.userInfo = this.$electron.remote.getGlobal("LOGINUSER");
this.sessionlist = this.$electron.remote.getGlobal("NEWMESSAGE");
this.setSessionlist();
setInterval(() => {
this.sessionlist = this.$electron.remote.getGlobal("NEWMESSAGE");
this.setSessionlist();
}, 2000);
},
methods: {
setSessionlist(){
let sessionlist = this.$electron.remote.getGlobal("NEWMESSAGE");
let list = [];
for(let i = 0; i < 4; i ++) {
list.push(sessionlist[i])
}
this.sessionlist = list
},
openMsg(session) {
var sessions = new Array();
sessions.push(session);
......
......@@ -22,7 +22,7 @@ export default {
methods: {
reconnect() {
this.resetCount++;
this.$store.dispatch("connect");
// this.$store.dispatch("connect");
this.splitTime = 10;
clearInterval(this.splitTimer);
this.splitTimer = null;
......
......@@ -284,7 +284,7 @@ export default {
});
},
createImage(dataurl){
console.log('图片来了!!!!!!!!!!!')
console.log('图片来了!!!!!!!!!!!', dataurl)
var strLen = dataurl.length;
var size = strLen-(strLen/8)*2;
let f = {
......
......@@ -18,7 +18,7 @@ import { onTeams, onSynCreateTeam, onCreateTeam, onUpdateTeam, onTeamMembers, on
const SDK = require('../../sdk/NIM_Web_SDK_v6.1.0')
// 重新初始化 NIM SDK
export function initNimSDK ({ state, commit, dispatch }, loginInfo) {
export function initNimSDK({ state, commit, dispatch }, loginInfo) {
if (state.nim) {
state.nim.disconnect()
}
......@@ -48,7 +48,7 @@ export function initNimSDK ({ state, commit, dispatch }, loginInfo) {
commit('updateNetError',true)
console.log('断网了')
},
onwillreconnect: function onWillReconnect () {
onwillreconnect: function onWillReconnect() {
commit('updateNetError',true)
},
ondisconnect: function onDisconnect (error) {
......
......@@ -137,7 +137,7 @@ export default {
state.mutelist=nim.mergeRelations(state.mutelist,mutelist)
state.mutelist = nim.cutRelations(state.mutelist, mutelist.invalid)
},
updateNetError (state, status){
updateNetError(state, status) {
state.isNetError=status
},
// 初始化,收到离线漫游消息时调用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment