mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
30 KiB
8 lines
30 KiB
import{d as K,H as T,S as X,b as V,e as f,v as z,w as u,bk as d,A as I,k as s,y as N,_ as q,f as R,Z as S,j as w,c as Q,E as j,r as ue,F as ee,t as A,x as te,h as L,a9 as we,q as oe,l as ve,am as ye}from"./@vue-M2CzPUka.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-iNEl8q3a.js";import{c as Te,u as W}from"./vuex-k9agayot.js";import{a as Pe}from"./axios-zw96FDk0.js";import{_ as Me,N as Ae,a as pe,b as de,c as Re,d as Ee,e as me,f as Ce,g as Oe,h as he,i as Se,j as F,k as Ie,u as Ue,l as $e,m as De,n as xe,o as Ne,p as qe,q as ze,r as Fe,s as Ke,t as Ve}from"./naive-ui-CFtxauK_.js";import{h as U}from"./moment-jIwEdMgI.js";import{S as We,M as Be,L as He,C as Ye,B as je,P as Qe,W as Ze,a as Ge,H as re,b as se,c as ne}from"./@vicons-t7bPon9z.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-5-iSHcg-.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-nQ5vzMKz.js";import"./vooks-RlHpQsWY.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))_(n);new MutationObserver(n=>{for(const c of n)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&_(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const c={};return n.integrity&&(c.integrity=n.integrity),n.referrerPolicy&&(c.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?c.credentials="include":n.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function _(n){if(n.ep)return;n.ep=!0;const c=r(n);fetch(n.href,c)}})();const Je="modulepreload",Xe=function(e){return"/"+e},ae={},M=function(t,r,_){let n=Promise.resolve();if(r&&r.length>0){const c=document.getElementsByTagName("link");n=Promise.all(r.map(l=>{if(l=Xe(l),l in ae)return;ae[l]=!0;const P=l.endsWith(".css"),k=P?'[rel="stylesheet"]':"";if(!!_)for(let i=c.length-1;i>=0;i--){const v=c[i];if(v.href===l&&(!P||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${k}`))return;const m=document.createElement("link");if(m.rel=P?"stylesheet":Je,P||(m.as="script",m.crossOrigin=""),m.href=l,document.head.appendChild(m),P)return new Promise((i,v)=>{m.addEventListener("load",i),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}return n.then(()=>t()).catch(c=>{const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c})},et=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>M(()=>import("./Home--QVDyCUb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]))},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>M(()=>import("./Post-fPbp6nhd.js"),__vite__mapDeps([46,4,25,34,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,21,23,24,26,31,32,33,28,18,19,27,29,35,36,37,38,42,43,47,45]))},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>M(()=>import("./Topic-mfRYoI-y.js"),__vite__mapDeps([48,22,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,35,25,26,36,42,43,49,45]))},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>M(()=>import("./Anouncement-jBgD29MZ.js"),__vite__mapDeps([50,31,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,32,35,25,26,22,36,42,43,51,45]))},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>M(()=>import("./Profile-VrxEigoT.js"),__vite__mapDeps([52,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,53,37,38,42,43,54,45]))},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>M(()=>import("./User-WBt5FsdU.js"),__vite__mapDeps([55,20,21,4,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,23,24,25,26,27,28,29,30,31,32,18,19,35,36,1,17,53,37,38,42,43,56,45]))},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>M(()=>import("./Messages-U6FsWsh_.js"),__vite__mapDeps([57,4,25,26,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,18,19,35,36,37,38,42,43,58,45]))},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>M(()=>import("./Collection-JyqBXzEz.js"),__vite__mapDeps([59,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,37,38,42,43,60,45]))},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>M(()=>import("./Contacts-hrZdUqvt.js"),__vite__mapDeps([61,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,22,31,32,35,25,26,36,37,38,42,43,62,45]))},{path:"/following",name:"following",meta:{title:"关注"},component:()=>M(()=>import("./Following-t2reqSPM.js"),__vite__mapDeps([63,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,22,31,32,35,25,26,36,37,38,42,43,64,45]))},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>M(()=>import("./Wallet-2l1r5HHK.js"),__vite__mapDeps([65,31,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,32,35,25,26,22,36,66,67,68,42,43,69,45]))},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>M(()=>import("./Setting-CzaykPUW.js"),__vite__mapDeps([70,35,25,4,26,8,6,22,2,3,5,7,9,10,11,12,13,14,15,16,36,42,43,71,45]))},{path:"/404",name:"404",meta:{title:"404"},component:()=>M(()=>import("./404-Y9K5O90e.js"),__vite__mapDeps([72,35,25,4,26,8,6,22,2,3,5,7,9,10,11,12,13,14,15,16,36,42,43,73,45]))},{path:"/:pathMatch(.*)",redirect:"/404"}],_e=be({history:ke(),routes:et});_e.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Te({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",unreadMsgCount:0,userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},profile:{useFriendship:!0,enableTrendsBar:!0,enableWallet:!1,allowTweetAttachment:!0,allowTweetAttachmentPrice:!0,allowTweetVideo:!0,allowUserRegister:!0,allowPhoneBind:!0,defaultTweetMaxLength:2e3,tweetWebEllipsisSize:400,tweetMobileEllipsisSize:300,defaultTweetVisibility:"friend",defaultMsgLoopInterval:5e3,copyrightTop:"2023 paopao.info",copyrightLeft:"Roc's Me",copyrightLeftLink:"",copyrightRight:"泡泡(PaoPao)开源社区",copyrightRightLink:"https://www.paopao.info"}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},updateUnreadMsgCount(e,t){e.unreadMsgCount=t},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},loadDefaultSiteProfile(e){e.profile.useFriendship="true".toLowerCase()==="true",e.profile.enableTrendsBar="false".toLowerCase()==="true",e.profile.enableWallet="false".toLocaleLowerCase()==="true",e.profile.allowTweetAttachment="true".toLowerCase()==="true",e.profile.allowTweetAttachmentPrice="false".toLowerCase()==="true",e.profile.allowTweetVideo="true".toLowerCase()==="true",e.profile.allowUserRegister="true".toLowerCase()==="true",e.profile.allowPhoneBind="true".toLowerCase()==="true",e.profile.defaultTweetMaxLength=2e3,e.profile.tweetWebEllipsisSize=400,e.profile.tweetMobileEllipsisSize=300,e.profile.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=5e3,e.profile.copyrightTop="2023 paopao.info",e.profile.copyrightLeft="Roc's Me",e.profile.copyrightLeftLink="",e.profile.copyrightRight="泡泡(PaoPao)开源社区",e.profile.copyrightRightLink="https://www.paopao.info"},updateSiteProfile(e,t){const r=e.profile;e.profile.useFriendship=t.use_friendship??r.useFriendship,e.profile.enableTrendsBar=t.enable_trends_bar??r.enableTrendsBar,e.profile.enableWallet=t.enable_wallet??r.enableWallet,e.profile.allowTweetAttachment=t.allow_tweet_attachment??r.allowTweetAttachment,e.profile.allowTweetAttachmentPrice=t.allow_tweet_attachment_price??r.allowTweetAttachmentPrice,e.profile.allowTweetVideo=t.allow_tweet_video??r.allowTweetVideo,e.profile.allowUserRegister=t.allow_user_register??r.allowUserRegister,e.profile.allowPhoneBind=t.allow_phone_bind??r.allowPhoneBind,e.profile.defaultTweetMaxLength=t.default_tweet_max_length??r.defaultTweetMaxLength,e.profile.tweetWebEllipsisSize=t.tweet_web_ellipsis_size??r.tweetWebEllipsisSize,e.profile.tweetMobileEllipsisSize=t.tweet_mobile_ellipsis_size??r.tweetMobileEllipsisSize,e.profile.defaultTweetVisibility=t.default_tweet_visibility??r.defaultTweetVisibility,e.profile.defaultMsgLoopInterval=t.default_msg_loop_interval??r.defaultMsgLoopInterval,e.profile.copyrightTop=t.copyright_top??r.copyrightTop,e.profile.copyrightLeft=t.copyright_left??r.copyrightLeft,e.profile.copyrightLeftLink=t.copyright_left_link??r.copyrightLeftLink,e.profile.copyrightRight=t.copyright_right??r.copyrightRight,e.profile.copyrightRightLink=t.copyright_right_link??r.copyrightRightLink},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),Z=Pe.create({baseURL:"",timeout:3e4});Z.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Z.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Z(e)}const le=e=>o({method:"post",url:"/v1/auth/login",data:e}),ot=e=>o({method:"post",url:"/v1/auth/register",data:e}),Y=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),rt={class:"auth-wrap"},st={key:0},nt=K({__name:"auth",setup(e){const t=W(),r=T(!1),_=T(),n=X({username:"",password:""}),c=T(),l=X({username:"",password:"",repassword:""}),P={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(m,i)=>!!l.password&&l.password.startsWith(i)&&l.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},k=m=>{var i;m.preventDefault(),m.stopPropagation(),(i=_.value)==null||i.validate(v=>{v||(r.value=!0,le({username:n.username,password:n.password}).then(h=>{const b=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(h=>{window.$message.success("登录成功"),r.value=!1,t.commit("updateUserinfo",h),t.commit("triggerAuth",!1),t.commit("refresh"),n.username="",n.password=""}).catch(h=>{r.value=!1}))})},E=m=>{var i;m.preventDefault(),m.stopPropagation(),(i=c.value)==null||i.validate(v=>{v||(r.value=!0,ot({username:l.username,password:l.password}).then(h=>le({username:l.username,password:l.password})).then(h=>{const b=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(h=>{window.$message.success("注册成功"),r.value=!1,t.commit("updateUserinfo",h),t.commit("triggerAuth",!1),l.username="",l.password="",l.repassword=""}).catch(h=>{r.value=!1}))})};return V(()=>{const m=localStorage.getItem("PAOPAO_TOKEN")||"";m?Y(m).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(m,i)=>{const v=Me,h=Ae,b=pe,a=de,g=Re,D=Ee,$=me,x=Ce,p=Oe,C=he,B=Se;return f(),z(B,{show:d(t).state.authModalShow,"onUpdate:show":i[7]||(i[7]=y=>d(t).state.authModalShow=y),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:u(()=>[w("div",rt,[s(C,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?S("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(h,null,{default:u(()=>[s(v,{type:"success"},{default:u(()=>[I("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:_,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(g,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[1]||(i[1]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:k},{default:u(()=>[I(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),z(p,{key:1,"default-value":d(t).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:u(()=>[s(x,{name:"signin",tab:"登录"},{default:u(()=>[s(D,{ref_key:"loginRef",ref:_,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(g,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[3]||(i[3]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:k},{default:u(()=>[I(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:c,model:l,rules:P},{default:u(()=>[s(g,{label:"用户名",path:"username"},{default:u(()=>[s(a,{value:l.username,"onUpdate:value":i[4]||(i[4]=y=>l.username=y),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:l.password,"onUpdate:value":i[5]||(i[5]=y=>l.password=y),onKeyup:q(N(E,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"重复密码",path:"repassword"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:l.repassword,"onUpdate:value":i[6]||(i[6]=y=>l.repassword=y),onKeyup:q(N(E,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:E},{default:u(()=>[I(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):S("",!0)]),_:1})])]),_:1},8,["show"])}}}),fe=(e,t)=>{const r=e.__vccOpts||e;for(const[_,n]of t)r[_]=n;return r},at=fe(nt,[["__scopeId","data-v-6f778fc4"]]),no=e=>o({method:"get",url:"/v1/posts",params:e}),lt=e=>o({method:"get",url:"/v1/tags",params:e}),ao=e=>o({method:"get",url:"/v1/post",params:e}),lo=e=>o({method:"get",url:"/v1/post/star",params:e}),io=e=>o({method:"post",url:"/v1/post/star",data:e}),uo=e=>o({method:"get",url:"/v1/post/collection",params:e}),co=e=>o({method:"post",url:"/v1/post/collection",data:e}),po=e=>o({method:"get",url:"/v1/post/comments",params:e}),mo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ho=e=>o({method:"get",url:"/v1/trends/index",params:e}),_o=e=>o({method:"post",url:"/v1/post",data:e}),fo=e=>o({method:"delete",url:"/v1/post",data:e}),go=e=>o({method:"post",url:"/v1/post/lock",data:e}),wo=e=>o({method:"post",url:"/v1/post/stick",data:e}),vo=e=>o({method:"post",url:"/v1/post/highlight",data:e}),yo=e=>o({method:"post",url:"/v1/post/visibility",data:e}),bo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),ko=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Po=e=>o({method:"post",url:"/v1/post/comment",data:e}),Mo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Eo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Oo=e=>o({method:"post",url:"/v1/topic/pin",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Io=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),$o=e=>o({method:"post",url:"/v1/captcha",data:e}),Do=e=>o({method:"post",url:"/v1/user/whisper",data:e}),xo=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),No=e=>o({method:"post",url:"/v1/friend/add",data:e}),qo=e=>o({method:"post",url:"/v1/user/follow",data:e}),zo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Fo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ko=e=>o({method:"get",url:"/v1/user/followings",params:e}),Vo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Wo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Ho=e=>o({method:"post",url:"/v1/user/activate",data:e}),Yo=e=>o({method:"post",url:"/v1/user/password",data:e}),jo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Qo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ie=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Zo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Go=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Jo=()=>o({method:"post",url:"/v1/user/message/readall"}),Xo=e=>o({method:"get",url:"/v1/user/collections",params:e}),er=e=>o({method:"get",url:"/v1/user/profile",params:e}),tr=e=>o({method:"get",url:"/v1/user/posts",params:e}),or=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),rr=e=>o({method:"post",url:"/v1/user/recharge",data:e}),sr=e=>o({method:"get",url:"/v1/user/recharge",params:e}),nr=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ar=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),lr=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),ir=e=>o({method:"get",url:"/v1/attachment",params:e}),ur=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),it=()=>o({method:"get",url:"/v1/admin/site/status"});U.locale("zh-cn");const ut=e=>U.unix(e).fromNow(),cr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},pr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},dr=e=>U.unix(e).utc(!0).format("YYYY年MM月"),ct={key:0,class:"rightbar-wrap"},pt={class:"search-wrap"},dt={class:"post-num"},mt={class:"post-num"},ht={class:"copyright"},_t=["href"],ft=["href"],gt={class:"site-info-item"},wt=K({__name:"rightbar",setup(e){const t=T([]),r=T([]),_=T(!1),n=T(""),c=W(),l=ce(),P=T(0),k=T(0),E=T(0),m=T(0),i=T(null),v=6,h=12,b=()=>{it().then(p=>{P.value=p.register_user_count,k.value=p.online_user_count,E.value=p.history_max_online,m.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{_.value=!0,lt({type:"hot_extral",num:h,extral_num:v}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,_.value=!1}).catch(p=>{_.value=!1})},g=p=>p>=1e3?(p/1e3).toFixed(1)+"k":p,D=()=>{l.push({name:"home",query:{q:n.value}})},$=Q({get:()=>c.state.userLogined&&r.value.length!==0,set:p=>{}});j(()=>({refreshTopicFollow:c.state.refreshTopicFollow,userLogined:c.state.userLogined}),(p,C)=>{(p.refreshTopicFollow!==C.refreshTopicFollow||p.userLogined)&&a(),c.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(C=>{C.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,C)=>{const B=F,y=de,G=ue("router-link"),J=Ie,H=he,ge=pe;return d(c).state.collapsedRight?S("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":C[0]||(C[0]=O=>n.value=O),onKeyup:q(N(D,["prevent"]),["enter"])},{prefix:u(()=>[s(B,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),z(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:_.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,O=>(f(),R("div",{class:"hot-tag-item",key:O.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:O.tag,t:"tag"}}},{default:u(()=>[I(" #"+A(O.tag),1)]),_:2},1032,["to"]),w("div",dt,A(g(O.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):S("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:_.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,O=>(f(),R("div",{class:"hot-tag-item",key:O.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:O.tag,t:"tag"}}},{default:u(()=>[I(" #"+A(O.tag),1)]),_:2},1032,["to"]),w("div",mt,A(g(O.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",ht,"© "+A(d(c).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(c).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(c).state.profile.copyrightLeft),9,_t),w("a",{href:d(c).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(c).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(c).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(P.value)+" 注册用户,"+A(k.value)+" 人在线,最高在线 "+A(E.value)+" 人,站点上线于 "+A(d(ut)(m.value)),1)],512)):S("",!0)]))}}}),vt=fe(wt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-ME_znyse.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Tt={class:"user-info"},Pt={class:"nickname"},Mt={class:"nickname-txt"},At={class:"username"},Rt={class:"user-mini-wrap"},Et={key:1,class:"user-wrap"},Ct={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},St=K({__name:"sidebar",setup(e){const t=W(),r=Le(),_=ce(),n=T(!1),c=T(r.name||""),l=T(),P="false".toLowerCase()==="true";j(r,()=>{c.value=r.name}),j(t.state,()=>{n.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?l.value||(ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)}),l.value=setInterval(()=>{ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)})},t.state.profile.defaultMsgLoopInterval)):l.value&&clearInterval(l.value)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const k=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>L(re),href:"/"},{label:"话题",key:"topic",icon:()=>L(se),href:"/topic"}];return P&&a.push({label:"公告",key:"anouncement",icon:()=>L(Be),href:"/anouncement"}),a.push({label:"主页",key:"profile",icon:()=>L(He),href:"/profile"}),a.push({label:"消息",key:"messages",icon:()=>L(Ye),href:"/messages"}),a.push({label:"收藏",key:"collection",icon:()=>L(je),href:"/collection"}),t.state.profile.useFriendship&&a.push({label:"好友",key:"contacts",icon:()=>L(Qe),href:"/contacts"}),t.state.profile.enableWallet&&a.push({label:"钱包",key:"wallet",icon:()=>L(Ze),href:"/wallet"}),a.push({label:"设置",key:"setting",icon:()=>L(Ge),href:"/setting"}),t.state.userInfo.id>0?a:[{label:"广场",key:"home",icon:()=>L(re),href:"/"},{label:"话题",key:"topic",icon:()=>L(se),href:"/topic"}]}),E=a=>"href"in a?L("div",{},a.label):a.label,m=a=>a.key==="messages"?L($e,{dot:!0,show:n.value,processing:!0},{default:()=>L(F,{color:a.key===c.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):L(F,null,{default:a.icon}),i=(a,g={})=>{c.value=a,_.push({name:a,query:{t:new Date().getTime()}})},v=()=>{r.path==="/"&&t.commit("refresh"),i("home")},h=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),v()};return window.$store=t,window.$message=Ue(),(a,g)=>{const D=De,$=xe,x=Ne,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:v},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:k.value,"render-label":E,"render-icon":m,value:c.value,"onUpdate:value":i},null,8,["options","value"]),d(t).state.userInfo.id>0?(f(),R("div",Lt,[s(x,{class:"user-avatar",round:"",size:34,src:d(t).state.userInfo.avatar},null,8,["src"]),w("div",Tt,[w("div",Pt,[w("span",Mt,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(F),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",At,"@"+A(d(t).state.userInfo.username),1)]),w("div",Rt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(F),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Et,[d(t).state.profile.allowUserRegister?S("",!0):(f(),R("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=C=>h("signin"))},{default:u(()=>[I(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=C=>h("signin"))},{default:u(()=>[I(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=C=>h("signup"))},{default:u(()=>[I(" 注册 ")]),_:1})])):S("",!0)]))])}}}),It=()=>o({method:"get",url:"/v1/site/profile"}),Ut={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=K({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?ze:null);function _(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&It().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return V(()=>{_()}),(n,c)=>{const l=St,P=ue("router-view"),k=vt,E=at,m=Fe,i=Ke,v=Ve,h=qe;return f(),z(h,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(m,null,{default:u(()=>{var b;return[w("div",{class:ve(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",Ut,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(l)])):S("",!0),w("div",Dt,[s(P,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),z(we,null,[n.$route.meta.keepAlive?(f(),z(oe(a),{key:0})):S("",!0)],1024)),n.$route.meta.keepAlive?S("",!0):(f(),z(oe(a),{key:0}))]),_:1})]),s(k)]),s(E)],2)]}),_:1})]),_:1}),s(v)]),_:1},8,["theme"])}}});ye(xt).use(_e).use(tt).mount("#app");export{Ko as $,io as A,co as B,ao as C,po as D,yt as E,Co as F,Oo as G,Io as H,So as I,lt as J,ut as K,dr as L,er as M,ur as N,xo as O,No as P,Vo as Q,Go as R,Zo as S,Jo as T,Xo as U,pr as V,lr as W,ir as X,mo as Y,Fo as Z,fe as _,ar as a,Do as a0,Y as a1,or as a2,rr as a3,sr as a4,Uo as a5,Qo as a6,Yo as a7,Bo as a8,Ho as a9,jo as aa,$o as ab,St as ac,ho as b,_o as c,no as d,tr as e,qo as f,nr as g,Wo as h,cr as i,To as j,Eo as k,bo as l,ko as m,Ro as n,Mo as o,Ao as p,Po as q,lo as r,uo as s,Lo as t,zo as u,fo as v,go as w,wo as x,vo as y,yo as z};
|
|
function __vite__mapDeps(indexes) {
|
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
__vite__mapDeps.viteFileDeps = ["assets/Home--QVDyCUb.js","assets/whisper-add-friend-kzktoNux.js","assets/naive-ui-CFtxauK_.js","assets/seemly-hKSMrbh9.js","assets/@vue-M2CzPUka.js","assets/vueuc-5-iSHcg-.js","assets/evtd-9ZCiDXyn.js","assets/@css-render-nQ5vzMKz.js","assets/vooks-RlHpQsWY.js","assets/vdirs-gz97tqc5.js","assets/@juggle--NVrOerG.js","assets/css-render-Adblu2bf.js","assets/@emotion-vV6BesBt.js","assets/lodash-es-KEIJqYRD.js","assets/treemate-hmrDCADh.js","assets/async-validator-BHjhHa7C.js","assets/date-fns-E8ESfRGG.js","assets/whisper-add-friend-R3W2ljoW.css","assets/whisper-p-lu9vBA.js","assets/whisper-UU5QVlv3.css","assets/post-item.vue_vue_type_style_index_0_lang-NAwb_d8Q.js","assets/content-uMCu942j.js","assets/@vicons-t7bPon9z.js","assets/paopao-video-player-P8vpiOXx.js","assets/content--HAHeWeT.css","assets/vuex-k9agayot.js","assets/vue-router-iNEl8q3a.js","assets/copy-to-clipboard-l6UqHK6O.js","assets/@babel-5-cIlDoe.js","assets/toggle-selection-fekekO1r.js","assets/post-item-wU5RYMZl.css","assets/post-skeleton-Ci-jNNIC.js","assets/post-skeleton-tYynKIkA.css","assets/lodash-8cBkGte7.js","assets/IEnum-u5OuruSk.js","assets/main-nav.vue_vue_type_style_index_0_lang-NlSSnAqR.js","assets/main-nav-Cd31t9PJ.css","assets/v3-infinite-loading--AB1xg2t.js","assets/v3-infinite-loading-Z45psRbt.css","assets/@opentiny-uoOjf5Au.js","assets/vue-l_NObxuH.js","assets/@opentiny-urK5SdM0.css","assets/axios-zw96FDk0.js","assets/moment-jIwEdMgI.js","assets/Home-FNP8rm38.css","assets/vfonts-1-VPxUEo.css","assets/Post-fPbp6nhd.js","assets/Post-1TDHbf8L.css","assets/Topic-mfRYoI-y.js","assets/Topic-0adcrc3O.css","assets/Anouncement-jBgD29MZ.js","assets/Anouncement-_fp7ZHOJ.css","assets/Profile-VrxEigoT.js","assets/count-GnrfahME.js","assets/Profile-6IJN_JzI.css","assets/User-WBt5FsdU.js","assets/User-sRiaqMlA.css","assets/Messages-U6FsWsh_.js","assets/Messages-hpLWVpg-.css","assets/Collection-JyqBXzEz.js","assets/Collection-Asz6ngr2.css","assets/Contacts-hrZdUqvt.js","assets/Contacts-5sEVRvVP.css","assets/Following-t2reqSPM.js","assets/Following-M_pYXXXd.css","assets/Wallet-2l1r5HHK.js","assets/qrcode-NFgyJgOr.js","assets/encode-utf8-YzUDWyGG.js","assets/dijkstrajs-mfgL5WWt.js","assets/Wallet-gRH3TBUo.css","assets/Setting-CzaykPUW.js","assets/Setting-99jPXkCK.css","assets/404-Y9K5O90e.js","assets/404-QyiMvdft.css"]
|
|
}
|
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
}
|