Skip to content

Commit 037ef55

Browse files
committed
增加权限,菜单...
1 parent ee3bd66 commit 037ef55

File tree

624 files changed

+212520
-1144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

624 files changed

+212520
-1144
lines changed

doc/sql/bing-upms.sql renamed to doc/sql/demo.sql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
/*
22
Navicat MySQL Data Transfer
33
4-
Source Server : CDB
5-
Source Server Version : 50628
6-
Source Host : gz-cdb-qlqtn6j8.sql.tencentcdb.com:63816
7-
Source Database : bing-upms
84
95
Target Server Type : MYSQL
106
Target Server Version : 50628
@@ -135,8 +131,8 @@ CREATE TABLE `user` (
135131
-- Records of user
136132
-- ----------------------------
137133
INSERT INTO `user` VALUES ('2', 'test', 'test', 'd829b843a6550a947e82f2f38ed6b7a7', '123', '[email protected]', '1', '2017-09-13 09:40:18', '2017-09-13 09:40:20');
138-
INSERT INTO `user` VALUES ('115', 'qq', 'qq', '907bddcfaa59d96588f2cecd6df70e09', '1507637903315', 'XiaoBingBy@qq.com', '6', '2017-10-10 20:18:23', '2017-10-13 10:58:05');
139-
INSERT INTO `user` VALUES ('116', 'MM', 'MM', '00f1f98ac1894db39a46d8355d29ea6c', '1507794757173', 'XiaoBingBy@qq.com', '1', '2017-10-12 15:52:37', null);
134+
INSERT INTO `user` VALUES ('115', 'qq', 'qq', '907bddcfaa59d96588f2cecd6df70e09', '1507637903315', 'XiaoVictorBy@qq.com', '6', '2017-10-10 20:18:23', '2017-10-13 10:58:05');
135+
INSERT INTO `user` VALUES ('116', 'MM', 'MM', '00f1f98ac1894db39a46d8355d29ea6c', '1507794757173', 'XiaoVictorBy@qq.com', '1', '2017-10-12 15:52:37', null);
140136
INSERT INTO `user` VALUES ('117', '123', '123', '90904403cc3d56398f314cdc7aa71180', '1508422236752', '123123@qq', '1', '2017-10-19 22:10:37', null);
141137

142138
-- ----------------------------

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>org.springframework.boot</groupId>
1010
<artifactId>spring-boot-starter-parent</artifactId>
11-
<version>1.5.7.RELEASE</version>
11+
<version>1.5.9.RELEASE</version>
1212
<relativePath/> <!-- lookup parent from repository -->
1313
</parent>
1414

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package com.victor;
22

3+
import org.mybatis.spring.annotation.MapperScan;
34
import org.springframework.boot.SpringApplication;
45
import org.springframework.boot.autoconfigure.SpringBootApplication;
5-
6+
import org.springframework.context.annotation.ComponentScan;
7+
@MapperScan({"com.victor.sys.mapper.*"})
68
@SpringBootApplication
79
public class SpringbootMybatisShiroApplication {
810

911

1012
public static void main(String[] args) {
1113
SpringApplication.run(SpringbootMybatisShiroApplication.class, args);
12-
System.out.println("======== Spring Boot Success ========");
14+
System.out.println("======== Spring Boot Success(成功) ========");
1315
}
1416
}

src/main/java/com/victor/common/controller/BaseController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.victor.common.controller;
22

3-
import org.apache.catalina.User;
3+
import com.victor.sys.entity.User;
44
import org.apache.shiro.SecurityUtils;
55
import org.apache.shiro.subject.Subject;
66
import com.victor.common.result.JsonResult;
@@ -84,17 +84,17 @@ public String getCurrentLoginUsername() {
8484
*/
8585
public Long getCurrentLoginId(){
8686
Subject currentUser = SecurityUtils.getSubject();
87-
// User user = currentUser.getPrincipals().oneByType(User.class);
88-
return null;
87+
User user = currentUser.getPrincipals().oneByType(User.class);
88+
return user.getId();
8989
}
9090

9191
/**
9292
* 登录用户对象
9393
*/
9494
public User getCurrentUser() {
9595
Subject currentUser = SecurityUtils.getSubject();
96-
// User user = currentUser.getPrincipals().oneByType(User.class);
97-
return null;
96+
User user = currentUser.getPrincipals().oneByType(User.class);
97+
return user;
9898
}
9999

100100
}

src/main/java/com/victor/common/controller/PermissionController.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/main/java/com/victor/common/controller/RoleController.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/main/java/com/victor/common/utils/DateUtil.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import java.util.Calendar;
44

55
/**
6-
* Author: XiaoBingBy
7-
8-
* Date: 2017/9/1
9-
* Time: 00:00
106
* Describe: 获取日期时间工具类
117
*/
128
public class DateUtil {

src/main/java/com/victor/common/utils/StringUtil.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package com.victor.common.utils;
2-
32
/**
4-
* Author: XiaoBingBy
5-
6-
* Date: 2017/9/1
7-
* Time: 00:00
83
* Describe: String工具类
94
*/
105
public class StringUtil {

src/main/java/com/victor/config/mybatis/MybatisPlusConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Describe: MybatisPlus 配置 官方Demo
1212
*/
1313
@Configuration
14-
@MapperScan({"com.victor.mapper*"})
14+
@MapperScan({"com.victor.sys.mapper.**"})
1515
public class MybatisPlusConfig {
1616

1717
/**

src/main/java/com/victor/config/shiro/MyshiroRealm.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
4747
System.out.println("MyShiroRealm.doGetAuthenticationInfo()");
4848
//获取用户的输入的账号.
4949
String username = (String)token.getPrincipal();
50-
System.out.println(token.getCredentials());
50+
//System.out.println(token.getCredentials());
5151

5252
//通过username从数据库中查找 User对象,如果找到,没找到.
5353
//实际项目中,这里可以根据实际情况做缓存,如果不做,Shiro自己也是有时间间隔机制,2分钟内不会重复执行该方法
5454
EntityWrapper<User> wrapper = new EntityWrapper<>();
55-
wrapper.where("username = {0}",username);
55+
wrapper.eq("username", username);
5656
User user = userService.selectOne(wrapper);
5757
System.out.println("----->>user="+user);
5858
if(user == null){
@@ -74,7 +74,7 @@ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
7474
SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
7575
user, //用户名
7676
user.getPassword(), //密码
77-
ByteSource.Util.bytes(user.getGredentialsSat()),//salt=username+salt
77+
ByteSource.Util.bytes(user.getSalt()),
7878
getName() //realm name
7979
);
8080

0 commit comments

Comments
 (0)