From d1e7b3624336abf6fe9376afbea550ce0723baff Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:40:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20user-info=20?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E7=9A=84=E8=BE=93=E5=87=BA=20(#2103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/cmd/user-info.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/server/cmd/user-info.go b/cmd/server/cmd/user-info.go index 0e29af56d..ccaa484fe 100644 --- a/cmd/server/cmd/user-info.go +++ b/cmd/server/cmd/user-info.go @@ -26,6 +26,7 @@ var userinfoCmd = &cobra.Command{ ssl := getSettingByKey(db, "SSL") entrance := getSettingByKey(db, "SecurityEntrance") encryptSetting := getSettingByKey(db, "EncryptKey") + address := getSettingByKey(db, "SystemIP") p := "" if len(encryptSetting) == 16 { @@ -35,11 +36,17 @@ var userinfoCmd = &cobra.Command{ p = password } - fmt.Printf("username: %s\n", user) - fmt.Printf("password: %s\n", p) - fmt.Printf("port: %s\n", port) - fmt.Printf("ssl: %s\n", ssl) - fmt.Printf("entrance: %s\n", entrance) + protocol := "http" + if ssl == "enable" { + protocol = "https" + } + if address == "" { + address = "$LOCAL_IP" + } + + fmt.Printf("面板地址: %s://%s:%s/%s \n", protocol, address, port, entrance) + fmt.Printf("用户名称: %s\n", user) + fmt.Printf("用户密码: %s\n", p) return nil }, }