feat:允许设定首次登录失败后是否进入守护
This commit is contained in:
@@ -56,7 +56,6 @@ func (a *file) WriteJson(path string, receiver interface{}) error {
|
||||
func (*file) GetRootPath() (string, error) {
|
||||
t, err := os.Executable()
|
||||
if err != nil {
|
||||
ErrHandler(err)
|
||||
return "", err
|
||||
}
|
||||
return filepath.Dir(t) + "/", nil
|
||||
|
||||
12
util/util.go
12
util/util.go
@@ -9,7 +9,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"regexp"
|
||||
"time"
|
||||
)
|
||||
@@ -51,17 +50,6 @@ func Sha1(content string) string {
|
||||
return fmt.Sprintf("%x\n", bs)
|
||||
}
|
||||
|
||||
func ErrHandler(err error) {
|
||||
if !global.Status.Output {
|
||||
return
|
||||
}
|
||||
Log.Println("运行出错,状态异常")
|
||||
if global.Config.Settings.DemoMode {
|
||||
Log.Fatalln(err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
d := net.Dialer{
|
||||
|
||||
Reference in New Issue
Block a user