//package com.landtool.lanbase.modules.api.controller;
|
//
|
//import org.apache.shiro.crypto.hash.Sha256Hash;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.servlet.ModelAndView;
|
//
|
//import com.landtool.lanbase.common.utils.CoderUtils;
|
//import com.landtool.lanbase.common.utils.Result;
|
//import com.landtool.lanbase.modules.api.annotation.Login;
|
//import com.landtool.lanbase.modules.api.utils.JwtUtils;
|
//import com.landtool.lanbase.modules.org.entity.OrgUser;
|
//import com.landtool.lanbase.modules.org.service.OrgUserService;
|
//
|
//import springfox.documentation.annotations.ApiIgnore;
|
//
|
//import java.util.HashMap;
|
//import java.util.Map;
|
//
|
///**
|
// * @author lanbase
|
// * @Description: TODO()
|
// * @date 2017-9-27 14:49
|
// */
|
//@RestController
|
//@RequestMapping("/api")
|
//@ApiIgnore()
|
//public class TestController {
|
//
|
// @Autowired
|
// private JwtUtils jwtUtils;
|
//
|
// @Autowired
|
// private OrgUserService orgUserService;
|
//
|
// @GetMapping("/login")
|
// public Result login(String username, String password){
|
// //用户信息
|
// OrgUser user = orgUserService.queryByUserName(username);
|
//
|
// //账号不存在
|
// if(user == null) {
|
// return Result.error("账号不存在");
|
// }
|
//
|
// //密码错误
|
//// if(!user.getPassword().equals(new Sha256Hash(password, user.getSalt()).toHex())) {
|
//// return Result.error("密码不正确");
|
//// }
|
// try {
|
// if(!user.getPassword().equals(CoderUtils.lantuEncryptMD5(password))) {
|
// return Result.error("密码不正确");
|
// }
|
// } catch (Exception e) {
|
// // TODO Auto-generated catch block
|
// e.printStackTrace();
|
// }
|
//
|
// //生成token
|
// String token = jwtUtils.generateToken(user.getUserid());
|
//
|
// Map<String, Object> map = new HashMap<>();
|
// map.put("userId", user.getUserid());
|
// map.put("token", token);
|
// map.put("expire", jwtUtils.getExpire());
|
//
|
// Result r=Result.ok().put(map);
|
// return r;
|
// }
|
//
|
// @Login
|
// @GetMapping("/test")
|
// public Result test(){
|
// return Result.ok();
|
// }
|
//
|
//}
|