Commit dd3e2237 authored by jiangzeyin's avatar jiangzeyin
Browse files

清理代码

parent 5cd80ce4
Showing with 3 additions and 60 deletions
+3 -60
......@@ -79,11 +79,7 @@ public class InstallController extends BaseController {
if (UserModel.SYSTEM_OCCUPY_NAME.equals(userName) || UserModel.SYSTEM_ADMIN.equals(userName)) {
return JsonMessage.getString(401, "当前登录名已经被系统占用");
}
// // 判断密码级别
// if (CheckPassword.checkPassword(userPwd) != 2) {
// return JsonMessage.getString(401, "系统管理员密码强度太低,请使用复杂的密码");
// }
//
// 创建用户
UserModel userModel = new UserModel();
userModel.setName(UserModel.SYSTEM_OCCUPY_NAME);
userModel.setId(userName);
......
......@@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
......@@ -48,7 +47,7 @@ public class NginxController extends BaseController {
private NginxService nginxService;
@RequestMapping(value = "nginx", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String ngx() throws IOException {
public String ngx() {
JSONArray ngxDirectory = whitelistDirectoryService.getNgxDirectory();
setAttribute("nginx", ngxDirectory);
List<CertModel> certList = certService.list();
......@@ -57,7 +56,7 @@ public class NginxController extends BaseController {
}
@RequestMapping(value = "nginx_setting", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public String setting(String path, String name, String type) throws IOException {
public String setting(String path, String name, String type) {
JSONArray ngxDirectory = whitelistDirectoryService.getNgxDirectory();
setAttribute("nginx", ngxDirectory);
List<CertModel> certList = certService.list();
......
......@@ -45,9 +45,6 @@ public class UserInfoController extends BaseController {
return JsonMessage.getString(400, "新旧密码一致");
}
UserModel userName = getUser();
// if (UserModel.SYSTEM_ADMIN.equals(userName.getParent()) && CheckPassword.checkPassword(newPwd) != 2) {
// return JsonMessage.getString(401, "系统管理员密码强度太低,请使用复杂的密码");
// }
try {
UserModel userModel = userService.simpleLogin(userName.getId(), oldPwd);
if (userModel == null || userModel.getPwdErrorCount() > 0) {
......
//package cn.keepbx.jpom.util;
//
///**
// * 判断密码强度
// *
// * @author jiangzeyin
// * @date 2019/3/18
// */
//public class CheckPassword {
//
// /**
// * 密码强度
// * Z = 字母 S = 数字 T = 特殊字符
// *
// * @return 0 弱 1 中 2强
// */
// public static int checkPassword(String passwordStr) {
// String regexZ = "\\d*";
// String regexS = "[a-zA-Z]+";
// String regexT = "\\W+$";
// String regexZT = "\\D*";
// String regexST = "[\\d\\W]*";
// String regexZS = "\\w*";
// String regexZST = "[\\w\\W]*";
//
// if (passwordStr.matches(regexZ)) {
// return 0;
// }
// if (passwordStr.matches(regexS)) {
// return 0;
// }
// if (passwordStr.matches(regexT)) {
// return 0;
// }
// if (passwordStr.matches(regexZT)) {
// return 1;
// }
// if (passwordStr.matches(regexST)) {
// return 1;
// }
// if (passwordStr.matches(regexZS)) {
// return 1;
// }
// if (passwordStr.matches(regexZST)) {
// return 2;
// }
// return -1;
// }
//}
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