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
e5a7e365
authored
Oct 21, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
2aff577f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
xim/index.ts
xim/xim.ts
xim/index.ts
View file @
e5a7e365
...
...
@@ -21,6 +21,7 @@ class Chat {
private
product
=
CustomerServiceProduct
.
Default
;
private
eventHub
:
Vue
|
null
=
null
;
private
keywords
:
string
[]
=
[];
private
ws
=
""
;
private
userMapping
:
{
[
key
:
string
]:
{
name
:
string
;
avatar
:
string
}
}
=
{};
...
...
@@ -48,12 +49,7 @@ class Chat {
};
}
dbController
.
setup
(
this
.
_sdk
().
global
.
uid
+
"-"
+
(
this
.
_sdk
().
global
.
initData
.
orgId
||
0
)
);
this
.
setupIndexDb
();
this
.
token
=
async
()
=>
option
.
sdk
().
global
.
jwtToken
;
tokenManager
.
save
(
this
.
token
);
...
...
@@ -67,7 +63,21 @@ class Chat {
// this.keywords = ["社保"];
return
this
.
initChatSdk
(
option
.
webSocketUri
);
return
this
.
initChatSdk
((
this
.
ws
=
option
.
webSocketUri
));
}
private
setupIndexDb
()
{
return
dbController
.
setup
(
this
.
_sdk
().
global
.
uid
+
"-"
+
(
this
.
_sdk
().
global
.
initData
.
orgId
||
0
)
);
}
public
resetup
(
org
:
()
=>
string
|
number
)
{
this
.
_orgId
=
org
;
xim
.
onConnected
();
return
this
.
setupIndexDb
();
}
public
unSetup
()
{
...
...
xim/xim.ts
View file @
e5a7e365
...
...
@@ -334,7 +334,7 @@ export class Xim {
return
[
args
.
slice
(
0
,
-
1
).
join
(
"."
),
listener
];
}
p
rivate
onConnected
()
{
p
ublic
onConnected
()
{
if
(
this
.
client
==
null
)
return
;
// 连接成功后,需要调用pubUserInfo, 否则服务端会认为此连接无效
this
.
client
.
pubUserInfo
(
JSON
.
stringify
({
org_id
:
chat
.
getOrgId
()
}));
...
...
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