Browse Source

Fixed fresh install panic issue

tobychui 2 năm trước cách đây
mục cha
commit
7f8e5763d7
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      mod/auth/authlogger/authlogger.go

+ 2 - 0
mod/auth/authlogger/authlogger.go

@@ -5,6 +5,7 @@ import (
 	"errors"
 	"log"
 	"net/http"
+	"os"
 	"strconv"
 	"strings"
 	"time"
@@ -36,6 +37,7 @@ type LoginRecord struct {
 
 //New Logger create a new logger object
 func NewLogger() (*Logger, error) {
+	os.MkdirAll("./system/auth/", 0775)
 	db, err := database.NewDatabase("./system/auth/authlog.db", false)
 	if err != nil {
 		return nil, errors.New("*ERROR* Failed to create database for login tracking: " + err.Error())