Skip to content

Commit 0ede684

Browse files
author
tiansh
committed
🔥优化代码
1 parent f0dd1d0 commit 0ede684

File tree

7 files changed

+1
-17
lines changed

7 files changed

+1
-17
lines changed

src/main/java/cn/hellohao/auth/filter/SubjectFilter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ protected boolean isAccessAllowed(ServletRequest request, ServletResponse respon
3535
String serviceName = httpServletRequest.getServletPath();//获取接口
3636
String Users_Origin = httpServletRequest.getHeader("usersOrigin");
3737
String token = httpServletRequest.getHeader("Authorization");
38-
//验证前端域名
3938
if(httpServletRequest.getMethod().equals("POST") && !serviceName.contains("/api") && !serviceName.contains("/verifyCode")
4039
&& !serviceName.contains("/getClientVersion") && !serviceName.contains("/client")){
4140
try{
@@ -75,7 +74,6 @@ protected boolean isAccessAllowed(ServletRequest request, ServletResponse respon
7574
Subject subject = SecurityUtils.getSubject();
7675
UsernamePasswordToken tokenOBJ = new UsernamePasswordToken(userData.getEmail(),userData.getPassword());
7776
tokenOBJ.setRememberMe(true);
78-
//执行登录方法,如果没有异常,说明登录成功
7977
subject.login(tokenOBJ);
8078
SecurityUtils.getSubject().getSession().setTimeout(3600000);
8179
User loginUser = (User) SecurityUtils.getSubject().getPrincipal();
@@ -102,7 +100,6 @@ protected boolean isAccessAllowed(ServletRequest request, ServletResponse respon
102100
subject.login(tokenOBJ);
103101
SecurityUtils.getSubject().getSession().setTimeout(3600000);//一小时
104102
} catch (Exception e) {
105-
// System.err.println("拦截器,登录失败,false");
106103
this.CODE = "403";
107104
return false;
108105
}

src/main/java/cn/hellohao/dao/CodeMapper.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99

1010
@Mapper
1111
public interface CodeMapper {
12-
//查询扩容码
1312
List<Code> selectCode(@Param("code") String code);
1413
Code selectCodekey(@Param("code") String code);
15-
//Integer selectCodekey(@Param("value") String value);
16-
//添加
1714
Integer addCode(Code code);
18-
//删除扩容码
1915
Integer deleteCode(@Param("code") String code);
2016

2117
}

src/main/java/cn/hellohao/dao/KeysMapper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99

1010
@Mapper
1111
public interface KeysMapper {
12-
//查询密钥
1312
Keys selectKeys(@Param("id") Integer id);
1413
List<Keys> getStorageName();
1514
List<Keys> getStorage();
16-
//修改key
1715
Integer updateKey(Keys key);
1816
List<Keys> getKeys();
1917

src/main/java/cn/hellohao/pojo/Msg.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ public class Msg implements Serializable {
1111

1212
private static final long serialVersionUID = 5196249482551119279L;
1313

14-
//返回码
1514
private String code ="200";
1615

17-
//提示信息
1816
private String info="操作成功";
1917

20-
//返回数据
2118
private Object data;
2219

23-
//异常
2420
private String exceptions;
2521

2622

src/main/java/cn/hellohao/service/impl/UploadServicel.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ private Msg updateImgCheck(User user, UploadConfig uploadConfig) {
415415
public static String plusDay(int setday) {
416416
Date d = new Date();
417417
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
418-
String currdate = format.format(d);
419-
System.out.println("现在的日期是:" + currdate);
420418
Calendar ca = Calendar.getInstance();
421419
ca.setTime(d);
422420
ca.add(Calendar.DATE, setday); // num为增加的天数,可以改变的

src/main/java/cn/hellohao/utils/FirstRun.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ public void afterPropertiesSet() {
145145
//检查表是否存在,后边加'imgdata' and column_name = 'explains' 检查字段是否存在
146146
private String isTableName = "SELECT count(table_name) FROM information_schema.TABLES WHERE TABLE_SCHEMA='tbed' and table_name =";
147147
private String judgeTable = "select count(*) from information_schema.columns where TABLE_SCHEMA='tbed' and table_name = ";
148-
//创建blacklist 2019-11-29
149148
private String sql0 =
150149
"alter table `keys` add (Region varchar(255) DEFAULT null,RootPath varchar(255) DEFAULT '/');";
151150
private String sql1 = "select count(*) from information_schema.columns where table_name = 'uploadconfig' and column_name = 'blacklist'";

src/main/java/cn/hellohao/utils/ImgUrlUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static Map<String,String> checkURLStatusCode(String urlStr){
7575
throw new Exception("ResponseCode is not begin with 2,code="+code);
7676
}
7777
map.put("Check","true");
78-
System.out.println("连接正常");
78+
// System.out.println("连接正常");
7979
}catch(Exception ex){
8080
System.out.println(ex.getMessage());
8181
}

0 commit comments

Comments
 (0)