Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Madara
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
Madara
Commits
4669e85c
Commit
4669e85c
authored
Sep 29, 2019
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
93929c38
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
708 additions
and
696 deletions
+708
-696
index.js
src/configs/index.js
+33
-33
index.js
src/main/index.js
+11
-7
App.vue
src/renderer/App.vue
+3
-0
index.vue
src/renderer/components/index.vue
+0
-1
chateditor.vue
src/renderer/components/msssage/chateditor.vue
+1
-0
index.vue
src/renderer/components/msssage/index.vue
+3
-1
session.js
src/store/actions/session.js
+78
-78
index.js
src/store/mutations/index.js
+579
-576
No files found.
src/configs/index.js
View file @
4669e85c
src/main/index.js
View file @
4669e85c
...
...
@@ -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) {
...
...
src/renderer/App.vue
View file @
4669e85c
...
...
@@ -9,6 +9,9 @@
export
default
{
name
:
"MageOffice"
,
mounted
()
{
window
.
alert
=
function
()
{
return
false
;
}
document
.
querySelector
(
'#app'
).
addEventListener
(
"dragover"
,
function
(
e
)
{
...
...
src/renderer/components/index.vue
View file @
4669e85c
...
...
@@ -195,7 +195,6 @@ export default {
},
8
*
1000
);
},
atMsg
(){
console
.
log
(
11111111111111
)
this
.
MsgBus
.
$emit
(
'send-at-name'
,
this
.
atInfo
.
atName
)
},
showCard
(
e
){
...
...
src/renderer/components/msssage/chateditor.vue
View file @
4669e85c
...
...
@@ -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
;
...
...
src/renderer/components/msssage/index.vue
View file @
4669e85c
...
...
@@ -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
]
...
...
src/store/actions/session.js
View file @
4669e85c
...
...
@@ -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'
,
{
...
...
src/store/mutations/index.js
View file @
4669e85c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment