|
@@ -142,7 +142,8 @@ class DistSiteController extends AdminController
|
|
|
$form->text('seo_keywords')->width(9,3);
|
|
|
$form->textarea('seo_description')->rows(2)->width(9,3);
|
|
|
$form->select('appearance_id',admin_trans_field('appearance'))->width(9,3)->options(DistAppearance::selectOptions())->required();
|
|
|
- $form->image("logo")
|
|
|
+ $form->cutImage("logo")
|
|
|
+ ->aspectRatio(130/50)// 设置裁剪框比例
|
|
|
->retainable()//禁止删OSS图
|
|
|
->autoUpload()
|
|
|
->uniqueName()
|
|
@@ -180,13 +181,15 @@ class DistSiteController extends AdminController
|
|
|
//
|
|
|
//保存后回调
|
|
|
$form->saved(function (Form $form, $result) {
|
|
|
+ $newId = $form->getKey();
|
|
|
if ($form->isCreating()) {
|
|
|
//创建后创建默认分类
|
|
|
- $newId = $form->getKey();
|
|
|
$appearanceId = $form->input('appearance_id');
|
|
|
//更新模版与变量
|
|
|
DistAppearance::switchTheme($appearanceId, $newId);
|
|
|
}
|
|
|
+ //更新缓存
|
|
|
+ DistAdminDistributor::clearCache($newId);
|
|
|
});
|
|
|
|
|
|
$form->disableDeleteButton();
|