漏洞修复
This commit is contained in:
parent
724ad87df9
commit
4404af2fb7
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.gen.domain.GenTable;
|
||||
import com.bonus.sgzb.gen.domain.GenTableColumn;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
|
@ -88,9 +89,14 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 查询数据表字段列表
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:query")
|
||||
@GetMapping(value = "/column/{tableId}")
|
||||
public TableDataInfo columnList(Long tableId)
|
||||
{
|
||||
// 只有管理员才能操作
|
||||
if (!isAdmin()) {
|
||||
throw new RuntimeException("没有权限操作");
|
||||
}
|
||||
TableDataInfo dataInfo = new TableDataInfo();
|
||||
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
||||
dataInfo.setRows(list);
|
||||
|
|
@ -98,6 +104,14 @@ public class GenController extends BaseController
|
|||
return dataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否管理员
|
||||
* @return
|
||||
*/
|
||||
private boolean isAdmin() {
|
||||
return SecurityUtils.isAdmin(SecurityUtils.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入表结构(保存)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue