Commit e8e8dfd5 authored by trumansdo's avatar trumansdo
Browse files

done------

完成动态路由,等后面填补一下数据库和前端的路由数据就可以进行下一步的页面代码开发
重写HTTPRequestLocal线程共享变量方法,使之责任明确
添加beetlsql的类型处理,使之可以用时间戳,更加通用
wait-----
在确定是不是要重构一下项目模块,使之更明确
parent 62046c00
*** Spring Boot 2 plus ${AnsiColor.BRIGHT_RED}
\ No newline at end of file
███████╗██████╗ ██████╗ ██╗███╗ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗ ██╗███████╗ ██╗ ██╗██╗ ██╗███████╗
██╔════╝██╔══██╗██╔══██╗██║████╗ ██║██╔════╝ ██╔══██╗██╔═══██╗██╔═══██╗╚══██╔══╝ ██╔══██╗██║ ██║ ██║██╔════╝ ██║ ██║██║ ██║██╔════╝
███████╗██████╔╝██████╔╝██║██╔██╗ ██║██║ ███╗██████╔╝██║ ██║██║ ██║ ██║█████╗██████╔╝██║ ██║ ██║███████╗ ██║ ██║██║ ██║█████╗
╚════██║██╔═══╝ ██╔══██╗██║██║╚██╗██║██║ ██║██╔══██╗██║ ██║██║ ██║ ██║╚════╝██╔═══╝ ██║ ██║ ██║╚════██║ ╚██╗ ██╔╝██║ ██║██╔══╝
███████║██║ ██║ ██║██║██║ ╚████║╚██████╔╝██████╔╝╚██████╔╝╚██████╔╝ ██║ ██║ ███████╗╚██████╔╝███████║ ╚████╔╝ ╚██████╔╝███████╗
╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══════╝ ╚═══╝ ╚═════╝ ╚══════╝
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
\ No newline at end of file
package com.ibeetl.admin.core.conf; package com.ibeetl.admin.core.conf;
import java.io.UnsupportedEncodingException; import cn.hutool.core.convert.Convert;
import java.util.List; import cn.hutool.core.util.ObjectUtil;
import javax.servlet.http.HttpServletRequest;
import org.beetl.core.Context;
import org.beetl.core.Function;
import org.beetl.core.GroupTemplate;
import org.beetl.ext.simulate.WebSimulate;
import org.beetl.sql.core.InterceptorContext;
import org.beetl.sql.ext.DebugInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.ibeetl.admin.core.rbac.DataAccess; import com.ibeetl.admin.core.rbac.DataAccess;
import com.ibeetl.admin.core.rbac.DataAccessFactory; import com.ibeetl.admin.core.rbac.DataAccessFactory;
...@@ -36,6 +20,33 @@ import com.ibeetl.admin.core.util.beetl.XXSDefenderFormat; ...@@ -36,6 +20,33 @@ import com.ibeetl.admin.core.util.beetl.XXSDefenderFormat;
import com.ibeetl.admin.core.web.query.QueryParser; import com.ibeetl.admin.core.web.query.QueryParser;
import com.ibeetl.starter.BeetlTemplateCustomize; import com.ibeetl.starter.BeetlTemplateCustomize;
import com.ibeetl.starter.ObjectMapperJsonUtil; import com.ibeetl.starter.ObjectMapperJsonUtil;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.beetl.core.Context;
import org.beetl.core.Function;
import org.beetl.core.GroupTemplate;
import org.beetl.ext.simulate.WebSimulate;
import org.beetl.sql.core.InterceptorContext;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.mapping.type.JavaSqlTypeHandler;
import org.beetl.sql.core.mapping.type.TypeParameter;
import org.beetl.sql.ext.DebugInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
@Configuration @Configuration
@AutoConfigureAfter(JasonConfig.class) @AutoConfigureAfter(JasonConfig.class)
...@@ -75,81 +86,87 @@ public class BeetlConf { ...@@ -75,81 +86,87 @@ public class BeetlConf {
} }
@Bean @Bean
public BeetlTemplateCustomize beetlTemplateCustomize() { public SQLManager sqlManager(
return new BeetlTemplateCustomize() { @Qualifier("baseDataSourceSqlManagerFactoryBean") SQLManager sqlManager) {
public void customize(GroupTemplate groupTemplate) {
groupTemplate.registerFunctionPackage("platform", platFormService); Map<Class, JavaSqlTypeHandler> typeHandlerMap = sqlManager.getDefaultBeanProcessors().getHandlers();
groupTemplate.registerFunctionPackage("queryCondtion", new QueryParser()); /*Java bean的属性类型处理器,从数据库类型转化到属性Date类型*/
groupTemplate.registerFunction("core.orgName", orgFunction); typeHandlerMap.remove(Date.class);
groupTemplate.registerFunction("core.functionName", funFunction); typeHandlerMap.put(Date.class, new DateTypeHandler());
groupTemplate.registerFunction("core.funAccessUrl", funAccessUrlFunction); typeHandlerMap.put(ZonedDateTime.class, new ZonedDateTimeTypeHandler());
groupTemplate.registerFunction("core.menuName", menuFunction); return sqlManager;
groupTemplate.registerFunction("core.searchCondtion", searchCondtionFunction); }
groupTemplate.registerFunction("core.roles", roleFunction);
groupTemplate.registerFunction("core.file", fileFunction);
groupTemplate.registerFormat("xss", new XXSDefenderFormat());
groupTemplate.registerFunction("uuid", new UUIDFunction());
groupTemplate.registerFunctionPackage("dict", dictDownQueryFunction);
// 模板页面判断是否有按钮权限,比如canAccess
groupTemplate.registerFunction(
"canAccess",
new Function() {
@Override
public Boolean call(Object[] paras, Context ctx) {
Long userId = platFormService.getCurrentUser().getId();
Long orgId = platFormService.getCurrentOrgId();
String functionCode = (String) paras[0];
return platFormService.canAcessFunction(userId, orgId, functionCode);
}
});
groupTemplate.registerFunction(
"abcd",
new Function() {
@Override @Bean
public Boolean call(Object[] paras, Context ctx) { public BeetlTemplateCustomize beetlTemplateCustomize() {
return true; return groupTemplate -> {
groupTemplate.registerFunctionPackage("platform", platFormService);
groupTemplate.registerFunctionPackage("queryCondtion", new QueryParser());
groupTemplate.registerFunction("core.orgName", orgFunction);
groupTemplate.registerFunction("core.functionName", funFunction);
groupTemplate.registerFunction("core.funAccessUrl", funAccessUrlFunction);
groupTemplate.registerFunction("core.menuName", menuFunction);
groupTemplate.registerFunction("core.searchCondtion", searchCondtionFunction);
groupTemplate.registerFunction("core.roles", roleFunction);
groupTemplate.registerFunction("core.file", fileFunction);
groupTemplate.registerFormat("xss", new XXSDefenderFormat());
groupTemplate.registerFunction("uuid", new UUIDFunction());
groupTemplate.registerFunctionPackage("dict", dictDownQueryFunction);
// 模板页面判断是否有按钮权限,比如canAccess
groupTemplate.registerFunction(
"canAccess",
(paras, ctx) -> {
Long userId = platFormService.getCurrentUser().getId();
Long orgId = platFormService.getCurrentOrgId();
String functionCode = (String) paras[0];
return platFormService.canAcessFunction(userId, orgId, functionCode);
});
groupTemplate.registerFunction(
"abcd",
new Function() {
@Override
public Boolean call(Object[] paras, Context ctx) {
return true;
}
});
groupTemplate.registerFunction(
"env",
new Function() {
@Override
public String call(Object[] paras, Context ctx) {
String key = (String) paras[0];
String value = env.getProperty(key);
if (value != null) {
return getStr(value);
} }
}); if (paras.length == 2) {
return (String) paras[1];
groupTemplate.registerFunction(
"env",
new Function() {
@Override
public String call(Object[] paras, Context ctx) {
String key = (String) paras[0];
String value = env.getProperty(key);
if (value != null) {
return getStr(value);
}
if (paras.length == 2) {
return (String) paras[1];
}
return null;
} }
return null;
protected String getStr(String str) { }
try {
return new String(str.getBytes("iso8859-1"), "UTF-8"); protected String getStr(String str) {
} catch (UnsupportedEncodingException e) { try {
throw new RuntimeException(e); return new String(str.getBytes("iso8859-1"), "UTF-8");
} } catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} }
}); }
});
groupTemplate.registerFunction(
"dataAccessList", groupTemplate.registerFunction(
new Function() { "dataAccessList",
new Function() {
@Override
public List<DataAccess> call(Object[] paras, Context ctx) { @Override
return dataAccessFactory.all(); public List<DataAccess> call(Object[] paras, Context ctx) {
} return dataAccessFactory.all();
}); }
} });
}; };
} }
...@@ -166,4 +183,43 @@ public class BeetlConf { ...@@ -166,4 +183,43 @@ public class BeetlConf {
return; return;
} }
} }
class DateTypeHandler extends JavaSqlTypeHandler {
@Override
public Object getValue(TypeParameter typePara) throws SQLException {
if (ObjectUtil.isNull(typePara.getRs().getObject(typePara.getIndex()))) {
return null;
}
int columnType = typePara.getColumnType();
if (Types.TIMESTAMP == columnType || Types.DATE == columnType) {
Timestamp timestamp = typePara.getRs().getTimestamp(typePara.getIndex());
return Date.from(Instant.ofEpochSecond(timestamp.getTime()));
} else if (Types.BIGINT == columnType) {
long timestamp = Convert.toLong(typePara.getRs().getLong(typePara.getIndex()), 0L);
return Date.from(Instant.ofEpochSecond(timestamp));
} else {
return null;
}
}
}
class ZonedDateTimeTypeHandler extends JavaSqlTypeHandler {
@Override
public Object getValue(TypeParameter typePara) throws SQLException {
if (ObjectUtil.isNull(typePara.getRs().getObject(typePara.getIndex()))) {
return null;
}
int columnType = typePara.getColumnType();
if (Types.TIMESTAMP == columnType || Types.DATE == columnType) {
Timestamp timestamp = typePara.getRs().getTimestamp(typePara.getIndex());
return ZonedDateTime
.ofInstant(Instant.ofEpochSecond(timestamp.getTime()), ZoneId.systemDefault());
} else if (Types.BIGINT == columnType) {
long timestamp = Convert.toLong(typePara.getRs().getLong(typePara.getIndex()), 0L);
return ZonedDateTime
.ofInstant(Instant.ofEpochSecond(timestamp), ZoneId.systemDefault());
} else {
return null;
}
}
}
} }
...@@ -44,7 +44,7 @@ public class JasonConfig { ...@@ -44,7 +44,7 @@ public class JasonConfig {
throws IOException { throws IOException {
gen.writeStartObject(); gen.writeStartObject();
gen.writeObjectField("code", Integer.parseInt(value.getCode())); gen.writeObjectField("code", Integer.parseInt(value.getCode()));
gen.writeStringField("msg", value.getMessage()); gen.writeStringField("message", value.getMessage());
Object data = value.getData(); Object data = value.getData();
if (data instanceof PageQuery) { if (data instanceof PageQuery) {
PageQuery query = (PageQuery) (data); PageQuery query = (PageQuery) (data);
......
package com.ibeetl.admin.core.conf; package com.ibeetl.admin.core.conf;
import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_CURRENT_USER;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ClassUtil; import cn.hutool.core.util.ClassUtil;
...@@ -69,8 +71,6 @@ public class MVCConf implements WebMvcConfigurer, InitializingBean { ...@@ -69,8 +71,6 @@ public class MVCConf implements WebMvcConfigurer, InitializingBean {
@Autowired private BeetlGroupUtilConfiguration beetlGroupUtilConfiguration; @Autowired private BeetlGroupUtilConfiguration beetlGroupUtilConfiguration;
@Autowired private HttpRequestLocal httpRequestLocal;
@Autowired private GroupTemplate groupTemplate; @Autowired private GroupTemplate groupTemplate;
@Autowired private RequestMappingHandlerAdapter adapter; @Autowired private RequestMappingHandlerAdapter adapter;
...@@ -78,7 +78,7 @@ public class MVCConf implements WebMvcConfigurer, InitializingBean { ...@@ -78,7 +78,7 @@ public class MVCConf implements WebMvcConfigurer, InitializingBean {
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry registry
.addInterceptor(new SessionInterceptor(httpRequestLocal, userService)) .addInterceptor(new SessionInterceptor(userService))
.addPathPatterns("/**"); .addPathPatterns("/**");
// super.addInterceptors(registry); // super.addInterceptors(registry);
} }
...@@ -116,40 +116,25 @@ class SessionInterceptor implements HandlerInterceptor { ...@@ -116,40 +116,25 @@ class SessionInterceptor implements HandlerInterceptor {
CoreUserService userService; CoreUserService userService;
HttpRequestLocal httpRequestLocal; public SessionInterceptor(CoreUserService userService) {
public SessionInterceptor(HttpRequestLocal httpRequestLocal, CoreUserService userService) {
this.userService = userService; this.userService = userService;
this.httpRequestLocal = httpRequestLocal;
} }
@Override @Override
public boolean preHandle( public boolean preHandle(
HttpServletRequest request, HttpServletResponse response, Object handler) { HttpServletRequest request, HttpServletResponse response, Object handler) {
httpRequestLocal.set(request); HttpRequestLocal.set(request);
if (StrUtil.containsAny(request.getRequestURI(), "/login", "/error", "/logout")) { if (StrUtil.containsAny(request.getRequestURI(), "/login", "/error", "/logout")) {
return true; return true;
} }
String token = request.getHeader(HttpHeaders.AUTHORIZATION); String token = HttpRequestLocal.getAuthorization();
Map<String, Object> payload = JoseJwtUtil.parsePayload(token); Map<String, Object> payload = JoseJwtUtil.parsePayload(token);
if (payload.isEmpty()) { if (payload.isEmpty()) {
/*验证失败,无效jwt*/ /*验证失败,无效jwt*/
return false; return false;
} }
Long uid = Convert.toLong(payload.get("uid"), -9999999999L);
HttpSession requestSession = request.getSession(true);
if (requestSession.getAttribute(CorePlatformService.ACCESS_CURRENT_USER) == null) {
// 模拟用户登录,用于快速开发,未来用rember么代替?
CoreUser user = userService.getUserById(uid);
Long orgId = user.getOrgId();
CoreOrg org = userService.getOrgById(orgId);
List<CoreOrg> orgs = userService.getUserOrg(uid, org.getId());
requestSession.setAttribute(CorePlatformService.ACCESS_CURRENT_USER, user);
requestSession.setAttribute(CorePlatformService.ACCESS_CURRENT_ORG, org);
requestSession.setAttribute(CorePlatformService.ACCESS_USER_ORGS, orgs);
requestSession.setAttribute("ip", httpRequestLocal.getRequestIP());
}
return true; return true;
} }
......
package com.ibeetl.admin.core.dao; package com.ibeetl.admin.core.dao;
import com.ibeetl.admin.core.entity.CoreRoute;
import java.util.List;
import org.beetl.sql.core.annotatoin.Param; import org.beetl.sql.core.annotatoin.Param;
import org.beetl.sql.core.annotatoin.Sql; import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.annotatoin.SqlResource; import org.beetl.sql.core.annotatoin.SqlResource;
...@@ -11,4 +13,6 @@ import com.ibeetl.admin.core.entity.CoreFunction; ...@@ -11,4 +13,6 @@ import com.ibeetl.admin.core.entity.CoreFunction;
public interface CoreFunctionDao extends BaseMapper<CoreFunction> { public interface CoreFunctionDao extends BaseMapper<CoreFunction> {
@Sql("select * from core_function where code = ?") @Sql("select * from core_function where code = ?")
CoreFunction getFunctionByCode(@Param(value = "code") String code); CoreFunction getFunctionByCode(@Param(value = "code") String code);
List<CoreRoute> getAllRoutes();
} }
package com.ibeetl.admin.core.entity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import lombok.Data;
/**
* 对应前端页面的routes路由表。具体格式如下: { "path": "/profile", "name": "router-name", "meta": { "title":
* "Profile", "roles": ["admin", "editor"], "icon": "user" }, "children": [] }
*
* @author 一日看尽长安花
*/
@Data
public class CoreRoute extends BaseEntity implements Comparable<CoreRoute> {
private Long id;
private Long parentId;
/** 路由路径,完全参照vue router规范 */
private String path;
/** 路由名称,请确保唯一性 */
private String name;
/** 路由顺序 */
private Long seq = -999L;
/** 路由元数据信息 */
private CoreRouteMeta meta;
/** 子路由项 */
private List<CoreRoute> children = CollUtil.newArrayList();
public CoreRouteMeta getMeta() {
if (ObjectUtil.isNotEmpty(this.meta)) return this.meta;
Map<String, Object> metaMap = MapUtil.builder(getTails()).build();
this.meta = BeanUtil.mapToBean(metaMap, CoreRouteMeta.class, true);
return this.meta;
}
@Override
public boolean equals(Object o) {
if (o != null && o instanceof CoreRoute) {
CoreRoute othRoute = (CoreRoute) o;
if (this.getId().equals(othRoute.getId())) {
return true;
}
if (this.getParentId().equals(othRoute.getParentId())) {
return StrUtil.equals(this.getPath(), othRoute.getPath())
&& StrUtil.equals(this.getName(), othRoute.getName());
} else {
return false;
}
} else {
return false;
}
}
@Override
public int hashCode() {
return Objects.hash(id, parentId, path, name);
}
@Override
public int compareTo(CoreRoute o) {
if (null == o) return -1;
Long seq1 = this.getSeq() == null ? -999L : this.getSeq();
Long seq2 = o.getSeq() == null ? -999L : o.getSeq();
return seq1.compareTo(seq2);
}
}
package com.ibeetl.admin.core.entity;
import cn.hutool.core.collection.CollUtil;
import java.util.List;
import lombok.Data;
@Data
public class CoreRouteMeta {
/** 路由展示在菜单中显示的标题 */
private String title;
/** 在菜单中显示的图标 */
private String icon;
/** 当前路由可以访问的角色 */
private List<Long> roles = CollUtil.<Long>newArrayList();
}
package com.ibeetl.admin.core.entity; package com.ibeetl.admin.core.entity;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.util.Date; import java.util.Date;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -29,6 +31,8 @@ public class CoreUserRole extends BaseEntity { ...@@ -29,6 +31,8 @@ public class CoreUserRole extends BaseEntity {
protected Date createTime; protected Date createTime;
protected ZonedDateTime updateTime;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -68,4 +72,12 @@ public class CoreUserRole extends BaseEntity { ...@@ -68,4 +72,12 @@ public class CoreUserRole extends BaseEntity {
public void setCreateTime(Date createTime) { public void setCreateTime(Date createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
public ZonedDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(ZonedDateTime updateTime) {
this.updateTime = updateTime;
}
} }
package com.ibeetl.admin.core.rbac;
import lombok.Data;
@Data
public class UserRoleInfo {
private String name;
private String avatar;
private Long[] roles;
private String introduction;
}
package com.ibeetl.admin.core.service; package com.ibeetl.admin.core.service;
import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_CURRENT_ORG;
import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_CURRENT_USER;
import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_USER_ORGS;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -61,13 +65,6 @@ public class CorePlatformService { ...@@ -61,13 +65,6 @@ public class CorePlatformService {
public static final String USER_DATA_ACCESS_CACHE = "cache:core:userDataAccess"; public static final String USER_DATA_ACCESS_CACHE = "cache:core:userDataAccess";
public static final String USER_MENU_CACHE = "cache:core:userMenu"; public static final String USER_MENU_CACHE = "cache:core:userMenu";
/*当前用户会话*/
public static final String ACCESS_CURRENT_USER = "core:user";
/*当前登录用户所在部门*/
public static final String ACCESS_CURRENT_ORG = "core:currentOrg";
/*用户可选部门*/
public static final String ACCESS_USER_ORGS = "core:orgs";
public static final String ACCESS_SUPPER_ADMIN = "admin"; public static final String ACCESS_SUPPER_ADMIN = "admin";
@Autowired HttpRequestLocal httpRequestLocal; @Autowired HttpRequestLocal httpRequestLocal;
...@@ -112,7 +109,7 @@ public class CorePlatformService { ...@@ -112,7 +109,7 @@ public class CorePlatformService {
List<CoreOrg> orgs = this.getCurrentOrgs(); List<CoreOrg> orgs = this.getCurrentOrgs();
for (CoreOrg org : orgs) { for (CoreOrg org : orgs) {
if (org.getId().equals(orgId)) { if (org.getId().equals(orgId)) {
httpRequestLocal.setSessionValue(CorePlatformService.ACCESS_CURRENT_ORG, org); httpRequestLocal.setSessionValue(ACCESS_CURRENT_ORG, org);
} }
} }
} }
...@@ -142,9 +139,9 @@ public class CorePlatformService { ...@@ -142,9 +139,9 @@ public class CorePlatformService {
} }
public void setLoginUser(CoreUser user, CoreOrg currentOrg, List<CoreOrg> orgs) { public void setLoginUser(CoreUser user, CoreOrg currentOrg, List<CoreOrg> orgs) {
httpRequestLocal.setSessionValue(CorePlatformService.ACCESS_CURRENT_USER, user); httpRequestLocal.setSessionValue(ACCESS_CURRENT_USER, user);
httpRequestLocal.setSessionValue(CorePlatformService.ACCESS_CURRENT_ORG, currentOrg); httpRequestLocal.setSessionValue(ACCESS_CURRENT_ORG, currentOrg);
httpRequestLocal.setSessionValue(CorePlatformService.ACCESS_USER_ORGS, orgs); httpRequestLocal.setSessionValue(ACCESS_USER_ORGS, orgs);
} }
public MenuItem getMenuItem(long userId, long orgId) { public MenuItem getMenuItem(long userId, long orgId) {
......
package com.ibeetl.admin.core.service; package com.ibeetl.admin.core.service;
import com.ibeetl.admin.core.dao.CoreRoleDao;
import com.ibeetl.admin.core.entity.CoreRole;
import com.ibeetl.admin.core.entity.CoreUserRole;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.ibeetl.admin.core.dao.CoreRoleDao;
import com.ibeetl.admin.core.entity.CoreRole;
/** /**
* 描述: 字典 service,包含常规字典和级联字典的操作。 * 描述: 字典 service,包含常规字典和级联字典的操作。
* *
* @author : xiandafu * @author : xiandafu
*/ */
@Slf4j
@Service @Service
@Transactional @Transactional
public class CoreRoleService extends CoreBaseService<CoreRole> { public class CoreRoleService extends CoreBaseService<CoreRole> {
private static final Logger LOGGER = LoggerFactory.getLogger(CoreRoleService.class);
@Autowired private CoreRoleDao roleDao; @Autowired private CoreRoleDao roleDao;
public List<CoreRole> getAllRoles(String type) { public List<CoreRole> getAllRoles(String type) {
......
package com.ibeetl.admin.core.service.vea;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import com.ibeetl.admin.core.dao.CoreFunctionDao;
import com.ibeetl.admin.core.dao.CoreRoleDao;
import com.ibeetl.admin.core.entity.CoreRoute;
import com.ibeetl.admin.core.entity.CoreUserRole;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@Transactional
public class RoleRoutesService {
@Autowired private CoreFunctionDao coreFunctionDao;
@Autowired private CoreRoleDao coreRoleDao;
public List<Long> getAllRoleIds(Long userId, Long orgId) {
return coreRoleDao.getSQLManager().lambdaQuery(CoreUserRole.class).andEq("user_id", userId)
.andEq("org_id", orgId).select(Long.class, "role_id").stream()
.distinct()
.collect(Collectors.toList());
}
/**
*
* 前端路由映射表中单个路由映射全部具有的信息:
* { <br/>
* "path": "/profile", <br/>
* "component": "Layout", <br/>
* "redirect": "/profile/index", <br/>
* "hidden": true, <br/>
* "alwaysShow": true, <br/>
* "name": "router-name", <br/>
* "meta": { <br/>
* "noCache": true, <br/>
* "affix": true, <br/>
* "breadcrumb": false, <br/>
* "activeMenu": "/example/list" <br/>
* }, <br/>
* "children": [] <br/>
* } <br/>
* 后端路由表中单个路由应该具有的信息: <br/>
* { <br/>
* "path": "/profile", <br/>
* "name": "router-name", <br/>
* "meta": { <br/>
* "title": "Profile", <br/>
* "roles": ["admin", "editor"], <br/>
* "icon": "user" <br/>
* }, <br/>
* "children": [] <br/>
* } <br/>
*
* @return 路由表格式
* */
public List<CoreRoute> getRoutes() {
List<CoreRoute> routesList = coreFunctionDao.getAllRoutes();
Map<Long, List<Long>> roleIdList =
routesList.stream()
.collect(
Collectors.groupingBy(
CoreRoute::getId,
Collectors.mapping(
coreRoute -> Convert.toLong(coreRoute.getTails().get("roleId")),
Collectors.toList())));
routesList = routesList.stream().distinct().sorted().collect(Collectors.toList());
for (CoreRoute coreRoute : routesList) {
coreRoute
.getMeta()
.getRoles()
.addAll(CollUtil.<Long>removeNull(roleIdList.get(coreRoute.getId())));
}
CoreRoute root = new CoreRoute();
root.setId(0L);
buildRoutesTree(root, routesList);
return root.getChildren();
}
/**
* 深度优先算法递归构建路由表
*
* @param root
* @param allRoutes
* @return
*/
private void buildRoutesTree(CoreRoute root, @NotNull List<CoreRoute> allRoutes) {
if (CollUtil.isEmpty(allRoutes)) return;
List<CoreRoute> childRoutes =
allRoutes.stream()
.filter(route -> route.getParentId().equals(root.getId()))
.collect(Collectors.toList());
root.setChildren(childRoutes);
allRoutes.removeAll(childRoutes);
Collections.sort(root.getChildren());
List<CoreRoute> rootChildrenList = root.getChildren();
for (int i = 0; i < rootChildrenList.size(); i++) {
buildRoutesTree(rootChildrenList.get(i), allRoutes);
}
}
}
package com.ibeetl.admin.core.util; package com.ibeetl.admin.core.util;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.ibeetl.admin.core.entity.CoreOrg;
import com.ibeetl.admin.core.entity.CoreUser;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.stream.Stream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.ibeetl.admin.core.conf.MVCConf; import com.ibeetl.admin.core.conf.MVCConf;
...@@ -15,49 +27,114 @@ import com.ibeetl.admin.core.conf.MVCConf; ...@@ -15,49 +27,114 @@ import com.ibeetl.admin.core.conf.MVCConf;
* @author lijiazhi * @author lijiazhi
*/ */
@Component @Component
public class HttpRequestLocal { public final class HttpRequestLocal {
/*当前用户会话*/
public static final String ACCESS_CURRENT_USER = "core:user";
/*当前登录用户所在部门*/
public static final String ACCESS_CURRENT_ORG = "core:currentOrg";
/*用户可选部门*/
public static final String ACCESS_USER_ORGS = "core:orgs";
public HttpRequestLocal() {} public HttpRequestLocal() {}
private static final ThreadLocal<HttpServletRequest> requests = private static final ThreadLocal<HttpServletRequest> requests =
new ThreadLocal<HttpServletRequest>() { ThreadLocal.withInitial(() -> null);
@Override
protected HttpServletRequest initialValue() { public static void setAccessCurrentOrg(CoreOrg org) {
return null; getHttpSession().setAttribute(ACCESS_CURRENT_ORG, org);
} }
};
public static CoreOrg getAccessCurrentOrg() {
return (CoreOrg) getHttpSession().getAttribute(ACCESS_CURRENT_ORG);
}
public static void setAccessUserOrgs(List<CoreOrg> orgs) {
getHttpSession().setAttribute(ACCESS_USER_ORGS, orgs);
}
public Object getSessionValue(String attr) { public static List<CoreOrg> getAccessUserOrgs() {
return requests.get().getSession().getAttribute(attr); return Convert.toList(CoreOrg.class, getHttpSession().getAttribute(ACCESS_USER_ORGS));
} }
public void setSessionValue(String attr, Object obj) { public static void setAccessCurrentUser(CoreUser user) {
requests.get().getSession().setAttribute(attr, obj); getHttpSession().setAttribute(ACCESS_CURRENT_USER, user);
} }
public Object getRequestValue(String attr) { public static CoreUser getAccessCurrentUser() {
return requests.get().getAttribute(attr); return (CoreUser) getHttpSession().getAttribute(ACCESS_CURRENT_USER);
} }
public String getRequestURI() { public static void setLoginerInfo(CoreUser user, CoreOrg org, List<CoreOrg> orgs) {
return requests.get().getRequestURI(); setAccessCurrentUser(user);
setAccessCurrentOrg(org);
setAccessUserOrgs(orgs);
getHttpSession().setAttribute("clientIP", getIpAddr(get()));
} }
public String getRequestIP() { public static void clearAllSession() {
return getIpAddr(requests.get()); getHttpSession().removeAttribute(ACCESS_CURRENT_USER);
getHttpSession().removeAttribute(ACCESS_CURRENT_ORG);
getHttpSession().removeAttribute(ACCESS_USER_ORGS);
} }
public void set(HttpServletRequest request) { public static Cookie getCookieByName(String cookieName) {
Assert.notNull(cookieName);
Cookie[] cookies = get().getCookies();
return Arrays.stream(cookies)
.filter(cookie -> StrUtil.equals(cookie.getName(), cookieName))
.findFirst()
.orElse(null);
}
public static Object getSessionValue(String attr) {
return getHttpSession().getAttribute(attr);
}
public static void setSessionValue(String attr, Object obj) {
get().getSession().setAttribute(attr, obj);
}
public static String getAuthorization() {
return get().getHeader(HttpHeaders.AUTHORIZATION);
}
public static Object getRequestValue(String attr) {
return get().getAttribute(attr);
}
public static void setRequestValue(String attr, Object obj) {
get().setAttribute(attr, obj);
}
/** @return 请求的uri,域名与参数之间的那部分 */
public static String getRequestURI() {
return get().getRequestURI();
}
/** @return 获取客户端ip */
public static String getRequestIP() {
return getIpAddr(get());
}
public static void set(HttpServletRequest request) {
requests.set(request); requests.set(request);
} }
public static HttpServletRequest get() {
return requests.get();
}
public static HttpSession getHttpSession() {
return get().getSession();
}
/** /**
* 获取当前网络ip * 获取当前网络ip
* *
* @param request * @param request
* @return * @return
*/ */
public String getIpAddr(HttpServletRequest request) { public static String getIpAddr(HttpServletRequest request) {
String ipAddress = request.getHeader("x-forwarded-for"); String ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP"); ipAddress = request.getHeader("Proxy-Client-IP");
......
package com.ibeetl.admin.core.web; package com.ibeetl.admin.core.web;
import cn.hutool.core.map.MapUtil; import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_CURRENT_ORG;
import cn.hutool.core.util.StrUtil; import static com.ibeetl.admin.core.util.HttpRequestLocal.ACCESS_USER_ORGS;
import com.ibeetl.admin.core.annotation.RequestBodyPlus;
import com.ibeetl.admin.core.util.JoseJwtUtil;
import com.ibeetl.admin.core.util.PlatformException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ibeetl.admin.core.conf.PasswordConfig.PasswordEncryptService; import com.ibeetl.admin.core.conf.PasswordConfig.PasswordEncryptService;
import com.ibeetl.admin.core.entity.CoreOrg; import com.ibeetl.admin.core.entity.CoreOrg;
...@@ -31,7 +16,15 @@ import com.ibeetl.admin.core.util.HttpRequestLocal; ...@@ -31,7 +16,15 @@ import com.ibeetl.admin.core.util.HttpRequestLocal;
import com.ibeetl.admin.core.web.dto.FunctionNodeView; import com.ibeetl.admin.core.web.dto.FunctionNodeView;
import com.ibeetl.admin.core.web.dto.MenuNodeView; import com.ibeetl.admin.core.web.dto.MenuNodeView;
import com.ibeetl.admin.core.web.dto.SystemMenuView; import com.ibeetl.admin.core.web.dto.SystemMenuView;
import sun.swing.StringUIClientPropertyKey; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller @Controller
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -79,7 +72,7 @@ public class CoreUserController { ...@@ -79,7 +72,7 @@ public class CoreUserController {
@ResponseBody @ResponseBody
public JsonResult<List<CoreOrg>> myOrgs() { public JsonResult<List<CoreOrg>> myOrgs() {
List<CoreOrg> orgs = List<CoreOrg> orgs =
(List<CoreOrg>) httpRequestLocal.getSessionValue(CorePlatformService.ACCESS_USER_ORGS); (List<CoreOrg>) httpRequestLocal.getSessionValue(ACCESS_USER_ORGS);
return JsonResult.success(orgs); return JsonResult.success(orgs);
} }
...@@ -109,7 +102,7 @@ public class CoreUserController { ...@@ -109,7 +102,7 @@ public class CoreUserController {
return JsonResult.failMessage("切换到不存在的部门"); return JsonResult.failMessage("切换到不存在的部门");
} }
httpRequestLocal.setSessionValue(CorePlatformService.ACCESS_CURRENT_ORG, currentOrg); httpRequestLocal.setSessionValue(ACCESS_CURRENT_ORG, currentOrg);
return JsonResult.success(); return JsonResult.success();
} }
...@@ -257,45 +250,4 @@ public class CoreUserController { ...@@ -257,45 +250,4 @@ public class CoreUserController {
} }
return views; return views;
} }
@GetMapping("/user/info")
@ResponseBody
public JsonResult info(
@RequestBodyPlus("username") String username, @RequestBodyPlus("password") String password) {
Map<String, Object> resultMap =
MapUtil.<String, Object>builder()
.build();
return JsonResult.success(resultMap);
}
@PostMapping("/user/login")
@ResponseBody
public JsonResult loginEle(
@RequestBodyPlus("username") String username, @RequestBodyPlus("password") String password) {
UserLoginInfo info = userService.login(username, password);
if (info == null) {
throw new PlatformException("用户名密码错误");
}
CoreUser user = info.getUser();
CoreOrg currentOrg = info.getOrgs().stream().findFirst().orElse(null);
for (CoreOrg org : info.getOrgs()) {
if (org.getId().equals(user.getOrgId())) {
currentOrg = org;
break;
}
}
info.setCurrentOrg(currentOrg);
// 记录登录信息到session
this.platformService.setLoginUser(info.getUser(), info.getCurrentOrg(), info.getOrgs());
Map<String, Object> resultMap =
MapUtil.<String, Object>builder()
.put("token", JoseJwtUtil.generateJwtJson(String.valueOf(user.getId())))
.build();
return JsonResult.success(resultMap);
}
} }
package com.ibeetl.admin.core.web.vea;
import cn.hutool.core.map.MapUtil;
import com.ibeetl.admin.core.annotation.RequestBodyPlus;
import com.ibeetl.admin.core.entity.CoreOrg;
import com.ibeetl.admin.core.entity.CoreRoute;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.rbac.UserLoginInfo;
import com.ibeetl.admin.core.rbac.UserRoleInfo;
import com.ibeetl.admin.core.service.vea.RoleRoutesService;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.admin.core.util.HttpRequestLocal;
import com.ibeetl.admin.core.util.JoseJwtUtil;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class UserRestController {
@Autowired private RoleRoutesService roleRoutesService;
@Autowired private CoreUserService coreUserService;
@GetMapping("/routes")
public JsonResult<List<CoreRoute>> routes() {
return JsonResult.success(roleRoutesService.getRoutes());
}
@GetMapping("/user/info")
public JsonResult info() {
CoreOrg currentOrg = HttpRequestLocal.getAccessCurrentOrg();
CoreUser currentUser = HttpRequestLocal.getAccessCurrentUser();
List<Long> roleIds = roleRoutesService.getAllRoleIds(currentUser.getId(), currentOrg.getId());
UserRoleInfo userRoleInfo = new UserRoleInfo();
userRoleInfo.setAvatar("avatar");
userRoleInfo.setIntroduction("introduction");
userRoleInfo.setName(currentUser.getName());
userRoleInfo.setRoles(roleIds.toArray(new Long[0]));
return JsonResult.success(userRoleInfo);
}
@PostMapping("/user/login")
public JsonResult loginEle(
@RequestBodyPlus("username") String username, @RequestBodyPlus("password") String password) {
UserLoginInfo info = coreUserService.login(username, password);
if (info == null) {
throw new PlatformException("用户名密码错误");
}
CoreUser user = info.getUser();
CoreOrg currentOrg = info.getOrgs().stream().findFirst().orElse(null);
for (CoreOrg org : info.getOrgs()) {
if (org.getId().equals(user.getOrgId())) {
currentOrg = org;
break;
}
}
info.setCurrentOrg(currentOrg);
// 记录登录信息到session
HttpRequestLocal.setLoginerInfo(info.getUser(), info.getCurrentOrg(), info.getOrgs());
Map<String, Object> resultMap =
MapUtil.<String, Object>builder()
.put("token", JoseJwtUtil.generateJwtJson(String.valueOf(user.getId())))
.build();
return JsonResult.success(resultMap);
}
@PostMapping("/user/logout")
public JsonResult logout() {
HttpRequestLocal.clearAllSession();
return JsonResult.success();
}
}
getAllRoutes
===
select router.id,
router.PARENT_ID,
ifnull(router.ACCESS_URL, '/error/404') path,
router.NAME,
menu.NAME title,
menu.ICON,
ifnull(menu.SEQ, 999999) seq,
crm.ROLE_ID
from core_function router
left join core_menu menu
on menu.FUNCTION_ID = router.ID
left join core_role_menu crm on crm.MENU_ID = menu.id;
-- MySQL dump 10.13 Distrib 5.6.24, for osx10.8 (x86_64) --
-- -- Script was generated by Devart dbForge Studio 2019 for MySQL, Version 8.2.23.0
-- Host: 127.0.0.1 Database: starter -- Product home page: http://www.devart.com/dbforge/mysql/studio
-- ------------------------------------------------------ -- Script date 2019/9/15 21:15:32
-- Server version 5.6.26 -- Server version: 8.0.17
-- Client version: 4.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `cms_blog`
--
DROP TABLE IF EXISTS `cms_blog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cms_blog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`content` varchar(512) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`create_user_id` int(11) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cms_blog`
--
LOCK TABLES `cms_blog` WRITE;
/*!40000 ALTER TABLE `cms_blog` DISABLE KEYS */;
INSERT INTO `cms_blog` VALUES (1,'hello','我的博客,内容是。。。','2018-02-22 09:53:05',1,'F0'),(2,'cccc','过年回家','2018-02-13 10:30:01',1,'F0');
/*!40000 ALTER TABLE `cms_blog` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_audit`
--
DROP TABLE IF EXISTS `core_audit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_audit` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`FUNCTION_CODE` varchar(45) DEFAULT NULL,
`FUNCTION_NAME` varchar(45) DEFAULT NULL,
`USER_ID` int(11) DEFAULT NULL,
`USER_NAME` varchar(45) DEFAULT NULL,
`IP` varchar(45) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
`SUCCESS` tinyint(4) DEFAULT NULL,
`MESSAGE` varchar(250),
`ORG_ID` varchar(45) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_audit`
--
LOCK TABLES `core_audit` WRITE;
/*!40000 ALTER TABLE `core_audit` DISABLE KEYS */;
INSERT INTO `core_audit` VALUES (1,'org.query','未定义',1,'超级管理员','172.16.49.65','2018-02-06 19:58:50.876000',1,'',NULL),(2,'org.query','未定义',1,'超级管理员','172.16.49.65','2018-02-06 19:58:51.377000',1,'',NULL),(3,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:00:10.972000',1,'',NULL),(4,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:00:11.130000',1,'',NULL),(5,'user.add','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:00:39.562000',1,'',NULL),(6,'user.edit','用户编辑',1,'超级管理员','172.16.49.65','2018-02-06 20:10:15.399000',1,'',NULL),(7,'user.query','用户列表',1,'超级管理员','172.16.49.65','2018-02-06 20:10:15.846000',1,'',NULL),(8,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:10:16.882000',1,'',NULL),(9,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:10:17.056000',1,'',NULL),(10,'user.edit','用户编辑',1,'超级管理员','172.16.49.65','2018-02-06 20:14:46.789000',0,'java.sql.SQLException: Error on delete of \'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\#sql978_2c3_6.MYI\' (Errcode: 13 - Permission denied)',NULL),(11,'user.edit','用户编辑',1,'超级管理员','172.16.49.65','2018-02-06 20:15:12.861000',1,'',NULL),(12,'user.query','用户列表',1,'超级管理员','172.16.49.65','2018-02-06 20:15:13.294000',1,'',NULL),(13,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:15:14.636000',1,'',NULL),(14,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:15:14.876000',1,'',NULL),(15,'audit','未定义',1,'超级管理员','172.16.49.65','2018-02-06 20:16:23.824000',1,'',NULL),(16,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:42:58.091000',1,'',NULL),(17,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:42:58.394000',1,'',NULL),(18,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:11.745000',1,'',NULL),(19,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:11.943000',1,'',NULL),(20,'user.add','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:13.058000',1,'',NULL),(21,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:28.999000',1,'',NULL),(22,'role.add','角色添加',1,'超级管理员','172.16.49.65','2018-02-07 09:53:29.162000',1,'',NULL),(23,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:43.017000',1,'',NULL),(24,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:43.148000',1,'',NULL),(25,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:53:45.338000',1,'',NULL),(26,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:03.185000',1,'',NULL),(27,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:03.646000',1,'',NULL),(28,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:06.264000',1,'',NULL),(29,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:07.508000',1,'',NULL),(30,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:09.524000',1,'',NULL),(31,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 09:56:10.738000',1,'',NULL),(32,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:02:00.590000',1,'',NULL),(33,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:02:00.803000',1,'',NULL),(34,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:02:02.991000',1,'',NULL),(35,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:05:40.367000',1,'',NULL),(36,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:05:40.496000',1,'',NULL),(37,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:05:42.173000',1,'',NULL),(38,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:06:02.218000',1,'',NULL),(39,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:07:45.273000',1,'',NULL),(40,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:07:45.943000',1,'',NULL),(41,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:07:47.715000',1,'',NULL),(42,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:08:03.378000',1,'',NULL),(43,'role.update','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:08:03.484000',1,'',NULL),(44,'role.edit','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:08:16.535000',1,'',NULL),(45,'role.query','未定义',1,'超级管理员','172.16.49.65','2018-02-07 10:08:16.691000',1,'',NULL);
/*!40000 ALTER TABLE `core_audit` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_dict`
--
DROP TABLE IF EXISTS `core_dict`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_dict` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`VALUE` varchar(16) NOT NULL,
`NAME` varchar(128) NOT NULL COMMENT '名称',
`TYPE` varchar(64) NOT NULL COMMENT '字典编码',
`TYPE_NAME` varchar(64) NOT NULL COMMENT '类型描述',
`SORT` int(6) DEFAULT NULL COMMENT '排序',
`PARENT` int(64) DEFAULT NULL COMMENT '父id',
`DEL_FLAG` int(6) DEFAULT NULL COMMENT '删除标记',
`REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
`CREATE_TIME` datetime(6) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`ID`),
KEY `idx_code` (`TYPE`),
KEY `idx_pid` (`PARENT`),
KEY `idx_value` (`VALUE`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='字典表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_dict`
--
LOCK TABLES `core_dict` WRITE;
/*!40000 ALTER TABLE `core_dict` DISABLE KEYS */;
INSERT INTO `core_dict` VALUES (1,'DA0','查看自己','data_access_type','数据权限',1,NULL,0,'11111111111111111123',NULL),(2,'DA1','查看本公司','data_access_type','数据权限',3,NULL,0,'hello,go',NULL),(3,'DA2','查看同机构','data_access_type','数据权限',3,NULL,0,NULL,NULL),(4,'DA3','查看本部门','data_access_type','数据权限',4,NULL,0,NULL,NULL),(5,'DA4','查看集团','data_access_type','数据权限',5,NULL,0,NULL,NULL),(6,'DA5','查看母公司','data_access_type','数据权限',6,NULL,0,NULL,'2017-10-14 11:45:02.000000'),(7,'FN0','普通功能','function_type','功能点类型',2,NULL,0,NULL,'2017-10-23 10:18:03.000000'),(8,'FN1','含数据权限','function_type','功能点类型',1,NULL,0,NULL,'2017-10-23 10:20:05.000000'),(9,'JT_01','管理岗位','job_type','岗位类型',1,NULL,0,NULL,NULL),(10,'JT_02','技术岗位','job_type','岗位类型',2,NULL,0,NULL,NULL),(11,'JT_S_01','董事会','job_sub_managment_type','管理岗位子类型',1,9,0,NULL,NULL),(12,'JT_S_02','秘书','job_sub_managment_type','管理岗位子类型',2,9,0,NULL,NULL),(13,'JT_S_03','技术经理','job_dev_sub_type','技术岗位子类型',1,10,0,NULL,NULL),(14,'JT_S_04','程序员','job_dev_sub_type','技术岗位子类型',2,10,0,NULL,NULL),(15,'MENU_M','菜单','menu_type','菜单类型',3,NULL,0,NULL,NULL),(16,'MENU_N','导航','menu_type','菜单类型',2,NULL,0,NULL,NULL),(17,'MENU_S','系统','menu_type','菜单类型',1,NULL,0,NULL,NULL),(18,'ORGT0','集团总部','org_type','机构类型',1,NULL,0,NULL,NULL),(19,'ORGT1','分公司','org_type','机构类型',2,NULL,0,NULL,NULL),(20,'ORGT2','部门','org_type','机构类型',3,NULL,0,NULL,NULL),(21,'ORGT3','小组','org_type','机构类型',4,NULL,0,NULL,NULL),(22,'R0','操作角色','role_type','数据权限',1,NULL,0,NULL,NULL),(23,'R1','工作流角色','role_type','用户角色',2,NULL,0,NULL,NULL),(24,'S0','禁用','user_state','用户状态',2,NULL,0,NULL,NULL),(25,'S1','启用','user_state','用户状态',1,NULL,0,NULL,NULL),(26,'昂按','随碟附送分','kkkk','水电费水电费',NULL,NULL,0,'','2018-02-28 15:43:34.447000'),(27,'昂按','随碟附送分','kkkk','水电费水电费',NULL,NULL,0,'','2018-02-28 15:46:08.035000'),(28,'sdf','sdfsdf','sfsdf','sdfsdf',1,NULL,1,'','2018-02-28 15:47:56.384000'),(29,'asas','sdfsd','sd','sd',NULL,NULL,1,'','2018-02-28 15:50:32.214000'),(30,'asas','sdfsd','sd','sd',NULL,NULL,1,'','2018-02-28 15:50:50.241000'),(31,'1','男','gender','性别',NULL,NULL,0,'','2018-03-10 11:36:19.930000'),(32,'2','女','gender','性别',NULL,NULL,0,NULL,'2018-03-10 11:36:20.001000');
/*!40000 ALTER TABLE `core_dict` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_file`
--
DROP TABLE IF EXISTS `core_file`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_file` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`NAME` varchar(64) DEFAULT NULL COMMENT '文件名称',
`PATH` varchar(255) DEFAULT NULL COMMENT '路径',
`BIZ_ID` varchar(128) DEFAULT NULL COMMENT '业务ID',
`USER_ID` int(20) DEFAULT NULL COMMENT '上传人id',
`CREATE_TIME` datetime(6) DEFAULT NULL COMMENT '创建时间',
`ORG_ID` int(20) DEFAULT NULL,
`BIZ_TYPE` varchar(128) DEFAULT NULL,
`FILE_BATCH_ID` varchar(128) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='文件表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_file`
--
LOCK TABLES `core_file` WRITE;
/*!40000 ALTER TABLE `core_file` DISABLE KEYS */;
INSERT INTO `core_file` VALUES (19,'dict_upload_template.xls','20180311/dict_upload_template.xls.8caa38fb-52ef-4c73-85ea-abfb1f5c5dc4',NULL,1,'2018-03-11 15:36:58.906000',1,NULL,'18c0dd67-e334-47ba-8969-915bcf77c544'),(20,'dict_upload_template.xls','20180311/dict_upload_template.xls.f50b7f0f-d376-4a95-be6a-14f5aa4a81e6',NULL,1,'2018-03-11 15:37:15.884000',1,NULL,'335a583a-9c74-462d-be0a-5a82d427b1aa'),(21,'dict_upload_template.xls','20180311/dict_upload_template.xls.b0b9434d-e367-43ef-b8ac-366cf7b018b6',NULL,1,'2018-03-11 15:38:52.600000',1,NULL,'a5b887c6-101c-46e8-b9e2-b3b448edff34'),(22,'dict_upload_template.xls','20180311/dict_upload_template.xls.15f02d15-2dd0-4cb7-b2e5-4f7d72fb497d',NULL,1,'2018-03-11 15:39:02.091000',1,NULL,'833d96bc-797c-403f-aa2e-00e2b5a3cd71'),(23,'dict_upload_template.xls','20180311/dict_upload_template.xls.f12350bc-31da-4875-a78e-0135f512fb4c',NULL,1,'2018-03-11 15:41:52.323000',1,NULL,'0b2a66a3-8aa8-46b7-8bf0-ce9f68041cd8'),(24,'dict_upload_template.xls','20180311/dict_upload_template.xls.5bf626e5-2152-45a5-a432-fc2e9fcb7903',NULL,1,'2018-03-11 15:43:18.066000',1,NULL,'813725ab-2c07-4e48-a766-7ebbe3083212'),(25,'dict_upload_template.xls','20180311/dict_upload_template.xls.3cd3eb95-aab9-4105-8d28-76a723274709',NULL,1,'2018-03-11 15:43:58.096000',1,NULL,'4216455c-20d7-4912-bfc8-c8cca7e70e9f'),(26,'dict_upload_template.xls','20180311/dict_upload_template.xls.d3dc557b-1e77-4955-a3be-7a8b4f86407c',NULL,1,'2018-03-11 15:45:02.882000',1,NULL,'e42dc975-edd5-4d16-8529-fa69b56a5eb5'),(34,'dict_upload_template.xls','20180311/dict_upload_template.xls.d50f8245-ec3e-4de1-9742-0c5c12105f27','175',1,'2018-03-11 16:30:36.191000',1,NULL,'79b294da-8792-4bfd-9d84-e3f989b88cdf'),(37,'副本 功能列表.xlsx','20180311/副本 功能列表.xlsx.bc7554e3-2a30-4667-aa61-0e280340b2be','175',1,'2018-03-11 18:53:41.504000',1,'User','79b294da-8792-4bfd-9d84-e3f989b88cdf'),(38,'副本 功能列表.xlsx','20180311/副本 功能列表.xlsx.d991eb1f-24a9-4db1-87c1-7ef9d2b8a40a','175',1,'2018-03-11 22:10:57.873000',1,'User','79b294da-8792-4bfd-9d84-e3f989b88cdf');
/*!40000 ALTER TABLE `core_file` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_file_tag`
--
DROP TABLE IF EXISTS `core_file_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_file_tag` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`KEY` varchar(64) NOT NULL COMMENT 'key,关键字',
`VALUE` varchar(255) NOT NULL COMMENT '关键字对应的值',
`FILE_ID` int(20) NOT NULL COMMENT 'sys_file的id,文件id',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='文件标签';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_file_tag`
--
LOCK TABLES `core_file_tag` WRITE;
/*!40000 ALTER TABLE `core_file_tag` DISABLE KEYS */;
INSERT INTO `core_file_tag` VALUES (1,'customer','12332',1),(2,'type','crdit',2);
/*!40000 ALTER TABLE `core_file_tag` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_function`
--
DROP TABLE IF EXISTS `core_function`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_function` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`CODE` varchar(250),
`NAME` varchar(16) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
`ACCESS_URL` varchar(250),
`PARENT_ID` int(65) DEFAULT NULL,
`TYPE` varchar(4) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_function`
--
LOCK TABLES `core_function` WRITE;
/*!40000 ALTER TABLE `core_function` DISABLE KEYS */;
INSERT INTO `core_function` VALUES (1,'user','用户功能',NULL,'/admin/user/index.do',0,'FN0'),(2,'user.query','用户列表',NULL,NULL,1,'FN1'),(3,'user.edit','用户编辑',NULL,NULL,1,'FN0'),(6,'org','组织机构',NULL,'/admin/org/index.do',0,'FN0'),(7,'role','角色管理',NULL,'/admin/role/index.do',0,'FN0'),(8,'menu','菜单管理',NULL,'/admin/menu/index.do',0,'FN0'),(9,'function','功能点管理',NULL,'/admin/function/index.do',0,'FN0'),(10,'roleFunction','角色功能授权',NULL,'/admin/role/function.do',0,'FN0'),(11,'roleDataAccess','角色数据授权',NULL,'/admin/role/data.do',0,'FN0'),(12,'code','代码生成',NULL,'/core/codeGen/index.do',0,'FN0'),(13,'dict','字典管理',NULL,'/admin/dict/index.do',0,'FN0'),(18,'trace','审计查询',NULL,'/admin/audit/index.do',0,'FN0'),(19,'file','相关文档',NULL,'/trade/interAndRelate/file.do',0,'FN0'),(91,'test','测试','2017-10-11 16:59:01.000000','/test/test.do',6,'FN0'),(161,'role.add','角色添加','2017-10-23 09:45:05.000000',NULL,7,'FN0'),(167,'workflow.admin','工作流监控',NULL,'/admin/workflow/index.do',0,'FN0'),(180,'code.query','代码生成测试',NULL,NULL,12,'FN0'),(181,'blog.query','博客查询功能',NULL,'',182,'FN0'),(182,'blog','博客测试',NULL,'/admin/blog/index.do',0,'FN0'),(183,'code.project','项目生成','2018-03-01 09:38:17.068000','/core/codeGen/project.do',12,'FN0');
/*!40000 ALTER TABLE `core_function` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_menu`
--
DROP TABLE IF EXISTS `core_menu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_menu` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`CODE` varchar(16) DEFAULT NULL,
`NAME` varchar(16) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
`FUNCTION_ID` int(6) DEFAULT NULL,
`TYPE` varchar(6) DEFAULT NULL COMMENT '1,系统,2 导航 3 菜单项(对应某个功能点)',
`PARENT_MENU_ID` int(65) DEFAULT NULL,
`SEQ` int(65) DEFAULT NULL,
`ICON` varchar(255) DEFAULT NULL COMMENT '图标',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_menu`
--
LOCK TABLES `core_menu` WRITE;
/*!40000 ALTER TABLE `core_menu` DISABLE KEYS */;
INSERT INTO `core_menu` VALUES (8,'系统管理','系统管理',NULL,NULL,'MENU_S',0,1,NULL),(10,'用户管理','用户管理',NULL,1,'MENU_M',18,1,NULL),(11,'组织机构管理','组织机构管理',NULL,6,'MENU_M',18,2,NULL),(12,'角色管理','角色管理',NULL,7,'MENU_M',18,3,NULL),(13,'菜单项','菜单项',NULL,8,'MENU_M',18,4,NULL),(14,'功能点管理','功能点管理',NULL,9,'MENU_M',18,5,NULL),(15,'字典数据管理','字典数据管理',NULL,13,'MENU_M',18,6,NULL),(16,'审计查询','审计查询',NULL,18,'MENU_M',19,7,NULL),(17,'代码生成','代码生成',NULL,12,'MENU_M',24,8,''),(18,'基础管理','基础管理',NULL,NULL,'MENU_N',8,1,NULL),(19,'监控管理','监控管理',NULL,NULL,'MENU_N',8,2,NULL),(20,'流程监控','流程监控',NULL,167,'MENU_M',19,3,NULL),(21,'角色功能授权','角色功能授权',NULL,10,'MENU_M',18,8,NULL),(22,'角色数据授权','角色数据授权',NULL,11,'MENU_M',18,9,NULL),(23,'博客测试','博客测试1',NULL,182,'MENU_M',19,9,''),(24,'代码生成导航','代码生成','2018-03-01 09:39:31.096000',NULL,'MENU_N',8,1,''),(25,'子系统生成','子系统生成','2018-03-01 09:42:35.839000',183,'MENU_M',24,1,'');
/*!40000 ALTER TABLE `core_menu` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_org`
--
DROP TABLE IF EXISTS `core_org`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_org` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`CODE` varchar(16) NOT NULL,
`NAME` varchar(16) NOT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
`PARENT_ORG_ID` int(20) DEFAULT NULL,
`TYPE` varchar(6) NOT NULL COMMENT '1 公司,2 部门,3 小组',
`DEL_FLAG` tinyint(6) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_org`
--
LOCK TABLES `core_org` WRITE;
/*!40000 ALTER TABLE `core_org` DISABLE KEYS */;
INSERT INTO `core_org` VALUES (1,'集团公司','集团','2018-02-02 17:18:50.000000',NULL,'ORGT0',0),(3,'信息科技部门','信息科技部门',NULL,1,'ORGT2',0),(4,'贵州银行','贵州银行','2018-02-02 17:18:56.000000',1,'ORGT1',0),(5,'贵州银行金科','贵州银行金融科技开发公司',NULL,4,'ORGT1',0),(6,'金科研发','金科研发',NULL,5,'ORGT2',0),(7,'金科研发部门','金科研发部门','2018-02-05 13:49:52.754000',6,'ORGT2',0),(8,'金科研发2部','金科研发2部','2018-02-05 13:50:43.901000',6,'ORGT2',0);
/*!40000 ALTER TABLE `core_org` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_role`
--
DROP TABLE IF EXISTS `core_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_role` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`CODE` varchar(16) DEFAULT NULL COMMENT '角色编码',
`NAME` varchar(255) DEFAULT NULL COMMENT '角色名称',
`CREATE_TIME` datetime(6) DEFAULT NULL COMMENT '创建时间',
`TYPE` varchar(6) DEFAULT NULL COMMENT '1 可以配置 2 固定权限角色',
PRIMARY KEY (`ID`),
KEY `code_idx` (`CODE`)
) ENGINE=InnoDB AUTO_INCREMENT=174 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_role`
--
LOCK TABLES `core_role` WRITE;
/*!40000 ALTER TABLE `core_role` DISABLE KEYS */;
INSERT INTO `core_role` VALUES (1,'DEPT_MANAGER','部门管理员',NULL,'R0'),(2,'CEO','公司CEO',NULL,'R0'),(3,'ASSIST','助理',NULL,'R0'),(12,'111','2324324','2017-09-06 04:08:00.000000','R0'),(13,'1111','哈哈','2017-09-06 04:09:05.000000','R0'),(15,'admin','ivy','2017-09-06 05:35:04.000000','R0'),(17,'123','我','2017-09-06 21:23:03.000000','R0'),(18,'23','234','2017-09-06 21:41:03.000000','R0'),(19,'132484','1','2017-09-06 21:42:02.000000','R0'),(173,'dept.admin','部门辅助管理员',NULL,'R0');
/*!40000 ALTER TABLE `core_role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_role_function`
--
DROP TABLE IF EXISTS `core_role_function`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_role_function` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`ROLE_ID` int(65) DEFAULT NULL,
`FUNCTION_ID` int(65) DEFAULT NULL,
`DATA_ACCESS_TYPE` tinyint(65) DEFAULT NULL,
`DATA_ACCESS_POLICY` varchar(128) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=207 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_role_function`
-- --
LOCK TABLES `core_role_function` WRITE; --
/*!40000 ALTER TABLE `core_role_function` DISABLE KEYS */; -- Disable foreign keys
INSERT INTO `core_role_function` VALUES (1,1,1,5,NULL),(2,1,2,4,NULL),(3,1,3,5,NULL),(4,2,2,2,NULL),(5,3,2,5,NULL),(6,3,3,5,NULL),(162,1,6,NULL,NULL),(164,1,91,NULL,NULL),(174,173,1,NULL,NULL),(176,173,2,5,NULL),(177,173,3,NULL,NULL),(178,173,167,NULL,NULL),(192,3,1,NULL,NULL),(194,3,12,NULL,NULL),(196,3,180,3,NULL),(197,NULL,1,NULL,NULL),(198,NULL,2,NULL,NULL),(199,NULL,3,NULL,NULL),(200,NULL,6,NULL,NULL),(201,NULL,91,NULL,NULL),(202,NULL,8,NULL,NULL),(205,1,182,NULL,NULL),(206,1,181,NULL,NULL); --
/*!40000 ALTER TABLE `core_role_function` ENABLE KEYS */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
UNLOCK TABLES;
--
-- Table structure for table `core_role_menu`
--
DROP TABLE IF EXISTS `core_role_menu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_role_menu` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`ROLE_ID` int(65) DEFAULT NULL,
`MENU_ID` int(65) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_role_menu`
--
LOCK TABLES `core_role_menu` WRITE;
/*!40000 ALTER TABLE `core_role_menu` DISABLE KEYS */;
INSERT INTO `core_role_menu` VALUES (1,1,10,NULL),(163,1,11,NULL),(175,173,10,NULL),(193,3,10,NULL),(195,3,17,NULL),(196,NULL,10,NULL),(197,NULL,11,NULL),(198,NULL,13,NULL),(200,1,23,NULL);
/*!40000 ALTER TABLE `core_role_menu` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_user`
--
DROP TABLE IF EXISTS `core_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_user` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`CODE` varchar(16) DEFAULT NULL,
`NAME` varchar(16) DEFAULT NULL,
`PASSWORD` varchar(64) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
`ORG_ID` int(65) DEFAULT NULL,
`STATE` varchar(16) DEFAULT NULL COMMENT '用户状态 1:启用 0:停用',
`JOB_TYPE1` varchar(16) DEFAULT NULL,
`DEL_FLAG` tinyint(6) DEFAULT NULL COMMENT '用户删除标记 0:未删除 1:已删除',
`update_Time` datetime DEFAULT NULL,
`JOB_TYPE0` varchar(16) DEFAULT NULL,
`attachment_id` varchar(128) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_user`
--
LOCK TABLES `core_user` WRITE;
/*!40000 ALTER TABLE `core_user` DISABLE KEYS */;
INSERT INTO `core_user` VALUES (1,'admin','超级管理员1','123456','2017-09-13 09:21:03.000000',1,'S1','JT_S_01',0,'2017-09-13 09:21:03','JT_01',NULL),(171,'lixx','李小小',NULL,'2018-01-28 11:21:20.914000',3,'S1','JT_S_04',0,NULL,'JT_02',NULL),(172,'lixx2','李xx2','123456','2018-01-28 11:22:38.814000',4,'S1','JT_S_02',0,NULL,'JT_01',NULL),(173,'test1','test1','123','2018-01-28 14:44:55.407000',5,'S1','JT_S_04',0,NULL,'JT_02',NULL),(174,'hank250','李小熊',NULL,'2018-02-16 11:36:41.438000',4,'S1','JT_S_04',0,NULL,'JT_02',NULL),(175,'test123','test12344',NULL,'2018-03-11 16:19:21.675000',3,'S1','JT_S_04',0,NULL,'JT_02','79b294da-8792-4bfd-9d84-e3f989b88cdf');
/*!40000 ALTER TABLE `core_user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `core_user_role`
--
DROP TABLE IF EXISTS `core_user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_user_role` (
`ID` int(20) NOT NULL AUTO_INCREMENT,
`USER_ID` int(20) DEFAULT NULL,
`ROLE_ID` int(20) DEFAULT NULL,
`ORG_ID` int(20) DEFAULT NULL,
`CREATE_TIME` datetime(6) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=173 DEFAULT CHARSET=utf8 COMMENT='用户角色关系表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `core_user_role`
--
LOCK TABLES `core_user_role` WRITE; --
/*!40000 ALTER TABLE `core_user_role` DISABLE KEYS */; -- Set SQL mode
INSERT INTO `core_user_role` VALUES (1,3,1,4,NULL),(2,4,2,5,NULL),(3,75,3,6,'2017-09-21 18:03:05.000000'),(35,1,1,1,'2017-09-06 01:12:02.000000'),(36,1,3,6,'2017-09-06 03:33:05.000000'),(38,1,1,3,'2017-09-06 03:35:02.000000'),(41,1,1,5,'2017-09-06 03:58:02.000000'),(42,3,3,1,'2017-09-06 04:01:00.000000'),(47,47,3,1,'2017-09-06 22:00:01.000000'),(49,5,3,4,'2017-09-06 22:01:00.000000'),(52,47,2,1,'2017-09-07 01:12:02.000000'),(53,48,3,4,'2017-09-07 01:14:04.000000'),(55,68,2,3,'2017-09-07 21:42:03.000000'),(125,74,1,4,'2017-10-17 09:37:02.000000'),(144,74,3,NULL,'2017-10-17 16:55:00.000000'),(145,67,3,NULL,'2017-10-17 16:55:01.000000'),(146,73,3,NULL,'2017-10-17 16:55:02.000000'),(147,22,3,NULL,'2017-10-17 16:55:04.000000'),(148,68,3,NULL,'2017-10-17 16:56:00.000000'),(168,72,1,3,'2017-10-24 14:40:04.000000'),(169,41,1,NULL,'2017-10-25 08:58:01.000000'),(171,170,1,5,'2017-10-25 09:08:05.000000'),(172,171,1,4,'2018-02-02 09:36:40.967000'); --
/*!40000 ALTER TABLE `core_user_role` ENABLE KEYS */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
--
-- Set character set the client will use to send SQL statements to the server
--
SET NAMES 'utf8';
DROP DATABASE IF EXISTS starter;
CREATE DATABASE IF NOT EXISTS starter
CHARACTER SET utf8
COLLATE utf8_general_ci;
--
-- Set default database
--
USE starter;
--
-- Create table `core_user_role`
--
CREATE TABLE IF NOT EXISTS core_user_role (
ID INT(20) NOT NULL AUTO_INCREMENT,
USER_ID INT(20) DEFAULT NULL,
ROLE_ID INT(20) DEFAULT NULL,
ORG_ID INT(20) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 173,
AVG_ROW_LENGTH = 712,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '用户角色关系表';
--
-- Create table `core_user`
--
CREATE TABLE IF NOT EXISTS core_user (
ID INT(20) NOT NULL AUTO_INCREMENT,
CODE VARCHAR(16) DEFAULT NULL,
NAME VARCHAR(16) DEFAULT NULL,
PASSWORD VARCHAR(64) DEFAULT NULL,
ORG_ID INT(65) DEFAULT NULL,
STATE VARCHAR(16) DEFAULT NULL COMMENT '用户状态 1:启用 0:停用',
JOB_TYPE1 VARCHAR(16) DEFAULT NULL,
DEL_FLAG TINYINT(6) DEFAULT NULL COMMENT '用户删除标记 0:未删除 1:已删除',
JOB_TYPE0 VARCHAR(16) DEFAULT NULL,
ATTACHMENT_ID VARCHAR(128) DEFAULT NULL,
INTRODUCTION VARCHAR(256) DEFAULT NULL COMMENT '简介',
AVATAR VARCHAR(128) DEFAULT NULL COMMENT '头像',
UPDATE_TIME BIGINT(11) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 176,
AVG_ROW_LENGTH = 2730,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_role_menu`
--
CREATE TABLE IF NOT EXISTS core_role_menu (
ID INT(20) NOT NULL AUTO_INCREMENT,
ROLE_ID INT(65) DEFAULT NULL,
MENU_ID INT(65) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 201,
AVG_ROW_LENGTH = 1820,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_role_function`
--
CREATE TABLE IF NOT EXISTS core_role_function (
ID INT(20) NOT NULL AUTO_INCREMENT,
ROLE_ID INT(65) DEFAULT NULL,
FUNCTION_ID INT(65) DEFAULT NULL,
DATA_ACCESS_TYPE TINYINT(65) DEFAULT NULL,
DATA_ACCESS_POLICY VARCHAR(128) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 206,
AVG_ROW_LENGTH = 712,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_role`
--
CREATE TABLE IF NOT EXISTS core_role (
ID INT(20) NOT NULL AUTO_INCREMENT,
CODE VARCHAR(16) DEFAULT NULL COMMENT '角色编码',
NAME VARCHAR(255) DEFAULT NULL COMMENT '角色名称',
TYPE VARCHAR(6) DEFAULT NULL COMMENT '1 可以配置 2 固定权限角色',
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 174,
AVG_ROW_LENGTH = 1638,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create index `code_idx` on table `core_role`
--
ALTER TABLE core_role
ADD INDEX code_idx(CODE);
--
-- Create table `core_org`
--
CREATE TABLE IF NOT EXISTS core_org (
ID INT(20) NOT NULL AUTO_INCREMENT,
CODE VARCHAR(16) NOT NULL,
NAME VARCHAR(16) NOT NULL,
PARENT_ORG_ID INT(20) DEFAULT NULL,
TYPE VARCHAR(6) NOT NULL COMMENT '1 公司,2 部门,3 小组',
DEL_FLAG TINYINT(6) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 9,
AVG_ROW_LENGTH = 2340,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_menu`
--
CREATE TABLE IF NOT EXISTS core_menu (
ID INT(20) NOT NULL AUTO_INCREMENT,
CODE VARCHAR(16) DEFAULT NULL,
NAME VARCHAR(16) DEFAULT NULL,
FUNCTION_ID INT(6) DEFAULT NULL,
TYPE VARCHAR(6) DEFAULT NULL COMMENT '1,系统,2 导航 3 菜单项(对应某个功能点)',
PARENT_MENU_ID INT(65) DEFAULT NULL,
SEQ INT(65) DEFAULT NULL,
ICON VARCHAR(255) DEFAULT NULL COMMENT '图标',
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 26,
AVG_ROW_LENGTH = 963,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_function`
--
CREATE TABLE IF NOT EXISTS core_function (
ID INT(20) NOT NULL AUTO_INCREMENT,
CODE VARCHAR(250) DEFAULT NULL,
NAME VARCHAR(16) DEFAULT NULL,
ACCESS_URL VARCHAR(250) DEFAULT NULL,
PARENT_ID INT(65) DEFAULT NULL,
TYPE VARCHAR(4) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 184,
AVG_ROW_LENGTH = 819,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `core_file_tag`
--
CREATE TABLE IF NOT EXISTS core_file_tag (
ID INT(20) NOT NULL AUTO_INCREMENT,
`KEY` VARCHAR(64) NOT NULL COMMENT 'key,关键字',
VALUE VARCHAR(255) NOT NULL COMMENT '关键字对应的值',
FILE_ID INT(20) NOT NULL COMMENT 'sys_file的id,文件id',
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 2,
AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '文件标签';
--
-- Create table `core_file`
--
CREATE TABLE IF NOT EXISTS core_file (
ID INT(20) NOT NULL AUTO_INCREMENT,
NAME VARCHAR(64) DEFAULT NULL COMMENT '文件名称',
PATH VARCHAR(255) DEFAULT NULL COMMENT '路径',
BIZ_ID VARCHAR(128) DEFAULT NULL COMMENT '业务ID',
USER_ID INT(20) DEFAULT NULL COMMENT '上传人id',
ORG_ID INT(20) DEFAULT NULL,
BIZ_TYPE VARCHAR(128) DEFAULT NULL,
FILE_BATCH_ID VARCHAR(128) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 1489,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '文件表';
--
-- Create table `core_dict`
--
CREATE TABLE IF NOT EXISTS core_dict (
ID INT(11) NOT NULL AUTO_INCREMENT,
VALUE VARCHAR(16) NOT NULL,
NAME VARCHAR(128) NOT NULL COMMENT '名称',
TYPE VARCHAR(64) NOT NULL COMMENT '字典编码',
TYPE_NAME VARCHAR(64) NOT NULL COMMENT '类型描述',
SORT INT(6) DEFAULT NULL COMMENT '排序',
PARENT INT(64) DEFAULT NULL COMMENT '父id',
DEL_FLAG INT(6) DEFAULT NULL COMMENT '删除标记',
REMARK VARCHAR(255) DEFAULT NULL COMMENT '备注',
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AUTO_INCREMENT = 33,
AVG_ROW_LENGTH = 512,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '字典表';
--
-- Create index `idx_code` on table `core_dict`
--
ALTER TABLE core_dict
ADD INDEX idx_code(TYPE);
--
-- Create index `idx_pid` on table `core_dict`
--
ALTER TABLE core_dict
ADD INDEX idx_pid(PARENT);
--
-- Create index `idx_value` on table `core_dict`
--
ALTER TABLE core_dict
ADD INDEX idx_value(VALUE);
--
-- Create table `core_audit`
--
CREATE TABLE IF NOT EXISTS core_audit (
ID INT(11) NOT NULL AUTO_INCREMENT,
FUNCTION_CODE VARCHAR(45) DEFAULT NULL,
FUNCTION_NAME VARCHAR(45) DEFAULT NULL,
USER_ID INT(11) DEFAULT NULL,
USER_NAME VARCHAR(45) DEFAULT NULL,
IP VARCHAR(45) DEFAULT NULL,
SUCCESS TINYINT(4) DEFAULT NULL,
MESSAGE VARCHAR(250) DEFAULT NULL,
ORG_ID VARCHAR(45) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (ID)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 364,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Create table `cms_blog`
--
CREATE TABLE IF NOT EXISTS cms_blog (
id INT(11) NOT NULL AUTO_INCREMENT,
title VARCHAR(255) DEFAULT NULL,
content VARCHAR(512) DEFAULT NULL,
create_user_id INT(11) DEFAULT NULL,
type VARCHAR(255) DEFAULT NULL,
CREATE_TIME BIGINT(11) DEFAULT NULL,
PRIMARY KEY (id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8,
COLLATE utf8_general_ci;
--
-- Dumping data for table core_user_role
--
INSERT INTO core_user_role VALUES
(1, 3, 1, 4, NULL),
(2, 4, 2, 5, NULL),
(3, 75, 3, 6, 1505988185),
(35, 1, 1, 1, 1504631522),
(36, 1, 3, 6, 1504639985),
(38, 1, 1, 3, 1504640102),
(41, 1, 1, 5, 1504641482),
(42, 3, 3, 1, 1504641660),
(47, 47, 3, 1, 1504706401),
(49, 5, 3, 4, 1504706460),
(52, 47, 2, 1, 1504717922),
(53, 48, 3, 4, 1504718044),
(55, 68, 2, 3, 1504791723),
(125, 74, 1, 4, 1508204222),
(144, 74, 3, NULL, 1508230500),
(145, 67, 3, NULL, 1508230501),
(146, 73, 3, NULL, 1508230502),
(147, 22, 3, NULL, 1508230504),
(148, 68, 3, NULL, 1508230560),
(168, 72, 1, 3, 1508827204),
(169, 41, 1, NULL, 1508893081),
(171, 170, 1, 5, 1508893685),
(172, 171, 1, 4, 1517535401);
--
-- Dumping data for table core_user
--
INSERT INTO core_user VALUES
(1, 'admin', '超级管理员1', '123456', 1, 'S1', 'JT_S_01', 0, 'JT_01', NULL, NULL, NULL, 1505265663, 1505265663),
(171, 'lixx', '李小小', NULL, 3, 'S1', 'JT_S_04', 0, 'JT_02', NULL, NULL, NULL, NULL, 1517109681),
(172, 'lixx2', '李xx2', '123456', 4, 'S1', 'JT_S_02', 0, 'JT_01', NULL, NULL, NULL, NULL, 1517109759),
(173, 'test1', 'test1', '123', 5, 'S1', 'JT_S_04', 0, 'JT_02', NULL, NULL, NULL, NULL, 1517121895),
(174, 'hank250', '李小熊', NULL, 4, 'S1', 'JT_S_04', 0, 'JT_02', NULL, NULL, NULL, NULL, 1518752201),
(175, 'test123', 'test12344', NULL, 3, 'S1', 'JT_S_04', 0, 'JT_02', '79b294da-8792-4bfd-9d84-e3f989b88cdf', NULL, NULL, NULL, 1520756362);
--
-- Dumping data for table core_role_menu
--
INSERT INTO core_role_menu VALUES
(1, 1, 10, NULL),
(163, 1, 11, NULL),
(175, 173, 10, NULL),
(193, 3, 10, NULL),
(195, 3, 17, NULL),
(196, NULL, 10, NULL),
(197, NULL, 11, NULL),
(198, NULL, 13, NULL),
(200, 1, 23, NULL);
--
-- Dumping data for table core_role_function
--
INSERT INTO core_role_function VALUES
(1, 1, 1, 5, NULL),
(2, 1, 2, 4, NULL),
(3, 1, 3, 5, NULL),
(4, 2, 2, 2, NULL),
(5, 3, 2, 5, NULL),
(6, 3, 3, 5, NULL),
(162, 1, 6, NULL, NULL),
(164, 1, 91, NULL, NULL),
(174, 173, 1, NULL, NULL),
(176, 173, 2, 5, NULL),
(177, 173, 3, NULL, NULL),
(178, 173, 167, NULL, NULL),
(192, 3, 1, NULL, NULL),
(194, 3, 12, NULL, NULL),
(196, 3, 180, 3, NULL),
(197, NULL, 1, NULL, NULL),
(198, NULL, 2, NULL, NULL),
(199, NULL, 3, NULL, NULL),
(200, NULL, 6, NULL, NULL),
(201, NULL, 91, NULL, NULL),
(202, NULL, 8, NULL, NULL),
(205, 1, 182, NULL, NULL),
(206, 1, 181, NULL, NULL);
--
-- Dumping data for table core_role
--
INSERT INTO core_role VALUES
(1, 'DEPT_MANAGER', '部门管理员', 'R0', NULL),
(2, 'CEO', '公司CEO', 'R0', NULL),
(3, 'ASSIST', '助理', 'R0', NULL),
(12, '111', '2324324', 'R0', 1504642080),
(13, '1111', '哈哈', 'R0', 1504642145),
(15, 'admin', 'ivy', 'R0', 1504647304),
(17, '123', '我', 'R0', 1504704183),
(18, '23', '234', 'R0', 1504705263),
(19, '132484', '1', 'R0', 1504705322),
(173, 'dept.admin', '部门辅助管理员', 'R0', NULL);
--
-- Dumping data for table core_org
--
INSERT INTO core_org VALUES
(1, '集团公司', '集团', NULL, 'ORGT0', 0, 1517563130),
(3, '信息科技部门', '信息科技部门', 1, 'ORGT2', 0, NULL),
(4, '贵州银行', '贵州银行', 1, 'ORGT1', 0, 1517563136),
(5, '贵州银行金科', '贵州银行金融科技开发公司', 4, 'ORGT1', 0, NULL),
(6, '金科研发', '金科研发', 5, 'ORGT2', 0, NULL),
(7, '金科研发部门', '金科研发部门', 6, 'ORGT2', 0, 1517809793),
(8, '金科研发2部', '金科研发2部', 6, 'ORGT2', 0, 1517809844);
--
-- Dumping data for table core_menu
--
INSERT INTO core_menu VALUES
(8, '系统管理', '系统管理', NULL, 'MENU_S', 0, 1, NULL, NULL),
(10, '用户管理', '用户管理', 1, 'MENU_M', 18, 1, NULL, NULL),
(11, '组织机构管理', '组织机构管理', 6, 'MENU_M', 18, 2, NULL, NULL),
(12, '角色管理', '角色管理', 7, 'MENU_M', 18, 3, NULL, NULL),
(13, '菜单项', '菜单项', 8, 'MENU_M', 18, 4, NULL, NULL),
(14, '功能点管理', '功能点管理', 9, 'MENU_M', 18, 5, NULL, NULL),
(15, '字典数据管理', '字典数据管理', 13, 'MENU_M', 18, 6, NULL, NULL),
(16, '审计查询', '审计查询', 18, 'MENU_M', 19, 7, NULL, NULL),
(17, '代码生成', '代码生成', 12, 'MENU_M', 24, 8, '', NULL),
(18, '基础管理', '基础管理', NULL, 'MENU_N', 8, 1, NULL, NULL),
(19, '监控管理', '监控管理', NULL, 'MENU_N', 8, 2, NULL, NULL),
(20, '流程监控', '流程监控', 167, 'MENU_M', 19, 3, NULL, NULL),
(21, '角色功能授权', '角色功能授权', 10, 'MENU_M', 18, 8, NULL, NULL),
(22, '角色数据授权', '角色数据授权', 11, 'MENU_M', 18, 9, NULL, NULL),
(23, '博客测试', '博客测试1', 182, 'MENU_M', 19, 9, '', NULL),
(24, '代码生成导航', '代码生成', NULL, 'MENU_N', 8, 1, '', 1519868371),
(25, '子系统生成', '子系统生成', 183, 'MENU_M', 24, 1, '', 1519868556);
--
-- Dumping data for table core_function
--
INSERT INTO core_function VALUES
(1, 'user', '用户功能', '/admin/user/index.do', 0, 'FN0', NULL),
(2, 'user.query', '用户列表', NULL, 1, 'FN1', NULL),
(3, 'user.edit', '用户编辑', NULL, 1, 'FN0', NULL),
(6, 'org', '组织机构', '/admin/org/index.do', 0, 'FN0', NULL),
(7, 'role', '角色管理', '/admin/role/index.do', 0, 'FN0', NULL),
(8, 'menu', '菜单管理', '/admin/menu/index.do', 0, 'FN0', NULL),
(9, 'function', '功能点管理', '/admin/function/index.do', 0, 'FN0', NULL),
(10, 'roleFunction', '角色功能授权', '/admin/role/function.do', 0, 'FN0', NULL),
(11, 'roleDataAccess', '角色数据授权', '/admin/role/data.do', 0, 'FN0', NULL),
(12, 'code', '代码生成', '/core/codeGen/index.do', 0, 'FN0', NULL),
(13, 'dict', '字典管理', '/admin/dict/index.do', 0, 'FN0', NULL),
(18, 'trace', '审计查询', '/admin/audit/index.do', 0, 'FN0', NULL),
(19, 'file', '相关文档', '/trade/interAndRelate/file.do', 0, 'FN0', NULL),
(91, 'test', '测试', '/test/test.do', 6, 'FN0', 1507712341),
(161, 'role.add', '角色添加', NULL, 7, 'FN0', 1508723105),
(167, 'workflow.admin', '工作流监控', '/admin/workflow/index.do', 0, 'FN0', NULL),
(180, 'code.query', '代码生成测试', NULL, 12, 'FN0', NULL),
(181, 'blog.query', '博客查询功能', '', 182, 'FN0', NULL),
(182, 'blog', '博客测试', '/admin/blog/index.do', 0, 'FN0', NULL),
(183, 'code.project', '项目生成', '/core/codeGen/project.do', 12, 'FN0', 1519868297);
--
-- Dumping data for table core_file_tag
--
INSERT INTO core_file_tag VALUES
(1, 'customer', '12332', 1),
(2, 'type', 'crdit', 2);
--
-- Dumping data for table core_file
--
INSERT INTO core_file VALUES
(19, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.8caa38fb-52ef-4c73-85ea-abfb1f5c5dc4', NULL, 1, 1, NULL, '18c0dd67-e334-47ba-8969-915bcf77c544', 1520753819),
(20, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.f50b7f0f-d376-4a95-be6a-14f5aa4a81e6', NULL, 1, 1, NULL, '335a583a-9c74-462d-be0a-5a82d427b1aa', 1520753836),
(21, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.b0b9434d-e367-43ef-b8ac-366cf7b018b6', NULL, 1, 1, NULL, 'a5b887c6-101c-46e8-b9e2-b3b448edff34', 1520753933),
(22, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.15f02d15-2dd0-4cb7-b2e5-4f7d72fb497d', NULL, 1, 1, NULL, '833d96bc-797c-403f-aa2e-00e2b5a3cd71', 1520753942),
(23, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.f12350bc-31da-4875-a78e-0135f512fb4c', NULL, 1, 1, NULL, '0b2a66a3-8aa8-46b7-8bf0-ce9f68041cd8', 1520754112),
(24, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.5bf626e5-2152-45a5-a432-fc2e9fcb7903', NULL, 1, 1, NULL, '813725ab-2c07-4e48-a766-7ebbe3083212', 1520754198),
(25, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.3cd3eb95-aab9-4105-8d28-76a723274709', NULL, 1, 1, NULL, '4216455c-20d7-4912-bfc8-c8cca7e70e9f', 1520754238),
(26, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.d3dc557b-1e77-4955-a3be-7a8b4f86407c', NULL, 1, 1, NULL, 'e42dc975-edd5-4d16-8529-fa69b56a5eb5', 1520754303),
(34, 'dict_upload_template.xls', '20180311/dict_upload_template.xls.d50f8245-ec3e-4de1-9742-0c5c12105f27', '175', 1, 1, NULL, '79b294da-8792-4bfd-9d84-e3f989b88cdf', 1520757036),
(37, '副本 功能列表.xlsx', '20180311/副本 功能列表.xlsx.bc7554e3-2a30-4667-aa61-0e280340b2be', '175', 1, 1, 'User', '79b294da-8792-4bfd-9d84-e3f989b88cdf', 1520765622),
(38, '副本 功能列表.xlsx', '20180311/副本 功能列表.xlsx.d991eb1f-24a9-4db1-87c1-7ef9d2b8a40a', '175', 1, 1, 'User', '79b294da-8792-4bfd-9d84-e3f989b88cdf', 1520777458);
--
-- Dumping data for table core_dict
--
INSERT INTO core_dict VALUES
(1, 'DA0', '查看自己', 'data_access_type', '数据权限', 1, NULL, 0, '11111111111111111123', NULL),
(2, 'DA1', '查看本公司', 'data_access_type', '数据权限', 3, NULL, 0, 'hello,go', NULL),
(3, 'DA2', '查看同机构', 'data_access_type', '数据权限', 3, NULL, 0, NULL, NULL),
(4, 'DA3', '查看本部门', 'data_access_type', '数据权限', 4, NULL, 0, NULL, NULL),
(5, 'DA4', '查看集团', 'data_access_type', '数据权限', 5, NULL, 0, NULL, NULL),
(6, 'DA5', '查看母公司', 'data_access_type', '数据权限', 6, NULL, 0, NULL, 1507952702),
(7, 'FN0', '普通功能', 'function_type', '功能点类型', 2, NULL, 0, NULL, 1508725083),
(8, 'FN1', '含数据权限', 'function_type', '功能点类型', 1, NULL, 0, NULL, 1508725205),
(9, 'JT_01', '管理岗位', 'job_type', '岗位类型', 1, NULL, 0, NULL, NULL),
(10, 'JT_02', '技术岗位', 'job_type', '岗位类型', 2, NULL, 0, NULL, NULL),
(11, 'JT_S_01', '董事会', 'job_sub_managment_type', '管理岗位子类型', 1, 9, 0, NULL, NULL),
(12, 'JT_S_02', '秘书', 'job_sub_managment_type', '管理岗位子类型', 2, 9, 0, NULL, NULL),
(13, 'JT_S_03', '技术经理', 'job_dev_sub_type', '技术岗位子类型', 1, 10, 0, NULL, NULL),
(14, 'JT_S_04', '程序员', 'job_dev_sub_type', '技术岗位子类型', 2, 10, 0, NULL, NULL),
(15, 'MENU_M', '菜单', 'menu_type', '菜单类型', 3, NULL, 0, NULL, NULL),
(16, 'MENU_N', '导航', 'menu_type', '菜单类型', 2, NULL, 0, NULL, NULL),
(17, 'MENU_S', '系统', 'menu_type', '菜单类型', 1, NULL, 0, NULL, NULL),
(18, 'ORGT0', '集团总部', 'org_type', '机构类型', 1, NULL, 0, NULL, NULL),
(19, 'ORGT1', '分公司', 'org_type', '机构类型', 2, NULL, 0, NULL, NULL),
(20, 'ORGT2', '部门', 'org_type', '机构类型', 3, NULL, 0, NULL, NULL),
(21, 'ORGT3', '小组', 'org_type', '机构类型', 4, NULL, 0, NULL, NULL),
(22, 'R0', '操作角色', 'role_type', '数据权限', 1, NULL, 0, NULL, NULL),
(23, 'R1', '工作流角色', 'role_type', '用户角色', 2, NULL, 0, NULL, NULL),
(24, 'S0', '禁用', 'user_state', '用户状态', 2, NULL, 0, NULL, NULL),
(25, 'S1', '启用', 'user_state', '用户状态', 1, NULL, 0, NULL, NULL),
(26, '昂按', '随碟附送分', 'kkkk', '水电费水电费', NULL, NULL, 0, '', 1519803814),
(27, '昂按', '随碟附送分', 'kkkk', '水电费水电费', NULL, NULL, 0, '', 1519803968),
(28, 'sdf', 'sdfsdf', 'sfsdf', 'sdfsdf', 1, NULL, 1, '', 1519804076),
(29, 'asas', 'sdfsd', 'sd', 'sd', NULL, NULL, 1, '', 1519804232),
(30, 'asas', 'sdfsd', 'sd', 'sd', NULL, NULL, 1, '', 1519804250),
(31, '1', '男', 'gender', '性别', NULL, NULL, 0, '', 1520652980),
(32, '2', '女', 'gender', '性别', NULL, NULL, 0, NULL, 1520652980);
--
-- Dumping data for table core_audit
--
INSERT INTO core_audit VALUES
(1, 'org.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517918331),
(2, 'org.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517918331),
(3, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517918411),
(4, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517918411),
(5, 'user.add', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517918440),
(6, 'user.edit', '用户编辑', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919015),
(7, 'user.query', '用户列表', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919016),
(8, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919017),
(9, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919017),
(10, 'user.edit', '用户编辑', 1, '超级管理员', '172.16.49.65', 0, 'java.sql.SQLException: Error on delete of ''C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\#sql978_2c3_6.MYI'' (Errcode: 13 - Permission denied)', NULL, 1517919287),
(11, 'user.edit', '用户编辑', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919313),
(12, 'user.query', '用户列表', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919313),
(13, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919315),
(14, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919315),
(15, 'audit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517919384),
(16, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517967778),
(17, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517967778),
(18, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968392),
(19, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968392),
(20, 'user.add', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968393),
(21, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968409),
(22, 'role.add', '角色添加', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968409),
(23, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968423),
(24, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968423),
(25, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968425),
(26, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968563),
(27, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968564),
(28, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968566),
(29, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968568),
(30, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968570),
(31, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968571),
(32, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968921),
(33, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968921),
(34, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517968923),
(35, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969140),
(36, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969140),
(37, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969142),
(38, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969162),
(39, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969265),
(40, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969266),
(41, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969268),
(42, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969283),
(43, 'role.update', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969283),
(44, 'role.edit', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969297),
(45, 'role.query', '未定义', 1, '超级管理员', '172.16.49.65', 1, '', NULL, 1517969297);
--
-- Dumping data for table cms_blog
--
INSERT INTO cms_blog VALUES
(1, 'hello', '我的博客,内容是。。。', 1, 'F0', 1519264385),
(2, 'cccc', '过年回家', 1, 'F0', 1518489001);
--
-- Restore previous SQL mode
--
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; --
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -- Enable foreign keys
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; --
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; \ No newline at end of file
-- Dump completed on 2018-03-12 9:08:56
...@@ -5,7 +5,8 @@ ENV = 'development' ...@@ -5,7 +5,8 @@ ENV = 'development'
# 在这里是webpack-dev-server启动的地址,然后通过webpack-dev-server的proxy代理到我们的后台服务器 # 在这里是webpack-dev-server启动的地址,然后通过webpack-dev-server的proxy代理到我们的后台服务器
# 仅限开发环境,生产环境要用NGINX仅限代理 # 仅限开发环境,生产环境要用NGINX仅限代理
VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
VUE_APP_SERVER_HOST = 'http://127.0.0.1:9527/mock' # VUE_APP_SERVER_HOST = 'http://127.0.0.1:9527/mock'
VUE_APP_SERVER_HOST = 'http://127.0.0.1:8080'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled. # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "3.2.1", "jszip": "3.2.1",
"lodash": "^4.17.15",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"path-to-regexp": "2.4.0", "path-to-regexp": "2.4.0",
......
...@@ -54,7 +54,7 @@ export const constantRoutes = [ ...@@ -54,7 +54,7 @@ export const constantRoutes = [
path: 'dashboard', path: 'dashboard',
component: () => import('@/views/dashboard/index'), component: () => import('@/views/dashboard/index'),
name: 'Dashboard', name: 'Dashboard',
meta: { title: 'Dashboard', icon: 'dashboard', affix: true } meta: { title: 'Dashboard', icon: 'dashboard', affix: false }
} }
] ]
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment