移除Vue实例并优化配置项加载逻辑
删除了`config.js`中的Vue实例创建过程,简化了上传类型的数据绑定。通过直接操作`app.upload_type`来响应上传类型的变化。
This commit is contained in:
@@ -9,6 +9,7 @@ use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnnotation;
|
||||
use app\Request;
|
||||
use think\App;
|
||||
use think\facade\Cache;
|
||||
use think\response\Json;
|
||||
|
||||
/**
|
||||
@@ -65,7 +66,7 @@ class Config extends AdminController
|
||||
}
|
||||
}
|
||||
TriggerService::updateMenu();
|
||||
TriggerService::updatesysConfig();
|
||||
TriggerService::updateSysConfig();
|
||||
}catch (\Exception $e) {
|
||||
$this->error('保存失败');
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ class TriggerService
|
||||
* 更新系统设置缓存
|
||||
* @return bool
|
||||
*/
|
||||
public static function updatesysConfig()
|
||||
public static function updateSysConfig(): bool
|
||||
{
|
||||
Cache::tag('sysconfig')->clear();
|
||||
Cache::tag('sysConfig')->clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,6 @@ define(["jquery", "easy-admin", "vue"], function ($, ea, Vue) {
|
||||
_group = $(this).data('group')
|
||||
});
|
||||
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
upload_type: upload_type
|
||||
}
|
||||
});
|
||||
|
||||
form.on("radio(upload_type)", function (data) {
|
||||
app.upload_type = this.value;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user