Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
miluoalbert opened this issue Jun 12, 2019 · 5 comments
Closed

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

miluoalbert opened this issue Jun 12, 2019 · 5 comments

Comments

@miluoalbert
Copy link

Bug report(问题描述)

Steps to reproduce(问题复现步骤)

  1. 参考图床配置页面中流程配置进行手动安装
  2. 执行完成”初始化程序“、”修改配置文件“、”创建(迁移)数据库“步骤
  3. 创建管理员,执行
$ ./auxpi -mod=admin -name=xxx -email=xxx@xxx.com -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','xxx@xxx.com','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=xxx@xxx.com -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表写入数据?

@0xDkd
Copy link
Owner

0xDkd commented Jun 12, 2019

在生成管理员之前,进行数据库的migrate了吗

@miluoalbert
Copy link
Author

进行了,Log如下:

$ ./auxpi migrate
Redis
2019/06/12 13:17:20 [info] replacing callback `gorm:update_time_stamp` from /Users/aimer/go/src/github.com/auxpi/models/models.go:80
2019/06/12 13:17:20 [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:274)
[2019-06-12 13:17:20]  [7.13ms]  DROP TABLE `auxpi_user`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/users.go:275)
[2019-06-12 13:17:20]  [28.09ms]  CREATE TABLE `auxpi_user` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`username` varchar(32) UNIQUE,`password` varchar(64),`is_admin` boolean,`email` varchar(100) UNIQUE,`status` int unsigned,`token` varchar(255) UNIQUE,`version` int unsigned,`role_id` int unsigned , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/images.go:182)
[2019-06-12 13:17:20]  [4.36ms]  DROP TABLE `auxpi_image`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/images.go:186)
[2019-06-12 13:17:20]  [16.04ms]  CREATE TABLE `auxpi_image` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`name` varchar(255),`link` varchar(255),`store_id` int,`user_id` int,`ip` varchar(255),`delete` varchar(255),`path` varchar(255) , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/images.go:186)
[2019-06-12 13:17:20]  [11.35ms]  CREATE INDEX idx_auxpi_image_store_id ON `auxpi_image`(store_id)
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/images.go:186)
[2019-06-12 13:17:20]  [19.87ms]  CREATE INDEX idx_auxpi_image_user_id ON `auxpi_image`(user_id)
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/sync.go:141)
[2019-06-12 13:17:20]  [11.49ms]  DROP TABLE `auxpi_sync_image`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/sync.go:142)
[2019-06-12 13:17:20]  [105.94ms]  CREATE TABLE `auxpi_sync_image` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`link` varchar(255),`path` varchar(255),`delete` varchar(255),`image_id` int unsigned , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/sync.go:142)
[2019-06-12 13:17:20]  [11.31ms]  CREATE INDEX idx_auxpi_sync_image_image_id ON `auxpi_sync_image`(image_id)
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:209)
[2019-06-12 13:17:20]  [4.32ms]  DROP TABLE `auxpi_store`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:210)
[2019-06-12 13:17:20]  [17.66ms]  CREATE TABLE `auxpi_store` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`name` varchar(32),`desc` varchar(255),`url` varchar(255),`icon` varchar(32),`color` varchar(32),`api` varchar(32),`router` varchar(32),`status` boolean,`weight` int,`rank` int,`auth` int unsigned , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:234)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x90\x9C\xE7\x8B\x97...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:234)
[2019-06-12 13:17:20]  [0.68ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('1','1560316640','1560316640','0','2019/06/12','搜狗图床','搜狗图床,有防盗链,会定期清除违规图片,建议仅作为备份','http://pic.sogou.com/pic/upload_pic.jsp','sougou','orange','sougou','SouGou','true','16','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:248)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\xBE\xAE\xE5\x8D\x9A...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:248)
[2019-06-12 13:17:20]  [0.48ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('2','1560316640','1560316640','0','2019/06/12','微博图床','新浪图床需要登录,对于违规图片有限制,但是不会清理图片','http://picupload.service.weibo.com/interface/pic_upload.php?ori=1&mime=image%2Fjpeg&data=base64&url=0&markpos=1&logo=&nick=0&marks=1&app=miniblog','weibo','red','sina','Sina','true','1','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:261)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:261)
[2019-06-12 13:17:20]  [0.41ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('3','1560316640','1560316640','0','2019/06/12','SMMS 图床','SMMS 兽兽家的图床,速度很不错,相当稳定~','https://sm.ms/api/upload','sm','blue','smms','Smms','true','2','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:274)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:274)
[2019-06-12 13:17:20]  [0.40ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('4','1560316640','1560316640','0','2019/06/12','CC 图床','CC 图床,服务器在香港,速度还可以','https://upload.cc/image_upload','cc','green','cc','cc','true','3','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:287)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:287)
[2019-06-12 13:17:20]  [0.46ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('5','1560316640','1560316640','0','2019/06/12','Flickr 图床','Flickr 图床是雅虎旗下的,图片可以在国内访问速度不错,但是 api 只能国外访问','','flickr','pink darken-1','flickr','Flickr','true','4','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:301)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A...' for column 'desc' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:301)
[2019-06-12 13:17:20]  [0.49ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('6','1560316640','1560316640','0','2019/06/12','Imgur','imgur 图床会永久储存,可以使用节点进行代理','','imgur','purple','imgur','Imgur','true','15','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:315)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x9C\xAC\xE5\x9C\xB0...' for column 'desc' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:315)
[2019-06-12 13:17:20]  [0.59ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('7','1560316640','1560316640','0','2019/06/12','Prnt','本地图床没有任何限制,但是会占用服务器的储存空间','','prnt','black','prnt','Prnt','true','14','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:341)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE7\xBD\x91\xE6\x98\x93...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:341)
[2019-06-12 13:17:20]  [0.58ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('8','1560316640','1560316640','0','2019/06/12','网易图床','网易严选 CDN,暂无防盗链,目前发现不会清理','','wangyi','red','neteasy','NetEasy','true','5','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:354)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE4\xBA\xAC\xE4\xB8\x9C...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:354)
[2019-06-12 13:17:20]  [0.58ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('9','1560316640','1560316640','0','2019/06/12','京东 图床','京东图床,不允许上传过小的图片,其它正常','','jingdong','orange-800','jd','Jd','true','6','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:367)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x8E\x98\xE9\x87\x91...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:367)
[2019-06-12 13:17:20]  [0.55ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('10','1560316640','1560316640','0','2019/06/12','掘金 图床','掘金图床,暂无防盗链,一切正常','','juejin','blue','juejin','JueJin','true','7','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:380)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE9\x98\xBF\xE9\x87\x8C...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:380)
[2019-06-12 13:17:20]  [0.56ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('11','1560316640','1560316640','0','2019/06/12','阿里 图床','阿里图床,推荐使用','','ali','orange','ali','Ali','true','8','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:393)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x9C\xAC\xE5\x9C\xB0...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:393)
[2019-06-12 13:17:20]  [0.57ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('12','1560316640','1560316640','0','2019/06/12','本地图床','本地图床没有任何限制,但是会占用服务器的储存空间','','auxpi','purple','local','Local','true','9','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:406)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\xB0\x8F\xE7\xB1\xB3...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:406)
[2019-06-12 13:17:20]  [0.81ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('14','1560316640','1560316640','0','2019/06/12','小米图床','小米图床不是很稳定,返回的 json 会改变','','xiaomi','orange','xiaomi','XiaoMi','true','10','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:419)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE8\x8B\x8F\xE5\xAE\x81...' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:419)
[2019-06-12 13:17:20]  [0.63ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('13','1560316640','1560316640','0','2019/06/12','苏宁图床','建议观察后使用','','suning','orange','suning','SuNing','true','11','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:432)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:432)
[2019-06-12 13:17:20]  [0.50ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('15','1560316640','1560316640','0','2019/06/12','Vim图床','国外图床,非常稳定,cf 的 CDN','','vim','green','vim','Vim','true','12','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:445)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBD\xE5\xA4\x96...' for column 'desc' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:445)
[2019-06-12 13:17:20]  [0.50ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('16','1560316640','1560316640','0','2019/06/12','OOXX','国外图床,稳定性未知,cf 提供 CDN','','ooxx','red','ooxx','ooxx','true','13','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:458)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x90\x9C\xE7\x8B\x90' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:458)
[2019-06-12 13:17:20]  [0.52ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('17','1560316640','1560316640','0','2019/06/12','搜狐','搜狐畅言图床,目前看来还不错','','souhu','orange','souhu','SouHu','true','13','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:471)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE7\x9A\x84\xE4\xBB\x93...' for column 'desc' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:471)
[2019-06-12 13:17:20]  [0.52ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('18','1560316640','1560316640','0','2019/06/12','Github','github 的仓库为我们提供图床,可以当做根节点使用','','github','black','github','Github','true','13','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:484)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\xA4\xB4\xE6\x9D\xA1' for column 'name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:484)
[2019-06-12 13:17:20]  [0.48ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('19','1560316640','1560316640','0','2019/06/12','头条','头条 CDN,稳定性位置','','toutiao','red','toutiao','TouTiao','true','13','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:497)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\xBE\x88\xE7\xA8\xB3...' for column 'desc' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:497)
[2019-06-12 13:17:20]  [0.45ms]  INSERT INTO `auxpi_store` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`desc`,`url`,`icon`,`color`,`api`,`router`,`status`,`weight`,`rank`,`auth`) VALUES ('20','1560316640','1560316640','0','2019/06/12','Gitee','gitee 很稳定,希望大家不要滥用','','gitee','red','gitee','Gitee','true','13','0','0')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:63)
[2019-06-12 13:17:20]  [9.85ms]  DROP TABLE `auxpi_role`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:64)
[2019-06-12 13:17:20]  [20.21ms]  CREATE TABLE `auxpi_role` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`name` varchar(255) UNIQUE,`display_name` varchar(255),`description` varchar(255) , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:72)
[2019-06-12 13:17:20]  [4.38ms]  DROP TABLE `auxpi_permission`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:73)
[2019-06-12 13:17:20]  [22.12ms]  CREATE TABLE `auxpi_permission` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`name` varchar(255) UNIQUE,`display_name` varchar(255),`description` varchar(255) , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:42)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x89\x80\xE6\x9C\x89...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:42)
[2019-06-12 13:17:20]  [0.95ms]  INSERT INTO `auxpi_permission` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('1','1560316640','1560316640','0','2019/06/12','All','所有权限','具有所有权限')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:48)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE4\xBF\xAE\xE6\x94\xB9...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:48)
[2019-06-12 13:17:20]  [0.40ms]  INSERT INTO `auxpi_permission` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('2','1560316640','1560316640','0','2019/06/12','edit_user','修改用户','edit_user')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:54)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE4\xBF\xAE\xE6\x94\xB9...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:54)
[2019-06-12 13:17:20]  [0.39ms]  INSERT INTO `auxpi_permission` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('3','1560316640','1560316640','0','2019/06/12','edit_image','修改图片','edit_image')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:60)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE4\xB8\x8A\xE4\xBC\xA0...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:60)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_permission` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('4','1560316640','1560316640','0','2019/06/12','upload_image','上传图片','upload_image')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:66)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x88\xA0\xE9\x99\xA4...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:66)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_permission` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('5','1560316640','1560316640','0','2019/06/12','delete_image','删除图片','delete_image')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:123)
[2019-06-12 13:17:20]  [6.98ms]  DROP TABLE `auxpi_option`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:124)
[2019-06-12 13:17:20]  [22.13ms]  CREATE TABLE `auxpi_option` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`options_key` varchar(255),`options_value` text,`group` varchar(255) , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.57ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','sina','{"status":false,"user_name":"","pass_word":"","reset_sina_cookie_time":3600,"defult_pic_size":"large","proxy":{"status":false,"node":"https://images.weserv.nl/?url="}}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.54ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','flickr','{"status":false,"default_size":"","id":"","api_key":"","api_secret":"","oauth_token":"","oauth_token_secret":""}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','local','{"status":true,"storage_location":"public/upload","link":"/images/"}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.36ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','imgur','{"status":false,"proxy":{"status":false,"node":"https://images.weserv.nl/?url="},"imgur_id":""}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','github','{"access_token":"","owner":"","repo":"","email":"","proxy":{"status":false,"node":"https://images.weserv.nl/?url="}}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','gitee','{"access_token":"","owner":"","repo":""}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.35ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','proxy','https://images.weserv.nl/?url=','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:89)
[2019-06-12 13:17:20]  [0.55ms]  SELECT * FROM `auxpi_store`  WHERE (api='local') ORDER BY `auxpi_store`.`id` ASC LIMIT 1
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/logs.go:31)
[2019-06-12 13:17:20]  [0.43ms]  INSERT INTO `auxpi_log` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`type`,`content`,`part`,`level`) VALUES ('1560316640','1560316640','0','2019/06/12','MODEL','record not found  ===>[stores.go:90]','SYSTEM','ERROR')
[1 rows affected or returned ]
[Models Error]:  record not found  ===>[stores.go:90]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.38ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','dispatch','{"status":true,"root":"local","root_id":0,"cache_time":7200000000000}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.36ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','api_option','{"status":false,"auth":true,"api_default":"SouGou"}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.35ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','ip_limit','{"status":false,"block_time":3600,"dead_line":10,"allow_num":100,"allow_time":3600}','conf')
[1 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A...' for column 'options_value' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/options.go:27)
[2019-06-12 13:17:20]  [0.40ms]  INSERT INTO `auxpi_option` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`options_key`,`options_value`,`group`) VALUES ('1560316640','1560316640','0','2019/06/12','site_base','{"site_name":"AuXpI API 图床","site_footer":"新一代图床","site_url":"http://yoursite.com/","logo":"https://i.loli.net/2019/05/03/5ccc431dc5a29.png","site_upload_max_number":10,"site_upload_max_size":5,"allow_tourists":false,"allow_register":false,"jwt_secret":"495afb7483cefe5f61a39a9399260837","jwt_due_time":3,"mail_config":{"status":false,"host":"","user":"","pass":"","port":"","from":"","nick_name":"","nick_email":""}}','conf')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/logs.go:31)
[2019-06-12 13:17:20]  [0.38ms]  INSERT INTO `auxpi_log` (`created_on`,`modified_on`,`deleted_on`,`created_day`,`type`,`content`,`part`,`level`) VALUES ('1560316640','1560316640','0','2019/06/12','MODEL','Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A...' for column 'options_value' at row 1  ===>[options.go:32]','SYSTEM','ERROR')
[1 rows affected or returned ]
[Models Error]:  Error 1366: Incorrect string value: '\xE5\x9B\xBE\xE5\xBA\x8A...' for column 'options_value' at row 1  ===>[options.go:32]

(/Users/aimer/go/src/github.com/auxpi/models/logs.go:80)
[2019-06-12 13:17:20]  [57.86ms]  DROP TABLE `auxpi_log`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/logs.go:81)
[2019-06-12 13:17:20]  [18.10ms]  CREATE TABLE `auxpi_log` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`type` varchar(32),`content` varchar(255),`part` varchar(32),`level` varchar(32) , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/distribution.go:122)
[2019-06-12 13:17:20]  [4.39ms]  DROP TABLE `auxpi_distribution`
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/distribution.go:123)
[2019-06-12 13:17:20]  [15.52ms]  CREATE TABLE `auxpi_distribution` (`id` int AUTO_INCREMENT,`created_on` int,`modified_on` int,`deleted_on` int,`created_day` varchar(32),`hash` varchar(255),`url` varchar(255),`ip` varchar(255),`short` varchar(255),`dispatch_url` varchar(255),`store_id` int,`user_id` int,`root_id` int,`root_url` varchar(255),`number` int , PRIMARY KEY (`id`))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/distribution.go:123)
[2019-06-12 13:17:20]  [64.57ms]  CREATE INDEX idx_auxpi_distribution_hash ON `auxpi_distribution`(`hash`)
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:20)
[2019-06-12 13:17:20]  [0.61ms]  SELECT * FROM `auxpi_permission`  WHERE (`auxpi_permission`.`id` IN ('1'))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:44)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE7\xAE\xA1\xE7\x90\x86...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:44)
[2019-06-12 13:17:20]  [0.57ms]  INSERT INTO `auxpi_role` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('1','1560316640','1560316640','0','2019/06/12','admin','管理员','可以对用户\用户权限\图片\API\站点 进行管理')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/permissions.go:20)
[2019-06-12 13:17:20]  [0.41ms]  SELECT * FROM `auxpi_permission`  WHERE (`auxpi_permission`.`id` IN ('4','5'))
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:52)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE6\x99\xAE\xE9\x80\x9A...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:52)
[2019-06-12 13:17:20]  [0.37ms]  INSERT INTO `auxpi_role` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('3','1560316640','1560316640','0','2019/06/12','normalUser','普通用户','可以上传图片,管理自己的图片')
[0 rows affected or returned ]

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:58)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\xB0\x81\xE7\xA6\x81...' for column 'display_name' at row 1

(/Users/aimer/go/src/github.com/auxpi/models/roles.go:58)
[2019-06-12 13:17:20]  [0.39ms]  INSERT INTO `auxpi_role` (`id`,`created_on`,`modified_on`,`deleted_on`,`created_day`,`name`,`display_name`,`description`) VALUES ('4','1560316640','1560316640','0','2019/06/12','blockUser','封禁的用户','无法登录,无法进行任何操作,小黑屋用户')
[0 rows affected or returned ]
[INFO]: Migrate done

@miluoalbert
Copy link
Author

数据库table截图:
image

@0xDkd
Copy link
Owner

0xDkd commented Jun 12, 2019

(/Users/aimer/go/src/github.com/auxpi/models/stores.go:445)
[2019-06-12 13:17:20]  Error 1366: Incorrect string value: '\xE5\x9B\xBD\xE5\xA4\x96...' for column 'desc' at row 1

这是数据库返回的报错,你的数据库可能不支持中文字符集

你可以参考这个 issue #52

@0xDkd 0xDkd closed this as completed Jun 13, 2019
@miluoalbert
Copy link
Author

抱歉前面一直没有时间试,执行

mysql>use auxpi;
mysql>alter database auxpi character set utf8

之后果然就好了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants