Skip to content

手动安装过程中管理员未正确添加 #60

@miluoalbert

Description

@miluoalbert

Bug report(问题描述)

Steps to reproduce(问题复现步骤)

  1. 参考图床配置页面中流程配置进行手动安装
  2. 执行完成”初始化程序“、”修改配置文件“、”创建(迁移)数据库“步骤
  3. 创建管理员,执行
$ ./auxpi -mod=admin -name=xxx [email protected] -pass=myPassword

指令

返回为:

[1] 17488
Redis
2019/06/12 11:42:08 [info] replacing callback `gorm:update_time_stamp` from /Users/aimer/go/src/github.com/auxpi/models/models.go:80
2019/06/12 11:42:08 [info] replacing callback `gorm:update_time_stamp` from /Users/aimer/go/src/github.com/auxpi/models/models.go:81

   _       __  __  ___ _____
  /_\  /\ /\ \/ / / _ \\_   \
 //_\\/ / \ \  / / /_)/ / /\/

/  _  \ \_/ /  \/ ___/\/ /_
\_/ \_/\___/_/\_\/   \____/

🍭 A NEW API IMAGES STORE TOOL 🍭


(/Users/aimer/go/src/github.com/auxpi/models/users.go:242)
[2019-06-12 11:42:08]  [1.14ms]  SELECT * FROM `auxpi_user`  WHERE (id='1') ORDER BY `auxpi_user`.`id` ASC LIMIT 1
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/logs.go:31)
[2019-06-12 11:42:08]  [0.58ms]  INSERT INTO `auxpi_log` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`type`,`content`,`part`,`level`) VALUES ('1560310928','1560310928','0','2019/06/12','MODEL','record not found  ===>[users.go:243]','SYSTEM','ERROR')
[1 rows affected or returned ]
[Models Error]:  record not found  ===>[users.go:243]

(/Users/aimer/go/src/github.com/auxpi/models/users.go:294)
[2019-06-12 11:42:08]  [0.45ms]  INSERT INTO `auxpi_user` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`username`,`password`,`is_admin`,`email`,`status`,`token`,`version`,`role_id`) VALUES ('1','1560310928','1560310928','0','2019/06/12','xxx','039898f337858fcbb6279b2cd59785420bb7891111aec173824cf4b222b2b2ff1','true','[email protected]','1','1d483d3111c5657dfe4c4cadf4ea9543be618a7f6def7e1df2b4b17d7d85e074','1','1')
[1 rows affected or returned ]
[INFO]: Create Admin SUCCESS
*bY: command not found
[1]+  Done                    ./auxpi -mod=admin -name=xxx [email protected] -pass=myPassword
  1. 执行./auxpi run后可正常建立服务,进入用户界面正常。
  2. 点击页面上”后台管理“,输入正确用户名密码进入管理员界面过程中报错(弹出提示栏):
getInfo: roles must be a non-null array !

后台日志:

(/Users/aimer/go/src/github.com/auxpi/models/users.go:104)
[2019-06-12 12:01:42]  [0.77ms]  SELECT * FROM `auxpi_user`  WHERE (username = 'xxx') ORDER BY `auxpi_user`.`id` ASC LIMIT 1
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/users.go:104)
[2019-06-12 12:01:42]  [0.44ms]  SELECT * FROM `auxpi_role`  WHERE (`id` IN ('1')) ORDER BY `auxpi_role`.`id` ASC
[0 rows affected or returned ]

Server environment(服务器环境)

  • Your OS & version (服务器系统&版本):
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=16.04
    DISTRIB_CODENAME=xenial
    DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
  • DataBase & version (数据库&版本):
    Mysql: 5.7.26 (docker)

Other relevant information(格外信息)

  • auxpi version:
    V2.3.9

貌似是执行建立管理员指令中没有往auxpi_role表写入数据?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions