2025-10-24 14:03:39 +08:00
|
|
|
package com.chinaweal.youfool.course.controller;
|
|
|
|
|
|
2025-10-24 14:16:02 +08:00
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
2025-10-24 14:03:39 +08:00
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面控制器
|
|
|
|
|
*
|
|
|
|
|
* @author lroyia
|
|
|
|
|
* @since 2025/10/24
|
|
|
|
|
**/
|
|
|
|
|
@Controller
|
|
|
|
|
public class PageController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 登录页面
|
|
|
|
|
*
|
|
|
|
|
* @return 登录页面
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/login")
|
|
|
|
|
public String loginPage() {
|
|
|
|
|
return "login";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 首页
|
|
|
|
|
*
|
|
|
|
|
* @return 首页
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/")
|
|
|
|
|
public String index() {
|
2025-10-24 14:16:02 +08:00
|
|
|
if (!StpUtil.isLogin()) {
|
|
|
|
|
return "redirect:/course/login";
|
|
|
|
|
}
|
2025-10-24 14:03:39 +08:00
|
|
|
return "index";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 首页
|
|
|
|
|
*
|
|
|
|
|
* @return 首页
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/index")
|
|
|
|
|
public String indexPage() {
|
2025-10-24 14:16:02 +08:00
|
|
|
if (!StpUtil.isLogin()) {
|
|
|
|
|
return "redirect:/course/login";
|
|
|
|
|
}
|
2025-10-24 14:03:39 +08:00
|
|
|
return "index";
|
|
|
|
|
}
|
|
|
|
|
}
|