-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
48 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
namespace console\controllers; | ||
|
||
|
||
use common\modules\user\models\User; | ||
use yii\console\Controller; | ||
use Yii; | ||
use yii\helpers\Console; | ||
|
@@ -187,23 +188,34 @@ public function actionInstall() | |
$this->setEnv('YII_ENV', $appStatus); | ||
// 迁移 | ||
Yii::$app->runAction('migrate/up', ['interactive' => false]); | ||
//创建默认用户 | ||
$this->runAction('create-admin', ['interactive' => $this->interactive]); | ||
$this->setEnv('SITE_URL', $this->prompt('siteUrl')); | ||
// 清缓存 | ||
Yii::$app->runAction('cache/flush-all', ['interactive' => false]); | ||
$this->setInstalled(); | ||
$end = <<<STR | ||
+=================================================+ | ||
| Installation completed successfully, Thanks you | | ||
| 安装成功,感谢选择和使用 yii2cmf | | ||
+-------------------------------------------------+ | ||
| 说明和注意事项: | | ||
| 图片不能正常显示需要到.env文件里修改对应URL | ||
+------------------------------------------+ | ||
| 默认后台账号:hehe 密码: 111111 | ||
+=================================================+ | ||
STR; | ||
|
||
$this->stdout($end, Console::FG_GREEN); | ||
} | ||
|
||
public function actionCreateAdmin() | ||
{ | ||
$user = new User(); | ||
$user->setScenario("create"); | ||
$user->email = '[email protected]'; | ||
$user->username = 'hehe'; | ||
$user->password = '111111'; | ||
$user->create(); | ||
} | ||
public function actionReset() | ||
{ | ||
if (!$this->checkInstalled()) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters