mirror of https://github.com/go-sonic/sonic.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
91 KiB
JavaScript
1 line
91 KiB
JavaScript
(function(){var e={35696:function(e,t,n){var a={"./af":92824,"./af.js":92824,"./ar":86445,"./ar-dz":14562,"./ar-dz.js":14562,"./ar-kw":7730,"./ar-kw.js":7730,"./ar-ly":91331,"./ar-ly.js":91331,"./ar-ma":40809,"./ar-ma.js":40809,"./ar-sa":12672,"./ar-sa.js":12672,"./ar-tn":40163,"./ar-tn.js":40163,"./ar.js":86445,"./az":75083,"./az.js":75083,"./be":35852,"./be.js":35852,"./bg":28418,"./bg.js":28418,"./bm":95530,"./bm.js":95530,"./bn":44399,"./bn-bd":24732,"./bn-bd.js":24732,"./bn.js":44399,"./bo":83423,"./bo.js":83423,"./br":98418,"./br.js":98418,"./bs":14699,"./bs.js":14699,"./ca":86158,"./ca.js":86158,"./cs":35163,"./cs.js":35163,"./cv":76502,"./cv.js":76502,"./cy":93355,"./cy.js":93355,"./da":63380,"./da.js":63380,"./de":92874,"./de-at":73181,"./de-at.js":73181,"./de-ch":71202,"./de-ch.js":71202,"./de.js":92874,"./dv":27182,"./dv.js":27182,"./el":61029,"./el.js":61029,"./en-au":15468,"./en-au.js":15468,"./en-ca":16079,"./en-ca.js":16079,"./en-gb":69774,"./en-gb.js":69774,"./en-ie":49746,"./en-ie.js":49746,"./en-il":95890,"./en-il.js":95890,"./en-in":58598,"./en-in.js":58598,"./en-nz":87070,"./en-nz.js":87070,"./en-sg":99443,"./en-sg.js":99443,"./eo":25428,"./eo.js":25428,"./es":57264,"./es-do":43750,"./es-do.js":43750,"./es-mx":52181,"./es-mx.js":52181,"./es-us":72533,"./es-us.js":72533,"./es.js":57264,"./et":19096,"./et.js":19096,"./eu":26370,"./eu.js":26370,"./fa":40825,"./fa.js":40825,"./fi":82152,"./fi.js":82152,"./fil":11640,"./fil.js":11640,"./fo":41632,"./fo.js":41632,"./fr":69766,"./fr-ca":79361,"./fr-ca.js":79361,"./fr-ch":56818,"./fr-ch.js":56818,"./fr.js":69766,"./fy":79648,"./fy.js":79648,"./ga":59419,"./ga.js":59419,"./gd":36828,"./gd.js":36828,"./gl":10159,"./gl.js":10159,"./gom-deva":37679,"./gom-deva.js":37679,"./gom-latn":92867,"./gom-latn.js":92867,"./gu":91590,"./gu.js":91590,"./he":90018,"./he.js":90018,"./hi":87153,"./hi.js":87153,"./hr":15280,"./hr.js":15280,"./hu":93224,"./hu.js":93224,"./hy-am":10545,"./hy-am.js":10545,"./id":40873,"./id.js":40873,"./is":12554,"./is.js":12554,"./it":67399,"./it-ch":73123,"./it-ch.js":73123,"./it.js":67399,"./ja":76119,"./ja.js":76119,"./jv":72974,"./jv.js":72974,"./ka":16687,"./ka.js":16687,"./kk":16014,"./kk.js":16014,"./km":72333,"./km.js":72333,"./kn":55870,"./kn.js":55870,"./ko":8414,"./ko.js":8414,"./ku":53436,"./ku.js":53436,"./ky":66429,"./ky.js":66429,"./lb":80083,"./lb.js":80083,"./lo":56916,"./lo.js":56916,"./lt":70206,"./lt.js":70206,"./lv":89798,"./lv.js":89798,"./me":77504,"./me.js":77504,"./mi":41602,"./mi.js":41602,"./mk":49053,"./mk.js":49053,"./ml":98358,"./ml.js":98358,"./mn":19713,"./mn.js":19713,"./mr":98513,"./mr.js":98513,"./ms":82054,"./ms-my":21170,"./ms-my.js":21170,"./ms.js":82054,"./mt":66098,"./mt.js":66098,"./my":56662,"./my.js":56662,"./nb":95386,"./nb.js":95386,"./ne":6839,"./ne.js":6839,"./nl":70962,"./nl-be":24941,"./nl-be.js":24941,"./nl.js":70962,"./nn":48865,"./nn.js":48865,"./oc-lnc":90497,"./oc-lnc.js":90497,"./pa-in":6236,"./pa-in.js":6236,"./pl":6898,"./pl.js":6898,"./pt":10525,"./pt-br":31392,"./pt-br.js":31392,"./pt.js":10525,"./ro":98541,"./ro.js":98541,"./ru":89845,"./ru.js":89845,"./sd":78838,"./sd.js":78838,"./se":32361,"./se.js":32361,"./si":18705,"./si.js":18705,"./sk":88843,"./sk.js":88843,"./sl":91893,"./sl.js":91893,"./sq":38771,"./sq.js":38771,"./sr":90457,"./sr-cyrl":82486,"./sr-cyrl.js":82486,"./sr.js":90457,"./ss":53202,"./ss.js":53202,"./sv":93231,"./sv.js":93231,"./sw":49441,"./sw.js":49441,"./ta":97474,"./ta.js":97474,"./te":71241,"./te.js":71241,"./tet":5927,"./tet.js":5927,"./tg":43677,"./tg.js":43677,"./th":57613,"./th.js":57613,"./tk":71089,"./tk.js":71089,"./tl-ph":82050,"./tl-ph.js":82050,"./tlh":6121,"./tlh.js":6121,"./tr":76180,"./tr.js":76180,"./tzl":29006,"./tzl.js":29006,"./tzm":1507,"./tzm-latn":64320,"./tzm-latn.js":64320,"./tzm.js":1507,"./ug-cn":8638,"./ug-cn.js":8638,"./uk":22759,"./uk.js":22759,"./ur":19478,"./ur.js":19478,"./uz":2001,"./uz-latn":95236,"./uz-latn.js":95236,"./uz.js":2001,"./vi":11937,"./vi.js":11937,"./x-pseudo":19779,"./x-pseudo.js":19779,"./yo":90947,"./yo.js":90947,"./zh-cn":55232,"./zh-cn.js":55232,"./zh-hk":80558,"./zh-hk.js":80558,"./zh-mo":2862,"./zh-mo.js":2862,"./zh-tw":92161,"./zh-tw.js":92161};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=r,e.exports=i,i.id=35696},83247:function(e,t){"use strict";t["Z"]={primaryColor:"#1890FF",navTheme:"dark",layout:"sidemenu",contentWidth:"Fixed",fixedHeader:!1,fixedSidebar:!0,autoHideHeader:!1,storageOptions:{namespace:"HALO__",name:"ls",storage:"local"}}},7439:function(e,t,n){"use strict";n.d(t,{j:function(){return i},k:function(){return r}});n(31875),n(29888),n(45107);var a=n(53298),i=[{path:"/",name:"index",component:a.iO,meta:{title:"首页"},redirect:"/dashboard",children:[{path:"/dashboard",name:"Dashboard",component:function(){return n.e(667).then(n.bind(n,8667))},meta:{title:"仪表盘",icon:"dashboard",hiddenHeaderContent:!1,keepAlive:!1}},{path:"/posts",name:"Posts",component:a.it,redirect:"/posts/list",meta:{title:"文章",icon:"form"},children:[{path:"/posts/list",name:"PostList",component:function(){return Promise.all([n.e(105),n.e(756),n.e(530),n.e(361)]).then(n.bind(n,89361))},meta:{title:"所有文章",hiddenHeaderContent:!1}},{path:"/posts/write",name:"PostWrite",component:function(){return Promise.all([n.e(105),n.e(799),n.e(530),n.e(214)]).then(n.bind(n,84214))},meta:{title:"写文章",hiddenHeaderContent:!1,keepAlive:!1}},{path:"/posts/edit",name:"PostEdit",hidden:!0,component:function(){return Promise.all([n.e(105),n.e(799),n.e(530),n.e(214)]).then(n.bind(n,84214))},meta:{title:"编辑文章",hiddenHeaderContent:!1,keepAlive:!1}},{path:"/categories",name:"CategoryList",component:function(){return Promise.all([n.e(513),n.e(562)]).then(n.bind(n,47562))},meta:{title:"分类目录",hiddenHeaderContent:!1}},{path:"/tags",name:"TagList",component:function(){return Promise.all([n.e(154),n.e(271)]).then(n.bind(n,68271))},meta:{title:"标签",hiddenHeaderContent:!1}}]},{path:"/sheets",name:"Sheets",component:a.it,redirect:"/sheets/list",meta:{title:"页面",icon:"read"},children:[{path:"/sheets/list",name:"SheetList",component:function(){return Promise.all([n.e(105),n.e(756),n.e(899),n.e(828)]).then(n.bind(n,9828))},meta:{title:"所有页面",hiddenHeaderContent:!1}},{path:"/sheets/write",name:"SheetWrite",component:function(){return Promise.all([n.e(105),n.e(799),n.e(899),n.e(265)]).then(n.bind(n,25265))},meta:{title:"新建页面",hiddenHeaderContent:!1,keepAlive:!1}},{path:"/sheets/edit",name:"SheetEdit",hidden:!0,component:function(){return Promise.all([n.e(105),n.e(799),n.e(899),n.e(265)]).then(n.bind(n,25265))},meta:{title:"编辑页面",hiddenHeaderContent:!1,keepAlive:!1}},{path:"/sheets/links",name:"LinkList",hidden:!0,component:function(){return Promise.all([n.e(513),n.e(702)]).then(n.bind(n,71702))},meta:{title:"友情链接",hiddenHeaderContent:!1}},{path:"/sheets/photos",name:"PhotoList",hidden:!0,component:function(){return n.e(379).then(n.bind(n,24379))},meta:{title:"图库",hiddenHeaderContent:!1}},{path:"/sheets/journals",name:"JournalList",hidden:!0,component:function(){return Promise.all([n.e(799),n.e(756),n.e(766)]).then(n.bind(n,24766))},meta:{title:"日志",hiddenHeaderContent:!1}}]},{path:"/attachments",name:"Attachments",component:function(){return n.e(187).then(n.bind(n,99187))},meta:{title:"附件",icon:"picture",hiddenHeaderContent:!1}},{path:"/comments",name:"Comments",component:function(){return n.e(782).then(n.bind(n,14782))},meta:{title:"评论",icon:"message",hiddenHeaderContent:!1}},{path:"/interface",name:"Interface",component:a.it,redirect:"/interface/themes",meta:{title:"外观",icon:"skin"},children:[{path:"/interface/themes",name:"ThemeList",component:function(){return n.e(107).then(n.bind(n,1107))},meta:{title:"主题",hiddenHeaderContent:!1}},{path:"/interface/themes/setting",name:"ThemeSetting",component:function(){return Promise.all([n.e(154),n.e(948)]).then(n.bind(n,53948))},meta:{title:"主题设置",hiddenHeaderContent:!1}},{path:"/interface/themes/edit",name:"ThemeEdit",component:function(){return Promise.all([n.e(788),n.e(192),n.e(549)]).then(n.bind(n,13549))},meta:{title:"主题编辑",hiddenHeaderContent:!1}},{path:"/interface/menus",name:"MenuList",component:function(){return Promise.all([n.e(513),n.e(726)]).then(n.bind(n,95726))},meta:{title:"菜单设置",hiddenHeaderContent:!1}}]},{path:"/user",name:"User",component:a.B4,redirect:"/user/profile",meta:{title:"用户",icon:"user"},children:[{path:"/user/profile",name:"Profile",component:function(){return n.e(37).then(n.bind(n,1037))},meta:{title:"个人资料",hiddenHeaderContent:!1}}]},{path:"/system",name:"System",component:a.it,redirect:"/system/options",meta:{title:"系统",icon:"setting"},children:[{path:"/system/developer/options",name:"DeveloperOptions",hidden:!0,component:function(){return n.e(336).then(n.bind(n,29336))},meta:{title:"开发者选项",hiddenHeaderContent:!1}},{path:"/system/options",name:"SystemOptions",component:function(){return n.e(994).then(n.bind(n,70799))},meta:{title:"博客设置",hiddenHeaderContent:!1}},{path:"/system/tools",name:"ToolList",component:function(){return Promise.all([n.e(164),n.e(875)]).then(n.bind(n,56875))},meta:{title:"小工具",hiddenHeaderContent:!1}},{path:"/system/actionlogs",name:"SystemActionLogs",hidden:!0,component:function(){return n.e(163).then(n.bind(n,65163))},meta:{title:"操作日志",hiddenHeaderContent:!1}},{path:"/system/about",name:"About",component:function(){return n.e(84).then(n.bind(n,65084))},meta:{title:"关于",hiddenHeaderContent:!1}}]}]},{path:"/interface/themes/setting/visual",name:"ThemeVisualSetting",hidden:!0,component:function(){return Promise.all([n.e(154),n.e(68)]).then(n.bind(n,62068))},meta:{title:"主题设置",hiddenHeaderContent:!1}},{path:"*",redirect:"/404",hidden:!0}],r=[{path:"/login",name:"Login",meta:{title:"登录"},component:function(){return n.e(712).then(n.bind(n,28712))}},{path:"/install",name:"Install",meta:{title:"安装向导"},component:function(){return n.e(307).then(n.bind(n,20307))}},{path:"/password/reset",name:"ResetPassword",meta:{title:"重置密码"},component:function(){return n.e(805).then(n.bind(n,52805))}},{path:"/404",name:"NotFound",component:function(){return n.e(933).then(n.bind(n,45933))}}]},43376:function(e,t,n){"use strict";n.d(t,{og:function(){return i},o6:function(){return r},Js:function(){return o},k:function(){return s},hh:function(){return l},JQ:function(){return u},nM:function(){return c},z$:function(){return d},Zi:function(){return m},v$:function(){return p}});var a=n(22373),i={bold:!0,italic:!0,header:!0,underline:!0,strikethrough:!0,superscript:!0,subscript:!0,quote:!0,ol:!0,ul:!0,link:!0,imagelink:!0,code:!0,table:!0,undo:!0,redo:!0,save:!0,navigation:!0,subfield:!0,fullscreen:!0,readmodel:!0,htmlcode:!0,preview:!0},r={bold:!0,italic:!0,header:!0,underline:!0,strikethrough:!0,superscript:!0,subscript:!0,quote:!0,ol:!0,ul:!0,link:!0,imagelink:!0,code:!0,table:!0,undo:!0,redo:!0,subfield:!0,htmlcode:!0,preview:!0},o={BLOG_INITIALIZED:{value:0,text:"博客初始化"},POST_PUBLISHED:{value:5,text:"文章发布"},POST_EDITED:{value:15,text:"文章修改"},POST_DELETED:{value:20,text:"文章删除"},LOGGED_IN:{value:25,text:"用户登录"},LOGGED_OUT:{value:30,text:"注销登录"},LOGIN_FAILED:{value:35,text:"登录失败"},PASSWORD_UPDATED:{value:40,text:"修改密码"},PROFILE_UPDATED:{value:45,text:"资料修改"},SHEET_PUBLISHED:{value:50,text:"页面发布"},SHEET_EDITED:{value:55,text:"页面修改"},SHEET_DELETED:{value:60,text:"页面删除"},MFA_UPDATED:{value:65,text:"两步验证"},LOGGED_PRE_CHECK:{value:70,text:"登录验证"}},s={LOCAL:{type:"LOCAL",text:"本地"},SMMS:{type:"SMMS",text:"SM.MS"},UPOSS:{type:"UPOSS",text:"又拍云"},QINIUOSS:{type:"QINIUOSS",text:"七牛云"},ALIOSS:{type:"ALIOSS",text:"阿里云"},BAIDUBOS:{type:"BAIDUBOS",text:"百度云"},TENCENTCOS:{type:"TENCENTCOS",text:"腾讯云"},HUAWEIOBS:{type:"HUAWEIOBS",text:"华为云"},MINIO:{type:"MINIO",text:"MinIO"}},l={PUBLISHED:{value:"PUBLISHED",color:"green",status:"success",text:"已发布"},INTIMATE:{value:"INTIMATE",color:"blue",status:"success",text:"私密"},DRAFT:{value:"DRAFT",color:"yellow",status:"warning",text:"草稿"}},u=(0,a.Z)((0,a.Z)({},l),{},{RECYCLE:{value:"RECYCLE",color:"red",status:"error",text:"回收站"}}),c=[{title:"标题",dataIndex:"title",width:"200px",ellipsis:!0,scopedSlots:{customRender:"postTitle"}},{title:"状态",dataIndex:"status",width:"100px",scopedSlots:{customRender:"status"}},{title:"分类",dataIndex:"categories",scopedSlots:{customRender:"categories"}},{title:"标签",dataIndex:"tags",scopedSlots:{customRender:"tags"}},{title:"评论",width:"70px",dataIndex:"commentCount",scopedSlots:{customRender:"commentCount"}},{title:"访问",width:"70px",dataIndex:"visits",scopedSlots:{customRender:"visits"}},{title:"发布时间",dataIndex:"createTime",width:"170px",scopedSlots:{customRender:"createTime"}},{title:"操作",width:"180px",scopedSlots:{customRender:"action"}}],d=[{title:"标题",dataIndex:"title",width:"200px",ellipsis:!0,scopedSlots:{customRender:"postTitle"}},{title:"分类",dataIndex:"categories",scopedSlots:{customRender:"categories"}},{title:"标签",dataIndex:"tags",scopedSlots:{customRender:"tags"}},{title:"评论",width:"70px",dataIndex:"commentCount",scopedSlots:{customRender:"commentCount"}},{title:"访问",width:"70px",dataIndex:"visits",scopedSlots:{customRender:"visits"}},{title:"操作",width:"180px",scopedSlots:{customRender:"action"}}],m={PUBLISHED:{color:"green",status:"success",text:"已发布",value:"PUBLISHED"},DRAFT:{color:"yellow",status:"warning",text:"草稿",value:"DRAFT"},RECYCLE:{color:"red",status:"error",text:"回收站",value:"RECYCLE"}},p={PUBLISHED:{value:"PUBLISHED",color:"green",status:"success",text:"已发布"},AUDITING:{value:"AUDITING",color:"yellow",status:"warning",text:"待审核"},RECYCLE:{value:"RECYCLE",color:"red",status:"error",text:"回收站"}}},53298:function(e,t,n){"use strict";n.d(t,{iO:function(){return Ke},it:function(){return d},B4:function(){return Xe}});var a,i,r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("router-view")],1)},o=[],s={name:"BlankLayout"},l=s,u=n(70739),c=(0,u.Z)(l,r,o,!1,null,null,null),d=c.exports,m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-layout",{class:["layout",e.device]},[e.isMobile()?n("a-drawer",{attrs:{closable:!1,visible:e.collapsed,wrapClassName:"drawer-sider "+e.navTheme,placement:"left"},on:{close:e.drawerClose}},[n("side-menu",{attrs:{collapsed:!1,collapsible:!0,menus:e.menus,theme:e.navTheme,mode:"inline"},on:{menuSelect:e.menuSelect}})],1):e.isSideMenu()?n("side-menu",{attrs:{collapsed:e.collapsed,collapsible:!0,menus:e.menus,theme:e.navTheme,mode:"inline"}}):e._e(),n("a-layout",{class:[e.layoutMode,"content-width-"+e.contentWidth],style:{paddingLeft:e.contentPaddingLeft,minHeight:"100vh"}},[n("global-header",{attrs:{collapsed:e.collapsed,device:e.device,menus:e.menus,mode:e.layoutMode,theme:e.navTheme},on:{toggle:e.toggle}}),n("a-layout-content",{style:{height:"100%",margin:"24px 24px 0",paddingTop:e.fixedHeader?"64px":"0"}},[n("transition",{attrs:{name:"page-transition"}},[n("route-view")],1)],1),n("a-layout-footer",[n("global-footer")],1)],1),n("setting-drawer",{ref:"drawer"}),n("LoginModal",{on:{success:e.onLoginSucceed}})],1)},p=[],h=n(22373),f=(n(62888),n(31875),n(22573)),g=n(98906),v=n(94370),b=n(83247),y=n(7439),x={name:"RouteView",props:{keepAlive:{type:Boolean,default:!0}},data:function(){return{}},render:function(){var e=arguments[0],t=this.$route.meta,n=e("keep-alive",[e("router-view")]),a=e("router-view");return!1===t.keepAlive?a:this.keepAlive||t.keepAlive?n:a}},_=x,k=(0,u.Z)(_,a,i,!1,null,null,null),C=k.exports,T=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-layout-sider",{class:["sider",e.isDesktop()?null:"shadow",e.theme,e.fixedSidebar?"ant-fixed-sidemenu":null],attrs:{collapsible:e.collapsible,trigger:null,width:"256px"},model:{value:e.collapsed,callback:function(t){e.collapsed=t},expression:"collapsed"}},[n("logo"),n("s-menu",{staticStyle:{padding:"16px 0px"},attrs:{collapsed:e.collapsed,menu:e.menus,mode:e.mode,theme:e.theme},on:{select:e.onSelect}})],1)},S=[],E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"logo"},[n("img",{staticClass:"select-none cursor-pointer hover:brightness-125 transition-all",style:{width:e.sidebarOpened?"64px":"48px"},attrs:{alt:"Sonic Logo",src:"/images/logo.png"},on:{click:function(t){return e.onLogoClick()}}})])},w=[],L=n(54288),Z=(n(70315),n(36591)),j=n(30826),I=n.n(j),A={name:"Logo",mixins:[v.jB],data:function(){return{clickCount:0}},computed:(0,h.Z)({},(0,g.Se)(["options"])),methods:(0,h.Z)((0,h.Z)({},(0,g.nv)(["refreshOptionsCache"])),{},{onLogoClick:I()((0,L.Z)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.clickCount++,10!==this.clickCount){e.next=16;break}return e.prev=2,e.next=5,Z.Z.option.saveMapView({developer_mode:!0});case 5:return e.next=7,this.refreshOptionsCache();case 7:this.$message.success("开发者选项已启用!"),this.clickCount=0,this.$router.push({name:"ToolList"}).catch((function(){})),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](2),this.$log.error(e.t0);case 15:return e.abrupt("return");case 16:this.clickCount>=5&&(this.options.developer_mode?(this.$message.info("当前已启用开发者选项!"),this.clickCount=0):this.$message.info("再点击 ".concat(10-this.clickCount," 次即可启用开发者选项!")));case 17:case"end":return e.stop()}}),e,this,[[2,12]])}))),200)})},O=A,P=(0,u.Z)(O,E,w,!1,null,null,null),H=P.exports,M=n(64689),D=n.n(M),$=n(64349),R=(n(18482),n(41479),n(2923),n(18329),n(21082),n(82395),n(64575)),F=n(48702),B={name:"SMenu",props:{menu:{type:Array,required:!0},theme:{type:String,required:!1,default:"dark"},mode:{type:String,required:!1,default:"inline"},collapsed:{type:Boolean,required:!1,default:!1}},data:function(){return{openKeys:[],selectedKeys:[],cachedOpenKeys:[]}},computed:{rootSubmenuKeys:function(e){var t=[];return e.menu.forEach((function(e){return t.push(e.path)})),t}},created:function(){this.updateMenu()},watch:{collapsed:function(e){e?(this.cachedOpenKeys=this.openKeys.concat(),this.openKeys=[]):this.openKeys=this.cachedOpenKeys},$route:function(){this.updateMenu()}},methods:{onOpenChange:function(e){var t=this;if("horizontal"!==this.mode){var n=e.find((function(e){return!t.openKeys.includes(e)}));this.rootSubmenuKeys.includes(n)?this.openKeys=n?[n]:[]:this.openKeys=e}else this.openKeys=e},onSelect:function(e){var t=e.item,n=e.key,a=e.selectedKeys;this.selectedKeys=a,this.$emit("select",{item:t,key:n,selectedKeys:a})},updateMenu:function(){var e=this.$route.matched.concat();e.length>=4&&this.$route.meta.hidden?(e.pop(),this.selectedKeys=[e[2].path]):this.selectedKeys=[e.pop().path];var t=[];"inline"===this.mode&&e.forEach((function(e){t.push(e.path)})),this.collapsed?this.cachedOpenKeys=t:this.openKeys=t},renderItem:function(e){return e.hidden?null:e.children&&!e.hideChildrenInMenu?this.renderSubMenu(e):this.renderMenuItem(e)},renderMenuItem:function(e){var t=this.$createElement,n=e.meta.target||null,a=n?"a":"router-link",i={to:{name:e.name}},r={href:e.path,target:e.meta.target};return t(R.ZP.Item,D()([{},{key:e.path}]),[t(a,{props:(0,h.Z)({},i),attrs:(0,h.Z)({},r)},[this.renderIcon(e.meta.icon),t("span",[e.meta.title])])])},renderSubMenu:function(e){var t=this,n=this.$createElement,a=[];return e.hideChildrenInMenu||e.children.forEach((function(e){return a.push(t.renderItem(e))})),n(R.ZP.SubMenu,D()([{},{key:e.path}]),[n("span",{slot:"title"},[this.renderIcon(e.meta.icon),n("span",[e.meta.title])]),a])},renderIcon:function(e){var t=this.$createElement;if("none"===e||void 0===e)return null;var n={};return"object"===(0,$.Z)(e)?n.component=e:n.type=e,t(F.Z,{props:(0,h.Z)({},n)})}},render:function(){var e=this,t=arguments[0],n={props:{mode:this.mode,theme:this.theme,openKeys:this.openKeys,selectedKeys:this.selectedKeys},on:{openChange:this.onOpenChange,select:this.onSelect}},a=this.menu.map((function(t){return t.hidden?null:e.renderItem(t)}));return t(R.ZP,D()([{},n]),[a])}},N=B,G={name:"SideMenu",components:{Logo:H,SMenu:N},mixins:[v.jB,v.KT],props:{mode:{type:String,required:!1,default:"inline"},theme:{type:String,required:!1,default:"dark"},collapsible:{type:Boolean,required:!1,default:!1},collapsed:{type:Boolean,required:!1,default:!1},menus:{type:Array,required:!0}},methods:{onSelect:function(e){this.$emit("menuSelect",e)}}},U=G,K=(0,u.Z)(U,T,S,!1,null,null,null),z=K.exports,V=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"showHeader"}},[e.visible?n("a-layout-header",{class:[e.fixedHeader&&"ant-header-fixedHeader",e.sidebarOpened?"ant-header-side-opened":"ant-header-side-closed"],staticStyle:{padding:"0"}},["sidemenu"===e.mode?n("div",{staticClass:"header"},["mobile"===e.device?n("a-icon",{staticClass:"trigger",attrs:{type:e.collapsed?"menu-fold":"menu-unfold"},on:{click:e.toggle}}):n("a-icon",{staticClass:"trigger",attrs:{type:e.collapsed?"menu-unfold":"menu-fold"},on:{click:e.toggle}}),n("user-menu")],1):n("div",{class:["top-nav-header-index",e.theme]},[n("div",{staticClass:"header-index-wide"},[n("div",{staticClass:"header-index-left"},["mobile"!==e.device?n("logo",{staticClass:"top-nav-header"}):e._e(),"mobile"!==e.device?n("s-menu",{attrs:{menu:e.menus,theme:e.theme,mode:"horizontal"}}):n("a-icon",{staticClass:"trigger",attrs:{type:e.collapsed?"menu-fold":"menu-unfold"},on:{click:e.toggle}})],1),n("user-menu",{staticClass:"header-index-right"})],1)])]):e._e()],1)},Y=[],q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"user-wrapper"},[n("a",{attrs:{href:e.options.blog_url,target:"_blank"}},[n("a-tooltip",{attrs:{placement:"bottom",title:"点击跳转到首页"}},[n("span",{staticClass:"action"},[n("a-icon",{attrs:{type:"link"}})],1)])],1),n("a",{attrs:{href:"javascript:void(0)"},on:{click:e.handleShowLayoutSetting}},[n("a-tooltip",{attrs:{placement:"bottom",title:"后台布局设置"}},[n("span",{staticClass:"action"},[n("a-icon",{attrs:{type:"setting"}})],1)])],1),n("header-comment",{staticClass:"action"}),n("a-dropdown",[e.user?n("span",{staticClass:"action ant-dropdown-link user-dropdown-menu"},[n("a-avatar",{staticClass:"avatar",attrs:{src:e.user.avatar||"//cn.gravatar.com/avatar/?s=256&d=mm",size:"small"}})],1):e._e(),n("a-menu",{staticClass:"user-dropdown-menu-wrapper",attrs:{slot:"overlay"},slot:"overlay"},[n("a-menu-item",{key:"0"},[n("router-link",{attrs:{to:{name:"Profile"}}},[n("a-icon",{attrs:{type:"user"}}),n("span",[e._v("个人资料")])],1)],1),n("a-menu-divider"),n("a-menu-item",{key:"1"},[n("a",{attrs:{href:"javascript:void(0);"},on:{click:e.handleLogout}},[n("a-icon",{attrs:{type:"logout"}}),n("span",[e._v("退出登录")])],1)])],1)],1)],1)},W=[],X=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-popover",{attrs:{arrowPointAtCenter:!0,autoAdjustOverflow:!0,overlayStyle:{width:"400px",top:"50px"},overlayClassName:"header-comment-popover",placement:"bottomRight",title:"待审核评论",trigger:"click"},scopedSlots:e._u([{key:"content",fn:function(){return[n("div",{staticClass:"custom-tab-wrapper"},[n("a-tabs",{attrs:{animated:{inkBar:!0,tabPane:!1}},on:{change:e.handleListAuditingComments},model:{value:e.activeKey,callback:function(t){e.activeKey=t},expression:"activeKey"}},e._l(e.targets,(function(t){return n("a-tab-pane",{key:t.key,attrs:{tab:t.label}},[n("CommentListView",{attrs:{comments:e.comments[t.dataKey],loading:e.comments.loading,clickable:""},on:{click:function(n){return e.handleRouteToCommentList(arguments[0],t)}}})],1)})),1)],1)]},proxy:!0}])},[n("span",{staticClass:"inline-block transition-all"},[e.comments.post.length||e.comments.sheet.length||e.comments.journal.length?n("a-badge",{attrs:{dot:""}},[n("a-icon",{attrs:{type:"bell"}})],1):n("a-badge",[n("a-icon",{attrs:{type:"bell"}})],1)],1)])},Q=[],J=(n(29888),n(45107),n(43376)),ee=[{key:"posts",dataKey:"post",label:"文章"},{key:"sheets",dataKey:"sheet",label:"页面"},{key:"journals",dataKey:"journal",label:"日志"}],te={name:"HeaderComment",data:function(){return{targets:ee,activeKey:"posts",comments:{post:[],sheet:[],journal:[],loading:!1}}},created:function(){this.handleListAuditingComments()},methods:{handleListAuditingComments:function(){var e=this;return(0,L.Z)(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.comments.loading=!0,n={status:"AUDITING",size:20},t.next=5,Promise.all(ee.map((function(e){return Z.Z.comment.list(e.key,n)})));case 5:a=t.sent,e.comments.post=a[0].data.content,e.comments.sheet=a[1].data.content,e.comments.journal=a[2].data.content,t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),e.$log.error("Failed to get auditing comments",t.t0);case 14:return t.prev=14,e.comments.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,11,14,17]])})))()},handleRouteToCommentList:function(e,t){this.$log.debug("Handle click auditing comment",e,t);var n=this.$router.currentRoute.name;this.$router.push({name:"Comments",query:{activeKey:t.dataKey,defaultStatus:J.v$.AUDITING.value}}),"Comments"===n&&this.$router.go(0)}}},ne=te,ae=(0,u.Z)(ne,X,Q,!1,null,null,null),ie=ae.exports,re={name:"UserMenu",components:{HeaderComment:ie},computed:(0,h.Z)({},(0,g.Se)(["user","options"])),methods:(0,h.Z)((0,h.Z)({},(0,g.nv)(["logout","ToggleLayoutSetting"])),{},{handleLogout:function(){var e=this;this.$confirm({title:"提示",content:"确定要注销登录吗 ?",onOk:function(){var t=(0,L.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.logout();case 3:window.location.reload(),t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](0),e.$message.error({title:"错误",description:t.t0.message});case 9:case"end":return t.stop()}}),t,null,[[0,6]])})));function n(){return t.apply(this,arguments)}return n}()})},handleShowLayoutSetting:function(){this.ToggleLayoutSetting(!0)}})},oe=re,se=(0,u.Z)(oe,q,W,!1,null,null,null),le=se.exports,ue={name:"GlobalHeader",components:{UserMenu:le,SMenu:N,Logo:H},mixins:[v.jB],props:{mode:{type:String,default:"sidemenu"},menus:{type:Array,required:!0},theme:{type:String,required:!1,default:"dark"},collapsed:{type:Boolean,required:!1,default:!1},device:{type:String,required:!1,default:"desktop"}},data:function(){return{visible:!0,oldScrollTop:0}},mounted:function(){document.addEventListener("scroll",this.handleScroll,{passive:!0})},methods:{handleScroll:function(){var e=this;if(this.autoHideHeader){var t=document.body.scrollTop+document.documentElement.scrollTop;this.ticking||(this.ticking=!0,requestAnimationFrame((function(){e.oldScrollTop>t?e.visible=!0:t>300&&e.visible?e.visible=!1:t<300&&!e.visible&&(e.visible=!0),e.oldScrollTop=t,e.ticking=!1})))}},toggle:function(){this.$emit("toggle")}},beforeDestroy:function(){document.body.removeEventListener("scroll",this.handleScroll,!0)}},ce=ue,de=(0,u.Z)(ce,V,Y,!1,null,null,null),me=de.exports,pe=me,he=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"footer text-center",staticStyle:{padding:"0 16px",margin:"48px 0 0"}},[n("div",{staticClass:"copyright",staticStyle:{color:"rgba(0, 0, 0, 0.45)","font-size":"14px"}},[e._v(" Powered by "),n("router-link",{attrs:{to:{name:"About"}}},[e._v(" Halo ")])],1)])},fe=[],ge={name:"GlobalFooter"},ve=ge,be=(0,u.Z)(ve,he,fe,!1,null,null,null),ye=be.exports,xe=ye,_e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"settingDrawer",staticClass:"setting-drawer"},[n("a-drawer",{attrs:{visible:e.layoutSetting,closable:"",width:"300"},on:{close:e.onClose}},[n("div",{staticClass:"setting-drawer-index-content"},[n("div",{staticClass:"mb-6"},[n("h3",{staticClass:"setting-drawer-index-title"},[e._v("整体风格设置")]),n("div",{staticClass:"setting-drawer-index-blockChecbox"},[n("a-tooltip",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v("暗色菜单风格")]},proxy:!0}])},[n("div",{staticClass:"setting-drawer-index-item",on:{click:function(t){return e.handleSetMenuTheme("dark")}}},[n("img",{attrs:{alt:"dark",src:"/images/dark.svg"}}),"dark"===e.navTheme?n("div",{staticClass:"setting-drawer-index-selectIcon"},[n("a-icon",{attrs:{type:"check"}})],1):e._e()])]),n("a-tooltip",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v("亮色菜单风格")]},proxy:!0}])},[n("div",{staticClass:"setting-drawer-index-item",on:{click:function(t){return e.handleSetMenuTheme("light")}}},[n("img",{attrs:{alt:"light",src:"/images/light.svg"}}),"dark"!==e.navTheme?n("div",{staticClass:"setting-drawer-index-selectIcon"},[n("a-icon",{attrs:{type:"check"}})],1):e._e()])])],1)]),n("a-divider"),n("div",{staticClass:"mb-6"},[n("h3",{staticClass:"setting-drawer-index-title"},[e._v("主题色")]),n("div",{staticClass:"h-5"},e._l(e.colorList,(function(t,a){return n("a-tooltip",{key:a,staticClass:"setting-drawer-theme-color-colorBlock",scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(t.key))]},proxy:!0}],null,!0)},[n("a-tag",{attrs:{color:t.color},on:{click:function(n){return e.handleChangeColor(t.color)}}},[t.color===e.primaryColor?n("a-icon",{attrs:{type:"check"}}):e._e()],1)],1)})),1)]),n("a-divider"),n("div",{staticClass:"mb-6"},[n("h3",{staticClass:"setting-drawer-index-title"},[e._v("导航模式")]),n("div",{staticClass:"setting-drawer-index-blockChecbox"},[n("div",{staticClass:"setting-drawer-index-item",on:{click:function(t){return e.handleSetLayout("sidemenu")}}},[n("img",{attrs:{alt:"sidemenu",src:"/images/sidemenu.svg"}}),"sidemenu"===e.layoutMode?n("div",{staticClass:"setting-drawer-index-selectIcon"},[n("a-icon",{attrs:{type:"check"}})],1):e._e()]),n("div",{staticClass:"setting-drawer-index-item",on:{click:function(t){return e.handleSetLayout("topmenu")}}},[n("img",{attrs:{alt:"topmenu",src:"/images/topmenu.svg"}}),"sidemenu"!==e.layoutMode?n("div",{staticClass:"setting-drawer-index-selectIcon"},[n("a-icon",{attrs:{type:"check"}})],1):e._e()])])]),n("a-divider"),n("div",{staticClass:"mt-6"},[n("a-list",{attrs:{split:!1}},[n("a-list-item",{scopedSlots:e._u([{key:"actions",fn:function(){return[n("a-tooltip",{scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" 该设定仅 [顶部栏导航] 时有效")]},proxy:!0}])},[n("a-select",{staticStyle:{width:"80px"},attrs:{disabled:"topmenu"!==e.layoutMode,value:e.contentWidth,size:"small"},on:{change:e.handleContentWidthChange}},[n("a-select-option",{attrs:{value:"Fixed"}},[e._v("固定")]),"sidemenu"!==e.layoutMode?n("a-select-option",{attrs:{value:"Fluid"}},[e._v("流式")]):e._e()],1)],1)]},proxy:!0}])},[n("a-list-item-meta",{scopedSlots:e._u([{key:"title",fn:function(){return[n("div",[e._v("内容区域宽度")])]},proxy:!0}])})],1),n("a-list-item",{scopedSlots:e._u([{key:"actions",fn:function(){return[n("a-switch",{attrs:{checked:e.fixedHeader,size:"small"},on:{change:e.handleSetFixedHeader}})]},proxy:!0}])},[n("a-list-item-meta",{scopedSlots:e._u([{key:"title",fn:function(){return[n("div",[e._v("固定 Header")])]},proxy:!0}])})],1),n("a-list-item",{scopedSlots:e._u([{key:"actions",fn:function(){return[n("a-switch",{attrs:{checked:e.autoHideHeader,disabled:!e.fixedHeader,size:"small"},on:{change:e.handleSetAutoHideHeader}})]},proxy:!0}])},[n("a-list-item-meta",{scopedSlots:e._u([{key:"title",fn:function(){return[n("a-tooltip",{attrs:{placement:"left"},scopedSlots:e._u([{key:"title",fn:function(){return[e._v("固定 Header 时可配置")]},proxy:!0}])},[n("div",{style:{opacity:e.fixedHeader?"1":"0.5"}},[e._v("下滑时隐藏 Header")])])]},proxy:!0}])})],1),n("a-list-item",{scopedSlots:e._u([{key:"actions",fn:function(){return[n("a-switch",{attrs:{checked:e.fixedSidebar,disabled:"topmenu"===e.layoutMode,size:"small"},on:{change:e.handleSetFixedSidebar}})]},proxy:!0}])},[n("a-list-item-meta",{scopedSlots:e._u([{key:"title",fn:function(){return[n("div",{style:{opacity:"topmenu"===e.layoutMode?"0.5":"1"}},[e._v("固定侧边菜单")])]},proxy:!0}])})],1)],1)],1),n("a-divider")],1)])],1)},ke=[],Ce=[{key:"红色",color:"#F5222D"},{key:"浅红色",color:"#FA541C"},{key:"日暮",color:"#FAAD14"},{key:"青色",color:"#13C2C2"},{key:"绿色",color:"#52C41A"},{key:"默认",color:"#1890FF"},{key:"蓝色",color:"#2F54EB"},{key:"紫色",color:"#722ED1"}],Te=(n(67395),n(93418),n(30535),n(85018),n(66480)),Se=n.n(Te),Ee=n(87724),we=n.n(Ee),Le=n(36725),Ze={getAntdSerials:function(e){var t=new Array(9).fill().map((function(t,n){return Se().varyColor.lighten(e,n/10)})),n=we()(e),a=Se().varyColor.toNum3(e.replace("#","")).join(",");return t.concat(n).concat(a)},changeColor:function(e){var t={newColors:this.getAntdSerials(e),changeUrl:function(e){return"/".concat(e)}};return Se().changer.changeColor(t,Promise)}},je=function(e){var t=Le.Z.loading("正在切换主题",0);Ze.changeColor(e).then((function(){t()}))},Ie={mixins:[v.jB,v.KT],data:function(){return{colorList:Ce,baseConfig:Object.assign({},b.Z)}},watch:{},mounted:function(){this.primaryColor!==b.Z.primaryColor&&je(this.primaryColor)},computed:(0,h.Z)({},(0,g.Se)(["layoutSetting"])),methods:(0,h.Z)((0,h.Z)({},(0,g.nv)(["setSidebar","ToggleLayoutSetting"])),{},{onClose:function(){this.ToggleLayoutSetting(!1)},handleSetMenuTheme:function(e){this.baseConfig.navTheme=e,this.$store.dispatch("ToggleTheme",e)},handleSetLayout:function(e){this.baseConfig.layout=e,this.$store.dispatch("ToggleLayoutMode",e),"sidemenu"===e?(this.handleContentWidthChange("Fixed"),this.handleSetFixedSidebar(!0)):(this.handleSetFixedHeader(!0),this.handleSetFixedSidebar(!1),this.$store.dispatch("setSidebar",!0))},handleContentWidthChange:function(e){this.baseConfig.contentWidth=e,this.$store.dispatch("ToggleContentWidth",e)},handleChangeColor:function(e){this.baseConfig.primaryColor=e,this.primaryColor!==e&&(this.$store.dispatch("ToggleColor",e),je(e))},handleSetFixedHeader:function(e){this.baseConfig.fixedHeader=e,this.$store.dispatch("ToggleFixedHeader",e),e||this.handleSetAutoHideHeader(!1)},handleSetAutoHideHeader:function(e){this.baseConfig.autoHideHeader=e,this.$store.dispatch("ToggleFixedHeaderHidden",e)},handleSetFixedSidebar:function(e){this.baseConfig.fixedSidebar=e,this.$store.dispatch("ToggleFixedSidebar",e)}})},Ae=Ie,Oe=(0,u.Z)(Ae,_e,ke,!1,null,"0512f470",null),Pe=Oe.exports,He=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-modal",{attrs:{footer:null,maskClosable:!1,width:320,title:"重新登录"},on:{cancel:e.handleCancelLogin},model:{value:e.loginModal,callback:function(t){e.loginModal=t},expression:"loginModal"}},[n("LoginForm",{on:{success:e.onLoginSucceed}})],1)],1)},Me=[],De=n(19060),$e={name:"LoginModal",components:{LoginForm:De.Z},computed:(0,h.Z)({},(0,g.Se)(["loginModal"])),methods:(0,h.Z)((0,h.Z)({},(0,g.nv)(["ToggleLoginModal"])),{},{onLoginSucceed:function(){this.$emit("success")},handleCancelLogin:function(){this.ToggleLoginModal(!1)}})},Re=$e,Fe=(0,u.Z)(Re,He,Me,!1,null,"3ad442b9",null),Be=Fe.exports,Ne={name:"BasicLayout",mixins:[v.jB,v.KT],components:{RouteView:C,SideMenu:z,GlobalHeader:pe,GlobalFooter:xe,SettingDrawer:Pe,LoginModal:Be},data:function(){return{production:b.Z.production,collapsed:!1,menus:[]}},computed:{contentPaddingLeft:function(){return!this.fixedSidebar||this.isMobile()?"0":this.sidebarOpened?"256px":"80px"}},watch:{sidebarOpened:function(e){this.collapsed=!e}},created:function(){this.menus=y.j.find((function(e){return"/"===e.path})).children,this.collapsed=!this.sidebarOpened},mounted:function(){var e=this,t=navigator.userAgent;t.indexOf("Edge")>-1&&this.$nextTick((function(){e.collapsed=!e.collapsed,setTimeout((function(){e.collapsed=!e.collapsed}),16)}))},methods:(0,h.Z)((0,h.Z)({},(0,g.nv)(["setSidebar","ToggleLoginModal"])),{},{toggle:function(){this.collapsed=!this.collapsed,this.setSidebar(!this.collapsed),(0,f.XC)()},menuSelect:function(){this.isDesktop()||(this.collapsed=!1)},drawerClose:function(){this.collapsed=!1},onLoginSucceed:function(){this.ToggleLoginModal(!1)}})},Ge=Ne,Ue=(0,u.Z)(Ge,m,p,!1,null,null,null),Ke=Ue.exports,ze=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:e.$route.meta.hiddenHeaderContent?null:"margin: -24px -24px 0px;"},[e.affix?n("a-affix",[e.$route.meta.hiddenHeaderContent?e._e():n("div",{staticClass:"page-header"},[n("div",{staticClass:"page-header-index-wide"},[n("a-page-header",{attrs:{breadcrumb:{props:{routes:e.breadList}},"sub-title":e.subTitle,title:e.title}},[e._t("extra",null,{slot:"extra"}),e._t("footer",null,{slot:"footer"}),e._t("content")],2)],1)])]):e._e(),e.$route.meta.hiddenHeaderContent||e.affix?e._e():n("div",{staticClass:"page-header"},[n("div",{staticClass:"page-header-index-wide"},[n("a-page-header",{attrs:{breadcrumb:{props:{routes:e.breadList}},"sub-title":e.subTitle,title:e.title}},[e._t("extra",null,{slot:"extra"}),e._t("footer",null,{slot:"footer"}),e._t("content")],2)],1)]),n("div",{staticClass:"content"},[n("div",{staticClass:"page-header-index-wide"},[e._t("default",(function(){return[n("router-view",{ref:"content"})]}))],2)])],1)},Ve=[],Ye={name:"PageView",props:{title:{type:String,default:null},subTitle:{type:String,default:null},affix:{type:Boolean,default:!1}},data:function(){return{breadList:[]}},created:function(){this.getBreadcrumb()},watch:{$route:function(){this.getBreadcrumb()}},methods:{getBreadcrumb:function(){var e=this;this.breadList=[],this.$route.matched.forEach((function(t){t.breadcrumbName=t.meta.title,e.breadList.push(t)}))}}},qe=Ye,We=(0,u.Z)(qe,ze,Ve,!1,null,"3af43504",null),Xe=We.exports},33132:function(e,t,n){"use strict";n(97898),n(63208),n(12809),n(60296);var a=n(35702),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-config-provider",{attrs:{locale:e.locale}},[n("div",{staticClass:"h-full",attrs:{id:"app"}},[n("router-view")],1)])},r=[],o=n(79840),s=n(68835),l={data:function(){return{locale:o.Z}},mounted:function(){var e=this,t=this.$store;(0,s.A)((function(n){switch(n){case s.m.DESKTOP:t.commit("TOGGLE_DEVICE","desktop"),t.dispatch("setSidebar",e.$store.getters.sidebar);break;case s.m.TABLET:t.commit("TOGGLE_DEVICE","tablet"),t.dispatch("setSidebar",e.$store.getters.sidebar);break;case s.m.MOBILE:default:t.commit("TOGGLE_DEVICE","mobile"),t.dispatch("setSidebar",!0);break}}))}},u=l,c=n(70739),d=(0,c.Z)(u,i,r,!1,null,null,null),m=d.exports,p=(n(41479),n(13407)),h=n(7439);a["default"].use(p.Z);var f=new p.Z({mode:"hash",base:"/",scrollBehavior:function(){return{y:0}},routes:h.k.concat(h.j)}),g=n(84561),v=n(58903),b=n(98291),y=!0,x={isEnabled:!0,logLevel:y?"error":"debug",stringifyArguments:!1,showLogLevel:!0,showMethodName:!0,separator:"|",showConsoleColors:!0};a["default"].use(b.Z,x);var _=n(60271),k=n.n(_),C=n(83247),T=n(50446),S=n(99683),E=n(20580),w=n(86419),L=n(21777),Z=n(32803),j=n(50342),I=n(90695),A=n(56968),O=n(98305),P=n(46888),H=n(73647),M=n(30134),D=n(37097),$=n(65601),R=n(19490),F=n(94827),B=n(27861),N=n(48702),G=n(35987),U=n(2693),K=n(91217),z=n(41594),V=n(21049),Y=n(64575),q=n(90351),W=n(8477),X=n(50468),Q=n(26883),J=n(98395),ee=n(36337),te=n(98655),ne=n(57694),ae=n(92921),ie=n(87883),re=n(8499),oe=n(44640),se=n(2871),le=n(13670),ue=n(42204),ce=n(57664),de=n(97885),me=n(83618),pe=n(49491),he=n(14901),fe=n(38712),ge=n(9277),ve=n(90959),be=n(29794),ye=n(43867),xe=n(18787),_e=n(15228),ke=n(36725),Ce=n(42728);a["default"].use(T.Z),a["default"].use(S.ZP),a["default"].use(E.Z),a["default"].use(w.Z),a["default"].use(L.Z),a["default"].use(Z.Z),a["default"].use(j.Z),a["default"].use(I.Z),a["default"].use(A.Z),a["default"].use(O.Z),a["default"].use(P.Z),a["default"].use(H.Z),a["default"].use(M.Z),a["default"].use(D.Z),a["default"].use($.Z),a["default"].use(R.ZP),a["default"].use(F.ZP),a["default"].use(B.ZP),a["default"].use(N.Z),a["default"].use(G.Z),a["default"].use(U.Z),a["default"].use(K.Z),a["default"].use(z.ZP),a["default"].use(V.Z),a["default"].use(Y.ZP),a["default"].use(q.Z),a["default"].use(W.Z),a["default"].use(X.ZP),a["default"].use(Q.Z),a["default"].use(J.Z),a["default"].use(ee.Z),a["default"].use(te.ZP),a["default"].use(ne.Z),a["default"].use(ae.ZP),a["default"].use(ie.Z),a["default"].use(re.Z),a["default"].use(oe.Z),a["default"].use(se.Z),a["default"].use(le.ZP),a["default"].use(ue.ZP),a["default"].use(ce.Z),a["default"].use(de.ZP),a["default"].use(me.Z),a["default"].use(pe.Z),a["default"].use(he.Z),a["default"].use(fe.Z),a["default"].use(ge.ZP),a["default"].use(ve.Z),a["default"].use(be.ZP),a["default"].use(ye.ZP),a["default"].use(xe.ZP),a["default"].use(_e.ZP),ke.Z.config({maxCount:1}),a["default"].prototype.$message=ke.Z,a["default"].prototype.$notification=Ce.Z,a["default"].prototype.$info=q.Z.info,a["default"].prototype.$success=q.Z.success,a["default"].prototype.$error=q.Z.error,a["default"].prototype.$warning=q.Z.warning,a["default"].prototype.$confirm=q.Z.confirm;n(21738);var Te=n(63214);function Se(){v.Z.commit("SET_SIDEBAR_TYPE",a["default"].ls.get(Te.mQ,!0)),v.Z.commit("TOGGLE_THEME",a["default"].ls.get(Te.t0,C.Z.navTheme)),v.Z.commit("TOGGLE_LAYOUT_MODE",a["default"].ls.get(Te.v9,C.Z.layout)),v.Z.commit("TOGGLE_FIXED_HEADER",a["default"].ls.get(Te.Vv,C.Z.fixedHeader)),v.Z.commit("TOGGLE_FIXED_SIDEBAR",a["default"].ls.get(Te.lK,C.Z.fixedSidebar)),v.Z.commit("TOGGLE_CONTENT_WIDTH",a["default"].ls.get(Te.hC,C.Z.contentWidth)),v.Z.commit("TOGGLE_FIXED_HEADER_HIDDEN",a["default"].ls.get(Te.NK,C.Z.autoHideHeader)),v.Z.commit("TOGGLE_COLOR",a["default"].ls.get(Te.Dp,C.Z.primaryColor)),v.Z.commit("SET_TOKEN",a["default"].ls.get(Te.LA)),v.Z.commit("SET_USER",a["default"].ls.get(Te.xR)),v.Z.commit("SET_OPTIONS",a["default"].ls.get(Te.JY))}var Ee=n(91884),we=n.n(Ee);a["default"].use(k(),C.Z.storageOptions),a["default"].use(we()),Se();var Le=n(54288),Ze=(n(70315),n(21082),n(2923),n(29981)),je=n.n(Ze),Ie=(n(30535),n(86381),function(e){document.title=e;var t=navigator.userAgent,n=/\bMicroMessenger\/([\d\.]+)/;if(n.test(t)&&/ip(hone|od|ad)/i.test(t)){var a=document.createElement("iframe");a.src="/favicon.ico",a.style.display="none",a.onload=function(){setTimeout((function(){a.remove()}),9)},document.body.appendChild(a)}}),Ae="Halo";je().configure({showSpinner:!1,speed:500});var Oe=["Login","Install","NotFound","ResetPassword"],Pe=null;function He(){Pe&&0!==Pe&&(clearTimeout(Pe),Pe=null),je().done()}f.beforeEach(function(){var e=(0,Le.Z)(regeneratorRuntime.mark((function e(t,n,a){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(He(),Pe=setTimeout((function(){je().start()}),250),void 0!==v.Z.getters.isInstalled){e.next=5;break}return e.next=5,v.Z.dispatch("fetchIsInstalled");case 5:if(v.Z.getters.isInstalled){e.next=12;break}return e.next=8,v.Z.commit("SET_OPTIONS",void 0);case 8:return e.next=10,v.Z.commit("CLEAR_TOKEN");case 10:return e.next=12,v.Z.commit("SET_USER",{});case 12:if(v.Z.getters.isInstalled||"Install"===t.name){e.next=16;break}return a({name:"Install"}),He(),e.abrupt("return");case 16:if(!v.Z.getters.isInstalled||"Install"!==t.name){e.next=20;break}return a({name:"Login"}),He(),e.abrupt("return");case 20:if(!v.Z.getters.token){e.next=30;break}if(v.Z.getters.options){e.next=24;break}return e.next=24,v.Z.dispatch("refreshOptionsCache").then();case 24:if(!["Login","Install"].includes(t.name)){e.next=28;break}return a({name:"Dashboard"}),He(),e.abrupt("return");case 28:return a(),e.abrupt("return");case 30:if(!Oe.includes(t.name)){e.next=33;break}return a(),e.abrupt("return");case 33:a({name:"Login",query:{redirect:t.fullPath}}),He();case 35:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}()),f.afterEach((function(e){e.meta&&"undefined"!==typeof e.meta.title&&Ie("".concat(e.meta.title," - ").concat(Ae)),He()}));n(90195),n(31875),n(43938);var Me=n(23598),De=n.n(Me),$e=(n(98101),n(25572)),Re=n(45311);De().locale("zh-cn"),a["default"].filter("moment",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm";return De()(e).format(t)})),a["default"].filter("moment_post_date",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/YYYY/MM/";return De()(e).format(t)})),a["default"].filter("moment_post_year",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/YYYY/";return De()(e).format(t)})),a["default"].filter("moment_post_day",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/YYYY/MM/DD/";return De()(e).format(t)})),a["default"].filter("timeAgo",$e.S),a["default"].filter("fileSizeFormat",(function(e){if(!e)return"0 Bytes";var t=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=parseFloat(e),a=Math.floor(Math.log(n)/Math.log(1024)),i=n/Math.pow(1024,a);return i=i.toFixed(2),i+" "+t[a]})),a["default"].filter("dayTime",(function(e){var t=Math.floor(e/86400),n=Math.floor(e%86400/3600),a=Math.floor(e%86400%3600/60),i=Math.floor(e%86400%3600%60);return t+"d "+n+"h "+a+"m "+i+"s"})),a["default"].filter("markdownRender",(function(e){return Re.TU.parse(e)}));n(18482),n(53961),n(96339),n(12566),n(93418),n(82395);var Fe,Be,Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split("").reduce((function(e,t){var n=t.charCodeAt(0);return n>=0&&n<=128?e+1:e+2}),0)},Ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=0;return e.split("").reduce((function(e,a){var i=a.charCodeAt(0);return n+=i>=0&&i<=128?1:2,n<=t?e+a:e}),"")},Ue={name:"Ellipsis",components:{Tooltip:me.Z},props:{prefixCls:{type:String,default:"ant-pro-ellipsis"},tooltip:{type:Boolean},length:{type:Number,required:!0},lines:{type:Number,default:1},fullWidthRecognition:{type:Boolean,default:!1}},methods:{getStrDom:function(e,t){var n=this.$createElement;return n("span",[Ge(e,this.length)+(t>this.length?"...":"")])},getTooltip:function(e,t){var n=this.$createElement;return n(me.Z,[n("template",{slot:"title"},[e]),this.getStrDom(e,t)])}},render:function(){var e=this.$props,t=e.tooltip,n=e.length,a=this.$slots.default.map((function(e){return e.text})).join(""),i=Ne(a);return t&&i>n?this.getTooltip(a,i):this.getStrDom(a,i)}},Ke=Ue,ze=(0,c.Z)(Ke,Fe,Be,!1,null,null,null),Ve=ze.exports,Ye=Ve,qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.prefixCls},[n("div",{staticClass:"float-left"},[e._t("extra",(function(){return[e._v(e._s(e.extra))]}))],2),n("div",{staticClass:"float-right"},[e._t("default")],2)])},We=[],Xe={name:"FooterToolBar",props:{prefixCls:{type:String,default:"ant-pro-footer-toolbar"},extra:{type:[String,Object],default:""}}},Qe=Xe,Je=(0,c.Z)(Qe,qe,We,!1,null,null,null),et=Je.exports,tt=et,nt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("file-pond",{ref:"pond",attrs:{"accepted-file-types":e.accepts,"allow-multiple":e.multiple,allowImagePreview:e.allowImagePreview,allowRevert:!1,files:e.fileList,"label-idle":e.label,maxFiles:e.maxFiles,maxParallelUploads:e.maxParallelUploads,name:e.name,server:e.server,fileValidateTypeLabelExpectedTypes:"请选择 {lastType} 格式的文件",labelFileProcessing:"上传中",labelFileProcessingAborted:"取消上传",labelFileProcessingComplete:"上传完成",labelFileProcessingError:"上传错误",labelFileTypeNotAllowed:"不支持当前文件格式",labelTapToCancel:"点击取消",labelTapToRetry:"点击重试"},on:{init:e.handleFilePondInit}})],1)},at=[],it=n(22373),rt=n(98906),ot=n(91860),st=n(77847),lt=n.n(st),ut=n(99312),ct=n.n(ut),dt=n(88761),mt=n.n(dt),pt=lt()(ct(),mt()),ht={name:"FilePondUpload",components:{FilePond:pt},props:{name:{type:String,required:!1,default:"file"},field:{type:String,required:!1,default:""},multiple:{type:Boolean,required:!1,default:!0},accepts:{type:Array,required:!1,default:function(){return null}},label:{type:String,required:!1,default:"点击选择文件或将文件拖拽到此处"},uploadHandler:{type:Function,required:!0}},computed:(0,it.Z)((0,it.Z)({},(0,rt.Se)(["options"])),{},{maxParallelUploads:function(){return this.options?this.options.attachment_upload_max_parallel_uploads:1},allowImagePreview:function(){return!!this.options&&this.options.attachment_upload_image_preview_enable},maxFiles:function(){return this.options?this.options.attachment_upload_max_files:1}}),data:function(){var e=this;return{server:{process:function(t,n,a,i,r,o,s){var l=ot.Axios.CancelToken,u=l.source();return e.uploadHandler(n,{onUploadProgress:function(e){e.total>0&&o(e.lengthComputable,e.loaded,e.total)},cancelToken:u.token},e.field).then((function(t){i(t),e.$log.debug("Uploaded successfully",t),e.$emit("success",t,n)})).catch((function(t){e.$log.debug("Failed to upload file",t),e.$emit("failure",t,n),r()})),{abort:function(){s(),e.$log.debug("Upload operation aborted by the user"),u.cancel("Upload operation canceled by the user.")}}}},fileList:[]}},methods:{handleFilePondInit:function(){this.$log.debug("FilePond has initialized")},handleClearFileList:function(){this.$refs.pond.removeFiles()}}},ft=ht,gt=(0,c.Z)(ft,nt,at,!1,null,null,null),vt=gt.exports,bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-modal",{attrs:{afterClose:e.onClose,footer:null,destroyOnClose:"",title:"上传附件"},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[n("FilePondUpload",{ref:"upload",attrs:{uploadHandler:e.uploadHandler}})],1)},yt=[],xt=n(36591),_t={name:"AttachmentUploadModal",props:{visible:{type:Boolean,default:!1}},data:function(){return{uploadHandler:function(e,t){return xt.Z.attachment.upload(e,t)}}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},methods:{onClose:function(){this.$refs.upload.handleClearFileList(),this.$emit("close")}}},kt=_t,Ct=(0,c.Z)(kt,bt,yt,!1,null,null,null),Tt=Ct.exports,St=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-modal",{attrs:{afterClose:e.onAfterClose,title:e.title,width:1280,destroyOnClose:""},scopedSlots:e._u([{key:"footer",fn:function(){return[n("a-button",{on:{click:function(t){e.modalVisible=!1}}},[e._v("取消")]),n("a-button",{attrs:{disabled:!e.list.selected.length,type:"primary"},on:{click:e.handleConfirm}},[e._v("确定")])]},proxy:!0}]),model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[n("div",{staticClass:"table-page-search-wrapper"},[n("a-form",{attrs:{layout:"inline"}},[n("a-row",{attrs:{gutter:24}},[n("a-col",{attrs:{md:6,sm:24}},[n("a-form-item",{attrs:{label:"关键词:"}},[n("a-input",{on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch()}},model:{value:e.list.params.keyword,callback:function(t){e.$set(e.list.params,"keyword",t)},expression:"list.params.keyword"}})],1)],1),n("a-col",{attrs:{md:6,sm:24}},[n("a-form-item",{attrs:{label:"存储位置:"}},[n("a-select",{attrs:{loading:e.types.loading,allowClear:""},on:{change:function(t){return e.handleSearch()}},model:{value:e.list.params.attachmentType,callback:function(t){e.$set(e.list.params,"attachmentType",t)},expression:"list.params.attachmentType"}},e._l(e.types.data,(function(t){return n("a-select-option",{key:t,attrs:{value:t}},[e._v(" "+e._s(e._f("typeText")(t))+" ")])})),1)],1)],1),n("a-col",{attrs:{md:6,sm:24}},[n("a-form-item",{attrs:{label:"文件类型:"}},[n("a-select",{attrs:{loading:e.mediaTypes.loading,allowClear:""},on:{change:function(t){return e.handleSearch()}},model:{value:e.list.params.mediaType,callback:function(t){e.$set(e.list.params,"mediaType",t)},expression:"list.params.mediaType"}},e._l(e.mediaTypes.data,(function(t,a){return n("a-select-option",{key:a,attrs:{value:t}},[e._v(" "+e._s(t)+" ")])})),1)],1)],1),n("a-col",{attrs:{md:6,sm:24}},[n("span",{staticClass:"table-page-search-submitButtons"},[n("a-space",[n("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleSearch()}}},[e._v("查询")]),n("a-button",{on:{click:function(t){e.handleResetParam(),e.handleListAttachments()}}},[e._v("重置")])],1)],1)])],1)],1)],1),n("div",{staticClass:"table-operator mb-0"},[n("a-button",{attrs:{icon:"cloud-upload",type:"primary"},on:{click:function(t){e.upload.visible=!0}}},[e._v("上传")])],1),n("a-divider"),n("a-spin",{attrs:{spinning:e.list.loading}},[n("div",{staticClass:"grid grid-cols-2 gap-x-2 gap-y-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10",attrs:{role:"list"}},e._l(e.list.data,(function(t,a){return n("div",{key:a,staticClass:"relative cursor-pointer overflow-hidden rounded-sm border-solid bg-white transition-all hover:shadow-sm",class:e.isItemSelect(t)?"border-blue-600":"border-slate-200",on:{click:function(n){return e.handleItemClick(t)},mouseenter:function(n){return e.$set(t,"hover",!0)},mouseleave:function(n){return e.$set(t,"hover",!1)}}},[n("div",{staticClass:"group aspect-w-10 aspect-h-7 block w-full overflow-hidden bg-white"},[e.isImage(t)?n("img",{staticClass:"pointer-events-none overflow-hidden object-cover transition-opacity group-hover:opacity-70",attrs:{alt:t.name,src:t.thumbPath,loading:"lazy"}}):n("span",{staticClass:"flex items-center justify-center text-2xl text-gray-600"},[e._v(" "+e._s(t.suffix)+" ")])]),n("a-tooltip",{attrs:{title:t.name}},[n("span",{staticClass:"block truncate p-1.5 text-xs font-medium text-gray-500"},[e._v(" "+e._s(t.name)+" ")])]),n("a-icon",{directives:[{name:"show",rawName:"v-show",value:e.isItemSelect(t)&&!t.hover,expression:"isItemSelect(attachment) && !attachment.hover"}],staticClass:"absolute top-1 right-1 cursor-pointer font-bold transition-all",style:{fontSize:"20px",color:"rgb(37 99 235)"},attrs:{theme:"twoTone",type:"check-circle"}}),n("a-icon",{directives:[{name:"show",rawName:"v-show",value:t.hover,expression:"attachment.hover"}],staticClass:"absolute top-1 right-1 cursor-pointer font-bold transition-all",style:{fontSize:"20px"},attrs:{theme:"twoTone",type:"profile"},on:{click:function(n){return n.stopPropagation(),e.handleOpenDetail(t)}}})],1)})),0)]),n("div",{staticClass:"mt-4 flex justify-between"},[n("a-popover",{attrs:{placement:"right",title:"预览",trigger:"click"}},[n("template",{slot:"content"},[e.list.selected.length?n("a-tabs",{attrs:{"default-active-key":"markdown","tab-position":"left"}},[n("a-tab-pane",{key:"markdown",attrs:{tab:"Markdown"}},[n("div",{staticClass:"text-slate-400",domProps:{innerHTML:e._s(e.markdownSyntaxList.join("<br />"))}})]),n("a-tab-pane",{key:"html",attrs:{"force-render":"",tab:"HTML"}},[n("div",{staticClass:"text-slate-400"},e._l(e.htmlSyntaxList,(function(t,a){return n("span",{key:a,staticClass:"text-slate-400"},[e._v(" "+e._s(t)),n("br")])})),0)])],1):n("div",{staticClass:"text-slate-400"},[e._v("未选择附件")])],1),n("a-tooltip",{attrs:{placement:"top",title:"点击预览"}},[n("div",{staticClass:"cursor-pointer select-none self-center text-slate-400 transition-all hover:text-blue-400"},[e._v(" 已选择 "+e._s(e.list.selected.length)+" 项 ")])])],2),n("div",{staticClass:"page-wrapper flex justify-end self-center"},[n("a-pagination",{staticClass:"pagination !mt-0",attrs:{current:e.pagination.page,defaultPageSize:e.pagination.size,pageSizeOptions:["40","50","100","150","200"],total:e.pagination.total,showLessItems:"",showSizeChanger:""},on:{change:e.handlePageChange,showSizeChange:e.handlePageSizeChange}})],1)],1),n("AttachmentUploadModal",{attrs:{visible:e.upload.visible},on:{"update:visible":function(t){return e.$set(e.upload,"visible",t)},close:e.handleSearch}}),n("AttachmentDetailModal",{attrs:{attachment:e.list.current,visible:e.detailVisible},on:{"update:visible":function(t){e.detailVisible=t},delete:function(t){return e.handleListAttachments()}},scopedSlots:e._u([{key:"extraFooter",fn:function(){return[n("a-button",{attrs:{disabled:e.selectPreviousButtonDisabled},on:{click:e.handleSelectPrevious}},[e._v("上一项")]),n("a-button",{attrs:{disabled:e.selectNextButtonDisabled},on:{click:e.handleSelectNext}},[e._v("下一项")]),n("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleItemClick(e.list.current)}}},[e._v(" "+e._s(e.list.selected.findIndex((function(t){return t.id===e.list.current.id}))>-1?"取消选择":"选择")+" ")])]},proxy:!0}])})],1)},Et=[],wt=n(23222),Lt=(n(15928),n(3662),n(43376)),Zt={name:"AttachmentSelectModal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:"选择附件"},multiSelect:{type:Boolean,default:!0}},data:function(){return{list:{data:[],total:0,hasNext:!1,hasPrevious:!1,loading:!1,params:{page:0,size:40,keyword:void 0,mediaType:void 0,attachmentType:void 0},selected:[],current:{}},mediaTypes:{data:[],loading:!1},types:{data:[],loading:!1},upload:{visible:!1},detailVisible:!1}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}},pagination:function(){return{page:this.list.params.page+1,size:this.list.params.size,total:this.list.total}},selectPreviousButtonDisabled:function(){var e=this,t=this.list.data.findIndex((function(t){return t.id===e.list.current.id}));return 0===t&&!this.list.hasPrevious},selectNextButtonDisabled:function(){var e=this,t=this.list.data.findIndex((function(t){return t.id===e.list.current.id}));return t===this.list.data.length-1&&!this.list.hasNext},isImage:function(){return function(e){return!(!e||!e.mediaType)&&e.mediaType.startsWith("image")}},isItemSelect:function(){return function(e){return this.list.selected.findIndex((function(t){return t.id===e.id}))>-1}},markdownSyntaxList:function(){return this.list.selected.length?this.list.selected.map((function(e){return".concat(e.path,")")})):[]},htmlSyntaxList:function(){return this.list.selected.length?this.list.selected.map((function(e){return'<img src="'.concat(e.path,'" alt="').concat(e.name,'">')})):[]}},watch:{modalVisible:function(e){e&&(this.handleListAttachments(),this.handleListMediaTypes(),this.handleListTypes())}},methods:{handleListAttachments:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.list.loading=!0,t.next=4,xt.Z.attachment.list(e.list.params);case 4:n=t.sent,e.list.data=n.data.content,e.list.total=n.data.total,e.list.hasNext=n.data.hasNext,e.list.hasPrevious=n.data.hasPrevious,t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),e.$log.error(t.t0);case 14:return t.prev=14,e.list.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,11,14,17]])})))()},handleListMediaTypes:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.mediaTypes.loading=!0,t.next=4,xt.Z.attachment.listMediaTypes();case 4:n=t.sent,e.mediaTypes.data=n.data,t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),e.$log.error(t.t0);case 11:return t.prev=11,e.mediaTypes.loading=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[0,8,11,14]])})))()},handleListTypes:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.types.loading=!0,t.next=4,xt.Z.attachment.listTypes();case 4:n=t.sent,e.types.data=n.data,t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),e.$log.error(t.t0);case 11:return t.prev=11,e.types.loading=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[0,8,11,14]])})))()},handlePageChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.list.params.page=e-1,this.handleListAttachments()},handleSearch:function(){this.handlePageChange(1)},handleResetParam:function(){this.list.params={page:0,size:40,keyword:void 0,mediaType:void 0,attachmentType:void 0}},handlePageSizeChange:function(e,t){this.$log.debug("Current: ".concat(e,", PageSize: ").concat(t)),this.list.params.page=0,this.list.params.size=t,this.handleListAttachments()},handleItemClick:function(e){if(!this.multiSelect)return this.$emit("confirm",{raw:[e],markdown:[".concat(e.path,")")],html:['<img src="'.concat(e.path,'" alt="').concat(e.name,'">')]}),void(this.modalVisible=!1);var t=this.list.selected.findIndex((function(t){return t.id===e.id}))>-1;t?this.handleUnselect(e):this.handleSelect(e)},handleSelect:function(e){this.list.selected=[].concat((0,wt.Z)(this.list.selected),[e])},handleUnselect:function(e){this.list.selected=this.list.selected.filter((function(t){return t.id!==e.id}))},handleConfirm:function(){this.$emit("confirm",{raw:this.list.selected,markdown:this.markdownSyntaxList,html:this.htmlSyntaxList}),this.modalVisible=!1},handleOpenDetail:function(e){this.list.current=e,this.detailVisible=!0},handleSelectPrevious:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.list.data.findIndex((function(t){return t.id===e.list.current.id})),!(n>0)){t.next=4;break}return e.list.current=e.list.data[n-1],t.abrupt("return");case 4:if(0!==n||!e.list.hasPrevious){t.next=9;break}return e.list.params.page--,t.next=8,e.handleListAttachments();case 8:e.list.current=e.list.data[e.list.data.length-1];case 9:case"end":return t.stop()}}),t)})))()},handleSelectNext:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.list.data.findIndex((function(t){return t.id===e.list.current.id})),!(n<e.list.data.length-1)){t.next=4;break}return e.list.current=e.list.data[n+1],t.abrupt("return");case 4:if(n!==e.list.data.length-1||!e.list.hasNext){t.next=9;break}return e.list.params.page++,t.next=8,e.handleListAttachments();case 8:e.list.current=e.list.data[0];case 9:case"end":return t.stop()}}),t)})))()},onAfterClose:function(){this.handleResetParam(),this.list.selected=[]}},filters:{typeText:function(e){return Lt.k[e].text}}},jt=Zt,It=(0,c.Z)(jt,St,Et,!1,null,null,null),At=It.exports,Ot=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-modal",{attrs:{width:e.isMobile()?"100%":"50%",title:"附件详情"},scopedSlots:e._u([{key:"footer",fn:function(){return[e._t("extraFooter"),n("a-popconfirm",{attrs:{cancelText:"取消",okText:"确定",title:"你确定要删除该附件?"},on:{confirm:e.handleDelete}},[n("ReactiveButton",{attrs:{errored:e.deleteErrored,loading:e.deleting,erroredText:"删除失败",icon:"delete",loadedText:"删除成功",text:"删除",type:"danger"},on:{callback:e.handleDeletedCallback}})],1)]},proxy:!0}],null,!0),model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[n("a-row",{attrs:{gutter:24,type:"flex"}},[n("a-col",{attrs:{lg:9,md:24,sm:24,xl:9,xs:24}},[n("div",{staticClass:"attach-detail-img pb-3"},[e.isImage?n("a",{attrs:{href:e.attachment.path,target:"_blank"}},[n("img",{staticClass:"w-full",attrs:{src:e.attachment.path,loading:"lazy"}})]):n("div",[e._v("此文件不支持预览")])])]),n("a-col",{attrs:{lg:15,md:24,sm:24,xl:15,xs:24}},[n("a-list",{attrs:{itemLayout:"horizontal"}},[n("a-list-item",{staticStyle:{"padding-top":"0"}},[n("a-list-item-meta",[e.editable?n("template",{slot:"description"},[n("a-input",{ref:"nameInput",on:{blur:e.handleUpdateName},model:{value:e.attachment.name,callback:function(t){e.$set(e.attachment,"name",t)},expression:"attachment.name"}})],1):n("template",{slot:"description"},[e._v(e._s(e.attachment.name))]),n("span",{attrs:{slot:"title"},slot:"title"},[e._v(" 附件名: "),n("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:e.handleEditName}},[n("a-icon",{attrs:{type:"edit"}})],1)],1)],2)],1),n("a-list-item",[n("a-list-item-meta",{attrs:{description:e.attachment.mediaType}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v("附件类型:")])])],1),n("a-list-item",[n("a-list-item-meta",{attrs:{description:e._f("typeText")(e.attachment.type)}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v("存储位置:")])])],1),n("a-list-item",[n("a-list-item-meta",[n("template",{slot:"description"},[e._v(" "+e._s(e._f("fileSizeFormat")(e.attachment.size))+" ")]),n("span",{attrs:{slot:"title"},slot:"title"},[e._v("附件大小:")])],2)],1),e.isImage?n("a-list-item",[n("a-list-item-meta",{attrs:{description:e.attachment.height+"x"+e.attachment.width}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v("图片尺寸:")])])],1):e._e(),n("a-list-item",[n("a-list-item-meta",[n("template",{slot:"description"},[e._v(" "+e._s(e._f("moment")(e.attachment.createTime))+" ")]),n("span",{attrs:{slot:"title"},slot:"title"},[e._v("上传日期:")])],2)],1),n("a-list-item",[n("a-list-item-meta",{scopedSlots:e._u([{key:"description",fn:function(){return[n("a",{attrs:{href:e.attachment.path,target:"_blank"}},[e._v(e._s(e.attachment.path))])]},proxy:!0}])},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v(" 普通链接: "),n("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:function(t){return e.handleCopyLink(""+e.attachment.path)}}},[n("a-icon",{attrs:{type:"copy"}})],1)],1)])],1),e.isImage?n("a-list-item",[n("a-list-item-meta",[n("span",{attrs:{slot:"description"},slot:"description"},[e._v("+")")]),n("span",{attrs:{slot:"title"},slot:"title"},[e._v(" Markdown 格式: "),n("a-button",{staticClass:"!p-0",attrs:{type:"link"},on:{click:function(t){e.handleCopyLink("")}}},[n("a-icon",{attrs:{type:"copy"}})],1)],1)])],1):e._e()],1)],1)],1)],1)},Pt=[],Ht=n(94370),Mt={name:"AttachmentDetailModal",mixins:[Ht.jB,Ht.KT],filters:{typeText:function(e){return e?Lt.k[e].text:""}},props:{visible:{type:Boolean,default:!0},attachment:{type:Object,default:function(){return{}}}},data:function(){return{editable:!1,deleting:!1,deleteErrored:!1}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}},isImage:function(){return!(!this.attachment||!this.attachment.mediaType)&&this.attachment.mediaType.startsWith("image")}},methods:{handleDelete:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.deleting=!0,t.next=4,xt.Z.attachment["delete"](e.attachment.id);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t["catch"](0),e.$log.error(t.t0),e.deleteErrored=!0;case 10:return t.prev=10,setTimeout((function(){e.deleting=!1}),400),t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[0,6,10,13]])})))()},handleDeletedCallback:function(){this.$emit("delete",this.attachment),this.deleteErrored=!1,this.modalVisible=!1},handleEditName:function(){var e=this;this.editable=!this.editable,this.editable&&this.$nextTick((function(){e.$refs.nameInput.focus()}))},handleUpdateName:function(){var e=this;return(0,Le.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.attachment.name){t.next=3;break}return e.$notification["error"]({message:"提示",description:"附件名称不能为空!"}),t.abrupt("return");case 3:return t.prev=3,t.next=6,xt.Z.attachment.update(e.attachment.id,e.attachment.name);case 6:t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](3),e.$log.error(t.t0);case 11:return t.prev=11,e.editable=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[3,8,11,14]])})))()},handleCopyLink:function(e){var t=this;this.$copyText(e).then((function(e){t.$log.debug("copy",e),t.$message.success("复制成功!")})).catch((function(e){t.$log.debug("copy.err",e),t.$message.error("复制失败!")}))}}},Dt=Mt,$t=(0,c.Z)(Dt,Ot,Pt,!1,null,null,null),Rt=$t.exports,Ft=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-button",{attrs:{block:e.block,icon:e.computedIcon,loading:e.loading,size:e.size,type:e.computedType},on:{click:e.handleClick}},[e._v(e._s(e.computedText)+" ")])},Bt=[],Nt={name:"ReactiveButton",props:{type:{type:String,default:"primary"},icon:{type:String,default:null},size:{type:String,default:"default"},block:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},errored:{type:Boolean,default:!1},text:{type:String,default:""},loadedText:{type:String,default:""},erroredText:{type:String,default:""}},data:function(){return{loaded:!1,hasError:!1}},watch:{loading:function(e){var t=this;e||(this.loaded=!0,this.errored&&(this.hasError=!0),setTimeout((function(){t.loaded=!1,t.hasError=!1,t.$emit("callback")}),400))}},computed:{computedType:function(){return this.loaded&&this.hasError?"danger":this.type},computedIcon:function(){return this.loaded?this.hasError?"close-circle":"check-circle":this.icon},computedText:function(){return this.loaded?this.hasError?this.erroredText:this.loadedText:this.text}},methods:{handleClick:function(){this.$emit("click")}}},Gt=Nt,Ut=(0,c.Z)(Gt,Ft,Bt,!1,null,null,null),Kt=Ut.exports,zt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-tag",{style:{color:e.labelColor},attrs:{color:e.tag.color}},[e._v(" "+e._s(e.tag.name)+"("+e._s(e.tag.postCount)+")")])},Vt=[],Yt=n(37750),qt={name:"PostTag",props:{tag:{type:Object,default:function(){}}},computed:{labelColor:function(){var e=this.tag||{},t=e.color;return t&&(0,Yt.vq)(t)?(0,Yt.RQ)(t)?"inherit":"#fff":"inherit"}}},Wt=qt,Xt=(0,c.Z)(Wt,zt,Vt,!1,null,null,null),Qt=Xt.exports,Jt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-input",{ref:"attachmentInput",attrs:{defaultValue:e.defaultValue,placeholder:e.placeholder,value:e.value},on:{change:e.onInputChange},scopedSlots:e._u([{key:"addonAfter",fn:function(){return[n("a-button",{staticClass:"!p-0 !h-auto",attrs:{type:"link"},on:{click:function(t){e.attachmentModalVisible=!0}}},[n("a-icon",{attrs:{type:"picture"}})],1)]},proxy:!0}])}),n("AttachmentSelectModal",{attrs:{multiSelect:!1,visible:e.attachmentModalVisible},on:{"update:visible":function(t){e.attachmentModalVisible=t},confirm:e.handleSelectAttachment}})],1)},en=[],tn={name:"AttachmentInput",props:{value:{type:String,default:""},defaultValue:{type:String,default:""},placeholder:{type:String,default:""},title:{type:String,default:"选择附件"}},data:function(){return{attachmentModalVisible:!1}},methods:{onInputChange:function(e){this.$emit("input",e.target.value)},handleSelectAttachment:function(e){var t=e.raw;t.length&&this.$emit("input",t[0].path)},focus:function(){this.$refs.attachmentInput.focus()}}},nn=tn,an=(0,c.Z)(nn,Jt,en,!1,null,null,null),rn=an.exports,on=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-list",{attrs:{dataSource:e.comments,loading:e.loading,"item-layout":"vertical"},scopedSlots:e._u([{key:"renderItem",fn:function(t,a){return[n("a-list-item",{key:a,staticClass:"!p-0",class:{"hover:bg-gray-100 hover:!px-1 hover:rounded transition-all cursor-pointer":e.clickable},on:{click:function(n){return e.handleClick(t)}}},[n("a-comment",{attrs:{avatar:t.avatar},scopedSlots:e._u([{key:"author",fn:function(){return[t.authorUrl?n("a",{staticClass:"!text-gray-800 hover:!text-blue-500",attrs:{href:t.authorUrl,target:"_blank"}},[e._v(" "+e._s(t.author)+" ")]):n("span",{staticClass:"!text-gray-500"},[e._v(e._s(t.author))]),e._v(" 发表在 "),n("span",{staticClass:"hover:!text-blue-500 cursor-pointer",on:{click:function(n){return e.handleOpenTarget(t)}}},[e._v(" 《"+e._s(e.targetTitle(t))+"》 ")])]},proxy:!0},{key:"content",fn:function(){return[n("p",{domProps:{innerHTML:e._s(e.$options.filters.markdownRender(t.content))}})]},proxy:!0},{key:"datetime",fn:function(){return[n("a-tooltip",{attrs:{title:e._f("moment")(t.createTime)}},[n("span",[e._v(e._s(e._f("timeAgo")(t.createTime)))])])]},proxy:!0}],null,!0)})],1)]}}])})},sn=[],ln={name:"CommentListView",props:{comments:{type:Array,default:function(){return[]}},loading:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1}},computed:{targetTitle:function(){return function(e){return e.post?e.post.title:e.sheet?e.sheet.title:e.journal?(0,$e._)(e.journal.createTime):""}}},methods:{handleOpenTarget:function(e){return(0,Le.Z)(regeneratorRuntime.mark((function t(){var n,a,i,r,o,s,l,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.post,a=e.sheet,!n&&!a){t.next=12;break}if(i=n||a,r=i.status,o=i.fullPath,s=i.id,!["PUBLISHED","INTIMATE"].includes(r)){t.next=6;break}return window.open(o,"_blank"),t.abrupt("return");case 6:if("DRAFT"!==r){t.next=12;break}return l=n?"post":"sheet",t.next=10,xt.Z[l].getPreviewLinkById(s);case 10:u=t.sent,window.open(u,"_blank");case 12:case"end":return t.stop()}}),t)})))()},handleClick:function(e){this.clickable&&this.$emit("click",e)}}},un=ln,cn=(0,c.Z)(un,on,sn,!1,null,null,null),dn=cn.exports,mn={Ellipsis:Ye,FooterToolbar:tt,FilePondUpload:vt,AttachmentUploadModal:Tt,AttachmentSelectModal:At,AttachmentDetailModal:Rt,ReactiveButton:Kt,PostTag:Qt,AttachmentInput:rn,CommentListView:dn},pn={};Object.keys(mn).forEach((function(e){pn[e]=a["default"].component(e,mn[e])}));var hn={i8:"1.6.0"};a["default"].config.productionTip=!1,a["default"].prototype.VERSION=hn.i8,a["default"].use(f),a["default"].use(g.Z),new a["default"]({router:f,store:v.Z,render:function(e){return e(m)}}).$mount("#app")},94370:function(e,t,n){"use strict";n.d(t,{jB:function(){return o},KT:function(){return s},g3:function(){return l}});var a=n(22373),i=n(68835),r=n(98906),o={computed:(0,a.Z)({},(0,r.rn)({layoutMode:function(e){return e.app.layout},navTheme:function(e){return e.app.theme},primaryColor:function(e){return e.app.color},fixedHeader:function(e){return e.app.fixedHeader},fixedSidebar:function(e){return e.app.fixedSidebar},contentWidth:function(e){return e.app.contentWidth},autoHideHeader:function(e){return e.app.autoHideHeader},sidebarOpened:function(e){return e.app.sidebar}})),methods:{isTopMenu:function(){return"topmenu"===this.layoutMode},isSideMenu:function(){return!this.isTopMenu()}}},s={computed:(0,a.Z)({},(0,r.rn)({device:function(e){return e.app.device}})),methods:{isMobile:function(){return this.device===i.m.MOBILE},isDesktop:function(){return this.device===i.m.DESKTOP},isTablet:function(){return this.device===i.m.TABLET}}},l={data:function(){return{viewMetas:{pageHeaderHeight:0,pageFooterHeight:0}}},computed:{editorHeight:function(){var e=64,t=24,n=40;return"calc(100vh - ".concat(e+t+n+this.viewMetas.pageHeaderHeight+this.viewMetas.pageFooterHeight+10,"px - 1rem)")}},mounted:function(){this.handleGetViewMetas()},methods:{handleGetViewMetas:function(){var e=document.getElementsByClassName("page-header");e&&e.length>0&&(this.viewMetas.pageHeaderHeight=e[0].clientHeight);var t=document.getElementsByClassName("ant-layout-footer");t&&t.length>0&&(this.viewMetas.pageFooterHeight=t[0].clientHeight)}}}},58903:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var a=n(35702),i=n(98906),r=(n(31875),n(63214)),o=n(36591),s={state:{sidebar:!0,device:"desktop",theme:"",layout:"",contentWidth:"",fixedHeader:!1,fixedSidebar:!1,autoHideHeader:!1,color:null,layoutSetting:!1,loginModal:!1,isInstalled:void 0},mutations:{SET_SIDEBAR_TYPE:function(e,t){a["default"].ls.set(r.mQ,t),e.sidebar=t},TOGGLE_DEVICE:function(e,t){e.device=t},TOGGLE_THEME:function(e,t){a["default"].ls.set(r.t0,t),e.theme=t},TOGGLE_LAYOUT_MODE:function(e,t){a["default"].ls.set(r.v9,t),e.layout=t},TOGGLE_FIXED_HEADER:function(e,t){a["default"].ls.set(r.Vv,t),e.fixedHeader=t},TOGGLE_FIXED_SIDEBAR:function(e,t){a["default"].ls.set(r.lK,t),e.fixedSidebar=t},TOGGLE_FIXED_HEADER_HIDDEN:function(e,t){a["default"].ls.set(r.NK,t),e.autoHideHeader=t},TOGGLE_CONTENT_WIDTH:function(e,t){a["default"].ls.set(r.hC,t),e.contentWidth=t},TOGGLE_COLOR:function(e,t){a["default"].ls.set(r.Dp,t),e.color=t},TOGGLE_LAYOUT_SETTING:function(e,t){a["default"].ls.set(r.W1,t),e.layoutSetting=t},TOGGLE_LOGIN_MODAL:function(e,t){e.loginModal=t},SET_IS_INSTALLED:function(e,t){e.isInstalled=t}},actions:{fetchIsInstalled:function(e){var t=e.commit;return new Promise((function(e,n){o.Z.isInstalled().then((function(n){t("SET_IS_INSTALLED",n.data),e(n)})).catch((function(e){n(e)}))}))},setSidebar:function(e,t){var n=e.commit;n("SET_SIDEBAR_TYPE",t)},ToggleTheme:function(e,t){var n=e.commit;n("TOGGLE_THEME",t)},ToggleLayoutMode:function(e,t){var n=e.commit;n("TOGGLE_LAYOUT_MODE",t)},ToggleFixedHeader:function(e,t){var n=e.commit;n("TOGGLE_FIXED_HEADER",t)},ToggleFixedSidebar:function(e,t){var n=e.commit;n("TOGGLE_FIXED_SIDEBAR",t)},ToggleFixedHeaderHidden:function(e,t){var n=e.commit;n("TOGGLE_FIXED_HEADER_HIDDEN",t)},ToggleContentWidth:function(e,t){var n=e.commit;n("TOGGLE_CONTENT_WIDTH",t)},ToggleColor:function(e,t){var n=e.commit;n("TOGGLE_COLOR",t)},ToggleLayoutSetting:function(e,t){var n=e.commit;n("TOGGLE_LAYOUT_SETTING",t)},ToggleLoginModal:function(e,t){var n=e.commit;n("TOGGLE_LOGIN_MODAL",t)}}},l=s,u={state:{token:null,user:{}},mutations:{SET_TOKEN:function(e,t){a["default"].ls.set(r.LA,t,t?1e3*t.expired_in:null),e.token=t},CLEAR_TOKEN:function(e){a["default"].ls.remove(r.LA),e.token=null},SET_USER:function(e,t){a["default"].ls.set(r.xR,t),e.user=t}},actions:{installCleanToken:function(e,t){var n=e.commit;return new Promise((function(e,a){o.Z.installation.install(t).then((function(t){n("CLEAR_TOKEN"),e(t)})).catch((function(e){a(e)}))}))},refreshUserCache:function(e){var t=e.commit;return new Promise((function(e,n){o.Z.user.getProfile().then((function(n){t("SET_USER",n.data),e(n)})).catch((function(e){n(e)}))}))},login:function(e,t){var n=e.commit,i=t.username,r=t.password,s=t.authcode;return new Promise((function(e,t){o.Z.login({username:i,password:r,authcode:s}).then((function(t){var i=t.data;a["default"].$log.debug("Got token",i),n("SET_TOKEN",i),e(t)})).catch((function(e){t(e)}))}))},logout:function(e){var t=e.commit;return new Promise((function(e){o.Z.logout().then((function(){t("CLEAR_TOKEN"),t("SET_USER",{}),e()})).catch((function(){e()}))}))},refreshToken:function(e,t){var n=e.commit;return new Promise((function(e,i){o.Z.refreshToken(t).then((function(t){var i=t.data;a["default"].$log.debug("Got token",i),n("SET_TOKEN",i),e(t)})).catch((function(e){var r=e.data;a["default"].$log.debug("Refresh error data",r),r&&400===r.status&&r.data===t&&n("CLEAR_TOKEN"),i(e)}))}))}}},c=u,d=["blog_url","developer_mode","attachment_upload_image_preview_enable","attachment_EXIF_remove_enable","attachment_upload_max_parallel_uploads","attachment_upload_max_files","sheet_prefix","post_permalink_type","sheet_permalink_type","archives_prefix","path_suffix","default_editor","default_menu_team"],m={state:{options:void 0},mutations:{SET_OPTIONS:function(e,t){a["default"].ls.set(r.JY,t),e.options=t}},actions:{refreshOptionsCache:function(e){var t=e.commit;return new Promise((function(e,n){o.Z.option.listAsMapViewByKeys(d).then((function(n){t("SET_OPTIONS",n.data),e(n)})).catch((function(e){n(e)}))}))}}},p=m,h={device:function(e){return e.app.device},theme:function(e){return e.app.theme},color:function(e){return e.app.color},layoutSetting:function(e){return e.app.layoutSetting},sidebar:function(e){return e.app.sidebar},loginModal:function(e){return e.app.loginModal},isInstalled:function(e){return e.app.isInstalled},token:function(e){return e.user.token},user:function(e){return e.user.user},options:function(e){return e.option.options}},f=h;a["default"].use(i.ZP);var g=new i.ZP.Store({modules:{app:l,user:c,option:p},state:{},mutations:{},actions:{},getters:f})},63214:function(e,t,n){"use strict";n.d(t,{LA:function(){return a},mQ:function(){return i},t0:function(){return r},v9:function(){return o},Dp:function(){return s},Vv:function(){return l},lK:function(){return u},NK:function(){return c},hC:function(){return d},xR:function(){return m},JY:function(){return p},W1:function(){return h}});var a="Access-Token",i="SIDEBAR_TYPE",r="DEFAULT_THEME",o="DEFAULT_LAYOUT_MODE",s="DEFAULT_COLOR",l="DEFAULT_FIXED_HEADER",u="DEFAULT_FIXED_SIDEBAR",c="DEFAULT_FIXED_HEADER_HIDDEN",d="DEFAULT_CONTENT_WIDTH_TYPE",m="USER",p="OPTIONS",h="LAYOUT_SETTING"},36591:function(e,t,n){"use strict";var a=n(54288),i=(n(70315),n(31875),n(30535),n(86381),n(82395),n(53961),n(18482),n(91860)),r=n(58903),o=n(36725),s=n(42728),l=n(22573),u=localStorage.getItem("apiUrl"),c=u||"",d=new i.HaloRestAPIClient({baseUrl:c}),m=new i.AdminApiClient(d);d.interceptors.request.use((function(e){var t=r.Z.getters.token;return t&&t.access_token&&(e.headers["Admin-Authorization"]=t.access_token),e}),(function(e){return Promise.reject(e)}));var p=!1,h=[];d.interceptors.response.use((function(e){return e}),function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(t){var n,a,u,c,d,m;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!i.Axios.isCancel(t)){e.next=2;break}return e.abrupt("return",Promise.reject(t));case 2:if(!/Network Error/.test(t.message)){e.next=5;break}return o.Z.error("网络错误,请检查网络连接"),e.abrupt("return",Promise.reject(t));case 5:if(n=r.Z.getters.token,a=t.config,u=t.response,c=u?u.data:null,!c){e.next=39;break}if(400!==c.status){e.next=14;break}return d=c.data,(0,l.Kn)(d)?(m=Object.keys(d||{}).map((function(e){return d[e]})),s.Z.error({message:c.message,description:function(e){var t=m.map((function(t){return e("a-alert",{props:{message:t,banner:!0,showIcon:!1,type:"error"}})}));return e("div",t)},duration:10})):o.Z.error(c.message),e.abrupt("return",Promise.reject(t));case 14:if(401!==c.status){e.next=37;break}if(p){e.next=36;break}return p=!0,e.prev=17,e.next=20,r.Z.dispatch("refreshToken",n.refresh_token);case 20:return h.forEach((function(e){return e()})),h=[],e.abrupt("return",(0,i.Axios)(a));case 25:return e.prev=25,e.t0=e["catch"](17),o.Z.warning("当前登录状态已失效,请重新登录"),e.next=30,r.Z.dispatch("ToggleLoginModal",!0);case 30:return e.abrupt("return",Promise.reject(e.t0));case 31:return e.prev=31,p=!1,e.finish(31);case 34:e.next=37;break;case 36:return e.abrupt("return",new Promise((function(e){h.push((function(){e((0,i.Axios)(a))}))})));case 37:return o.Z.error(c.message||"服务器错误"),e.abrupt("return",Promise.reject(t));case 39:return o.Z.error("网络异常"),e.abrupt("return",Promise.reject(t));case 41:case"end":return e.stop()}}),e,null,[[17,25,31,34]])})));return function(t){return e.apply(this,arguments)}}()),t["Z"]=m},37750:function(e,t,n){"use strict";n.d(t,{RQ:function(){return a},vq:function(){return r},aX:function(){return i}});n(30535),n(15231),n(85018),n(96153),n(31875),n(11074),n(86381);var a=function(e){return!!r(e)&&(e.match(/^rgb/)?(e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/),t=e[1],n=e[2],a=e[3]):(e=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&")),t=e>>16,n=e>>8&255,a=255&e),i=Math.sqrt(t*t*.299+n*n*.587+a*a*.114),i>127.5);var t,n,a,i},i=/(^#[0-9A-F])/i,r=function(e){return i.test(e)}},25572:function(e,t,n){"use strict";n.d(t,{_:function(){return r},S:function(){return o}});var a=n(23598),i=n.n(a);n(98101);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm";return i()(e).format(t)}function o(e){var t=(new Date).getTime(),n=t-e,a=Math.floor(n/864e5);if(0===a){var r=n%864e5,o=Math.floor(r/36e5);if(0===o){var s=r%36e5,l=Math.floor(s/6e4);if(0===l){var u=s%6e4,c=Math.round(u/1e3);return c+" 秒前"}return l+" 分钟前"}return o+" 小时前"}return a<0?"刚刚":a<5?a+" 天前":i()(e).format("YYYY-MM-DD HH:mm")}i().locale("zh-cn")},68835:function(e,t,n){"use strict";n.d(t,{m:function(){return r},A:function(){return o}});var a=n(3779),i=n.n(a),r={DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile"},o=function(e){var t={match:function(){e&&e(r.DESKTOP)}},n={match:function(){e&&e(r.TABLET)}},a={match:function(){e&&e(r.MOBILE)}};i().register("screen and (max-width: 576px)",a).register("screen and (min-width: 576px) and (max-width: 1199px)",n).register("screen and (min-width: 1200px)",t)}},22573:function(e,t,n){"use strict";n.d(t,{XC:function(){return i},Kn:function(){return r},I8:function(){return o}});var a=n(64349);n(87591),n(31875),n(18482),n(53961);function i(){var e=document.createEvent("HTMLEvents");e.initEvent("resize",!0,!0),e.eventType="message",window.dispatchEvent(e)}function r(e){return e&&"object"===(0,a.Z)(e)&&e.constructor===Object}function o(e){if(!e&&"object"!==(0,a.Z)(e))throw new Error("error arguments");var t=e.constructor===Array?[]:{};return Object.keys(e).forEach((function(n){e[n]&&"object"===(0,a.Z)(e[n])?t[n]=o(e[n]):t[n]=e[n]})),t}},19060:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a-form-model",{ref:"loginForm",attrs:{model:e.form.model,rules:e.form.rules,layout:"vertical"},nativeOn:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.form.needAuthCode?e.handleLogin():e.handleLoginClick()}}},[e.form.needAuthCode?e._e():n("a-form-model-item",{attrs:{prop:"username"}},[n("a-input",{attrs:{placeholder:"用户名/邮箱"},model:{value:e.form.model.username,callback:function(t){e.$set(e.form.model,"username",t)},expression:"form.model.username"}},[n("a-icon",{staticStyle:{color:"rgba(0, 0, 0, 0.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),e.form.needAuthCode?e._e():n("a-form-model-item",{attrs:{prop:"password"}},[n("a-input",{attrs:{placeholder:"密码",type:"password"},model:{value:e.form.model.password,callback:function(t){e.$set(e.form.model,"password",t)},expression:"form.model.password"}},[n("a-icon",{staticStyle:{color:"rgba(0, 0, 0, 0.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),e.form.needAuthCode?n("a-form-model-item",{attrs:{prop:"authcode"}},[n("a-input",{attrs:{maxLength:6,placeholder:"两步验证码"},model:{value:e.form.model.authcode,callback:function(t){e.$set(e.form.model,"authcode",t)},expression:"form.model.authcode"}},[n("a-icon",{staticStyle:{color:"rgba(0, 0, 0, 0.25)"},attrs:{slot:"prefix",type:"safety-certificate"},slot:"prefix"})],1)],1):e._e(),n("a-form-model-item",[n("a-button",{attrs:{block:!0,loading:e.form.logging,type:"primary"},on:{click:function(t){e.form.needAuthCode?e.handleLogin():e.handleLoginClick()}}},[e._v(" "+e._s(e.buttonName)+" ")])],1)],1)],1)},i=[],r=n(22373),o=(n(87591),n(31875),n(98906)),s=n(36591),l={name:"LoginForm",data:function(){var e=this,t=function(t,n,a){!n&&e.form.needAuthCode?a(new Error("* 请输入两步验证码")):a()};return{form:{model:{authcode:null,password:null,username:null},rules:{username:[{required:!0,message:"* 用户名/邮箱不能为空",trigger:["change"]}],password:[{required:!0,message:"* 密码不能为空",trigger:["change"]}],authcode:[{validator:t,trigger:["change"]}]},needAuthCode:!1,logging:!1}}},computed:{buttonName:function(){return this.form.needAuthCode?"验证":"登录"}},methods:(0,r.Z)((0,r.Z)({},(0,o.nv)(["login","refreshUserCache","refreshOptionsCache"])),{},{handleLoginClick:function(){var e=this;e.$refs.loginForm.validate((function(t){t&&(e.form.logging=!0,s.Z.needMFACode({username:e.form.model.username,password:e.form.model.password}).then((function(t){var n=t.data;n&&n.needMFACode?(e.form.needAuthCode=!0,e.form.model.authcode=null):e.handleLogin()})).finally((function(){setTimeout((function(){e.form.logging=!1}),300)})))}))},handleLogin:function(){var e=this;e.$refs.loginForm.validate((function(t){t&&(e.form.logging=!0,e.login(e.form.model).then((function(){e.$emit("success")})).finally((function(){setTimeout((function(){e.form.logging=!1}),300)})))}))}})},u=l,c=n(70739),d=(0,c.Z)(u,a,i,!1,null,null,null),m=d.exports},64121:function(){}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=e,function(){var e=[];n.O=function(t,a,i,r){if(!a){var o=1/0;for(c=0;c<e.length;c++){a=e[c][0],i=e[c][1],r=e[c][2];for(var s=!0,l=0;l<a.length;l++)(!1&r||o>=r)&&Object.keys(n.O).every((function(e){return n.O[e](a[l])}))?a.splice(l--,1):(s=!1,r<o&&(o=r));if(s){e.splice(c--,1);var u=i();void 0!==u&&(t=u)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[a,i,r]}}(),function(){n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,{a:t}),t}}(),function(){n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,a){return n.f[a](e,t),t}),[]))}}(),function(){n.u=function(e){return"js/"+e+"."+{37:"6a03c659",68:"3605f322",84:"0a25ec62",105:"5673945d",107:"c9413b7f",154:"445ed0f8",163:"f94a8d0a",164:"4ee274e1",187:"54972bff",192:"96a8d804",214:"38102091",265:"1903c08e",271:"023a72fd",303:"b6f8abcf",307:"4d6affb6",336:"a65a8665",355:"e10abe01",361:"7c0bd5d8",379:"a154db4a",513:"f561d6de",530:"c74d516c",549:"862957fd",562:"574f40b9",626:"32ef51dd",667:"a6692782",702:"9e713c96",712:"8a49ddcc",719:"8a5309d3",726:"c184179f",756:"6b5d55e6",766:"75c47b7a",773:"a6f95edf",782:"f22fdd59",788:"89c10845",799:"2e8971ee",805:"945e2775",828:"bd55ca6d",875:"b26f07e7",899:"6379a537",933:"d0bcb2df",948:"ae9c5b7a",994:"73591730"}[e]+".js"}}(),function(){n.miniCssF=function(e){return"css/"+e+"."+{68:"78f75b8b",271:"216595d3",307:"982db2ca",562:"f14bd7a4",702:"989122e8",726:"3db0de18",799:"7eba7ac9",948:"216595d3",994:"828845cf"}[e]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="halo-admin:";n.l=function(a,i,r,o){if(e[a])e[a].push(i);else{var s,l;if(void 0!==r)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==a||d.getAttribute("data-webpack")==t+r){s=d;break}}s||(l=!0,s=document.createElement("script"),s.charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+r),s.src=a),e[a]=[i];var m=function(t,n){s.onerror=s.onload=null,clearTimeout(p);var i=e[a];if(delete e[a],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}}}(),function(){n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){n.p="/"}(),function(){var e=function(e,t,n,a){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css";var r=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var o=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=s,i.parentNode.removeChild(i),a(l)}};return i.onerror=i.onload=r,i.href=t,document.head.appendChild(i),i},t=function(e,t){for(var n=document.getElementsByTagName("link"),a=0;a<n.length;a++){var i=n[a],r=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(r===e||r===t))return i}var o=document.getElementsByTagName("style");for(a=0;a<o.length;a++){i=o[a],r=i.getAttribute("data-href");if(r===e||r===t)return i}},a=function(a){return new Promise((function(i,r){var o=n.miniCssF(a),s=n.p+o;if(t(o,s))return i();e(a,s,i,r)}))},i={143:0};n.f.miniCss=function(e,t){var n={68:1,271:1,307:1,562:1,702:1,726:1,799:1,948:1,994:1};i[e]?t.push(i[e]):0!==i[e]&&n[e]&&t.push(i[e]=a(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}(),function(){var e={143:0};n.f.j=function(t,a){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)a.push(i[2]);else{var r=new Promise((function(n,a){i=e[t]=[n,a]}));a.push(i[2]=r);var o=n.p+n.u(t),s=new Error,l=function(a){if(n.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var r=a&&("load"===a.type?"missing":a.type),o=a&&a.target&&a.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",s.name="ChunkLoadError",s.type=r,s.request=o,i[1](s)}};n.l(o,l,"chunk-"+t,t)}},n.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,r,o=a[0],s=a[1],l=a[2],u=0;if(o.some((function(t){return 0!==e[t]}))){for(i in s)n.o(s,i)&&(n.m[i]=s[i]);if(l)var c=l(n)}for(t&&t(a);u<o.length;u++)r=o[u],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(c)},a=self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=n.O(void 0,[998],(function(){return n(33132)}));a=n.O(a)})(); |