var $url="/settings/configsAdmin",data=utils.init({uploadUrl:null,uploadFileList:[],form:{adminTitle:null,adminLogoUrl:null,adminWelcomeHtml:null}}),methods={apiGet:function(){var i=this;utils.loading(this,!0),$api.get($url).then(function(o){var t=o.data;i.form.adminTitle=t.adminTitle,i.form.adminLogoUrl=t.adminLogoUrl,i.form.adminWelcomeHtml=t.adminWelcomeHtml||"欢迎使用 SS CMS 管理后台",i.form.adminLogoUrl&&i.uploadFileList.push({name:"avatar",url:i.form.adminLogoUrl})}).catch(function(i){utils.error(i)}).then(function(){utils.loading(i,!1)})},apiSubmit:function(){var i=this;utils.loading(this,!0),$api.post($url,{adminTitle:i.form.adminTitle,adminLogoUrl:i.form.adminLogoUrl,adminWelcomeHtml:i.form.adminWelcomeHtml}).then(function(i){i.data;utils.success("管理后台设置保存成功！")}).catch(function(i){utils.error(i)}).then(function(){utils.loading(i,!1)})},btnSubmitClick:function(){var i=this;this.$refs.form.validate(function(o){o&&i.apiSubmit()})},uploadBefore:i=>/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.webp)$/i.exec(i.name)?!!(i.size/1024/1024<10)||(utils.error("管理后台Logo图片大小不能超过 10MB!"),!1):(utils.error("管理后台Logo只能是图片格式，请选择有效的文件上传!"),!1),uploadProgress:function(){utils.loading(this,!0)},uploadSuccess:function(i,o,t){this.form.adminLogoUrl=i.value,utils.loading(this,!1),t.length>1&&t.splice(0,1)},uploadError:function(i){utils.loading(this,!1);var o=JSON.parse(i.message);utils.error(o.message)},uploadRemove(i){this.form.adminLogoUrl=null}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.uploadUrl=$apiUrl+$url+"/actions/upload",this.apiGet()}});