Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
dd181812
Commit
dd181812
authored
Dec 01, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
8ce57638
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
14 additions
and
268 deletions
+14
-268
CommonConstant.java
.../src/main/java/com/jz/common/constant/CommonConstant.java
+1
-1
AuditStatusEnum.java
...on/src/main/java/com/jz/common/enums/AuditStatusEnum.java
+1
-1
DelFlagEnum.java
...common/src/main/java/com/jz/common/enums/DelFlagEnum.java
+1
-1
GoodsDataEnum.java
...mmon/src/main/java/com/jz/common/enums/GoodsDataEnum.java
+1
-1
CommonsUtil.java
...common/src/main/java/com/jz/common/utils/CommonsUtil.java
+1
-1
RedisUtil.java
...m-common/src/main/java/com/jz/common/utils/RedisUtil.java
+2
-2
Result.java
jz-dm-common/src/main/java/com/jz/common/utils/Result.java
+1
-1
VerifyUtil.java
...-common/src/main/java/com/jz/common/utils/VerifyUtil.java
+1
-1
LoginUntil.java
.../src/main/java/com/jz/manage/commonsUtils/LoginUntil.java
+0
-35
CredentialMatcher.java
...a/com/jz/manage/config/shiroConfig/CredentialMatcher.java
+0
-26
MyShiroRealm.java
...n/java/com/jz/manage/config/shiroConfig/MyShiroRealm.java
+0
-91
ShiroProperties.java
...ava/com/jz/manage/config/shiroConfig/ShiroProperties.java
+0
-102
SysOperaterLog.java
...src/main/java/com/jz/manage/intercept/SysOperaterLog.java
+1
-1
SystemLogAspect.java
...rc/main/java/com/jz/manage/intercept/SystemLogAspect.java
+3
-3
SpringApplicationProvider.java
...n/java/com/jz/manage/utils/SpringApplicationProvider.java
+1
-1
No files found.
jz-dm-common/src/main/java/com/jz/common/
C
onstant/CommonConstant.java
→
jz-dm-common/src/main/java/com/jz/common/
c
onstant/CommonConstant.java
View file @
dd181812
package
com
.
jz
.
common
.
C
onstant
;
package
com
.
jz
.
common
.
c
onstant
;
/**
* @ClassName: CommonConstant
...
...
jz-dm-common/src/main/java/com/jz/common/
Enum
/AuditStatusEnum.java
→
jz-dm-common/src/main/java/com/jz/common/
enums
/AuditStatusEnum.java
View file @
dd181812
package
com
.
jz
.
common
.
Enum
;
package
com
.
jz
.
common
.
enums
;
/**
* 审核状态
...
...
jz-dm-common/src/main/java/com/jz/common/
Enum
/DelFlagEnum.java
→
jz-dm-common/src/main/java/com/jz/common/
enums
/DelFlagEnum.java
View file @
dd181812
package
com
.
jz
.
common
.
Enum
;
package
com
.
jz
.
common
.
enums
;
/**
* 删除标识
...
...
jz-dm-common/src/main/java/com/jz/common/
Enum
/GoodsDataEnum.java
→
jz-dm-common/src/main/java/com/jz/common/
enums
/GoodsDataEnum.java
View file @
dd181812
package
com
.
jz
.
common
.
Enum
;
package
com
.
jz
.
common
.
enums
;
/**
* 商品数据类型
...
...
jz-dm-
manage/src/main/java/com/jz/manage/commonsU
tils/CommonsUtil.java
→
jz-dm-
common/src/main/java/com/jz/common/u
tils/CommonsUtil.java
View file @
dd181812
package
com
.
jz
.
manage
.
commonsU
tils
;
package
com
.
jz
.
common
.
u
tils
;
import
java.io.Serializable
;
import
java.text.ParseException
;
...
...
jz-dm-
manage/src/main/java/com/jz/manage/commonsUtils/RedisUn
til.java
→
jz-dm-
common/src/main/java/com/jz/common/utils/RedisU
til.java
View file @
dd181812
package
com
.
jz
.
manage
.
commonsU
tils
;
package
com
.
jz
.
common
.
u
tils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
* Redis工具类
*/
@Component
public
class
RedisU
n
til
{
public
class
RedisUtil
{
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
...
...
jz-dm-common/src/main/java/com/jz/common/utils/Result.java
View file @
dd181812
package
com
.
jz
.
common
.
utils
;
import
com.jz.common.
C
onstant.CommonConstant
;
import
com.jz.common.
c
onstant.CommonConstant
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
jz-dm-
manage/src/main/java/com/jz/manage/commonsU
tils/VerifyUtil.java
→
jz-dm-
common/src/main/java/com/jz/common/u
tils/VerifyUtil.java
View file @
dd181812
package
com
.
jz
.
manage
.
commonsU
tils
;
package
com
.
jz
.
common
.
u
tils
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/commonsUtils/LoginUntil.java
deleted
100644 → 0
View file @
8ce57638
/*
package com.ma.demo.commonsUtils;
import com.ma.demo.service.UserService;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class LoginUntil implements Serializable {
private static UserService userService;
static {
userService = SpringApplicationProvider.getBean(UserService.class);
}
public static int loginLog(String userId) throws Exception{
Map map = new HashMap<>();
map.put("userId",userId);
map.put("loginTime", CommonsUtil.getCurrentTime());
map.put("status","01");
map.put("creTime", CommonsUtil.getCurrentTime());
userService.addLoginLog(map);
return 1;
}
public static int loginOutLog(String userId) throws Exception{
Map map = new HashMap<>();
map.put("userId",userId);
map.put("logOutTime", CommonsUtil.getCurrentTime());
map.put("status","02");
map.put("creTime", CommonsUtil.getCurrentTime());
return userService.addLoginOutLog(map);
}
}
*/
jz-dm-manage/src/main/java/com/jz/manage/config/shiroConfig/CredentialMatcher.java
deleted
100644 → 0
View file @
8ce57638
/*
package com.ma.demo.config.shiroConfig;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;
*/
/*
* 密码比较器
* *//*
public class CredentialMatcher extends SimpleCredentialsMatcher {
@Override
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) token;
//获得用登录输入的密码:(可以采用加盐(salt)的方式去检验)
String password = new String(usernamePasswordToken.getPassword());
//获得数据库中的密码
String dbPassword = (String) info.getCredentials();
return this.equals(password, dbPassword);
}
}
*/
jz-dm-manage/src/main/java/com/jz/manage/config/shiroConfig/MyShiroRealm.java
deleted
100644 → 0
View file @
8ce57638
/*
package com.ma.demo.config.shiroConfig;
import com.ma.demo.entity.Menu;
import com.ma.demo.entity.Roles;
import com.ma.demo.entity.User;
import com.ma.demo.service.UserService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class MyShiroRealm extends AuthorizingRealm {
private final static Logger log = LoggerFactory.getLogger(MyShiroRealm.class);
@Autowired
private UserService userService;
*/
/*
*身份认证,登录,获取身份验证信息
* Shiro中,最终是通过 Realm 来获取应用程序中的用户、角色及权限信息的
*//*
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
UsernamePasswordToken utoken = (UsernamePasswordToken) token;//获取用户输入的token
//String userToken = (String) token.getCredentials();
log.info("******用户的token" + token.getPrincipal() + "******");
String username = utoken.getUsername();
log.info(username);
User user = userService.selectByUsername(username);
log.info(user.toString());
//放入shiro.调用CredentialsMatcher检验密码
return new SimpleAuthenticationInfo(user, user.getPassword(), this.getClass().getName());
}
*/
/*
*授权
* @param principals 权限信息 身份集合
* *//*
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
User user = (User) principals.fromRealm(this.getClass().getName()).iterator().next();
List<String> permissionList = new ArrayList();
List<String> roleNameList = new ArrayList();
Set<Roles> roleSet = user.getRoles();
if (CollectionUtils.isNotEmpty(roleSet)) {
for (Roles role : roleSet) {
roleNameList.add(role.getRoleName());
Set<Menu> menusSet = role.getMenus();
if (CollectionUtils.isNotEmpty(menusSet)) {
for (Menu menu : menusSet) {
permissionList.add(menu.getMenuName());
}
}
}
}
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
info.addStringPermissions(permissionList);
info.addRoles(roleNameList);
return info;
}
*/
/**
* 清除当前用户的权限认证缓存
*
* @param principals 权限信息 身份集合
*//*
@Override
public void clearCache(PrincipalCollection principals) {
super.clearCache(principals);
}
}
*/
jz-dm-manage/src/main/java/com/jz/manage/config/shiroConfig/ShiroProperties.java
deleted
100644 → 0
View file @
8ce57638
/*
package com.ma.demo.config.shiroConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;
@ConfigurationProperties("hayek.shiro") //指明前缀
@Service
public class ShiroProperties {
private String anonUrl;
private String loginUrl;
private String successUrl;
private String logoutUrl;
private String unauthorizedUrl;
private int cookieTimeout;
private String sessionIdName;
private long sessionTimeout;
public int getCookieTimeout() {
return cookieTimeout;
}
public void setCookieTimeout(int cookieTimeout) {
this.cookieTimeout = cookieTimeout;
}
public String getAnonUrl() {
return anonUrl;
}
public void setAnonUrl(String anonUrl) {
this.anonUrl = anonUrl;
}
public String getLoginUrl() {
return loginUrl;
}
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
public String getSuccessUrl() {
return successUrl;
}
public void setSuccessUrl(String successUrl) {
this.successUrl = successUrl;
}
public String getLogoutUrl() {
return logoutUrl;
}
public void setLogoutUrl(String logoutUrl) {
this.logoutUrl = logoutUrl;
}
public String getUnauthorizedUrl() {
return unauthorizedUrl;
}
public void setUnauthorizedUrl(String unauthorizedUrl) {
this.unauthorizedUrl = unauthorizedUrl;
}
public String getSessionIdName() {
return sessionIdName;
}
public void setSessionIdName(String sessionIdName) {
this.sessionIdName = sessionIdName;
}
public long getSessionTimeout() {
return sessionTimeout;
}
public void setSessionTimeout(long sessionTimeout) {
this.sessionTimeout = sessionTimeout;
}
public String getExpireIn() {
return expireIn;
}
public void setExpireIn(String expireIn) {
this.expireIn = expireIn;
}
private String expireIn;
}
*/
jz-dm-manage/src/main/java/com/jz/manage/
commonsUtils/
intercept/SysOperaterLog.java
→
jz-dm-manage/src/main/java/com/jz/manage/intercept/SysOperaterLog.java
View file @
dd181812
package
com
.
jz
.
manage
.
commonsUtils
.
intercept
;
package
com
.
jz
.
manage
.
intercept
;
import
java.lang.annotation.*
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/
commonsUtils/
intercept/SystemLogAspect.java
→
jz-dm-manage/src/main/java/com/jz/manage/intercept/SystemLogAspect.java
View file @
dd181812
/*
package com.ma.demo.
commonsU
tils.intercept;
package com.ma.demo.
u
tils.intercept;
import com.alibaba.fastjson.JSON;
import com.ma.demo.
commonsU
tils.CommonsUtil;
import com.ma.demo.
u
tils.CommonsUtil;
import com.ma.demo.entity.SysOperateLog;
import com.ma.demo.entity.User;
import com.ma.demo.service.SysOperateLogService;
...
...
@@ -41,7 +41,7 @@ public class SystemLogAspect {
* Service层切点
*//*
@Pointcut("@annotation( com.ma.demo.
commonsU
tils.intercept.SysOperaterLog)")
@Pointcut("@annotation( com.ma.demo.
u
tils.intercept.SysOperaterLog)")
public void serviceAspect() {
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/
commonsU
tils/SpringApplicationProvider.java
→
jz-dm-manage/src/main/java/com/jz/manage/
u
tils/SpringApplicationProvider.java
View file @
dd181812
package
com
.
jz
.
manage
.
commonsU
tils
;
package
com
.
jz
.
manage
.
u
tils
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment