
5 changed files with 91 additions and 41 deletions
@ -0,0 +1,38 @@ |
|||
package com.supervise.rms.biz.tmp; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("/sysuser") |
|||
public class SysuserRest { |
|||
|
|||
@PostMapping("/login") |
|||
public ResultBean<Map<String, Object>> dologin(@RequestBody Map<String, String> param) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String userName = param.get("userName"); |
|||
String password = param.get("password"); |
|||
|
|||
if (StringUtils.isBlank(userName)) |
|||
return rb.setMsg("账号不可为空!"); |
|||
if (StringUtils.isBlank(password)) |
|||
return rb.setMsg("密码不可为空!"); |
|||
|
|||
if ("13131100001".equals(userName) && "123456".equals(password)) { |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("token", "abc987654321"); |
|||
map.put("name", "测试账号"); |
|||
return rb.success().setData(map); |
|||
} else { |
|||
return rb.setMsg("账号或密码错误"); |
|||
} |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue