Merge remote-tracking branch 'origin/main' into main
# Conflicts: # dataease-commons/dataease-common-auth/src/main/java/io/dataease/commons/auth/config/F2cRealm.java # frontend/src/api/user-token.js # frontend/src/store/modules/user-token.js
@ -3,13 +3,13 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>fit2cloud-commons</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-commons</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-common-auth</artifactId>
|
||||
<artifactId>dataease-common-auth</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -24,9 +24,9 @@
|
||||
<version>${jwt.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<artifactId>fit2cloud-common-db</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-common-db</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -50,6 +50,11 @@
|
||||
<artifactId>ehcache-core</artifactId>
|
||||
<version>${ehcache.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
|
||||
<!--下面是数据层mybatis配置-->
|
||||
|
||||
@ -58,4 +63,4 @@
|
||||
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,14 +1,13 @@
|
||||
package com.fit2cloud.commons.auth.api;
|
||||
package io.dataease.commons.auth.api;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import com.fit2cloud.commons.auth.bean.LoginDto;
|
||||
import com.fit2cloud.commons.auth.bean.UserBean;
|
||||
import com.fit2cloud.commons.auth.bean.UserInfo;
|
||||
import com.fit2cloud.commons.auth.config.RsaProperties;
|
||||
import com.fit2cloud.commons.auth.service.UserService;
|
||||
import com.fit2cloud.commons.auth.util.JWTUtil;
|
||||
import com.fit2cloud.commons.auth.util.RsaUtil;
|
||||
import io.dataease.commons.auth.bean.LoginDto;
|
||||
import io.dataease.commons.auth.bean.UserBean;
|
||||
import io.dataease.commons.auth.bean.UserInfo;
|
||||
import io.dataease.commons.auth.config.RsaProperties;
|
||||
import io.dataease.commons.auth.service.UserService;
|
||||
import io.dataease.commons.auth.util.JWTUtil;
|
||||
import io.dataease.commons.auth.util.RsaUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.bean;
|
||||
package io.dataease.commons.auth.bean;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.bean;
|
||||
package io.dataease.commons.auth.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.bean;
|
||||
package io.dataease.commons.auth.bean;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.bean;
|
||||
package io.dataease.commons.auth.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.bean;
|
||||
package io.dataease.commons.auth.bean;
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.config;
|
||||
package io.dataease.commons.auth.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
@ -1,9 +1,8 @@
|
||||
package com.fit2cloud.commons.auth.config;
|
||||
package io.dataease.commons.auth.config;
|
||||
|
||||
import com.fit2cloud.commons.auth.bean.UserBean;
|
||||
import com.fit2cloud.commons.auth.service.UserService;
|
||||
import com.fit2cloud.commons.auth.util.JWTUtil;
|
||||
import com.fit2cloud.commons.auth.util.RsaUtil;
|
||||
import io.dataease.commons.auth.bean.UserBean;
|
||||
import io.dataease.commons.auth.service.UserService;
|
||||
import io.dataease.commons.auth.util.JWTUtil;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
@ -68,13 +67,8 @@ public class F2cRealm extends AuthorizingRealm {
|
||||
if (userBean == null) {
|
||||
throw new AuthenticationException("User didn't existed!");
|
||||
}
|
||||
String pwd = null;
|
||||
try {
|
||||
pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, userBean.getPassword());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (! JWTUtil.verify(token, username, pwd)) {
|
||||
|
||||
if (! JWTUtil.verify(token, username, userBean.getPassword())) {
|
||||
throw new AuthenticationException("Username or password error");
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.config;
|
||||
package io.dataease.commons.auth.config;
|
||||
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.config;
|
||||
package io.dataease.commons.auth.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
@ -1,10 +1,9 @@
|
||||
package com.fit2cloud.commons.auth.config;
|
||||
package io.dataease.commons.auth.config;
|
||||
|
||||
import com.fit2cloud.commons.auth.filter.F2CLogoutFilter;
|
||||
import com.fit2cloud.commons.auth.filter.F2CPermissionsFilter;
|
||||
import com.fit2cloud.commons.auth.filter.F2CRolesFilter;
|
||||
import com.fit2cloud.commons.auth.filter.JWTFilter;
|
||||
import com.fit2cloud.commons.auth.service.ShiroService;
|
||||
import io.dataease.commons.auth.filter.F2CLogoutFilter;
|
||||
import io.dataease.commons.auth.filter.F2CPermissionsFilter;
|
||||
import io.dataease.commons.auth.filter.JWTFilter;
|
||||
import io.dataease.commons.auth.service.ShiroService;
|
||||
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator;
|
||||
import org.apache.shiro.mgt.DefaultSubjectDAO;
|
||||
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
|
@ -1,9 +1,9 @@
|
||||
package com.fit2cloud.commons.auth.dao;
|
||||
package io.dataease.commons.auth.dao;
|
||||
|
||||
|
||||
|
||||
import com.fit2cloud.commons.auth.bean.ExtPermissionBean;
|
||||
import com.fit2cloud.commons.auth.entity.SysUser;
|
||||
import io.dataease.commons.auth.bean.ExtPermissionBean;
|
||||
import io.dataease.commons.auth.entity.SysUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.entity;
|
||||
package io.dataease.commons.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.filter;
|
||||
package io.dataease.commons.auth.filter;
|
||||
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.filter.authc.LogoutFilter;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.filter;
|
||||
package io.dataease.commons.auth.filter;
|
||||
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.filter;
|
||||
package io.dataease.commons.auth.filter;
|
||||
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.filter.authz.AuthorizationFilter;
|
@ -1,7 +1,7 @@
|
||||
package com.fit2cloud.commons.auth.filter;
|
||||
package io.dataease.commons.auth.filter;
|
||||
|
||||
import com.fit2cloud.commons.auth.config.JWTToken;
|
||||
import com.fit2cloud.commons.auth.util.JWTUtil;
|
||||
import io.dataease.commons.auth.config.JWTToken;
|
||||
import io.dataease.commons.auth.util.JWTUtil;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
|
||||
import org.slf4j.Logger;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.filter;
|
||||
package io.dataease.commons.auth.filter;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysDept;
|
||||
import io.dataease.commons.auth.entity.SysDept;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysDictDetail;
|
||||
import io.dataease.commons.auth.entity.SysDictDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysDict;
|
||||
import io.dataease.commons.auth.entity.SysDict;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysMenu;
|
||||
import io.dataease.commons.auth.entity.SysMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysRole;
|
||||
import io.dataease.commons.auth.entity.SysRole;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysUser;
|
||||
import io.dataease.commons.auth.entity.SysUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.auth.mapper;
|
||||
package io.dataease.commons.auth.mapper;
|
||||
|
||||
import com.fit2cloud.commons.auth.entity.SysUsersRoles;
|
||||
import io.dataease.commons.auth.entity.SysUsersRoles;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.service;
|
||||
package io.dataease.commons.auth.service;
|
||||
|
||||
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
|
||||
|
@ -1,13 +1,12 @@
|
||||
package com.fit2cloud.commons.auth.service;
|
||||
package io.dataease.commons.auth.service;
|
||||
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fit2cloud.commons.auth.bean.UserBean;
|
||||
import com.fit2cloud.commons.auth.dao.ExtUserMapper;
|
||||
import com.fit2cloud.commons.auth.entity.SysUser;
|
||||
import com.fit2cloud.commons.auth.mapper.SysUserMapper;
|
||||
import io.dataease.commons.auth.bean.UserBean;
|
||||
import io.dataease.commons.auth.dao.ExtUserMapper;
|
||||
import io.dataease.commons.auth.entity.SysUser;
|
||||
import io.dataease.commons.auth.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
@ -1,8 +1,8 @@
|
||||
package com.fit2cloud.commons.auth.service.impl;
|
||||
package io.dataease.commons.auth.service.impl;
|
||||
|
||||
import com.fit2cloud.commons.auth.bean.ExtPermissionBean;
|
||||
import com.fit2cloud.commons.auth.dao.ExtUserMapper;
|
||||
import com.fit2cloud.commons.auth.service.ShiroService;
|
||||
import io.dataease.commons.auth.bean.ExtPermissionBean;
|
||||
import io.dataease.commons.auth.dao.ExtUserMapper;
|
||||
import io.dataease.commons.auth.service.ShiroService;
|
||||
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.util;
|
||||
package io.dataease.commons.auth.util;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
@ -1,14 +1,12 @@
|
||||
package com.fit2cloud.commons.auth.util;
|
||||
package io.dataease.commons.auth.util;
|
||||
|
||||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.JWTVerifier;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import com.auth0.jwt.exceptions.JWTDecodeException;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.fit2cloud.commons.auth.dao.ExtUserMapper;
|
||||
import com.fit2cloud.commons.auth.service.UserService;
|
||||
import io.dataease.commons.auth.dao.ExtUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.auth.util;
|
||||
package io.dataease.commons.auth.util;
|
||||
|
||||
|
||||
|
@ -3,13 +3,13 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>fit2cloud-commons</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<artifactId>dataease-commons</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-common-base</artifactId>
|
||||
<artifactId>dataease-common-base</artifactId>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,7 +1,7 @@
|
||||
package com.fit2cloud.commons.base;
|
||||
package io.dataease.commons.base;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fit2cloud.commons.base.result.ResultEntity;
|
||||
import io.dataease.commons.base.result.ResultEntity;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.web.error.ErrorAttributeOptions;
|
||||
import org.springframework.boot.web.servlet.error.ErrorAttributes;
|
@ -1,8 +1,8 @@
|
||||
package com.fit2cloud.commons.base;
|
||||
package io.dataease.commons.base;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fit2cloud.commons.base.result.ResultEntity;
|
||||
import io.dataease.commons.base.result.ResultEntity;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.base.api;
|
||||
package io.dataease.commons.base.api;
|
||||
|
||||
import com.fit2cloud.commons.base.result.ResultEntity;
|
||||
import io.dataease.commons.base.result.ResultEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.fit2cloud.commons.base.api;
|
||||
package io.dataease.commons.base.api;
|
||||
|
||||
import com.fit2cloud.commons.base.result.ResultEntity;
|
||||
import io.dataease.commons.base.result.ResultEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.base.result;
|
||||
package io.dataease.commons.base.result;
|
||||
|
||||
|
||||
import lombok.Data;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.commons.base.result;
|
||||
package io.dataease.commons.base.result;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
@ -3,13 +3,13 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>fit2cloud-commons</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<artifactId>dataease-commons</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-common-db</artifactId>
|
||||
<artifactId>dataease-common-db</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -61,4 +61,4 @@
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.common.db;
|
||||
package io.dataease.common.db;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.generator.AutoGenerator;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.common.db;
|
||||
package io.dataease.common.db;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.common.db;
|
||||
package io.dataease.common.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.common.db;
|
||||
package io.dataease.common.db;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.common.db;
|
||||
package io.dataease.common.db;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
@ -3,13 +3,13 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>fit2cloud-commons</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<artifactId>dataease-commons</artifactId>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-common-logs</artifactId>
|
||||
<artifactId>dataease-common-logs</artifactId>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -3,20 +3,20 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-commons</artifactId>
|
||||
<artifactId>dataease-commons</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>fit2cloud-common-auth</module>
|
||||
<module>fit2cloud-common-base</module>
|
||||
<module>fit2cloud-common-logs</module>
|
||||
<module>fit2cloud-common-db</module>
|
||||
<module>dataease-common-logs</module>
|
||||
<module>dataease-common-db</module>
|
||||
<module>dataease-common-base</module>
|
||||
<module>dataease-common-auth</module>
|
||||
</modules>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -4,32 +4,32 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>dataease</artifactId>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>fit2cloud-system</artifactId>
|
||||
<artifactId>dataease-server</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<artifactId>fit2cloud-common-base</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-common-base</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<artifactId>fit2cloud-common-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-common-auth</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fit2cloud</groupId>
|
||||
<artifactId>fit2cloud-common-db</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<groupId>io.dataease</groupId>
|
||||
<artifactId>dataease-common-db</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -41,10 +41,15 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>18.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud;
|
||||
package io.dataease;
|
||||
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
@ -1,18 +1,11 @@
|
||||
package com.fit2cloud.system.api;
|
||||
package io.dataease.system.api;
|
||||
|
||||
|
||||
import com.fit2cloud.common.db.PageUtils;
|
||||
import com.fit2cloud.common.db.Pager;
|
||||
/*import com.fit2cloud.commons.auth.entity.User;
|
||||
import com.fit2cloud.commons.auth.mapper.UserMapper;*/
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class BusiApi {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.system.api;
|
||||
package io.dataease.system.api;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
@ -1,4 +1,4 @@
|
||||
package com.fit2cloud.system.api;
|
||||
package io.dataease.system.api;
|
||||
|
||||
|
||||
|
@ -126,3 +126,17 @@ CREATE TABLE `sys_users_roles` (
|
||||
PRIMARY KEY (`user_id`,`role_id`) USING BTREE,
|
||||
KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户角色关联';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `datasource`;
|
||||
CREATE TABLE `datasource` (
|
||||
`id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`name` varchar(255) NOT NULL COMMENT '名称',
|
||||
`type` varchar(255) NOT NULL COMMENT '类型',
|
||||
`configuration` longtext COMMENT '详细信息',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT '描述',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='数据源链接';
|
33
dataease-server/src/test/java/io/dataease/MyTest.java
Normal file
@ -0,0 +1,33 @@
|
||||
package io.dataease;
|
||||
|
||||
import io.dataease.datasource.JdbcDataProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MyTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Map<String, String> dataSource = new HashMap<>();
|
||||
dataSource.put("driver", "com.mysql.cj.jdbc.Driver");
|
||||
dataSource.put("jdbc_url", "jdbc:mysql://localhost:3306/dataease?characterEncoding=utf8&useSSL=true");
|
||||
dataSource.put("database", "dataease");
|
||||
dataSource.put("user", "root");
|
||||
dataSource.put("passwd", "jinlong");
|
||||
dataSource.put("", "");
|
||||
Map<String, String> query = new HashMap<>();
|
||||
query.put("sql", "select table_name from information_schema.tables where table_schema='DATABASE';".replace("DATABASE", dataSource.get("database")));
|
||||
// query.put("sql", "SELECT * FROM dataease.test_users;");
|
||||
JdbcDataProvider jdbcDataProvider = new JdbcDataProvider();
|
||||
jdbcDataProvider.setDataSource(dataSource);
|
||||
jdbcDataProvider.setQuery(query);
|
||||
// jdbcDataProvider.test();
|
||||
// jdbcDataProvider.getData();
|
||||
for (String showTable : jdbcDataProvider.showTables()) {
|
||||
System.out.println(showTable);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.fit2cloud;
|
||||
|
||||
import com.fit2cloud.common.db.CodeGenerator;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MyTest {
|
||||
|
||||
/*public static void main(String[] args) throws IOException {
|
||||
ClassLoader classLoader = SystemApp.class.getClassLoader();
|
||||
InputStream resourceAsStream = classLoader.getResourceAsStream("application.properties");
|
||||
Properties properties = new Properties();
|
||||
properties.load(resourceAsStream);
|
||||
System.setProperties(properties);
|
||||
|
||||
CodeGenerator.test();
|
||||
}*/
|
||||
|
||||
}
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
21
frontend/src/api/user.js
Normal file
@ -0,0 +1,21 @@
|
||||
/* 前后端分离的登录方式 */
|
||||
import {get, post, put} from "@/plugins/request"
|
||||
|
||||
export function login(data) {
|
||||
return post("/login", data)
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return post("/logout")
|
||||
}
|
||||
|
||||
export function getCurrentUser() {
|
||||
return get("/info")
|
||||
}
|
||||
|
||||
export function updateInfo(data) {
|
||||
return put("/update", data)
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |