20200611-zlp-1
培训视频(七牛设置私有空间)管理
This commit is contained in:
@ -349,14 +349,14 @@ export default {
|
|||||||
file.type === "video/avi" ||
|
file.type === "video/avi" ||
|
||||||
file.type === "video/wmv" ||
|
file.type === "video/wmv" ||
|
||||||
file.type === "video/rmvb";
|
file.type === "video/rmvb";
|
||||||
const isLt500M = file.size / 1024 / 1024 < 500;
|
const isLt1000M = file.size / 1024 / 1024 < 1000;
|
||||||
if (!isVideo) {
|
if (!isVideo) {
|
||||||
this.msgError("请上传正确格式的视频!");
|
this.msgError("请上传正确格式的视频!");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.form.filetype = file.type;
|
this.form.filetype = file.type;
|
||||||
if (!isLt500M) {
|
if (!isLt1000M) {
|
||||||
this.msgError("上传视频文件大小不能超过 500MB!");
|
this.msgError("上传视频文件大小不能超过 1000MB!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ export default {
|
|||||||
sources: [
|
sources: [
|
||||||
{
|
{
|
||||||
type: response.data.filetype,
|
type: response.data.filetype,
|
||||||
src: "https://files.benyiedu.com/" + response.data.videourl
|
src: response.data.videourl
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
notSupportedMessage: "此视频暂无法播放,请稍后再试",
|
notSupportedMessage: "此视频暂无法播放,请稍后再试",
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listVideo, getVideo } from "@/api/benyi_train/video";
|
import { listVideo, getVideo, privateDownloadUrl } from "@/api/benyi_train/video";
|
||||||
import { listAllLecturer } from "@/api/benyi_train/lecturer";
|
import { listAllLecturer } from "@/api/benyi_train/lecturer";
|
||||||
import { listMoedata } from "@/api/system/moedata";
|
import { listMoedata } from "@/api/system/moedata";
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ export default {
|
|||||||
{
|
{
|
||||||
type: ele.filetype,
|
type: ele.filetype,
|
||||||
// mp4
|
// mp4
|
||||||
src: "https://files.benyiedu.com/" + ele.videourl
|
src: ele.videourl
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
notSupportedMessage: "此视频暂无法播放,请稍后再试",
|
notSupportedMessage: "此视频暂无法播放,请稍后再试",
|
||||||
|
@ -14,6 +14,21 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String UTF8 = "UTF-8";
|
public static final String UTF8 = "UTF-8";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GBK 字符集
|
||||||
|
*/
|
||||||
|
public static final String GBK = "GBK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* http请求
|
||||||
|
*/
|
||||||
|
public static final String HTTP = "http://";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https请求
|
||||||
|
*/
|
||||||
|
public static final String HTTPS = "https://";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用成功标识
|
* 通用成功标识
|
||||||
*/
|
*/
|
||||||
@ -94,6 +109,16 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String JWT_AUTHORITIES = "authorities";
|
public static final String JWT_AUTHORITIES = "authorities";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数管理 cache key
|
||||||
|
*/
|
||||||
|
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典管理 cache key
|
||||||
|
*/
|
||||||
|
public static final String SYS_DICT_KEY = "sys_dict:";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资源映射路径 前缀
|
* 资源映射路径 前缀
|
||||||
*/
|
*/
|
||||||
|
64
ruoyi/src/main/java/com/ruoyi/common/utils/DictUtils.java
Normal file
64
ruoyi/src/main/java/com/ruoyi/common/utils/DictUtils.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
import com.ruoyi.framework.redis.RedisCache;
|
||||||
|
import com.ruoyi.project.system.domain.SysDictData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典工具类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class DictUtils
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 设置字典缓存
|
||||||
|
*
|
||||||
|
* @param key 参数键
|
||||||
|
* @param dictDatas 字典数据列表
|
||||||
|
*/
|
||||||
|
public static void setDictCache(String key, List<SysDictData> dictDatas)
|
||||||
|
{
|
||||||
|
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典缓存
|
||||||
|
*
|
||||||
|
* @param key 参数键
|
||||||
|
* @return dictDatas 字典数据列表
|
||||||
|
*/
|
||||||
|
public static List<SysDictData> getDictCache(String key)
|
||||||
|
{
|
||||||
|
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||||
|
if (StringUtils.isNotNull(cacheObj))
|
||||||
|
{
|
||||||
|
List<SysDictData> DictDatas = StringUtils.cast(cacheObj);
|
||||||
|
return DictDatas;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空字典缓存
|
||||||
|
*/
|
||||||
|
public static void clearDictCache()
|
||||||
|
{
|
||||||
|
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
|
||||||
|
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置cache key
|
||||||
|
*
|
||||||
|
* @param configKey 参数键
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
public static String getCacheKey(String configKey)
|
||||||
|
{
|
||||||
|
return Constants.SYS_DICT_KEY + configKey;
|
||||||
|
}
|
||||||
|
}
|
@ -450,4 +450,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static <T> T cast(Object obj)
|
||||||
|
{
|
||||||
|
return (T) obj;
|
||||||
|
}
|
||||||
}
|
}
|
@ -18,6 +18,7 @@ import javax.net.ssl.TrustManager;
|
|||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用http发送方法
|
* 通用http发送方法
|
||||||
@ -36,6 +37,19 @@ public class HttpUtils
|
|||||||
* @return 所代表远程资源的响应结果
|
* @return 所代表远程资源的响应结果
|
||||||
*/
|
*/
|
||||||
public static String sendGet(String url, String param)
|
public static String sendGet(String url, String param)
|
||||||
|
{
|
||||||
|
return sendGet(url, param, Constants.UTF8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向指定 URL 发送GET方法的请求
|
||||||
|
*
|
||||||
|
* @param url 发送请求的 URL
|
||||||
|
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||||
|
* @param contentType 编码类型
|
||||||
|
* @return 所代表远程资源的响应结果
|
||||||
|
*/
|
||||||
|
public static String sendGet(String url, String param, String contentType)
|
||||||
{
|
{
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
@ -49,7 +63,7 @@ public class HttpUtils
|
|||||||
connection.setRequestProperty("connection", "Keep-Alive");
|
connection.setRequestProperty("connection", "Keep-Alive");
|
||||||
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
||||||
connection.connect();
|
connection.connect();
|
||||||
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType));
|
||||||
String line;
|
String line;
|
||||||
while ((line = in.readLine()) != null)
|
while ((line = in.readLine()) != null)
|
||||||
{
|
{
|
||||||
@ -104,7 +118,7 @@ public class HttpUtils
|
|||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String urlNameString = url + "?" + param;
|
String urlNameString = url;
|
||||||
log.info("sendPost - {}", urlNameString);
|
log.info("sendPost - {}", urlNameString);
|
||||||
URL realUrl = new URL(urlNameString);
|
URL realUrl = new URL(urlNameString);
|
||||||
URLConnection conn = realUrl.openConnection();
|
URLConnection conn = realUrl.openConnection();
|
||||||
|
@ -3,6 +3,7 @@ package com.ruoyi.common.utils.ip;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
import com.ruoyi.common.utils.http.HttpUtils;
|
||||||
import com.ruoyi.framework.config.RuoYiConfig;
|
import com.ruoyi.framework.config.RuoYiConfig;
|
||||||
@ -16,11 +17,15 @@ public class AddressUtils
|
|||||||
{
|
{
|
||||||
private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
|
private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
|
||||||
|
|
||||||
public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
|
// IP地址查询
|
||||||
|
public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp";
|
||||||
|
|
||||||
|
// 未知地址
|
||||||
|
public static final String UNKNOWN = "XX XX";
|
||||||
|
|
||||||
public static String getRealAddressByIP(String ip)
|
public static String getRealAddressByIP(String ip)
|
||||||
{
|
{
|
||||||
String address = "XX XX";
|
String address = UNKNOWN;
|
||||||
// 内网不查询
|
// 内网不查询
|
||||||
if (IpUtils.internalIp(ip))
|
if (IpUtils.internalIp(ip))
|
||||||
{
|
{
|
||||||
@ -28,17 +33,23 @@ public class AddressUtils
|
|||||||
}
|
}
|
||||||
if (RuoYiConfig.isAddressEnabled())
|
if (RuoYiConfig.isAddressEnabled())
|
||||||
{
|
{
|
||||||
String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
|
try
|
||||||
if (StringUtils.isEmpty(rspStr))
|
{
|
||||||
|
String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK);
|
||||||
|
if (StringUtils.isEmpty(rspStr))
|
||||||
|
{
|
||||||
|
log.error("获取地理位置异常 {}", ip);
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
JSONObject obj = JSONObject.parseObject(rspStr);
|
||||||
|
String region = obj.getString("pro");
|
||||||
|
String city = obj.getString("city");
|
||||||
|
return String.format("%s %s", region, city);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.error("获取地理位置异常 {}", ip);
|
log.error("获取地理位置异常 {}", ip);
|
||||||
return address;
|
|
||||||
}
|
}
|
||||||
JSONObject obj = JSONObject.parseObject(rspStr);
|
|
||||||
JSONObject data = obj.getObject("data", JSONObject.class);
|
|
||||||
String region = data.getString("region");
|
|
||||||
String city = data.getString("city");
|
|
||||||
address = region + " " + city;
|
|
||||||
}
|
}
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.net.InetAddress;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.html.EscapeUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取IP方法
|
* 获取IP方法
|
||||||
@ -40,7 +41,7 @@ public class IpUtils
|
|||||||
{
|
{
|
||||||
ip = request.getRemoteAddr();
|
ip = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
|
ip = EscapeUtil.clean(ip);// 清除Xss特殊字符
|
||||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.project.common.CommonController;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -31,10 +32,11 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/benyi/video")
|
@RequestMapping("/benyi/video")
|
||||||
public class ByTrainVideoController extends BaseController
|
public class ByTrainVideoController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IByTrainVideoService byTrainVideoService;
|
private IByTrainVideoService byTrainVideoService;
|
||||||
|
@Autowired
|
||||||
|
private CommonController commonController;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,10 +44,16 @@ public class ByTrainVideoController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('benyi:video:list')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(ByTrainVideo byTrainVideo)
|
public TableDataInfo list(ByTrainVideo byTrainVideo) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<ByTrainVideo> list = byTrainVideoService.selectByTrainVideoList(byTrainVideo);
|
List<ByTrainVideo> list = byTrainVideoService.selectByTrainVideoList(byTrainVideo);
|
||||||
|
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
list.get(i).setVideourl(commonController.privateDownloadUrl(list.get(i).getVideourl()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,8 +63,7 @@ public class ByTrainVideoController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('benyi:video:export')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:export')")
|
||||||
@Log(title = "培训", businessType = BusinessType.EXPORT)
|
@Log(title = "培训", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public AjaxResult export(ByTrainVideo byTrainVideo)
|
public AjaxResult export(ByTrainVideo byTrainVideo) {
|
||||||
{
|
|
||||||
List<ByTrainVideo> list = byTrainVideoService.selectByTrainVideoList(byTrainVideo);
|
List<ByTrainVideo> list = byTrainVideoService.selectByTrainVideoList(byTrainVideo);
|
||||||
ExcelUtil<ByTrainVideo> util = new ExcelUtil<ByTrainVideo>(ByTrainVideo.class);
|
ExcelUtil<ByTrainVideo> util = new ExcelUtil<ByTrainVideo>(ByTrainVideo.class);
|
||||||
return util.exportExcel(list, "video");
|
return util.exportExcel(list, "video");
|
||||||
@ -67,9 +74,10 @@ public class ByTrainVideoController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('benyi:video:query')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
{
|
ByTrainVideo byTrainVideo = byTrainVideoService.selectByTrainVideoById(id);
|
||||||
return AjaxResult.success(byTrainVideoService.selectByTrainVideoById(id));
|
byTrainVideo.setVideourl(commonController.privateDownloadUrl(byTrainVideo.getVideourl()));
|
||||||
|
return AjaxResult.success(byTrainVideo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,8 +86,7 @@ public class ByTrainVideoController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('benyi:video:add')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:add')")
|
||||||
@Log(title = "培训", businessType = BusinessType.INSERT)
|
@Log(title = "培训", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody ByTrainVideo byTrainVideo)
|
public AjaxResult add(@RequestBody ByTrainVideo byTrainVideo) {
|
||||||
{
|
|
||||||
byTrainVideo.setCreatetime(new Date());
|
byTrainVideo.setCreatetime(new Date());
|
||||||
byTrainVideo.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
byTrainVideo.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||||
return toAjax(byTrainVideoService.insertByTrainVideo(byTrainVideo));
|
return toAjax(byTrainVideoService.insertByTrainVideo(byTrainVideo));
|
||||||
@ -91,8 +98,7 @@ public class ByTrainVideoController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('benyi:video:edit')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:edit')")
|
||||||
@Log(title = "培训", businessType = BusinessType.UPDATE)
|
@Log(title = "培训", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody ByTrainVideo byTrainVideo)
|
public AjaxResult edit(@RequestBody ByTrainVideo byTrainVideo) {
|
||||||
{
|
|
||||||
return toAjax(byTrainVideoService.updateByTrainVideo(byTrainVideo));
|
return toAjax(byTrainVideoService.updateByTrainVideo(byTrainVideo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,9 +107,8 @@ public class ByTrainVideoController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('benyi:video:remove')")
|
@PreAuthorize("@ss.hasPermi('benyi:video:remove')")
|
||||||
@Log(title = "培训", businessType = BusinessType.DELETE)
|
@Log(title = "培训", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
{
|
|
||||||
return toAjax(byTrainVideoService.deleteByTrainVideoByIds(ids));
|
return toAjax(byTrainVideoService.deleteByTrainVideoByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class CommonController {
|
|||||||
@Resource
|
@Resource
|
||||||
private FileConfig fileConfig;
|
private FileConfig fileConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileConfig constantQiniu;
|
private FileConfig constantQiniu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用下载请求
|
* 通用下载请求
|
||||||
@ -133,9 +133,19 @@ public class CommonController {
|
|||||||
System.out.println("auth:" + auth);
|
System.out.println("auth:" + auth);
|
||||||
String upToken = auth.uploadToken(constantQiniu.getBucket());
|
String upToken = auth.uploadToken(constantQiniu.getBucket());
|
||||||
ajax.put("token", upToken);
|
ajax.put("token", upToken);
|
||||||
|
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String privateDownloadUrl(String URL) {
|
||||||
|
|
||||||
|
Auth auth = Auth.create(constantQiniu.getAccessKey(), constantQiniu.getSecretKey());
|
||||||
|
String downloadURL = auth.privateDownloadUrl(constantQiniu.getDomain() + URL, 60);
|
||||||
|
//System.out.println("test=" + downloadURL);
|
||||||
|
|
||||||
|
return downloadURL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本地资源通用下载
|
* 本地资源通用下载
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user