From 9be0bcc80c05f7260f298f00a7f502659f177d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 1 Nov 2020 22:08:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=9A=84=E5=9C=B0=E5=9D=80=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/jsh/erp/ErpApplication.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jsh/erp/ErpApplication.java b/src/main/java/com/jsh/erp/ErpApplication.java index d3384ce1..2f3d8285 100644 --- a/src/main/java/com/jsh/erp/ErpApplication.java +++ b/src/main/java/com/jsh/erp/ErpApplication.java @@ -1,17 +1,27 @@ package com.jsh.erp; +import com.jsh.erp.utils.ComputerInfo; import org.mybatis.spring.annotation.MapperScan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.Environment; import org.springframework.scheduling.annotation.EnableScheduling; +import java.io.IOException; + @SpringBootApplication -@MapperScan(basePackages = {"com.jsh.erp.datasource.mappers"}) +@MapperScan("com.jsh.erp.datasource.mappers") @ServletComponentScan @EnableScheduling public class ErpApplication{ - public static void main(String[] args) { - SpringApplication.run(ErpApplication.class, args); + public static void main(String[] args) throws IOException { + ConfigurableApplicationContext context = SpringApplication.run(ErpApplication.class, args); + Environment environment = context.getBean(Environment.class); + System.out.println("启动成功,访问地址:http://" + ComputerInfo.getIpAddr() + ":" + + environment.getProperty("server.port") + ",测试用户:jsh,密码:123456"); } }