data/menu.xls | 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/controller/sys/SignController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/entity/sys/LoginInfo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/mapper/data/UsersMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/service/data/UsersService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/service/sys/UserService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/data/UsersMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/static/css/cas.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/static/js/bootstrap.min.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/static/js/bootstrap.min.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/static/js/font-awesome.min.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/static/js/jquery-ui.min.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
data/menu.xlsBinary files differ
src/main/java/com/lf/server/controller/sys/SignController.java
@@ -1,9 +1,13 @@ package com.lf.server.controller.sys; import com.lf.server.controller.BaseController; import com.lf.server.entity.all.ResponseMsg; import com.lf.server.entity.data.UsersEntity; import com.lf.server.entity.sys.LoginInfo; import com.lf.server.entity.sys.Result; import com.lf.server.entity.sys.User; import com.lf.server.service.sys.UserService; import com.lf.server.helper.StringHelper; import com.lf.server.service.data.UsersService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -15,14 +19,9 @@ */ @RestController @RequestMapping("/sign") public class SignController { public class SignController extends BaseController { @Autowired UserService userService; @GetMapping("/getName") public User getName(String loginName) { return userService.queryUserByName(loginName); } UsersService userService; /** * è·³å°é¦é¡µ @@ -54,37 +53,33 @@ } /** * è·³å°æªææé¡µé¢ * return "redirect:/toLogin" * * @return String */ @GetMapping("/noauth") public ModelAndView toNoAuth(ModelAndView mv) { mv.setViewName("noauth"); return mv; } /** * ç»å½è®¤è¯ * * @return String */ @GetMapping("/login") public ModelAndView login(String username, String password, String service, Integer rememberMe) { ModelAndView mv = new ModelAndView(); @PostMapping(value="/login", produces = "application/json; charset=UTF-8") public ResponseMsg<String> login(@RequestBody UsersEntity user) { try { mv.setViewName("index"); if (service != null && service.length() > 0) { mv.addObject("url", service); } else { mv.addObject("msg", username); if (user == null) { return fail("请è¾å ¥ç¨æ·ååå¯ç ï¼", null); } } catch (Exception e) { } if (StringHelper.isEmpty(user.getUid())) { return fail("ç¨æ·åä¸è½ä¸ºç©ºï¼", null); } if (StringHelper.isEmpty(user.getPwd())) { return fail("å¯ç ä¸è½ä¸ºç©ºï¼", null); } return mv; UsersEntity ue = userService.selectByUid(user.getUid()); if (ue == null) { return fail("ç¨æ·åä¸åå¨ï¼", null); } return null; } catch (Exception ex) { return fail(ex.getMessage(), null); } } /** @@ -98,23 +93,5 @@ mv.setViewName("login"); return mv; } /** * Ajaxç»å½ * * @param userInfo * @return */ @PostMapping(value = "/ajaxLogin", produces = "application/json; charset=UTF-8") public Result ajaxLogin(@RequestBody User userInfo) { try { LoginInfo loginInfo = userService.getLoginInfo(userInfo.getLoginName()); return new Result(200, loginInfo != null ? "ç»å½æå" : "ç»å½å¤±è´¥", loginInfo); } catch (Exception e) { e.printStackTrace(); return new Result(500, e.getMessage()); } } } src/main/java/com/lf/server/entity/sys/LoginInfo.java
@@ -1,93 +1,47 @@ package com.lf.server.entity.sys; import java.io.Serializable; import java.util.Set; /** * LoginInfo * @author * ç»å½ä¿¡æ¯ç±» * @author WWW */ public class LoginInfo implements Serializable { private Integer uuid; public class LoginInfo { private String uname; private String name; private String pwd; private String townId; private String salt; private Set<String> roleList; private String service; private Set<String> permissionList; private String token; public LoginInfo() { public String getUname() { return uname; } public LoginInfo(Set<String> roleList, Set<String> permissionList) { this.roleList = roleList; this.permissionList = permissionList; public void setUname(String uname) { this.uname = uname; } public LoginInfo(Integer userId, String userName, Set<String> roleList, Set<String> permissionList) { this.uuid = userId; this.name = userName; this.roleList = roleList; this.permissionList = permissionList; public String getPwd() { return pwd; } public String getTownId() { return townId; public void setPwd(String pwd) { this.pwd = pwd; } public void setTownId(String townId) { this.townId = townId; public String getSalt() { return salt; } public Integer getUuid() { return uuid; public void setSalt(String salt) { this.salt = salt; } public void setUuid(Integer uuid) { this.uuid = uuid; public String getService() { return service; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } public Integer getUserId() { return uuid; } public void setUserId(Integer userId) { this.uuid = userId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set<String> getRoleList() { return roleList; } public void setRoleList(Set<String> roleList) { this.roleList = roleList; } public Set<String> getPermissionList() { return permissionList; } public void setPermissionList(Set<String> permissionList) { this.permissionList = permissionList; public void setService(String service) { this.service = service; } } src/main/java/com/lf/server/mapper/data/UsersMapper.java
@@ -81,6 +81,13 @@ public UsersEntity selectUser(int id); /** * æ ¹æ®uidæ¥è¯¢ * @param uid * @return */ public UsersEntity selectByUid(String uid); /** * æ¥è¯¢å ¨é¨æ°æ® * * @return src/main/java/com/lf/server/service/data/UsersService.java
@@ -29,6 +29,11 @@ } @Override public UsersEntity selectByUid(String uid) { return usersMapper.selectByUid(uid); } @Override public List<UsersEntity> selectUserAll() { return usersMapper.selectUserAll(); } src/main/java/com/lf/server/service/sys/UserService.java
ÎļþÒÑɾ³ý src/main/resources/mapper/data/UsersMapper.xml
@@ -32,8 +32,6 @@ limit #{limit} offset #{offset} </select> <select id="selectUserAll" resultMap="resultMap" resultType="com.lf.server.entity.data.UsersEntity"> select * from lf.sys_user </select> @@ -42,6 +40,10 @@ select * from lf.sys_user where id = #{id} </select> <select id="selectByUid" resultMap="resultMap" resultType="com.lf.server.entity.data.UsersEntity"> select * from lf.sys_user where uid = #{uid} </select> <insert id="insertUser" parameterType="com.lf.server.entity.data.UsersEntity"> insert into lf.sys_user (depid,uid,uname,pwd,salt,sex,native,contact,job,email,addr,edu,idcard,status,create_user,create_time,bak) src/main/resources/static/css/cas.css
ÎļþÒÑɾ³ý src/main/resources/static/js/bootstrap.min.css
ÎļþÒÑɾ³ý src/main/resources/static/js/bootstrap.min.js
ÎļþÒÑɾ³ý src/main/resources/static/js/font-awesome.min.css
ÎļþÒÑɾ³ý src/main/resources/static/js/jquery-ui.min.js
ÎļþÒÑɾ³ý