大屏项目初始化
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mini.mybigscreen.Auth;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class routeController {
|
||||
@@ -10,9 +12,15 @@ public class routeController {
|
||||
/**
|
||||
* 路由跳转
|
||||
*/
|
||||
@GetMapping({"/", "/login", "/dashboard"})
|
||||
@GetMapping({"/", "/login", "/bigScreen", "/dashboard"})
|
||||
public String forwardToIndex() {
|
||||
return "forward:/index.html";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/**/{path:[^.]*}")
|
||||
public String redirect(@PathVariable String path) {
|
||||
return "forward:/index.html";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.mini.mybigscreen.Auth;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mini.mybigscreen.Model.LoginRequest;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.Model.loginUser;
|
||||
import com.mini.mybigscreen.Model.userInfo;
|
||||
import com.mini.mybigscreen.biz.domain.HomeUser;
|
||||
import com.mini.mybigscreen.biz.service.HomeUserService;
|
||||
import com.mini.mybigscreen.utils.AesUtil;
|
||||
@@ -32,11 +34,11 @@ public class userController {
|
||||
.eq("password", AesUtil.encrypt(loginRequest.getPassword()));
|
||||
HomeUser user = userService.getOne(queryWrapper, true);
|
||||
if (user != null) {
|
||||
String token = KeyUtil.ObjKey(125,0);
|
||||
String token = KeyUtil.ObjKey(125, 0);
|
||||
HttpSession session = request.getSession(true);
|
||||
session.setAttribute("userName", user.getUserName());
|
||||
session.setAttribute("token", token);
|
||||
return Result.success(token);
|
||||
return Result.success(new userInfo(token, new loginUser(user.getUname(), user.getUserId(), user.getRoleId(), user.getUserName())));
|
||||
}
|
||||
return Result.error("账号或密码错误");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user