feat: 注释掉登录验证
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<ehcache.version>2.6.6</ehcache.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -29,6 +30,18 @@
|
||||
<artifactId>adc-da-sys</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<!-- EHCACHE begin -->
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-core</artifactId>
|
||||
<version>${ehcache.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-web</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
<!-- EHCACHE end -->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.Map;
|
||||
|
||||
@Validated
|
||||
@Controller
|
||||
@RequestMapping(value = "/auth")
|
||||
@RequestMapping(value = "/api")
|
||||
@Api(description = "登录接口")
|
||||
@Slf4j
|
||||
public class LoginRestController {
|
||||
@@ -79,47 +79,48 @@ public class LoginRestController {
|
||||
private int verifyCodeMode;
|
||||
|
||||
|
||||
// @ApiOperation(value = "登录")
|
||||
// @PostMapping(value = "/login")
|
||||
// @ResponseBody
|
||||
// public ResponseMessage<String> loginWithVerifyCode(HttpServletResponse response, @RequestBody LoginVO loginVO) {
|
||||
// String username = loginVO.getUsername();
|
||||
// String password = loginVO.getPassword();
|
||||
// String key = loginVO.getKey();
|
||||
//
|
||||
// if (StringUtils.isBlank(username)) {
|
||||
// return Result.error("r0014", "登录名不能为空");
|
||||
// }
|
||||
// if (StringUtils.isBlank(password)) {
|
||||
// return Result.error("r0016", "密码不能为空");
|
||||
// }
|
||||
// if (StringUtils.isBlank(key)) {
|
||||
// return Result.error("key不能为空");
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// UserEO userEO = userService.getUserByLoginNameNotDeleted(username);
|
||||
// if (null == userEO) {
|
||||
// log.info("用户[{}]身份验证失败", username);
|
||||
// return Result.error("r0011", "您输入的帐号或密码有误");
|
||||
// }
|
||||
// if (PasswordUtils.validatePassword(password, userEO.getPassword())) {
|
||||
// String token = JWTUtil.sign(username, userEO.getPassword(), userEO.getUsid());
|
||||
// response.setHeader("Authorization", token);
|
||||
// response.addHeader("Access-Control-Allow-Headers", "Authorization");
|
||||
// return Result.success(token);
|
||||
// } else {
|
||||
// log.info("用户[{}]密码验证失败", username);
|
||||
// return Result.error("r0011", "您输入的帐号或密码有误");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "登录")
|
||||
// @GetMapping(value = "/login")
|
||||
@PostMapping(value = "/login")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginWithVerifyCode(HttpServletResponse response, @RequestBody LoginVO loginVO) {
|
||||
String username = loginVO.getUsername();
|
||||
String password = loginVO.getPassword();
|
||||
String key = loginVO.getKey();
|
||||
|
||||
if (StringUtils.isBlank(username)) {
|
||||
return Result.error("r0014", "登录名不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(password)) {
|
||||
return Result.error("r0016", "密码不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(key)) {
|
||||
return Result.error("key不能为空");
|
||||
}
|
||||
|
||||
|
||||
|
||||
UserEO userEO = userService.getUserByLoginNameNotDeleted(username);
|
||||
if (null == userEO) {
|
||||
log.info("用户[{}]身份验证失败", username);
|
||||
return Result.error("r0011", "您输入的帐号或密码有误");
|
||||
}
|
||||
if (PasswordUtils.validatePassword(password, userEO.getPassword())) {
|
||||
String token = JWTUtil.sign(username, userEO.getPassword(), userEO.getUsid());
|
||||
response.setHeader("Authorization", token);
|
||||
response.addHeader("Access-Control-Allow-Headers", "Authorization");
|
||||
return Result.success(token);
|
||||
} else {
|
||||
log.info("用户[{}]密码验证失败", username);
|
||||
return Result.error("r0011", "您输入的帐号或密码有误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "登录")
|
||||
@GetMapping(value = "/login")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginRest(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestParam @NotNull(message = "请输入用户名") String username,
|
||||
@RequestParam @NotNull(message = "请输入密码") String password,
|
||||
|
||||
@@ -22,7 +22,7 @@ import javax.servlet.Filter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
//@Configuration
|
||||
@Order(value=1)
|
||||
public class ShiroConfig {
|
||||
|
||||
|
||||
+28
@@ -180,5 +180,33 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
}
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "|SysCorpEO|导出excel")
|
||||
// @GetMapping(value = "/exportStandardsInfoExcel")
|
||||
// public void exportStandardsInfoExcel(StandardsInfoExcelVO standardsInfoExcelVO,HttpServletResponse response,
|
||||
// HttpServletRequest request) throws Exception {
|
||||
// OutputStream os = null;
|
||||
// Workbook workbook = null;
|
||||
// try {
|
||||
// if(StringUtils.isEmpty(standardsInfoExcelVO.getExportName())||standardsInfoExcelVO.getExportName().equals("null")){
|
||||
// standardsInfoExcelVO.setExportName("标准法规信息");
|
||||
// }
|
||||
// response.setHeader("Content-Disposition",
|
||||
// "attachment; filename=" + ReadExcel.encodeFileName(standardsInfoExcelVO.getExportName()+".xlsx",
|
||||
// request));
|
||||
// response.setContentType("application/force-download");
|
||||
// // 导出所有数据
|
||||
// List<SarStandardsInfo> datas = sarStandardsInfoEOService.getExportDatas(standardsInfoExcelVO);
|
||||
// workbook = StandExportUtil.exportDatas(datas,standardsInfoExcelVO.getStandType());
|
||||
// os = response.getOutputStream();
|
||||
// workbook.write(os);
|
||||
// os.flush();
|
||||
// } catch (IOException e) {
|
||||
// logger.error(e.getMessage(), e);
|
||||
// throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
// } finally {
|
||||
// IOUtils.closeQuietly(os);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user