mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 修复密码设置失败的BUG
This commit is contained in:
parent
45dc3df4b3
commit
7531ef30e0
@ -80,7 +80,7 @@ class Install extends Command {
|
|||||||
$output->info('ApiAdmin配置更新成功');
|
$output->info('ApiAdmin配置更新成功');
|
||||||
|
|
||||||
//生成lock文件,并且写入用户名密码
|
//生成lock文件,并且写入用户名密码
|
||||||
file_put_contents($lockFile, "lock");
|
file_put_contents($lockFile, $authKey);
|
||||||
$output->info('lock文件初始化成功');
|
$output->info('lock文件初始化成功');
|
||||||
|
|
||||||
Console::call('migrate:run');
|
Console::call('migrate:run');
|
||||||
|
@ -30,11 +30,14 @@ class IniAdminUser extends Migrator {
|
|||||||
*/
|
*/
|
||||||
public function up() {
|
public function up() {
|
||||||
$pass = Strs::randString(8);
|
$pass = Strs::randString(8);
|
||||||
|
$lockFile = Env::get('app_path') . 'install' . DIRECTORY_SEPARATOR . 'lock.ini';
|
||||||
|
$authKey = file_get_contents($lockFile);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
'nickname' => 'root',
|
'nickname' => 'root',
|
||||||
'password' => Tools::userMd5($pass),
|
'password' => Tools::userMd5($pass, $authKey),
|
||||||
'create_time' => time(),
|
'create_time' => time(),
|
||||||
'create_ip' => ip2long('127.0.0.1'),
|
'create_ip' => ip2long('127.0.0.1'),
|
||||||
'update_time' => time(),
|
'update_time' => time(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user