Commit 4669e85c authored by 罗超's avatar 罗超

no message

parent 93929c38
......@@ -79,6 +79,8 @@ const addnewuserUrl = process.env.NODE_ENV === 'development' ? `http://localhost
const appXmlPath = process.execPath.substring(0, process.execPath.lastIndexOf('\\') + 1) + 'app.json'
const forwardUrl = process.env.NODE_ENV === 'development' ? `http://localhost:9080/#/forwardMsg` : `file://${__dirname}/index.html#/forwardMsg`
if (process.env.NODE_ENV !== 'development') {
global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
......@@ -290,8 +292,8 @@ app.on('activate', () => {
createWindow()
}
})
ipc.on('reconnect',function(event){
nim=null
ipc.on('reconnect', function(event) {
nim = null
initNIM(global.LOGINUSER.ImAccount, global.LOGINUSER.ImToken)
})
ipc.on('loginSuccess', function(event, userInfo) {
......@@ -697,6 +699,7 @@ ipc.on('send-file', function(event, obj) {
custom: JSON.stringify(customMsg),
uploadprogress: function(data) {
file.progess = data.percentage
console.log(file)
event.sender.send('sending-process', file)
},
uploaderror: function() {
......@@ -936,7 +939,8 @@ let getNoticeWindows = function() {
width: 300,
height: 115,
skipTaskbar: true,
alwaysOnTop: true
alwaysOnTop: false,
focusable: false
})
noticeWindows.setBounds({
y: electron.screen.getPrimaryDisplay().workAreaSize.height - 115,
......@@ -1099,7 +1103,6 @@ let initNIM = function(uid, token) {
function onDisconnect(error) {
// 此时说明 SDK 处于断开状态, 开发者此时应该根据错误码提示相应的错误信息, 并且跳转到登录页面
if (error) {
switch (error.code) {
// 账号或者密码错误, 请跳转到登录页面并提示错误
......@@ -1115,6 +1118,7 @@ let initNIM = function(uid, token) {
break;
}
}
console.log('异常了');
}
function onError(error) {
......
......@@ -9,6 +9,9 @@
export default {
name: "MageOffice",
mounted() {
window.alert = function() {
return false;
}
document.querySelector('#app').addEventListener(
"dragover",
function(e) {
......
......@@ -195,7 +195,6 @@ export default {
}, 8*1000);
},
atMsg(){
console.log(11111111111111)
this.MsgBus.$emit('send-at-name', this.atInfo.atName)
},
showCard(e){
......
......@@ -85,6 +85,7 @@ export default {
});
this.$electron.ipcRenderer.on("sending-process", (event, file) => {
console.log(file)
this.GLOBALSENDING.forEach(x => {
if ((x.msgId = file.msgId)) {
x = file;
......
......@@ -590,7 +590,9 @@ export default {
lastMsg.type === "notification" &&
lastMsg.attach &&
lastMsg.attach.team &&
lastMsg.attach.team.custom
lastMsg.attach.team.custom &&
this.$store.state.msgs[item.id] &&
this.$store.state.msgs[item.id].length>0
) {
for (let i = this.$store.state.msgs[item.id].length-1; i >= 0; i--) {
lastMsg=this.$store.state.msgs[item.id][i]
......
......@@ -5,7 +5,7 @@
import store from '../'
// 如果会话对象不是好友,需要更新好友名片
function updateSessionAccount (sessions) {
function updateSessionAccount(sessions) {
let accountsNeedSearch = []
sessions.forEach(item => {
if (item.scene === 'p2p') {
......@@ -23,18 +23,18 @@ function updateSessionAccount (sessions) {
}
// onSessions只在初始化完成后回调
export function onSessions (sessions) {
export function onSessions(sessions) {
updateSessionAccount(sessions)
store.commit('updateSessions', sessions)
}
export function onUpdateSession (session) {
export function onUpdateSession(session) {
let sessions = [session]
updateSessionAccount(sessions)
store.commit('updateSessions', sessions)
}
export function deleteSession ({state, commit}, sessionId) {
export function deleteSession({ state, commit }, sessionId) {
const nim = state.nim
sessionId = sessionId || ''
let scene = null
......@@ -50,7 +50,7 @@ export function deleteSession ({state, commit}, sessionId) {
nim.deleteSession({
scene,
to: account,
done: function deleteServerSessionDone (error, obj) {
done: function deleteServerSessionDone(error, obj) {
if (error) {
//alert(error)
......@@ -58,7 +58,7 @@ export function deleteSession ({state, commit}, sessionId) {
}
nim.deleteLocalSession({
id: sessionId,
done: function deleteLocalSessionDone (error, obj) {
done: function deleteLocalSessionDone(error, obj) {
if (error) {
//alert(error)
return
......@@ -71,7 +71,7 @@ export function deleteSession ({state, commit}, sessionId) {
}
}
export function setCurrSession ({state, commit, dispatch}, sessionId) {
export function setCurrSession({ state, commit, dispatch }, sessionId) {
const nim = state.nim
if (sessionId) {
commit('updateCurrSessionId', {
......@@ -91,7 +91,7 @@ export function setCurrSession ({state, commit, dispatch}, sessionId) {
}
}
export function resetCurrSession ({state, commit}) {
export function resetCurrSession({ state, commit }) {
const nim = state.nim
nim.resetCurrSession()
commit('updateCurrSessionMsgs', {
......
This diff is collapsed.
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