微服务优化

pull/3664/head
zhangdaiscott 2022-04-24 17:49:34 +08:00
parent 67d8cdbc6c
commit e89423c666
2 changed files with 16 additions and 21 deletions

View File

@ -1,10 +1,13 @@
package com.alibaba.nacos;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletResponse;
/**
* Nacos
@ -34,4 +37,16 @@ public class JeecgNacosApplication {
System.setProperty("server.port","8848");
SpringApplication.run(JeecgNacosApplication.class, args);
}
/**
*
*
* @param model
* @return
*/
@GetMapping("/")
public String index(Model model, HttpServletResponse response) {
// 视图重定向 - 跳转
return "/nacos";
}
}

View File

@ -1,20 +0,0 @@
package com.alibaba.nacos.control;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
/**
* -
*/
@Controller
public class IndexController {
private Logger logger = LoggerFactory.getLogger(IndexController.class);
@GetMapping("/")
public String index(Model model) {
return "/nacos"; // 视图重定向 - 跳转
}
}