上传成功返回全路径

This commit is contained in:
shuzheng 2017-05-15 21:58:37 +08:00
parent 4f8e149546
commit 31dcc3811a
4 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package com.zheng.oss.web.controller; package com.zheng.oss.web.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zheng.oss.common.constant.OssConstant;
import com.zheng.oss.common.constant.OssResult; import com.zheng.oss.common.constant.OssResult;
import com.zheng.oss.common.constant.OssResultConstant; import com.zheng.oss.common.constant.OssResultConstant;
import com.zheng.oss.web.service.AliyunOssService; import com.zheng.oss.web.service.AliyunOssService;
@ -53,7 +54,9 @@ public class AliyunOssController {
@ResponseBody @ResponseBody
public Object callback(HttpServletRequest request) { public Object callback(HttpServletRequest request) {
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
data.put("filename", request.getParameter("filename")); String filename = request.getParameter("filename");
filename = "http://".concat(OssConstant.ALIYUN_OSS_BUCKET_NAME).concat(".").concat(OssConstant.ALIYUN_OSS_ENDPOINT).concat("/").concat(filename);
data.put("filename", filename);
data.put("size", request.getParameter("size")); data.put("size", request.getParameter("size"));
data.put("mimeType", request.getParameter("mimeType")); data.put("mimeType", request.getParameter("mimeType"));
data.put("width", request.getParameter("width")); data.put("width", request.getParameter("width"));

View File

@ -5,9 +5,9 @@ zheng-ui.path=http://ui.zhangshuzheng.cn:1000/
### aliyun oss ### ### aliyun oss ###
aliyun.oss.endpoint=oss-cn-shanghai.aliyuncs.com aliyun.oss.endpoint=oss-cn-shanghai.aliyuncs.com
aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId= aliyun.oss.accessKeyId=LTAIujvuTExezdKk
aliyun.oss.accessKeySecret= aliyun.oss.accessKeySecret=T7UnQA5mEbTZXJpdrZjOZzoPoqHuYb
aliyun.oss.bucketName=shuzheng aliyun.oss.bucketName=shuzheng
aliyun.oss.policy.expire=30 aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10 aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback

View File

@ -8,6 +8,6 @@ aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId= aliyun.oss.accessKeyId=
aliyun.oss.accessKeySecret= aliyun.oss.accessKeySecret=
aliyun.oss.bucketName=shuzheng_prod aliyun.oss.bucketName=shuzheng_prod
aliyun.oss.policy.expire=30 aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10 aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback

View File

@ -8,6 +8,6 @@ aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId= aliyun.oss.accessKeyId=
aliyun.oss.accessKeySecret= aliyun.oss.accessKeySecret=
aliyun.oss.bucketName=shuzheng_test aliyun.oss.bucketName=shuzheng_test
aliyun.oss.policy.expire=30 aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10 aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback