modified 修复密码设置失败的BUG

This commit is contained in:
zhaoxiang 2020-05-27 17:30:52 +08:00
parent 45dc3df4b3
commit 7531ef30e0
2 changed files with 5 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class Install extends Command {
$output->info('ApiAdmin配置更新成功');
//生成lock文件并且写入用户名密码
file_put_contents($lockFile, "lock");
file_put_contents($lockFile, $authKey);
$output->info('lock文件初始化成功');
Console::call('migrate:run');

View File

@ -30,11 +30,14 @@ class IniAdminUser extends Migrator {
*/
public function up() {
$pass = Strs::randString(8);
$lockFile = Env::get('app_path') . 'install' . DIRECTORY_SEPARATOR . 'lock.ini';
$authKey = file_get_contents($lockFile);
$data = [
'id' => 1,
'username' => 'root',
'nickname' => 'root',
'password' => Tools::userMd5($pass),
'password' => Tools::userMd5($pass, $authKey),
'create_time' => time(),
'create_ip' => ip2long('127.0.0.1'),
'update_time' => time(),