fix:app模块 system
This commit is contained in:
parent
9e2a90bb51
commit
c98fcfb656
|
@ -1,11 +1,64 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.PasswordUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.base.entity.postgre.SysDepart;
|
||||
import org.jeecg.modules.base.entity.postgre.SysUser;
|
||||
import org.jeecg.modules.model.SysLoginModel;
|
||||
import org.jeecg.modules.service.LoginService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("")
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
/**
|
||||
* app登录
|
||||
* @param sysLoginModel
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/mLogin", method = RequestMethod.POST)
|
||||
public Result<JSONObject> mLogin(@RequestBody SysLoginModel sysLoginModel) {
|
||||
return loginService.mLogin(sysLoginModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/logout")
|
||||
public Result<Object> logout(HttpServletRequest request, HttpServletResponse response) {
|
||||
//用户退出逻辑
|
||||
return loginService.logout(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台生成图形验证码 :有效
|
||||
* @param response
|
||||
* @param key
|
||||
*/
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping(value = "/randomImage/{key}")
|
||||
public Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key) {
|
||||
return loginService.randomImage(response, key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package org.jeecg.modules.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 登录表单
|
||||
*
|
||||
* @Author scott
|
||||
* @since 2019-01-18
|
||||
*/
|
||||
@ApiModel(value="登录对象", description="登录对象")
|
||||
public class SysLoginModel {
|
||||
@ApiModelProperty(value = "账号")
|
||||
private String username;
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
@ApiModelProperty(value = "验证码")
|
||||
private String captcha;
|
||||
@ApiModelProperty(value = "验证码key")
|
||||
private String checkKey;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getCaptcha() {
|
||||
return captcha;
|
||||
}
|
||||
|
||||
public void setCaptcha(String captcha) {
|
||||
this.captcha = captcha;
|
||||
}
|
||||
|
||||
public String getCheckKey() {
|
||||
return checkKey;
|
||||
}
|
||||
|
||||
public void setCheckKey(String checkKey) {
|
||||
this.checkKey = checkKey;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,46 @@
|
|||
package org.jeecg.modules.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.base.entity.postgre.SysEmail;
|
||||
import org.jeecg.modules.model.SysLoginModel;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@Component
|
||||
@FeignClient("armd-system")
|
||||
@FeignClient(value = "armd-system", path = "/sys")
|
||||
public interface LoginService {
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/mLogin")
|
||||
Result<JSONObject> mLogin(SysLoginModel sysLoginModel);
|
||||
|
||||
/**
|
||||
* 登出
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/logout")
|
||||
Result<Object> logout(HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 图形验证码
|
||||
*/
|
||||
@GetMapping("/randomImage/{key}")
|
||||
Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key);
|
||||
|
||||
/**
|
||||
* 图形验证码
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/checkCaptcha")
|
||||
Result<?> checkCaptcha();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user