oss上传功能改进
This commit is contained in:
parent
61d66f7caa
commit
8ad969b131
@ -32,9 +32,7 @@ public class OssController {
|
|||||||
return new CommonResult().success(result);
|
return new CommonResult().success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@ApiOperation(value = "oss上传成功回调")
|
||||||
* 上传成功回调方法
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "callback",method = RequestMethod.POST)
|
@RequestMapping(value = "callback",method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object callback(HttpServletRequest request) {
|
public Object callback(HttpServletRequest request) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.macro.mall.dto;
|
package com.macro.mall.dto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 获取OSS上传授权返回结果
|
||||||
* Created by macro on 2018/5/17.
|
* Created by macro on 2018/5/17.
|
||||||
*/
|
*/
|
||||||
public class OssPolicyResult {
|
public class OssPolicyResult {
|
||||||
@ -8,8 +9,7 @@ public class OssPolicyResult {
|
|||||||
private String policy;
|
private String policy;
|
||||||
private String signature;
|
private String signature;
|
||||||
private String dir;
|
private String dir;
|
||||||
private String callback;
|
private String host;
|
||||||
private String action;
|
|
||||||
|
|
||||||
public String getAccessKeyId() {
|
public String getAccessKeyId() {
|
||||||
return accessKeyId;
|
return accessKeyId;
|
||||||
@ -43,19 +43,11 @@ public class OssPolicyResult {
|
|||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCallback() {
|
public String getHost() {
|
||||||
return callback;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCallback(String callback) {
|
public void setHost(String host) {
|
||||||
this.callback = callback;
|
this.host = host;
|
||||||
}
|
|
||||||
|
|
||||||
public String getAction() {
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAction(String action) {
|
|
||||||
this.action = action;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import com.macro.mall.dto.OssPolicyResult;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* oss上传管理Service
|
||||||
* Created by macro on 2018/5/17.
|
* Created by macro on 2018/5/17.
|
||||||
*/
|
*/
|
||||||
public interface OssService {
|
public interface OssService {
|
||||||
|
@ -4,11 +4,9 @@ import com.aliyun.oss.OSSClient;
|
|||||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||||
import com.aliyun.oss.model.MatchMode;
|
import com.aliyun.oss.model.MatchMode;
|
||||||
import com.aliyun.oss.model.PolicyConditions;
|
import com.aliyun.oss.model.PolicyConditions;
|
||||||
import com.macro.mall.dto.OssCallbackParam;
|
|
||||||
import com.macro.mall.dto.OssCallbackResult;
|
import com.macro.mall.dto.OssCallbackResult;
|
||||||
import com.macro.mall.dto.OssPolicyResult;
|
import com.macro.mall.dto.OssPolicyResult;
|
||||||
import com.macro.mall.service.OssService;
|
import com.macro.mall.service.OssService;
|
||||||
import com.macro.mall.util.JsonUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -78,7 +76,7 @@ public class OssServiceImpl implements OssService {
|
|||||||
result.setSignature(signature);
|
result.setSignature(signature);
|
||||||
result.setDir(dir);
|
result.setDir(dir);
|
||||||
// result.setCallback(callbackData);
|
// result.setCallback(callbackData);
|
||||||
result.setAction(action);
|
result.setHost(action);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("签名生成失败", e);
|
LOGGER.error("签名生成失败", e);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ $(function() {
|
|||||||
{field: 'email', title: '邮箱', sortable: true, halign: 'center'},
|
{field: 'email', title: '邮箱', sortable: true, halign: 'center'},
|
||||||
{field: 'address', title: '地址', sortable: true, halign: 'center'},
|
{field: 'address', title: '地址', sortable: true, halign: 'center'},
|
||||||
{field: 'remark', title: '备注', sortable: true, halign: 'center'},
|
{field: 'remark', title: '备注', sortable: true, halign: 'center'},
|
||||||
{field: 'action', title: '操作', halign: 'center', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
|
{field: 'host', title: '操作', halign: 'center', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
|
||||||
]
|
]
|
||||||
}).on('all.bs.table', function (e, name, args) {
|
}).on('all.bs.table', function (e, name, args) {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
@ -153,7 +153,7 @@ function createAction() {
|
|||||||
confirm: {
|
confirm: {
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'waves-effect waves-button',
|
btnClass: 'waves-effect waves-button',
|
||||||
action: function () {
|
host: function () {
|
||||||
$.alert('确认');
|
$.alert('确认');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -190,7 +190,7 @@ function updateAction() {
|
|||||||
confirm: {
|
confirm: {
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'waves-effect waves-button',
|
btnClass: 'waves-effect waves-button',
|
||||||
action: function () {
|
host: function () {
|
||||||
$.alert('确认');
|
$.alert('确认');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -228,7 +228,7 @@ function deleteAction() {
|
|||||||
confirm: {
|
confirm: {
|
||||||
text: '确认',
|
text: '确认',
|
||||||
btnClass: 'waves-effect waves-button',
|
btnClass: 'waves-effect waves-button',
|
||||||
action: function () {
|
host: function () {
|
||||||
var ids = new Array();
|
var ids = new Array();
|
||||||
for (var i in rows) {
|
for (var i in rows) {
|
||||||
ids.push(rows[i].systemId);
|
ids.push(rows[i].systemId);
|
||||||
|
@ -108,10 +108,10 @@
|
|||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dm-icon pull-right">
|
<ul class="dropdown-menu dm-icon pull-right">
|
||||||
<li class="hidden-xs">
|
<li class="hidden-xs">
|
||||||
<a class="waves-effect" data-ma-action="fullscreen" href="javascript:fullPage();"><i class="zmdi zmdi-fullscreen"></i> 全屏模式</a>
|
<a class="waves-effect" data-ma-host="fullscreen" href="javascript:fullPage();"><i class="zmdi zmdi-fullscreen"></i> 全屏模式</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="waves-effect" data-ma-action="clear-localstorage" href="javascript:;"><i class="zmdi zmdi-delete"></i> 清除缓存</a>
|
<a class="waves-effect" data-ma-host="clear-localstorage" href="javascript:;"><i class="zmdi zmdi-delete"></i> 清除缓存</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="waves-effect" href="javascript:;"><i class="zmdi zmdi-face"></i> 隐私管理</a>
|
<a class="waves-effect" href="javascript:;"><i class="zmdi zmdi-face"></i> 隐私管理</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user