mitao
2025-03-28 b44b174f656aac1fe03e7f96851e564c3982f67d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.sinata.web.controller.backend.system;
 
import com.sinata.common.config.RuoYiConfig;
import com.sinata.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
/**
 * 首页
 *
 * @author ruoyi
 */
@Controller
public class SysIndexController
{
    /** 系统基础配置 */
    @Autowired
    private RuoYiConfig ruoyiConfig;
 
    @Value("${spring.profiles.active}")
    private String env;
 
    @RequestMapping("/")
    public String index() {
        if (!env.equals("dev")) {
            return "redirect:/msg";
        } else {
            return "redirect:/doc.html";
        }
    }
 
    /**
     * 访问首页,提示语
     */
    @RequestMapping("/msg")
    @ResponseBody
    public String msg()
    {
        return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
    }
}