提交 31dcc381 编写于 作者: shuzheng5201314's avatar shuzheng5201314

上传成功返回全路径

上级 4f8e1495
package com.zheng.oss.web.controller;
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.OssResultConstant;
import com.zheng.oss.web.service.AliyunOssService;
......@@ -53,7 +54,9 @@ public class AliyunOssController {
@ResponseBody
public Object callback(HttpServletRequest request) {
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("mimeType", request.getParameter("mimeType"));
data.put("width", request.getParameter("width"));
......
......@@ -5,9 +5,9 @@ zheng-ui.path=http://ui.zhangshuzheng.cn:1000/
### aliyun oss ###
aliyun.oss.endpoint=oss-cn-shanghai.aliyuncs.com
aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId=
aliyun.oss.accessKeySecret=
aliyun.oss.accessKeyId=LTAIujvuTExezdKk
aliyun.oss.accessKeySecret=T7UnQA5mEbTZXJpdrZjOZzoPoqHuYb
aliyun.oss.bucketName=shuzheng
aliyun.oss.policy.expire=30
aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback
\ No newline at end of file
......@@ -8,6 +8,6 @@ aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId=
aliyun.oss.accessKeySecret=
aliyun.oss.bucketName=shuzheng_prod
aliyun.oss.policy.expire=30
aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback
\ No newline at end of file
......@@ -8,6 +8,6 @@ aliyun.oss.endpoint.internal=oss-cn-shanghai-internal.aliyuncs.com
aliyun.oss.accessKeyId=
aliyun.oss.accessKeySecret=
aliyun.oss.bucketName=shuzheng_test
aliyun.oss.policy.expire=30
aliyun.oss.policy.expire=300
aliyun.oss.maxSize=10
aliyun.oss.callback=http://shuzheng.tunnel.qydev.com/aliyun/oss/callback
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册