Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
5d021c2f
Commit
5d021c2f
authored
Sep 30, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新整理七牛JS
parent
b7f2759f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
9 deletions
+44
-9
video-upload.vue
src/frontend/web/js/components/common/video-upload.vue
+4
-9
qiniu.js
src/frontend/web/js/utils/qiniu.js
+40
-0
No files found.
src/frontend/web/js/components/common/video-upload.vue
View file @
5d021c2f
...
...
@@ -58,8 +58,8 @@ export default {
var
self
=
this
,
startTime
;
require
.
ensure
([
"../../
libs/plupload/plupload.full.min.js
"
,
"moment"
],
function
()
{
require
(
"script!../../libs/plupload/plupload.full.min.js
"
);
require
.
ensure
([
"../../
utils/qiniu
"
,
"moment"
],
function
()
{
var
qiniu
=
require
(
"../../utils/qiniu
"
);
var
moment
=
require
(
"moment"
);
moment
.
locale
(
'zh-cn'
,
{
...
...
@@ -80,17 +80,12 @@ export default {
}
});
var
uploader
=
new
plupload
.
Uploader
({
runtimes
:
'html5,flash,html4'
,
var
uploader
=
new
qiniu
.
Uploader
({
browse_button
:
'uploadVideo1'
,
drop_element
:
'uploadVideo1'
,
url
:
"http://upload.qiniu.com/"
,
multipart_params
:
{
token
:
self
.
uptoken
},
upload_token
:
self
.
uptoken
,
max_file_size
:
'2gb'
,
flash_swf_url
:
__CDN_URL__
+
'assets/plupload/Moxie.swf'
,
max_retries
:
0
,
dragdrop
:
true
,
multi_selection
:
false
,
auto_start
:
true
,
...
...
src/frontend/web/js/utils/qiniu.js
0 → 100644
View file @
5d021c2f
/**
* Created by pader on 16/9/30.
*
* 七牛上传组件
*
* e.g.
* //建议使用 require.ensure 方式加载
* var qiniu = require("utils/qiniu.js");
*
* var uploader = new qiniu.Uploader({
* upload_token: "<UPLOAD_TOKEN>",
* ..其它参数与 plupload 一致
* });
*
* uploader.init();
*/
require
(
"script!../libs/plupload/plupload.full.min.js"
);
module
.
exports
=
{
Uploader
:
function
(
option
)
{
var
setting
=
{
runtimes
:
'html5,flash,html4'
,
url
:
"http://upload.qiniu.com/"
,
multipart_params
:
{},
flash_swf_url
:
__CDN_URL__
+
'assets/plupload/Moxie.swf'
,
max_retries
:
0
};
if
(
!
option
.
multipart_params
)
{
option
.
multipart_params
=
{};
}
option
.
multipart_params
.
token
=
option
.
upload_token
;
delete
option
.
upload_token
;
$
.
extend
(
true
,
option
,
setting
);
return
(
new
plupload
.
Uploader
(
option
));
}
};
\ No newline at end of file
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