فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

wangshuai 4 سال پیش
والد
کامیت
87e2f34264

+ 4 - 1
magic-api-spring-boot-starter/src/main/java/org/ssssssss/magicapi/spring/boot/starter/ApplicationUriPrinter.java

@@ -4,6 +4,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.web.context.WebServerApplicationContext;
 import org.springframework.core.annotation.Order;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.stereotype.Component;
@@ -29,6 +30,8 @@ public class ApplicationUriPrinter implements CommandLineRunner {
 	private ConfigurableEnvironment springEnv;
 	@Autowired
 	private MagicAPIProperties properties;
+	@Autowired
+	private WebServerApplicationContext serverApplicationContext;
 
 	@Override
 	public void run(String... args) throws Exception {
@@ -39,7 +42,7 @@ public class ApplicationUriPrinter implements CommandLineRunner {
 		} catch (UnknownHostException e) {
 			System.out.println("当前服务地址获取失败");
 		}
-		String port = springEnv.getProperty("server.port", "port");
+		int port = serverApplicationContext.getWebServer().getPort();
 		String path = springEnv.getProperty("server.servlet.context-path", "");
 		String magicWebPath = properties.getWeb();
 		String schema = "http://";

+ 13 - 0
magic-api-spring-boot-starter/src/main/java/org/ssssssss/magicapi/spring/boot/starter/MagicAPIProperties.java

@@ -97,6 +97,10 @@ public class MagicAPIProperties {
 	 */
 	private String pushPath = "/_magic-api-sync";
 
+	/**
+	 * 启动完成之后打印地址
+	 */
+	private boolean showUrl = true;
 
 	@NestedConfigurationProperty
 	private SecurityConfig securityConfig = new SecurityConfig();
@@ -325,4 +329,13 @@ public class MagicAPIProperties {
 	public void setPushPath(String pushPath) {
 		this.pushPath = pushPath;
 	}
+
+	public boolean isShowUrl() {
+		return showUrl;
+	}
+
+	public MagicAPIProperties setShowUrl(boolean showUrl) {
+		this.showUrl = showUrl;
+		return this;
+	}
 }

+ 1 - 1
magic-editor/src/console/src/components/layout/magic-header.vue

@@ -69,7 +69,7 @@
         </div>
         <div>
           <label>秘钥:</label>
-          <magic-input placeholder="请输入秘钥" v-model="secretKey" width="300px"/>
+          <magic-input placeholder="请输入秘钥" v-model="secretKey" width="300px" type="password" />
         </div>
       </template>
       <template #buttons>