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
2b02de5c
authored
Jul 16, 2021
by
panjiangyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
成员名字
parent
803da04e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
components/message.vue
store/index.ts
utils/user-info.ts
components/message.vue
View file @
2b02de5c
This diff is collapsed.
Click to expand it.
store/index.ts
View file @
2b02de5c
...
...
@@ -5,6 +5,7 @@ import { ChatMember } from "../model";
import
{
isAccessibleUrl
}
from
"../service/tools"
;
import
{
unique
}
from
"../utils"
;
import
{
decode
}
from
"../utils/jwt"
;
import
{
getUserInfo
}
from
"../utils/user-info"
;
import
Chat
from
"../xim"
;
import
chatType
from
"../xim/chat-type"
;
import
xim
,
{
ChatNotifyListener
}
from
"../xim/xim"
;
...
...
@@ -548,14 +549,10 @@ export default {
chatMembers
.
map
(
async
(
member
)
=>
{
let
result
:
NonNullable
<
ChatStore
.
STATE_CURRENT_CHAT_MEMBERS
>
[
number
];
try
{
const
info
=
await
sdk
()
.
model
(
"user"
)
.
detail
(
member
.
eid
)
.
query
();
const
data
=
await
getUserInfo
(
member
.
eid
);
result
=
{
...
member
,
name
:
info
.
row
.
first_name
.
value
as
string
,
phone
:
info
.
row
.
last_name
.
value
as
string
,
...
data
,
};
}
catch
(
error
)
{
// eslint-disable-next-line no-console
...
...
@@ -621,7 +618,7 @@ export default {
});
detailManager
.
done
();
await
action
.
execute
();
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
));
await
new
Promise
(
(
resolve
)
=>
setTimeout
(
resolve
,
500
));
await
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
);
},
},
...
...
utils/user-info.ts
0 → 100644
View file @
2b02de5c
import
Chat
from
"../xim"
;
export
type
UserMapping
=
{
[
eid
:
string
]:
{
name
:
string
;
phone
:
string
;
};
};
const
userMapping
:
UserMapping
=
{};
export
const
getUserMapping
=
()
=>
userMapping
;
export
async
function
getUserInfo
(
eid
:
string
)
{
if
(
userMapping
[
eid
]
!=
null
)
return
userMapping
[
eid
];
const
info
=
await
Chat
.
getSdk
().
model
(
"user"
).
detail
(
eid
).
query
();
const
data
=
{
name
:
info
.
row
.
first_name
.
value
as
string
,
phone
:
info
.
row
.
last_name
.
value
as
string
,
};
userMapping
[
eid
]
=
data
;
return
data
;
}
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