Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
Overview
Overview
Details
Activity
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
qlintonger xeno
standalone-anyremote
Commits
d16b3c3b
Commit
d16b3c3b
authored
May 06, 2024
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加内容+11
parent
0cd1cbbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
anyremote/agoraHandle.js
+20
-0
src/api/alova-instance.ts
+2
-1
src/views/remote/videoCall/videoChat.vue
+19
-5
No files found.
anyremote/agoraHandle.js
View file @
d16b3c3b
...
...
@@ -416,6 +416,26 @@ export class AgoraHandle {
)
}
sendFile
(
data
)
{
const
channelID
=
chatChannelState
.
value
.
chatChannelId
;
const
fromName
=
userStates
.
value
.
currentUserName
this
.
AnyRemote
.
sendWSFromCall
(
'-2'
,
'ChatFile'
,
{
msgId
:
generateMessageId
(),
quoteId
:
""
,
channelID
,
fromName
,
tip
:
{
fileUrl
:
data
.
fileUrl
,
fileName
:
data
.
fileName
,
fileSize
:
data
.
fileSize
,
fileType
:
"file"
}
}
)
}
sendVideo
(
data
,
fileType
=
'video'
)
{
const
channelID
=
chatChannelState
.
value
.
chatChannelId
;
const
fromName
=
userStates
.
value
.
currentUserName
...
...
src/api/alova-instance.ts
View file @
d16b3c3b
...
...
@@ -38,7 +38,8 @@ export const alova = createAlova({
appStore
.
count
++
}
// 设置请求头application/json;charset=UTF-8
const
isUpload
=
method
.
meta
?.
isUpload
const
isUpload
=
method
.
config
?.
meta
?.
isUpload
console
.
log
(
'the upload here'
,
isUpload
,
method
)
if
(
isUpload
&&
method
.
data
)
{
method
.
data
=
Object
.
entries
(
method
.
data
).
reduce
(
function
(
q
,
w
)
{
if
(
!
(
w
[
1
]
instanceof
File
))
{
...
...
src/views/remote/videoCall/videoChat.vue
View file @
d16b3c3b
...
...
@@ -40,21 +40,21 @@
</div>
<div
class=
"px-4 py-2"
>
<a-space
size=
"medium"
>
<a-upload
:custom-request=
"
uploadMuFile
"
:show-file-list=
"false"
accept=
"image/*"
>
<a-upload
:custom-request=
"
option => uploadMuFile(option, 'image')
"
:show-file-list=
"false"
accept=
"image/*"
>
<template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
:size=
"15"
icon=
"image"
></global-icon>
</div>
</
template
>
</a-upload>
<a-upload
:custom-request=
"
uploadMuFile
"
:show-file-list=
"false"
accept=
".pdf"
>
<a-upload
:custom-request=
"
option => uploadMuFile(option, 'file')
"
:show-file-list=
"false"
accept=
".pdf"
>
<
template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
:size=
"15"
icon=
"pdf"
></global-icon>
</div>
</
template
>
</a-upload>
<a-upload
:custom-request=
"
uploadMuFile
"
:show-file-list=
"false"
accept=
"video/*"
>
<a-upload
:custom-request=
"
option => uploadMuFile(option, 'video')
"
:show-file-list=
"false"
accept=
"video/*"
>
<
template
#
upload-button
>
<div
class=
"flex-center px-3 py-1 rounded cursor-pointer bg-fill-bg1"
>
<global-icon
:size=
"15"
icon=
"video"
></global-icon>
...
...
@@ -91,7 +91,7 @@ function sendMessageText() {
}
}
const
uploadMuFile
=
(
option
:
any
)
=>
{
const
uploadMuFile
=
(
option
:
any
,
type
:
string
)
=>
{
const
{
onError
,
fileItem
}
=
option
const
params
=
{
apiPwd
:
'Ifar$2_0160_525_Mocp'
,
...
...
@@ -104,13 +104,27 @@ const uploadMuFile = (option: any) => {
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
'发送内容'
,
res
)
const
dataFormed
=
{
fileUrl
:
res
.
data
.
url
,
fileName
:
res
.
data
.
name
,
fileSize
:
Number
.
parseInt
(
res
.
data
.
size
),
fileType
:
type
}
if
(
type
===
'pdf'
)
{
AnyR
?.
agora
.
sendFile
(
dataFormed
)
}
else
if
(
type
===
'image'
)
{
AnyR
?.
agora
.
sendImage
(
dataFormed
)
}
else
{
AnyR
?.
agora
.
sendVideo
(
dataFormed
)
}
Message
.
success
(
'发送成功'
)
}
else
{
onError
(
new
Error
(
'Upload failed'
))
Message
.
success
(
'发送失败'
)
Message
.
error
(
'发送失败'
)
}
})
.
catch
((
error
)
=>
{
console
.
log
(
'出现错误'
,
error
);
onError
(
error
)
})
as
any
}
...
...
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