|
@@ -6,7 +6,6 @@ import (
|
|
|
"fmt"
|
|
|
"log"
|
|
|
"regexp"
|
|
|
- "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
@@ -161,7 +160,7 @@ func (a *Admin) QueryUserByUsername(ctx context.Context, username string) (*mode
|
|
|
Username: constant.AdminAccess,
|
|
|
Password: pwd,
|
|
|
RealName: constant.AdminAccess,
|
|
|
- Pid: 0,
|
|
|
+ Pid: "0",
|
|
|
RoleId: constant.AdminAccess,
|
|
|
ManagerAuth: 0,
|
|
|
Status: 1,
|
|
@@ -175,7 +174,7 @@ func (a *Admin) QueryUserByUsername(ctx context.Context, username string) (*mode
|
|
|
"username": constant.AdminAccess,
|
|
|
"password": pwd,
|
|
|
"real_name": constant.AdminAccess,
|
|
|
- "pid": 0,
|
|
|
+ "pid": "0",
|
|
|
"role_id": constant.AdminAccess,
|
|
|
"status": 1,
|
|
|
})
|
|
@@ -204,7 +203,7 @@ func (a *Admin) ChangePassword(ctx context.Context, username string, password st
|
|
|
}
|
|
|
|
|
|
// Add 添加管理员
|
|
|
-func (a *Admin) Add(ctx context.Context, username string, password string, realName string, pid int64, roleId int64, status int) error {
|
|
|
+func (a *Admin) Add(ctx context.Context, username string, password string, realName string, pid string, roleId string, status int) error {
|
|
|
// 判断账号是否重复
|
|
|
admin := model.Admin{}
|
|
|
err := mdb.MDB.Collection(a.GetDBName()).FindOne(ctx, bson.M{"username": username}).Decode(&admin)
|
|
@@ -215,7 +214,7 @@ func (a *Admin) Add(ctx context.Context, username string, password string, realN
|
|
|
Password: password,
|
|
|
RealName: realName,
|
|
|
Pid: pid,
|
|
|
- RoleId: strconv.FormatInt(roleId, 10),
|
|
|
+ RoleId: roleId,
|
|
|
Status: status,
|
|
|
CreatedAt: time.Now().Unix(),
|
|
|
UpdatedAt: time.Now().Unix(),
|