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
5893efae
authored
Oct 21, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
cs
parent
39bbc202
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
14 deletions
service/emoji.ts
service/request.ts
store/index.ts
service/emoji.ts
View file @
5893efae
...
...
@@ -18,14 +18,7 @@ export class EmojiService {
private
static
ready
=
false
;
private
static
token
:
TokenStringGetter
;
private
static
beforeReadyCacheAction
:
Function
[]
=
[];
private
url
=
""
;
public
constructor
()
{
this
.
url
=
process
.
env
.
NODE_ENV
===
"production"
?
"https://file.teammix.com"
:
""
;
}
private
readonly
url
=
"https://file.teammix.com"
;
public
async
getEmoji
()
{
if
(
cacheEmoji
)
{
...
...
service/request.ts
View file @
5893efae
import
Axios
from
"axios"
;
import
qs
from
"qs"
;
import
chat
from
"../xim/index"
;
export
function
buildConfig
(
token
:
string
,
url
:
string
)
{
...
...
@@ -9,6 +8,7 @@ export function buildConfig(token: string, url: string) {
}
return
{
headers
:
{
Authorization
:
token
}
};
}
export
function
invokeGet
<
T
>
(
url
:
string
,
token
:
string
)
{
return
new
Promise
<
T
>
((
resolve
,
reject
)
=>
{
Axios
.
get
(
url
,
buildConfig
(
token
,
url
))
...
...
store/index.ts
View file @
5893efae
...
...
@@ -31,7 +31,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
}
...
...
@@ -52,13 +52,13 @@ async function preCacheImgs(msgs?: any[]) {
return
Promise
.
resolve
();
}
await
Promise
.
all
(
msgs
.
map
((
k
)
=>
{
msgs
.
filter
(
i
=>
i
.
id
>
0
).
map
((
k
)
=>
{
return
new
Promise
((
resolve
:
(
p
:
void
)
=>
void
)
=>
{
if
(
k
.
type
===
"image"
)
{
const
msg
=
JSON
.
parse
(
k
.
msg
);
const
url
=
msg
.
url
;
if
(
!
isAccessibleUrl
(
url
))
{
resolve
();
re
turn
re
solve
();
}
if
(
url
&&
...
...
@@ -315,7 +315,7 @@ export default {
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
=
[...
current
];
}
},
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
const
setTimeoutId
:
{
[
key
:
string
]:
number
}
=
{};
return
(
state
:
ChatStoreState
,
...
...
@@ -717,7 +717,7 @@ export default {
}
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
);
...
...
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