Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae024595
authored
Nov 02, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
9aed20af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
38 deletions
store/index.ts
xim/index.ts
xim/xim.ts
store/index.ts
View file @
ae024595
This diff is collapsed.
Click to expand it.
xim/index.ts
View file @
ae024595
...
...
@@ -63,7 +63,7 @@ class Chat implements ChatMessageController {
option
.
message
&&
(
this
.
messageController
=
option
.
message
);
this
.
setupIndexDb
();
await
this
.
setupIndexDb
();
this
.
token
=
async
()
=>
option
.
sdk
().
global
.
jwtToken
;
tokenManager
.
save
(
this
.
token
);
...
...
@@ -92,7 +92,7 @@ class Chat implements ChatMessageController {
s
.
global
.
uid
+
"-"
+
(
s
.
global
.
initData
.
orgId
||
0
)
);
}
return
Promise
.
reject
(
new
Error
(
'Sdk is not defined'
));
return
Promise
.
reject
(
new
Error
(
"Sdk is not defined"
));
}
public
resetup
(
org
:
()
=>
string
|
number
)
{
...
...
xim/xim.ts
View file @
ae024595
...
...
@@ -7,6 +7,7 @@ import { Message, NotifyMessage } from "./models/chat";
import
chat
from
"./index"
;
import
{
STATUS
}
from
"xchat-client/dist/xchat"
;
import
{
AxiosInstance
}
from
"axios"
;
wampDebug
(
true
);
...
...
@@ -203,6 +204,55 @@ export class Xim {
return
data
;
}
public
async
queryLastPageMsgWhenNotMember
(
chatParameter
:
{
model
:
string
;
obj
:
string
;
})
{
return
this
.
queryMessagesWhenNotMember
(
chatParameter
,
0
,
0
,
20
,
1
);
}
public
async
queryPreviousPageMsgWhenNotMember
(
chatParameter
:
{
model
:
string
;
obj
:
string
;
},
start
:
number
)
{
return
this
.
queryMessagesWhenNotMember
(
chatParameter
,
0
,
start
,
20
,
1
);
}
public
async
queryNextPageMsgWhenNotMember
(
chatParameter
:
{
model
:
string
;
obj
:
string
;
},
end
:
number
)
{
return
this
.
queryMessagesWhenNotMember
(
chatParameter
,
end
,
0
,
20
,
0
);
}
private
queryMessagesWhenNotMember
(
chatParameter
:
{
model
:
string
;
obj
:
string
},
lid
:
number
,
rid
:
number
,
limit
:
number
,
desc
:
number
)
{
const
sdk
=
chat
.
getSdk
();
const
query
=
sdk
.
getAxios
()
as
AxiosInstance
;
const
q
=
[
`lid=
${
lid
}
`
,
`rid=
${
rid
}
`
,
`limit=
${
limit
}
`
,
`desc=
${
desc
}
`
,
];
return
query
.
get
<
any
,
Message
[]
>
(
`
${
sdk
.
global
.
baseUrl
}
general/xim/model/
${
chatParameter
.
model
}
/
${
chatParameter
.
obj
}
/msgs?
${
q
.
join
(
"&"
)}
`
);
}
/** 查询上一页消息 */
public
async
queryPrevPageMsg
(
chatType
:
string
,
...
...
@@ -398,7 +448,8 @@ export class Xim {
}
private
debug
(
message
:
any
,
...
params
:
any
[])
{
ChatLoggerService
.
logger
&&
ChatLoggerService
.
logger
.
debug
(
message
,
params
);
ChatLoggerService
.
logger
&&
ChatLoggerService
.
logger
.
debug
(
message
,
params
);
}
public
registerOnMessage
(
vue
:
Vue
,
action
:
(
e
:
Message
)
=>
void
)
{
...
...
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