前置文章:
Spug发布前端项目实战全过程https://blog.csdn.net/wdy_2099/article/details/120215392
Spug设置报警提醒功能(钉钉、微信、邮箱)落地详细https://blog.csdn.net/wdy_2099/article/details/120224867
问题:未知原因导致“账户已被系统禁用”
处理方式:
进入spug容器内部,直接改数据库spug user表 的admin的is_active=1即可。
[root@nb1 bin]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb001c1db674 registry.aliyuncs.com/openspug/spug "/entrypoint.sh" 4 weeks ago Up 37 minutes 0.0.0.0:8082->80/tcp, :::8082->80/tcp spug
1、进入容器内部:
docker exec -it spug bash
2、改数据库流程:
[root@bb001c1db674 /]# mysql -uspug -pspug.dev
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 47
Server version: 5.5.68-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| spug |
| test |
+--------------------+
3 rows in set (0.00 sec)MariaDB [(none)]> use spug
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MariaDB [spug]>
MariaDB [spug]>
MariaDB [spug]> show tables;
+-------------------+
| Tables_in_spug |
+-------------------+
| alarm_contacts |
| alarm_groups |
| alarms |
| apps |
| config_histories |
| configs |
| deploy_extend1 |
| deploy_extend2 |
| deploy_requests |
| deploys |
| detections |
| django_migrations |
| environments |
| exec_templates |
| host_extend |
| host_groups |
| host_groups_hosts |
| hosts |
| login_histories |
| navigations |
| notices |
| notifies |
| repositories |
| roles |
| services |
| settings |
| task_histories |
| tasks |
| user_role_rel |
| users |
+-------------------+
30 rows in set (0.00 sec)MariaDB [spug]> select * from users;
+----+----------+-----------+--------------------------------------------------------------------------------+---------+-----------+-----------+----------------------------------+---------------+---------------------+---------------+----------+---------------------+------------+---------------+---------------+
| id | username | nickname | password_hash | type | is_supper | is_active | access_token | token_expired | last_login | last_ip | wx_token | created_at | deleted_at | created_by_id | deleted_by_id |
+----+----------+-----------+--------------------------------------------------------------------------------+---------+-----------+-----------+----------------------------------+---------------+---------------------+---------------+----------+---------------------+------------+---------------+---------------+
| 1 | admin | 管理员 | pbkdf2_sha256$150000$6pMX0lbZ1gP0$FOkYC42nLZI8Qdl6zF0wqaFdfKsUH1iMwD69Db85160= | default | 1 | 0 | ff2a325e650644f5a02e95315008d38a | 1633974335 | 2021-10-11 13:14:05 | 192.168.1.127 | NULL | 2021-09-08 17:07:57 | NULL | NULL | NULL |
+----+----------+-----------+--------------------------------------------------------------------------------+---------+-----------+-----------+----------------------------------+---------------+---------------------+---------------+----------+---------------------+------------+---------------+---------------+
1 row in set (0.00 sec)MariaDB [spug]> update users set is_active =1 ;
Query OK, 1 row affected (0.06 sec)
Rows matched: 1 Changed: 1 Warnings: 0MariaDB [spug]> exit
这样就解决了这个问题,好!
注意:spug不只是docker部署一种方法,所以根据自己的来。思路是一样的。
此外,还可以接外部数据库,如果是外部的话,就直接在外部对应的数据库内进行改动即可。