feat: 修改 user-info 指令的输出 (#2103)

pull/2105/head
zhengkunwang 2023-08-29 11:40:15 +08:00 committed by GitHub
parent 3adb200585
commit d1e7b36243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -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
},
}