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
5de2722d
Commit
5de2722d
authored
Sep 26, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/madara
parents
e7754390
0d9bfe5b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
578 additions
and
564 deletions
+578
-564
.gitignore
.gitignore
+1
-0
index.js
src/store/actions/index.js
+145
-144
msgs.js
src/store/actions/msgs.js
+432
-420
No files found.
.gitignore
View file @
5de2722d
...
...
@@ -17,3 +17,4 @@ dist/
package/
build/
node_modules.rar
node_modules.zip
src/store/actions/index.js
View file @
5de2722d
...
...
@@ -4,28 +4,28 @@ import cookie from '../../utils/cookie'
import
pageUtil
from
'../../utils/page'
/* 导出actions方法 */
import
{
showLoading
,
hideLoading
,
showFullscreenImg
,
hideFullscreenImg
}
from
'./widgetUi'
import
{
initNimSDK
}
from
'./initNimSDK'
import
{
initChatroomSDK
,
resetChatroomSDK
}
from
'./initChatroomSDK'
import
{
updateBlack
}
from
'./blacks'
import
{
updateFriend
,
addFriend
,
deleteFriend
}
from
'./friends'
import
{
resetSearchResult
,
searchUsers
,
searchTeam
}
from
'./search'
import
{
deleteSession
,
setCurrSession
,
resetCurrSession
}
from
'./session'
import
{
sendMsg
,
sendTip
,
markInMutelist
,
sendFileMsg
,
sendDataUrlMsg
,
sendDataUrlMsgCall
,
sendMsgReceipt
,
sendRobotMsg
,
revocateMsg
,
updateLocalMsg
,
getHistoryMsgs
,
resetNoMoreHistoryMsgs
,
continueRobotMsg
}
from
'./msgs'
import
{
markSysMsgRead
,
resetSysMsgs
,
deleteSysMsgs
,
markCustomSysMsgRead
}
from
'./sysMsgs'
import
{
sendChatroomMsg
,
sendChatroomRobotMsg
,
sendChatroomFileMsg
,
getChatroomHistoryMsgs
}
from
'./chatroomMsgs'
import
{
initChatroomInfos
,
getChatroomInfo
,
getChatroomMembers
,
clearChatroomMembers
}
from
'./chatroomInfos'
import
{
delegateTeamFunction
,
getNotifyForNewTeamMsg
,
onTeamNotificationMsg
,
enterSettingPage
,
getTeamMembers
,
checkTeamMsgReceipt
,
getTeamMsgReads
}
from
'./team'
import
{
showLoading
,
hideLoading
,
showFullscreenImg
,
hideFullscreenImg
}
from
'./widgetUi'
import
{
initNimSDK
}
from
'./initNimSDK'
import
{
initChatroomSDK
,
resetChatroomSDK
}
from
'./initChatroomSDK'
import
{
updateBlack
}
from
'./blacks'
import
{
updateFriend
,
addFriend
,
deleteFriend
}
from
'./friends'
import
{
resetSearchResult
,
searchUsers
,
searchTeam
}
from
'./search'
import
{
deleteSession
,
setCurrSession
,
resetCurrSession
}
from
'./session'
import
{
sendMsg
,
sendTip
,
forwardMsg
,
markInMutelist
,
sendFileMsg
,
sendDataUrlMsg
,
sendDataUrlMsgCall
,
sendMsgReceipt
,
sendRobotMsg
,
revocateMsg
,
updateLocalMsg
,
getHistoryMsgs
,
resetNoMoreHistoryMsgs
,
continueRobotMsg
}
from
'./msgs'
import
{
markSysMsgRead
,
resetSysMsgs
,
deleteSysMsgs
,
markCustomSysMsgRead
}
from
'./sysMsgs'
import
{
sendChatroomMsg
,
sendChatroomRobotMsg
,
sendChatroomFileMsg
,
getChatroomHistoryMsgs
}
from
'./chatroomMsgs'
import
{
initChatroomInfos
,
getChatroomInfo
,
getChatroomMembers
,
clearChatroomMembers
}
from
'./chatroomInfos'
import
{
delegateTeamFunction
,
getNotifyForNewTeamMsg
,
onTeamNotificationMsg
,
enterSettingPage
,
getTeamMembers
,
checkTeamMsgReceipt
,
getTeamMsgReads
}
from
'./team'
function
connectNim
({
state
,
commit
,
dispatch
},
obj
)
{
let
{
force
}
=
Object
.
assign
({},
obj
)
function
connectNim
({
state
,
commit
,
dispatch
},
obj
)
{
let
{
force
}
=
Object
.
assign
({},
obj
)
// 操作为内容页刷新页面,此时无nim实例
//
if
(
!
state
.
nim
||
force
)
{
let
loginuser
=
require
(
'electron'
).
remote
.
getGlobal
(
"LOGINUSER"
);
let
loginuser
=
require
(
'electron'
).
remote
.
getGlobal
(
"LOGINUSER"
);
let
loginInfo
=
{
uid
:
loginuser
.
ImAccount
,
sdktoken
:
loginuser
.
ImToken
,
sdktoken
:
loginuser
.
ImToken
,
}
if
(
!
loginInfo
.
uid
)
{
// 无cookie,直接跳转登录页
...
...
@@ -37,14 +37,14 @@ function connectNim ({state, commit, dispatch}, obj) {
}
}
function
connectChatroom
({
state
,
commit
,
dispatch
},
obj
)
{
let
{
chatroomId
}
=
Object
.
assign
({},
obj
)
function
connectChatroom
({
state
,
commit
,
dispatch
},
obj
)
{
let
{
chatroomId
}
=
Object
.
assign
({},
obj
)
const
nim
=
state
.
nim
if
(
nim
)
{
dispatch
(
'showLoading'
)
nim
.
getChatroomAddress
({
chatroomId
,
done
:
function
getChatroomAddressDone
(
error
,
obj
)
{
done
:
function
getChatroomAddressDone
(
error
,
obj
)
{
if
(
error
)
{
//alert(error.message)
//location.href = '#/room'
...
...
@@ -57,7 +57,7 @@ function connectChatroom ({state, commit, dispatch}, obj) {
}
export
default
{
updateRefreshState
({
commit
})
{
updateRefreshState
({
commit
})
{
commit
(
'updateRefreshState'
)
},
...
...
@@ -69,8 +69,8 @@ export default {
continueRobotMsg
,
// 连接sdk请求,false表示强制重连
connect
(
store
,
obj
)
{
let
{
type
}
=
Object
.
assign
({},
obj
)
connect
(
store
,
obj
)
{
let
{
type
}
=
Object
.
assign
({},
obj
)
// type 可为 nim chatroom
type
=
type
||
'nim'
switch
(
type
)
{
...
...
@@ -84,7 +84,7 @@ export default {
},
// 用户触发的登出逻辑
logout
({
state
,
commit
})
{
logout
({
state
,
commit
})
{
cookie
.
delCookie
(
'uid'
)
cookie
.
delCookie
(
'sdktoken'
)
if
(
state
.
nim
)
{
...
...
@@ -113,6 +113,7 @@ export default {
resetCurrSession
,
// 发送消息
sendMsg
,
forwardMsg
,
sendTip
,
sendFileMsg
,
sendDataUrlMsg
,
...
...
src/store/actions/msgs.js
View file @
5de2722d
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