Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
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
web_component
submodule
Commits
35f7c964
Commit
35f7c964
authored
May 24, 2020
by
满振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改路径
parent
0a2afe77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
common.tsx
components/braftEditor/common.tsx
+2
-2
uploadQIniu.tsx
components/braftEditor/uploadQIniu.tsx
+3
-2
No files found.
components/braftEditor/common.tsx
View file @
35f7c964
...
...
@@ -3,7 +3,7 @@ import request from '@/utils/request';
// 文件上传获取token
export
function
getToken
()
{
return
request
(
'/qiniu/token'
,
{
method
:
'get'
,
prefix
:
'/adminApi'
});
return
request
(
'/qiniu/token'
,
{
method
:
'get'
,
prefix
:
'/adminApi'
,
params
:
{
bucket
:
'apollo-influencer'
}
});
}
...
...
@@ -15,7 +15,7 @@ export function getToken() {
* @returns {string} 返回随机字符串
*/
export
function
getRandom
(
len
=
6
,
type
?:
string
,
extra
?:
string
):
string
{
export
function
getRandom
(
len
=
6
,
type
?:
string
,
extra
?:
string
):
string
{
const
num
=
'0123456789'
;
const
letter
=
'abcdefghigklmnopqrstuvwxyz'
;
const
upLetter
=
letter
.
toUpperCase
();
...
...
components/braftEditor/uploadQIniu.tsx
View file @
35f7c964
...
...
@@ -13,9 +13,10 @@ interface IProps {
successCbk
?:
Function
,
// 成功回调
percentCbk
?:
Function
,
// 进度条回调
language
?:
'zh'
|
'en'
;
actionUrl
?:
string
;
}
const
UploadCom
:
React
.
FC
<
IProps
>
=
({
maxSize
=
maxSizeDefault
,
successCbk
,
percentCbk
,
language
=
'zh'
})
=>
{
const
UploadCom
:
React
.
FC
<
IProps
>
=
({
maxSize
=
maxSizeDefault
,
actionUrl
,
successCbk
,
percentCbk
,
language
=
'zh'
})
=>
{
const
[
token
,
setToken
]
=
useState
(
''
);
const
[
domain
,
setDomain
]
=
useState
(
''
);
...
...
@@ -80,7 +81,7 @@ const UploadCom:React.FC<IProps> = ({ maxSize = maxSizeDefault, successCbk, perc
return
(
<
Upload
action=
"https://upload-z1.qiniup.com/"
// 七牛上传地址
action=
{
actionUrl
||
'https://up-na0.qiniup.com/'
}
// 七牛上传地址
data=
{
getData
}
beforeUpload=
{
beforeUpload
}
onChange=
{
onChange
}
...
...
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