视频-七牛

This commit is contained in:
zhanglipeng
2021-01-29 17:42:09 +08:00
parent 611695463a
commit bccd850ae6
5 changed files with 60 additions and 61 deletions

View File

@ -27,7 +27,7 @@ export function downLoadVideoUrl(str) {
headers: { 'Authorization': 'Bearer ' + getToken() }, headers: { 'Authorization': 'Bearer ' + getToken() },
}).then(res => { }).then(res => {
// console.log(res); // console.log(res);
res.send(); return res.data
}) })
} }
@ -40,8 +40,7 @@ export function downLoadUrl(str, item) {
headers: { 'Authorization': 'Bearer ' + getToken() }, headers: { 'Authorization': 'Bearer ' + getToken() },
}).then(res => { }).then(res => {
// console.log(res); // console.log(res);
// downloadFileFun(res.data, item) downloadFileFun(res.data, item)
res.send();
}) })
} }

View File

@ -22,8 +22,8 @@
<span>{{ i + 1 }}.</span> <span>{{ i + 1 }}.</span>
<i class="el-icon-document icon"></i>{{ ele.name }} <i class="el-icon-document icon"></i>{{ ele.name }}
</div> </div>
<!-- <a class="right" :href="apiurl + ele.fileurl">下载</a> --> <a class="right" :href="apiurl + ele.fileurl">下载</a>
<a class="right" @click="down(ele)">下载</a> <!-- <a class="right" @click="down(ele)">下载</a> -->
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -176,7 +176,6 @@ export default {
listVideo(this.queryParams).then((response) => { listVideo(this.queryParams).then((response) => {
this.videoList = response.rows; this.videoList = response.rows;
this.playerOptions = response.rows.map((ele) => { this.playerOptions = response.rows.map((ele) => {
console.log(ele.videourl);
return { return {
autoplay: false, autoplay: false,
muted: true, muted: true,
@ -187,8 +186,8 @@ export default {
{ {
type: ele.filetype, type: ele.filetype,
// mp4 // mp4
// src: ele.videourl src: ele.videourl
src: downLoadVideoUrl(ele.videourl), // src: downLoadVideoUrl(ele.videourl),
}, },
], ],
notSupportedMessage: "此视频暂无法播放,请稍后再试", notSupportedMessage: "此视频暂无法播放,请稍后再试",

View File

@ -94,9 +94,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/**/*.css", "/**/*.css",
"/**/*.js" "/**/*.js"
).permitAll() ).permitAll()
// .antMatchers("/profile/**").anonymous() .antMatchers("/profile/**").anonymous()
// .antMatchers("/common/download**").anonymous() .antMatchers("/common/download**").anonymous()
// .antMatchers("/common/download/resource**").anonymous() .antMatchers("/common/download/resource**").anonymous()
.antMatchers("/swagger-ui.html").anonymous() .antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous() .antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous() .antMatchers("/webjars/**").anonymous()

View File

@ -62,8 +62,8 @@ public class ByTrainVideoController extends BaseController {
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
// list.get(i).setVideourl(commonController.privateDownloadUrl(list.get(i).getVideourl())); list.get(i).setVideourl(commonController.privateDownloadUrl(list.get(i).getVideourl()));
list.get(i).setVideourl("profile/video/"+list.get(i).getVideourl()+".mp4"); // list.get(i).setVideourl("/profile/video/"+list.get(i).getVideourl()+".mp4");
} }
} }
@ -104,6 +104,7 @@ public class ByTrainVideoController extends BaseController {
public AjaxResult getInfo(@PathVariable("id") Long id) { public AjaxResult getInfo(@PathVariable("id") Long id) {
ByTrainVideo byTrainVideo = byTrainVideoService.selectByTrainVideoById(id); ByTrainVideo byTrainVideo = byTrainVideoService.selectByTrainVideoById(id);
byTrainVideo.setVideourl(commonController.privateDownloadUrl(byTrainVideo.getVideourl())); byTrainVideo.setVideourl(commonController.privateDownloadUrl(byTrainVideo.getVideourl()));
// byTrainVideo.setVideourl("/profile/video/"+list.get(i).getVideourl()+".mp4");
// System.out.println("url:"+byTrainVideo.getVideourl()); // System.out.println("url:"+byTrainVideo.getVideourl());
byTrainVideo.setType(byTrainVideo.getType().substring(0, byTrainVideo.getType().length() - 1));//去掉后缀的,号 byTrainVideo.setType(byTrainVideo.getType().substring(0, byTrainVideo.getType().length() - 1));//去掉后缀的,号
return AjaxResult.success(byTrainVideo); return AjaxResult.success(byTrainVideo);