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.
7 lines
30 KiB
7 lines
30 KiB
import{d as K,H as L,S as X,b as V,e as f,v as z,w as u,bf as d,A as I,k as s,y as N,_ as q,f as A,Z as S,j as v,c as Q,E as j,r as ue,F as ee,t as M,x as te,h as k,a6 as we,q as oe,l as ve,ah as ye}from"./@vue-73x4sYJ2.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-22lN-LLO.js";import{c as Te,u as W}from"./vuex-6eozxOS7.js";import{a as Pe}from"./axios-QLjAsgXu.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-qF3urcFV.js";import{h as U}from"./moment-TH1CLKMj.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-UfsZxvNZ.js";/* empty css */import"./seemly-tZbmuCcS.js";import"./vueuc-oXvKre1p.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-RY9kiobo.js";import"./vooks-574GUng3.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Jaty3dru.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 l of n)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&_(c)}).observe(document,{childList:!0,subtree:!0});function r(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function _(n){if(n.ep)return;n.ep=!0;const l=r(n);fetch(n.href,l)}})();const Je="modulepreload",Xe=function(e){return"/"+e},ae={},P=function(t,r,_){if(!r||r.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(r.map(l=>{if(l=Xe(l),l in ae)return;ae[l]=!0;const c=l.endsWith(".css"),O=c?'[rel="stylesheet"]':"";if(!!_)for(let h=n.length-1;h>=0;h--){const i=n[h];if(i.href===l&&(!c||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${O}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":Je,c||(g.as="script",g.crossOrigin=""),g.href=l,document.head.appendChild(g),c)return new Promise((h,i)=>{g.addEventListener("load",h),g.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>t()).catch(l=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l})},et=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>P(()=>import("./Home-nBvhGgJ3.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:()=>P(()=>import("./Post-E_ELhaqQ.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:()=>P(()=>import("./Topic-Dyi1bGbQ.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:()=>P(()=>import("./Anouncement-BaTbuw8e.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:()=>P(()=>import("./Profile-KriToSh-.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:()=>P(()=>import("./User-mqM99TZc.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:()=>P(()=>import("./Messages-omlMwWgU.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:()=>P(()=>import("./Collection-5lNJT1Z1.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:()=>P(()=>import("./Contacts-hN2-f_sj.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:()=>P(()=>import("./Following--1xMeRFN.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:()=>P(()=>import("./Wallet-h29qIFUu.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:()=>P(()=>import("./Setting-I_cCyk-8.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:()=>P(()=>import("./404-Hd886V-Y.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="true".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=L(!1),_=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),O={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,i)=>!!c.password&&c.password.startsWith(i)&&c.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},T=h=>{var i;h.preventDefault(),h.stopPropagation(),(i=_.value)==null||i.validate(R=>{R||(r.value=!0,le({username:n.username,password:n.password}).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("登录成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),t.commit("refresh"),n.username="",n.password=""}).catch(m=>{r.value=!1}))})},g=h=>{var i;h.preventDefault(),h.stopPropagation(),(i=l.value)==null||i.validate(R=>{R||(r.value=!0,ot({username:c.username,password:c.password}).then(m=>le({username:c.username,password:c.password})).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("注册成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),c.username="",c.password="",c.repassword=""}).catch(m=>{r.value=!1}))})};return V(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?Y(h).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(h,i)=>{const R=Me,m=Ae,b=pe,a=de,w=Re,D=Ee,$=me,x=Ce,p=Oe,E=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(()=>[v("div",rt,[s(E,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?S("",!0):(f(),A("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(R,{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(w,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{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(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{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(w,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{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(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[I(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:O},{default:u(()=>[s(w,{label:"用户名",path:"username"},{default:u(()=>[s(a,{value:c.username,"onUpdate:value":i[4]||(i[4]=y=>c.username=y),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(w,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:c.password,"onUpdate:value":i[5]||(i[5]=y=>c.password=y),onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"重复密码",path:"repassword"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:c.repassword,"onUpdate:value":i[6]||(i[6]=y=>c.repassword=y),onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:g},{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/follow",data:e}),So=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Io=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Uo=e=>o({method:"post",url:"/v1/captcha",data:e}),$o=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Do=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),xo=e=>o({method:"post",url:"/v1/friend/add",data:e}),No=e=>o({method:"post",url:"/v1/user/follow",data:e}),qo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Fo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ko=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Vo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Ho=e=>o({method:"post",url:"/v1/user/password",data:e}),Yo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),jo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ie=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Qo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Zo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Go=()=>o({method:"post",url:"/v1/user/message/readall"}),Jo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Xo=e=>o({method:"get",url:"/v1/user/profile",params:e}),er=e=>o({method:"get",url:"/v1/user/posts",params:e}),tr=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),or=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rr=e=>o({method:"get",url:"/v1/user/recharge",params:e}),sr=e=>o({method:"get",url:"/v1/suggest/users",params:e}),nr=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),ar=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),lr=e=>o({method:"get",url:"/v1/attachment",params:e}),ir=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(),ur=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()},cr=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()},pr=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=L([]),r=L([]),_=L(!1),n=L(""),l=W(),c=ce(),O=L(0),T=L(0),g=L(0),h=L(0),i=L(null),R=6,m=12,b=()=>{it().then(p=>{O.value=p.register_user_count,T.value=p.online_user_count,g.value=p.history_max_online,h.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{_.value=!0,lt({type:"hot_extral",num:m,extral_num:R}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,_.value=!1}).catch(p=>{_.value=!1})},w=p=>p>=1e3?(p/1e3).toFixed(1)+"k":p,D=()=>{c.push({name:"home",query:{q:n.value}})},$=Q({get:()=>l.state.userLogined&&r.value.length!==0,set:p=>{}});j(()=>({refreshTopicFollow:l.state.refreshTopicFollow,userLogined:l.state.userLogined}),(p,E)=>{(p.refreshTopicFollow!==E.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(E=>{E.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,E)=>{const B=F,y=de,G=ue("router-link"),J=Ie,H=he,ge=pe;return d(l).state.collapsedRight?S("",!0):(f(),A("div",ct,[v("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":E[0]||(E[0]=C=>n.value=C),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),A(ee,null,te(r.value,C=>(f(),A("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[I(" #"+M(C.tag),1)]),_:2},1032,["to"]),v("div",dt,M(w(C.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),A(ee,null,te(t.value,C=>(f(),A("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[I(" #"+M(C.tag),1)]),_:2},1032,["to"]),v("div",mt,M(w(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[v("div",ht,"© "+M(d(l).state.profile.copyrightTop),1),v("div",null,[s(ge,null,{default:u(()=>[v("a",{href:d(l).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},M(d(l).state.profile.copyrightLeft),9,_t),v("a",{href:d(l).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},M(d(l).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(l).state.userInfo.is_admin?(f(),A("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[v("span",gt,M(O.value)+" 注册用户,"+M(T.value)+" 人在线,最高在线 "+M(g.value)+" 人,站点上线于 "+M(d(ut)(h.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=L(!1),l=L(r.name||""),c=L(),O="false".toLowerCase()==="true";j(r,()=>{l.value=r.name}),j(t.state,()=>{n.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?c.value||(ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)}),c.value=setInterval(()=>{ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)})},t.state.profile.defaultMsgLoopInterval)):c.value&&clearInterval(c.value)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const T=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return O&&a.push({label:"公告",key:"anouncement",icon:()=>k(Be),href:"/anouncement"}),a.push({label:"主页",key:"profile",icon:()=>k(He),href:"/profile"}),a.push({label:"消息",key:"messages",icon:()=>k(Ye),href:"/messages"}),a.push({label:"收藏",key:"collection",icon:()=>k(je),href:"/collection"}),t.state.profile.useFriendship&&a.push({label:"好友",key:"contacts",icon:()=>k(Qe),href:"/contacts"}),t.state.profile.enableWallet&&a.push({label:"钱包",key:"wallet",icon:()=>k(Ze),href:"/wallet"}),a.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?a:[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}]}),g=a=>"href"in a?k("div",{},a.label):a.label,h=a=>a.key==="messages"?k($e,{dot:!0,show:n.value,processing:!0},{default:()=>k(F,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(F,null,{default:a.icon}),i=(a,w={})=>{l.value=a,_.push({name:a,query:{t:new Date().getTime()}})},R=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),R()};return window.$store=t,window.$message=Ue(),(a,w)=>{const D=De,$=xe,x=Ne,p=me;return f(),A("div",bt,[v("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:R},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:T.value,"render-label":g,"render-icon":h,value:l.value,"onUpdate:value":i},null,8,["options","value"]),d(t).state.userInfo.id>0?(f(),A("div",Lt,[s(x,{class:"user-avatar",round:"",size:34,src:d(t).state.userInfo.avatar},null,8,["src"]),v("div",Tt,[v("div",Pt,[v("span",Mt,M(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})]),v("div",At,"@"+M(d(t).state.userInfo.username),1)]),v("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(),A("div",Et,[d(t).state.profile.allowUserRegister?S("",!0):(f(),A("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=E=>m("signin"))},{default:u(()=>[I(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),A("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=E=>m("signin"))},{default:u(()=>[I(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=E=>m("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,l)=>{const c=St,O=ue("router-view"),T=vt,g=at,h=Fe,i=Ke,R=Ve,m=qe;return f(),z(m,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(h,null,{default:u(()=>{var b;return[v("div",{class:ve(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[v("div",Ut,[d(t).state.desktopModelShow?(f(),A("div",$t,[s(c)])):S("",!0),v("div",Dt,[s(O,{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(T)]),s(g)],2)]}),_:1})]),_:1}),s(R)]),_:1},8,["theme"])}}});ye(xt).use(_e).use(tt).mount("#app");export{$o as $,io as A,co as B,ao as C,po as D,yt as E,Co as F,So as G,Oo as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Ko as P,Zo as Q,Qo as R,Go as S,Jo as T,cr as U,ar as V,lr as W,mo as X,zo as Y,Fo as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,Io as a4,jo as a5,Ho as a6,Wo as a7,Bo as a8,Yo as a9,Uo as aa,St as ab,ho as b,_o as c,no as d,er as e,No as f,sr as g,Vo as h,ur 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,qo 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-nBvhGgJ3.js","assets/whisper-add-friend-rSx0n5Ly.js","assets/naive-ui-qF3urcFV.js","assets/seemly-tZbmuCcS.js","assets/@vue-73x4sYJ2.js","assets/vueuc-oXvKre1p.js","assets/evtd-9ZCiDXyn.js","assets/@css-render-RY9kiobo.js","assets/vooks-574GUng3.js","assets/vdirs-gz97tqc5.js","assets/@juggle--NVrOerG.js","assets/css-render-Jaty3dru.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-nUbeLD5N.js","assets/whisper-UU5QVlv3.css","assets/post-item.vue_vue_type_style_index_0_lang-MnafUKn3.js","assets/content-jjSUke8z.js","assets/@vicons-UfsZxvNZ.js","assets/paopao-video-player-c1AKUL7s.js","assets/content--HAHeWeT.css","assets/vuex-6eozxOS7.js","assets/vue-router-22lN-LLO.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-IEvC_QvH.js","assets/post-skeleton-tYynKIkA.css","assets/lodash-8cBkGte7.js","assets/IEnum-u5OuruSk.js","assets/main-nav.vue_vue_type_style_index_0_lang--76-h8Yy.js","assets/main-nav-Cd31t9PJ.css","assets/v3-infinite-loading-yUDJG3gQ.js","assets/v3-infinite-loading-Z45psRbt.css","assets/@opentiny-ZnHDpCDL.js","assets/vue-llHYvwqU.js","assets/@opentiny-p0R3KACn.css","assets/axios-QLjAsgXu.js","assets/moment-TH1CLKMj.js","assets/Home-95rZ95Lp.css","assets/vfonts-1-VPxUEo.css","assets/Post-E_ELhaqQ.js","assets/Post-1TDHbf8L.css","assets/Topic-Dyi1bGbQ.js","assets/Topic-QHpoLRv-.css","assets/Anouncement-BaTbuw8e.js","assets/Anouncement-_fp7ZHOJ.css","assets/Profile-KriToSh-.js","assets/count-GnrfahME.js","assets/Profile-6IJN_JzI.css","assets/User-mqM99TZc.js","assets/User-sRiaqMlA.css","assets/Messages-omlMwWgU.js","assets/Messages-hpLWVpg-.css","assets/Collection-5lNJT1Z1.js","assets/Collection-Asz6ngr2.css","assets/Contacts-hN2-f_sj.js","assets/Contacts-5sEVRvVP.css","assets/Following--1xMeRFN.js","assets/Following-M_pYXXXd.css","assets/Wallet-h29qIFUu.js","assets/qrcode-NFgyJgOr.js","assets/encode-utf8-YzUDWyGG.js","assets/dijkstrajs-mfgL5WWt.js","assets/Wallet-gRH3TBUo.css","assets/Setting-I_cCyk-8.js","assets/Setting-99jPXkCK.css","assets/404-Hd886V-Y.js","assets/404-QyiMvdft.css"]
|
|
}
|
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
} |