Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
wanda-ball
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c5c90ea9
authored
Jun 11, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传进度
parent
569192ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
src/pages/index/ImgUp2.vue
+16
-7
src/pages/index/index.js
+1
-1
No files found.
src/pages/index/ImgUp2.vue
View file @
c5c90ea9
...
...
@@ -194,7 +194,7 @@ export default {
var
formData
=
new
FormData
();
// formData.append('name', flie.name)
formData
.
append
(
"OSSAccessKeyId"
,
data
.
accessid
);
formData
.
append
(
"key"
,
data
.
dir
+
"/"
+
data
.
expire
+
flie
.
name
);
formData
.
append
(
"key"
,
data
.
dir
+
data
.
expire
+
flie
.
name
);
formData
.
append
(
"policy"
,
data
.
policy
);
formData
.
append
(
"dir"
,
data
.
dir
);
// formData.append('name', flie)
...
...
@@ -203,11 +203,19 @@ export default {
formData
.
append
(
"success_action_status"
,
"200"
);
formData
.
append
(
"file"
,
flie
);
console
.
log
(
formData
,
data
);
// Indicator.close()
axios
.
post
(
data
.
host
,
formData
,
{
onUploadProgress
:
(
progressEvent
)
=>
{
let
complete
=
(
progressEvent
.
loaded
/
progressEvent
.
total
*
100
|
0
)
+
'%'
console
.
log
(
complete
,
'progress'
)
// Indicator.close()
document
.
querySelector
(
'.mint-indicator-text'
).
innerText
=
complete
},
headers
:
{
"Content-Type"
:
"multipart/form-data;"
}
}).
then
(
file
=>
{
Indicator
.
close
()
Indicator
.
open
({
text
:
'上传成功'
,
spinnerType
:
'fading-circle'
...
...
@@ -216,10 +224,10 @@ export default {
Indicator
.
close
()
},
500
)
resolve
({
url
:
data
.
host
+
"/"
+
data
.
dir
+
"/"
+
data
.
expire
+
flie
.
name
url
:
'https://wanda-static.bdideal.com'
+
"/"
+
data
.
dir
+
data
.
expire
+
flie
.
name
});
console
.
log
(
data
.
host
+
"/"
+
data
.
dir
+
"/"
+
data
.
expire
+
flie
.
name
data
.
host
+
"/"
+
data
.
dir
+
data
.
expire
+
flie
.
name
);
}).
catch
(
err
=>
{
Indicator
.
open
({
...
...
@@ -243,12 +251,13 @@ export default {
}
let
file
=
files
[
0
];
this
.
videoUrl
=
file
;
this
.
isPhoto
=
false
;
this
.
isPreivw
=
true
;
// this.videoUrl = file;
console
.
log
(
files
,
"event"
,
files
[
0
].
size
/
1024
/
1024
);
this
.
upload
(
file
).
then
(
res
=>
{
this
.
videoUrl
=
res
.
url
this
.
isPhoto
=
false
;
this
.
isPreivw
=
true
;
})
// this.createImage(files, e);
},
...
...
@@ -343,7 +352,7 @@ export default {
axios
.
post
(
"/contest/join"
,
{
image
:
''
,
product_type
:
1
,
product_type
:
2
,
title
:
this
.
title
,
video
:
this
.
videoUrl
,
desc
:
this
.
desc
,
...
...
src/pages/index/index.js
View file @
c5c90ea9
...
...
@@ -17,7 +17,7 @@ import api from '@/modules/js/api.js';
import
VueLazyload
from
'vue-lazyload'
;
axios
.
defaults
.
baseURL
=
api
.
server
;
axios
.
defaults
.
timeout
=
10000
;
axios
.
defaults
.
timeout
=
1000
*
60
*
1
0
;
// axios.defaults.headers.common['systemtype'] = api.extra;
import
'@/modules/js/request.js'
...
...
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