七牛云签算播放时间
This commit is contained in:
parent
e8e2434dbd
commit
ea4f4d18bf
@ -103,6 +103,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()));
|
||||||
|
// 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);
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ public class CommonController {
|
|||||||
public String privateDownloadUrl(String URL) {
|
public String privateDownloadUrl(String URL) {
|
||||||
|
|
||||||
Auth auth = Auth.create(constantQiniu.getAccessKey(), constantQiniu.getSecretKey());
|
Auth auth = Auth.create(constantQiniu.getAccessKey(), constantQiniu.getSecretKey());
|
||||||
String downloadURL = auth.privateDownloadUrl(constantQiniu.getDomain() + URL, 60);
|
String downloadURL = auth.privateDownloadUrl(constantQiniu.getDomain() + URL, 3600);
|
||||||
//System.out.println("test=" + downloadURL);
|
//System.out.println("test=" + downloadURL);
|
||||||
|
|
||||||
return downloadURL;
|
return downloadURL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user