Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
8383bf0d
提交
8383bf0d
authored
6月 12, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:小旋风Ⅱ操作视频
上级
7306cd85
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
11 行增加
和
5 行删除
+11
-5
commonType.ts
src/api/interface/commonType.ts
+2
-0
common.ts
src/api/modules/common.ts
+2
-2
index.tsx
src/components/uploader/index.tsx
+7
-3
没有找到文件。
src/api/interface/commonType.ts
浏览文件 @
8383bf0d
...
@@ -15,3 +15,5 @@ export type BackEndLoginType = InterFunction<
...
@@ -15,3 +15,5 @@ export type BackEndLoginType = InterFunction<
>
;
>
;
// 上传图片
// 上传图片
export
type
uploadOssType
=
InterFunction
<
any
,
{
filePath
:
string
}
>
;
export
type
uploadOssType
=
InterFunction
<
any
,
{
filePath
:
string
}
>
;
// 断电上传
export
type
uploadOssBPType
=
InterFunction
<
any
,
any
>
;
src/api/modules/common.ts
浏览文件 @
8383bf0d
import
axios
from
'../request'
;
import
axios
from
'../request'
;
import
{
BackEndLoginType
,
uploadOssType
}
from
'~/api/interface/commonType'
;
import
{
BackEndLoginType
,
uploadOss
BPType
,
uploadOss
Type
}
from
'~/api/interface/commonType'
;
export
class
CommonAPI
{
export
class
CommonAPI
{
// 用户登录
// 用户登录
...
@@ -10,5 +10,5 @@ export class CommonAPI {
...
@@ -10,5 +10,5 @@ export class CommonAPI {
static
uploadOss
:
uploadOssType
=
(
data
)
=>
axios
.
post
(
'/pms/upload/oss'
,
data
);
static
uploadOss
:
uploadOssType
=
(
data
)
=>
axios
.
post
(
'/pms/upload/oss'
,
data
);
// 断点上传
// 断点上传
static
uploadOssBP
:
uploadOssType
=
(
data
)
=>
axios
.
post
(
'/pms/upload/breakpoint'
,
data
);
static
uploadOssBP
:
uploadOss
BP
Type
=
(
data
)
=>
axios
.
post
(
'/pms/upload/breakpoint'
,
data
);
}
}
src/components/uploader/index.tsx
浏览文件 @
8383bf0d
...
@@ -80,7 +80,9 @@ export const Uploader: React.FC<PropsType> = (props) => {
...
@@ -80,7 +80,9 @@ export const Uploader: React.FC<PropsType> = (props) => {
CommonAPI
.
uploadOssBP
(
formData
).
then
(
CommonAPI
.
uploadOssBP
(
formData
).
then
(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore
(
val
:
{
result
:
{
filePath
:
string
}
})
=>
{
//(val: { result: { filePath: string } }) => {
({
result
})
=>
{
console
.
log
(
result
);
setFileList
([
setFileList
([
...
fileList
,
...
fileList
,
{
{
...
@@ -89,7 +91,8 @@ export const Uploader: React.FC<PropsType> = (props) => {
...
@@ -89,7 +91,8 @@ export const Uploader: React.FC<PropsType> = (props) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore
name
:
res
.
file
.
name
,
name
:
res
.
file
.
name
,
url
:
val
.
result
.
filePath
,
// url: val.result.filePath,
url
:
result
,
},
},
]);
]);
onChange
?.([
onChange
?.([
...
@@ -100,7 +103,8 @@ export const Uploader: React.FC<PropsType> = (props) => {
...
@@ -100,7 +103,8 @@ export const Uploader: React.FC<PropsType> = (props) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// @ts-ignore
name
:
res
.
file
.
name
,
name
:
res
.
file
.
name
,
url
:
val
.
result
.
filePath
,
// url: val.result.filePath,
url
:
result
,
},
},
]);
]);
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论