| | |
| | | package com.ruoyi; |
| | | |
| | | import eu.bitwalker.useragentutils.Application; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | /** |
| | |
| | | public static void main(String[] args) |
| | | { |
| | | // System.setProperty("spring.devtools.restart.enabled", "false"); |
| | | SpringApplication.run(RuoYiApplication.class, args); |
| | | ConfigurableApplicationContext run = SpringApplication.run(RuoYiApplication.class, args); |
| | | System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙"); |
| | | |
| | | |
| | | // 获取Environment实例 |
| | | Environment env = run.getEnvironment(); |
| | | |
| | | // 获取端口号和上下文路径 |
| | | String serverPort = env.getProperty("server.port"); |
| | | String contextPath = env.getProperty("server.servlet.context-path", ""); |
| | | |
| | | // 打印启动信息 |
| | | System.out.println("\n\n===========> 系统启动成功!后台地址:http://localhost:" + serverPort + contextPath); |
| | | |
| | | } |
| | | } |