自动化立体仓库 - WCS系统
vincent
2020-05-26 47014719789d1bfd9e368f5233d3f752a1e2e262
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
package com.zy.common.web;
 
import com.core.common.Cools;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
 
import javax.servlet.http.HttpServletResponse;
 
/**
 * Created by vincent on 2019-07-30
 */
@Controller
public class RouterController {
 
    @Value("${spring.application.name}")
    private String applicationName;
 
    @RequestMapping("/")
    public void index(HttpServletResponse response) {
        try{
            String redirect = Cools.isEmpty(applicationName)?"views/index.html":"/"+applicationName+"/views/index.html";
            response.sendRedirect(redirect);
        } catch (Exception ex){
            ex.printStackTrace();
        }
    }
 
    @RequestMapping("/login")
    public void login(HttpServletResponse response) {
        try{
            String redirect = Cools.isEmpty(applicationName)?"/views/login.html":"/"+applicationName+"/views/login.html";
            response.sendRedirect(redirect);
        } catch (Exception ex){
            ex.printStackTrace();
        }
    }
 
}