当迁移了管理平台后,自动跳转到确认API配置页

This commit is contained in:
刘祥超
2021-11-21 15:57:13 +08:00
parent ac39908737
commit 749eac74fe
11 changed files with 406 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ package setup
import (
"github.com/TeaOSLab/EdgeAdmin/internal/configs"
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
"os"
)
var isConfigured bool
@@ -16,3 +18,16 @@ func IsConfigured() bool {
isConfigured = err == nil
return isConfigured
}
// IsNewInstalled IsNew 检查是否新安装
func IsNewInstalled() bool {
homeDir, err := os.UserHomeDir()
if err != nil {
return false
}
_, err = os.Stat(homeDir + "/." + teaconst.ProcessName + "/api.yaml")
if err != nil {
return true
}
return false
}