修复管理员新建用户后建立数据文件夹出错的问题

*问题是 /
This commit is contained in:
Chenx221 2024-04-22 19:06:55 +08:00
parent ddb076cf31
commit 06de6953ed
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021

View File

@ -239,11 +239,11 @@ class AdminController extends Controller
$model->name = $model->username; //用户默认昵称为用户名,后期可以修改
if ($model->save(false)) { // save without validation
if ($model->role == 'user') {
$userFolder = Yii::getAlias(Yii::$app->params['dataDirectory']) . ' / ' . $model->id;
$userFolder = Yii::getAlias(Yii::$app->params['dataDirectory']) . '/' . $model->id;
if (!is_dir($userFolder)) {
mkdir($userFolder);
}
$secretFolder = Yii::getAlias(Yii::$app->params['dataDirectory']) . ' / ' . $model->id . ' . secret';
$secretFolder = Yii::getAlias(Yii::$app->params['dataDirectory']) . '/' . $model->id . ' . secret';
if (!is_dir($secretFolder)) {
mkdir($secretFolder);
}