Commit 27d1f42c authored by 罗超's avatar 罗超

部分调整

parent 4b4dd98a
......@@ -713,7 +713,7 @@ ipc.on('delete-file', function(event, p) {
fs.unlink(p, function(err) {})
})
ipc.on('send-file', function(event, obj) {
let { scene, to, filePath, name, size, md5, type, file } = obj
let { scene, to, filePath, name, size, md5, type, fileInfo } = obj
let customMsg = {
"msgtype": "custom_file",
"data": {
......@@ -730,6 +730,9 @@ ipc.on('send-file', function(event, obj) {
"Width": "210"
}
}
if (!nim) {
initNIM(global.LOGINUSER.ImAccount, global.LOGINUSER.ImToken)
}
nim.sendFile({
scene,
to,
......@@ -738,7 +741,7 @@ ipc.on('send-file', function(event, obj) {
custom: JSON.stringify(customMsg),
uploadprogress: function(data) {
file.progess = data.percentage
console.log(file)
console.log(data)
event.sender.send('sending-process', file)
},
uploaderror: function() {
......@@ -753,6 +756,7 @@ ipc.on('send-file', function(event, obj) {
//onSendMsgDone(error, msg)
}
})
})
ipc.on('read-clip', function(event) {
const rawFilePath = clipboard.readBuffer('FileNameW').toString('ucs2');
......@@ -1149,7 +1153,7 @@ let formatDate = function(date, format) {
};
let initNIM = function(uid, token) {
try {
nim = SDK.getInstance({
nim = SDK.NIM.getInstance({
debug: false,
appKey: 'b612b31e837c79c68f141aeb719d2b20',
account: uid,
......@@ -1192,9 +1196,9 @@ let initNIM = function(uid, token) {
function onError(error) {
// console.log(error);
console.log('error........')
console.log('error........', error)
}
} catch (error) {
console.log('error2........', error)
}
}
\ No newline at end of file
......@@ -88,7 +88,6 @@ export default {
});
this.$electron.ipcRenderer.on("sending-process", (event, file) => {
console.log(file)
this.GLOBALSENDING.forEach(x => {
if ((x.msgId = file.msgId)) {
x = file;
......
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