From f2f2f89b4d6d0c89843ce3e3823695eed4db7cb7 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 3 Oct 2023 08:21:57 +0800 Subject: [PATCH 1/3] frontend: custom use web profile feature to enable fetch web profile from backend --- web/.env | 1 + web/dist/assets/{404-c0c7310e.js => 404-7a651458.js} | 2 +- ...ouncement-a1221d42.js => Anouncement-ade70010.js} | 2 +- ...Collection-55969243.js => Collection-71fe2540.js} | 2 +- .../{Contacts-669f91fa.js => Contacts-c3dd71d7.js} | 2 +- .../{Following-3acd73c5.js => Following-a53b2057.js} | 2 +- .../assets/{Home-c19b4d50.js => Home-142cb625.js} | 2 +- .../{Messages-2895f627.js => Messages-e06acc1a.js} | 2 +- .../assets/{Post-44974496.js => Post-6b0900af.js} | 2 +- .../{Profile-7682ee52.js => Profile-11f878a8.js} | 2 +- .../{Setting-9923d3fd.js => Setting-75fc0298.js} | 2 +- .../assets/{Topic-a2ac0d74.js => Topic-cbdeda07.js} | 2 +- .../assets/{User-f3cd38fc.js => User-d45b8d09.js} | 2 +- .../{Wallet-d200e3ec.js => Wallet-3ded4712.js} | 2 +- .../{content-a642a616.js => content-3ace01ff.js} | 2 +- .../assets/{index-15a0e03b.js => index-428b5d53.js} | 2 +- ...-nav.vue_vue_type_style_index_0_lang-1c9035f6.js} | 2 +- ...item.vue_vue_type_style_index_0_lang-093e4300.js} | 2 +- ...keleton-a15059e0.js => post-skeleton-510366fa.js} | 2 +- .../{whisper-29f2b0aa.js => whisper-7ff8cab8.js} | 2 +- ...nd-78adb41e.js => whisper-add-friend-55077e20.js} | 2 +- web/dist/index.html | 2 +- web/src/App.vue | 12 +++++++----- web/src/vite-env.d.ts | 1 + 24 files changed, 30 insertions(+), 26 deletions(-) rename web/dist/assets/{404-c0c7310e.js => 404-7a651458.js} (85%) rename web/dist/assets/{Anouncement-a1221d42.js => Anouncement-ade70010.js} (91%) rename web/dist/assets/{Collection-55969243.js => Collection-71fe2540.js} (90%) rename web/dist/assets/{Contacts-669f91fa.js => Contacts-c3dd71d7.js} (92%) rename web/dist/assets/{Following-3acd73c5.js => Following-a53b2057.js} (95%) rename web/dist/assets/{Home-c19b4d50.js => Home-142cb625.js} (98%) rename web/dist/assets/{Messages-2895f627.js => Messages-e06acc1a.js} (98%) rename web/dist/assets/{Post-44974496.js => Post-6b0900af.js} (98%) rename web/dist/assets/{Profile-7682ee52.js => Profile-11f878a8.js} (95%) rename web/dist/assets/{Setting-9923d3fd.js => Setting-75fc0298.js} (98%) rename web/dist/assets/{Topic-a2ac0d74.js => Topic-cbdeda07.js} (95%) rename web/dist/assets/{User-f3cd38fc.js => User-d45b8d09.js} (97%) rename web/dist/assets/{Wallet-d200e3ec.js => Wallet-3ded4712.js} (95%) rename web/dist/assets/{content-a642a616.js => content-3ace01ff.js} (98%) rename web/dist/assets/{index-15a0e03b.js => index-428b5d53.js} (82%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-a20a8596.js => main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-4d372959.js => post-item.vue_vue_type_style_index_0_lang-093e4300.js} (98%) rename web/dist/assets/{post-skeleton-a15059e0.js => post-skeleton-510366fa.js} (88%) rename web/dist/assets/{whisper-29f2b0aa.js => whisper-7ff8cab8.js} (95%) rename web/dist/assets/{whisper-add-friend-78adb41e.js => whisper-add-friend-55077e20.js} (95%) diff --git a/web/.env b/web/.env index 80fe27f8..d78cee2c 100644 --- a/web/.env +++ b/web/.env @@ -2,6 +2,7 @@ VITE_HOST="" # 功能特性开启 VITE_USE_FRIENDSHIP=true +VITE_USE_WEB_PROFILE=true # 是否使用后端web服务提供的WebProfile来自定义前端的功能特性 # 模块开启 VITE_ENABLE_ANOUNCEMENT=false diff --git a/web/dist/assets/404-c0c7310e.js b/web/dist/assets/404-7a651458.js similarity index 85% rename from web/dist/assets/404-c0c7310e.js rename to web/dist/assets/404-7a651458.js index e856f23c..38fb1117 100644 --- a/web/dist/assets/404-c0c7310e.js +++ b/web/dist/assets/404-7a651458.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-15a0e03b.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-428b5d53.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; diff --git a/web/dist/assets/Anouncement-a1221d42.js b/web/dist/assets/Anouncement-ade70010.js similarity index 91% rename from web/dist/assets/Anouncement-a1221d42.js rename to web/dist/assets/Anouncement-ade70010.js index 5db5ae2a..c8e4c0f1 100644 --- a/web/dist/assets/Anouncement-a1221d42.js +++ b/web/dist/assets/Anouncement-ade70010.js @@ -1 +1 @@ -import{_ as N}from"./post-skeleton-a15059e0.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-15a0e03b.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; +import{_ as N}from"./post-skeleton-510366fa.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-428b5d53.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; diff --git a/web/dist/assets/Collection-55969243.js b/web/dist/assets/Collection-71fe2540.js similarity index 90% rename from web/dist/assets/Collection-55969243.js rename to web/dist/assets/Collection-71fe2540.js index f178e0b0..83fe55e5 100644 --- a/web/dist/assets/Collection-55969243.js +++ b/web/dist/assets/Collection-71fe2540.js @@ -1 +1 @@ -import{_ as q}from"./whisper-29f2b0aa.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as U}from"./post-skeleton-a15059e0.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-15a0e03b.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{b()}),(e,r)=>{const m=E,O=U,P=ae,T=D,F=le,H=R,N=q,V=te,W=ie,j=ne;return o(),n("div",null,[a(m,{title:"收藏"}),a(V,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(T,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",pe,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),p.value>0?(o(),d(j,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",me,[_.value?h("",!0):(o(),d(W,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}});const Ye=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ye as default}; +import{_ as q}from"./whisper-7ff8cab8.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-093e4300.js";import{_ as U}from"./post-skeleton-510366fa.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-428b5d53.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-3ace01ff.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{b()}),(e,r)=>{const m=E,O=U,P=ae,T=D,F=le,H=R,N=q,V=te,W=ie,j=ne;return o(),n("div",null,[a(m,{title:"收藏"}),a(V,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(T,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",pe,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),p.value>0?(o(),d(j,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",me,[_.value?h("",!0):(o(),d(W,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}});const Ye=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ye as default}; diff --git a/web/dist/assets/Contacts-669f91fa.js b/web/dist/assets/Contacts-c3dd71d7.js similarity index 92% rename from web/dist/assets/Contacts-669f91fa.js rename to web/dist/assets/Contacts-c3dd71d7.js index 0fee06b6..40770470 100644 --- a/web/dist/assets/Contacts-669f91fa.js +++ b/web/dist/assets/Contacts-c3dd71d7.js @@ -1 +1 @@ -import{_ as W}from"./whisper-29f2b0aa.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-15a0e03b.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-a15059e0.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Qe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; +import{_ as W}from"./whisper-7ff8cab8.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-428b5d53.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-510366fa.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Qe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; diff --git a/web/dist/assets/Following-3acd73c5.js b/web/dist/assets/Following-a53b2057.js similarity index 95% rename from web/dist/assets/Following-3acd73c5.js rename to web/dist/assets/Following-a53b2057.js index 93666235..a95dd56e 100644 --- a/web/dist/assets/Following-3acd73c5.js +++ b/web/dist/assets/Following-a53b2057.js @@ -1 +1 @@ -import{_ as Q}from"./whisper-29f2b0aa.js";import{d as N,c as O,r as X,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as D,Y as ie,Z as _e}from"./index-15a0e03b.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-a15059e0.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=X("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const De=D(Oe,[["__scopeId","data-v-1fb7364a"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},V=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,Y=Fe,E=De,G=Te,J=Q,K=ke,L=ze,Z=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":W},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",Ve,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",We,[t.value.length===0?(c(),d("div",je,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(G,{key:P.user_id},{default:a(()=>[n(E,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Z,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; +import{_ as Q}from"./whisper-7ff8cab8.js";import{d as N,c as O,r as X,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as D,Y as ie,Z as _e}from"./index-428b5d53.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-510366fa.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=X("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const De=D(Oe,[["__scopeId","data-v-1fb7364a"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},V=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,Y=Fe,E=De,G=Te,J=Q,K=ke,L=ze,Z=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":W},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",Ve,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",We,[t.value.length===0?(c(),d("div",je,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(G,{key:P.user_id},{default:a(()=>[n(E,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Z,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; diff --git a/web/dist/assets/Home-c19b4d50.js b/web/dist/assets/Home-142cb625.js similarity index 98% rename from web/dist/assets/Home-c19b4d50.js rename to web/dist/assets/Home-142cb625.js index 44d12495..7758bcf9 100644 --- a/web/dist/assets/Home-c19b4d50.js +++ b/web/dist/assets/Home-142cb625.js @@ -1 +1 @@ -import{W as De}from"./whisper-add-friend-78adb41e.js";import{_ as Te}from"./whisper-29f2b0aa.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as xe}from"./post-skeleton-a15059e0.js";import{d as ye,H as r,c as _e,b as Ae,e as u,f as w,bf as m,j as I,k as n,w as i,q as E,Y as b,y as he,A as O,x as $,F as fe,u as ge,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as ke}from"./vuex-44de225f.js";import{l as we}from"./lodash-e0b37ac3.js";import{g as Fe,a as Ne,c as Re,b as qe,d as Ge,e as Oe,u as Pe,f as Se,h as Ye,_ as Me}from"./index-15a0e03b.js";import{p as We}from"./content-a642a616.js";import{V,P as L}from"./IEnum-5453a777.js";import{I as Le,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as be,v as Ze,j as Je,e as Xe,w as $e,x as et,y as tt,z as st,A as at,B as nt,C as ot,a as Ie,D as lt,E as it,F as rt,G as ut,H as ct,l as pt,I as dt,J as vt,k as mt}from"./naive-ui-eecf2ec3.js";import{_ as _t}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{b as ft,u as gt}from"./vue-router-e5a2430e.js";import{W as ht}from"./v3-infinite-loading-2c58ec2f.js";import{S as wt}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const yt=K=>{const g=new FileReader,l=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),q=()=>{const _=new Uint8Array(g.result).subarray(0,4);let U="";for(let h=0;h<_.length;h++)U+=_[h].toString(16);switch(U){case"504b0304":case"504b0506":case"504b0708":return l("application/zip");case"504b030414":return l("application/x-zip-compressed");case"504b0508":return l("application/x-zip");case"504b5370":return l("application/octet-stream");default:return!1}};return new Promise((_,U)=>{g.onloadend=()=>{const h=K.type;_(h===""||h==="application/octet-stream"?q():l(h))},g.readAsArrayBuffer(K.slice(0,4))})},At={key:0,class:"compose-wrap"},kt={class:"compose-line"},bt={class:"compose-user"},It={class:"compose-line compose-options"},zt={class:"attachment"},Ct={class:"submit-wrap"},Dt={class:"attachment-list-wrap"},Tt={key:0,class:"attachment-price-wrap"},Ut=I("span",null," 附件价格¥",-1),Bt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Vt={key:1,class:"compose-wrap"},Et=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ft={key:0,class:"login-only-wrap"},Nt={key:1,class:"login-wrap"},Rt=ye({__name:"compose",emits:["post-success"],setup(K,{emit:g}){const l=ke(),q=r([]),_=r(!1),U=r(!1),h=r(!1),y=r(!1),A=r(""),F=r([]),G=r(),D=r(0),p=r("public/image"),T=r([]),N=r([]),d=r([]),f=r([]),B=r(V.PUBLIC),z=r(V.PUBLIC),R=+"400",Y=r("true".toLowerCase()==="true"),j="/v1/attachment",Q=_e(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),ee=_e(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return l.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),te=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},se=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},ae=we.debounce(s=>{Fe({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),H=we.debounce(s=>{Ne({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),Z=(s,a)=>{_.value||(_.value=!0,a==="@"?ae(s):H(s))},J=s=>{s.length>R?A.value=s.substring(0,R):A.value=s},P=s=>{p.value=s},ne=s=>{for(let o=0;o30&&(s[o].name=e.substring(0,18)+"..."+e.substring(e.length-9)+"."+t)}T.value=s},S=async s=>{var a,e,t,o,c;return p.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((a=s.file.file)==null?void 0:a.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):p.value==="image"&&((e=s.file.file)==null?void 0:e.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((t=s.file.file)==null?void 0:t.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((o=s.file.file)==null?void 0:o.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):p.value==="attachment"&&!await yt(s.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):p.value==="attachment"&&((c=s.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},oe=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);t.code===0&&(p.value==="public/image"&&N.value.push({id:s.id,content:t.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:t.data.content}),p.value==="attachment"&&f.value.push({id:s.id,content:t.data.content}))}catch{window.$message.error("上传失败")}},M=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);if(t.code!==0){let o=t.msg||"上传失败";t.details&&t.details.length>0&&t.details.map(c=>{o+=":"+c}),window.$message.error(o)}}catch{window.$message.error("上传失败")}},x=({file:s})=>{let a=N.value.findIndex(e=>e.id===s.id);a>-1&&N.value.splice(a,1),a=d.value.findIndex(e=>e.id===s.id),a>-1&&d.value.splice(a,1),a=f.value.findIndex(e=>e.id===s.id),a>-1&&f.value.splice(a,1)},X=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=We(A.value);const e=[];let t=100;e.push({content:A.value,type:L.TEXT,sort:t}),N.value.map(o=>{t++,e.push({content:o.content,type:L.IMAGEURL,sort:t})}),d.value.map(o=>{t++,e.push({content:o.content,type:L.VIDEOURL,sort:t})}),f.value.map(o=>{t++,e.push({content:o.content,type:L.ATTACHMENT,sort:t})}),F.value.length>0&&F.value.map(o=>{t++,e.push({content:o,type:L.LINKURL,sort:t})}),U.value=!0,Re({contents:e,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+D.value*100,visibility:B.value}).then(o=>{var c;window.$message.success("发布成功"),U.value=!1,g("post-success",o),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",F.value=[],N.value=[],d.value=[],f.value=[],B.value=z.value}).catch(o=>{U.value=!1})},W=s=>{l.commit("triggerAuth",!0),l.commit("triggerAuthKey",s)};return Ae(()=>{const s=l.state.profile.defaultTweetVisibility;l.state.profile.useFriendship&&s==="friend"?z.value=V.FRIEND:s==="following"?z.value=V.Following:s==="public"?z.value=V.PUBLIC:z.value=V.PRIVATE,B.value=z.value}),(s,a)=>{const e=be,t=Ze,o=Je,c=Xe,C=$e,le=et,ie=tt,re=st,ue=at,ce=nt,pe=ot,de=Ie,ve=lt,me=it;return u(),w("div",null,[m(l).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(e,{round:"",size:30,src:m(l).state.userInfo.avatar},null,8,["src"])]),n(t,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(ce,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:j,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:S,onFinish:oe,onError:M,onRemove:x,"onUpdate:fileList":ne},{default:i(()=>[I("div",It,[I("div",zt,[n(C,{abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("public/image"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),m(l).state.profile.allowTweetVideo?(u(),E(C,{key:0,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value!=="public/video"||T.value.length===9,onClick:()=>{P("public/video"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),m(l).state.profile.allowTweetAttachment?(u(),E(C,{key:1,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("attachment"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:he(te,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Qe))]),_:1})]),_:1},8,["onClick"]),Y.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:he(se,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(ie,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(le,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/m(R)*100},null,8,["percentage"])]),default:i(()=>[O(" "+$(A.value.length)+" / "+$(m(R)),1)]),_:1}),n(c,{loading:U.value,onClick:X,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Dt,[n(re),f.value.length>0?(u(),w("div",Tt,[m(l).state.profile.allowTweetAttachmentPrice?(u(),E(ue,{key:0,value:D.value,"onUpdate:value":a[0]||(a[0]=v=>D.value=v),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Ut]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),y.value?(u(),w("div",Bt,[n(ve,{value:B.value,"onUpdate:value":a[1]||(a[1]=v=>B.value=v),name:"radiogroup"},{default:i(()=>[n(de,null,{default:i(()=>[(u(!0),w(fe,null,ge(ee.value,v=>(u(),E(pe,{key:v.value,value:v.value,label:v.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),h.value?(u(),w("div",xt,[n(me,{value:F.value,"onUpdate:value":a[2]||(a[2]=v=>F.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,m(l).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),m(l).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>W("signup"))},{default:i(()=>[O(" 注册 ")]),_:1})])):b("",!0)]))])}}});const qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Gt="/assets/discover-tweets-ab101944.jpeg",Ot="/assets/following-tweets-e36b4410.jpeg",Pt={class:"slide-bar-item"},St={class:"slide-bar-item-title slide-bar-user-link"},Yt={key:1,class:"skeleton-wrap"},Mt={key:0,class:"empty-wrap"},Wt={key:1},Lt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=ye({__name:"Home",setup(K){const g=ke(),l=ft(),q=gt(),_=rt(),U=r(9),h=r(8),y=r([{title:"最新动态",style:1,username:"",avatar:qt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Gt,show:!1},{title:"正在关注",style:3,username:"",avatar:Ot,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),A=Ve({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),F=r(null),G=r("泡泡广场"),D=r(!1),p=r(!1),T=r(1),N=r(""),d=r([]),f=r(1),B=r(20),z=r(0),R=r(!1),Y=r(!1),j=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Q=e=>{j.value=e,R.value=!0},ee=()=>{R.value=!1},te=()=>{Y.value=!0},se=e=>{_.warning({title:"删除好友",content:"将好友 “"+e.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Ye({user_id:A.id}).then(t=>{window.$message.success("操作成功"),e.user.is_friend=!1}).catch(t=>{})}})},ae=()=>{Y.value=!1,F.value=null},H=e=>{F.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?se(e):te()},Z=e=>{_.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),J(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),J(e.user_id,!0)}).catch(t=>{})}})};function J(e,t){for(let o in d.value)d.value[o].user_id==e&&(d.value[o].user.is_following=t)}const P=()=>{G.value="泡泡广场",l.query&&l.query.q&&(l.query.t&&l.query.t==="tag"?G.value="#"+decodeURIComponent(l.query.q):G.value="搜索: "+decodeURIComponent(l.query.q))},ne=_e(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{D.value=!1,p.value=!1,d.value=[],f.value=1,z.value=0},oe=(e,t)=>{switch(S(),T.value=e.style,l.query.q&&(l.query.q=null,P()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:l.query.q=null,x("following");break;case 21:N.value=e.username,X();break}y.value[t].show=!1},M=()=>{y.value=y.value.slice(0,3),!(!g.state.profile.useFriendship||!g.state.profile.enableTrendsBar||g.state.userInfo.id===0)&&qe({page:1,page_size:50}).then(e=>{var t=0;const o=e.list||[];let c=[];for(;t0&&(y.value=y.value.concat(c))}).catch(e=>{console.log(e)})},x=e=>{D.value=!0,Ge({query:l.query.q?decodeURIComponent(l.query.q):null,type:l.query.t,style:e,page:f.value,page_size:B.value}).then(t=>{D.value=!1,t.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(t.list):(d.value=t.list,window.scrollTo(0,0)),z.value=Math.ceil(t.pager.total_rows/B.value)}).catch(t=>{D.value=!1,f.value>1&&f.value--})},X=()=>{D.value=!0,Oe({username:N.value,style:"post",page:f.value,page_size:B.value}).then(e=>{D.value=!1,e.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(e.list):(d.value=e.list||[],window.scrollTo(0,0)),z.value=Math.ceil(e.pager.total_rows/B.value)}).catch(e=>{d.value=[],f.value>1&&f.value--,D.value=!1})},W=e=>{q.push({name:"post",query:{id:e.id}})},s=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:l.query.q?x("search"):X();break}},a=()=>{f.value{S(),M(),x("newest")}),Ee(()=>({path:l.path,query:l.query,refresh:g.state.refresh}),(e,t)=>{if(P(),e.refresh!==t.refresh){S(),setTimeout(()=>{M(),s()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{M(),s()},0))}),(e,t)=>{const o=_t,c=Rt,C=ct,le=be,ie=pt,re=dt,ue=xe,ce=vt,pe=Ue,de=Be,ve=Te,me=De,v=ut,ze=mt,Ce=Ie;return u(),w("div",null,[n(o,{title:G.value},null,8,["title"]),n(v,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(C,null,{default:i(()=>[n(c,{onPostSuccess:W})]),_:1}),ne.value?(u(),E(C,{key:0},{default:i(()=>[n(m(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":U.value,onClick:oe,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(ie,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(le,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(re,{"line-clamp":2},{default:i(()=>[O($(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),D.value&&d.value.length===0?(u(),w("div",Yt,[n(ue,{num:B.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ce,{size:"large",description:"暂无数据"})])):b("",!0),m(g).state.desktopModelShow?(u(),w("div",Wt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Lt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(de,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(ve,{show:R.value,user:j.value,onSuccess:ee},null,8,["show","user"]),n(me,{show:Y.value,user:A,onSuccess:ae},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(m(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>a())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,$(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-040841fc"]]);export{Fs as default}; +import{W as De}from"./whisper-add-friend-55077e20.js";import{_ as Te}from"./whisper-7ff8cab8.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-093e4300.js";import{_ as xe}from"./post-skeleton-510366fa.js";import{d as ye,H as r,c as _e,b as Ae,e as u,f as w,bf as m,j as I,k as n,w as i,q as E,Y as b,y as he,A as O,x as $,F as fe,u as ge,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as ke}from"./vuex-44de225f.js";import{l as we}from"./lodash-e0b37ac3.js";import{g as Fe,a as Ne,c as Re,b as qe,d as Ge,e as Oe,u as Pe,f as Se,h as Ye,_ as Me}from"./index-428b5d53.js";import{p as We}from"./content-3ace01ff.js";import{V,P as L}from"./IEnum-5453a777.js";import{I as Le,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as be,v as Ze,j as Je,e as Xe,w as $e,x as et,y as tt,z as st,A as at,B as nt,C as ot,a as Ie,D as lt,E as it,F as rt,G as ut,H as ct,l as pt,I as dt,J as vt,k as mt}from"./naive-ui-eecf2ec3.js";import{_ as _t}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{b as ft,u as gt}from"./vue-router-e5a2430e.js";import{W as ht}from"./v3-infinite-loading-2c58ec2f.js";import{S as wt}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const yt=K=>{const g=new FileReader,l=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),q=()=>{const _=new Uint8Array(g.result).subarray(0,4);let U="";for(let h=0;h<_.length;h++)U+=_[h].toString(16);switch(U){case"504b0304":case"504b0506":case"504b0708":return l("application/zip");case"504b030414":return l("application/x-zip-compressed");case"504b0508":return l("application/x-zip");case"504b5370":return l("application/octet-stream");default:return!1}};return new Promise((_,U)=>{g.onloadend=()=>{const h=K.type;_(h===""||h==="application/octet-stream"?q():l(h))},g.readAsArrayBuffer(K.slice(0,4))})},At={key:0,class:"compose-wrap"},kt={class:"compose-line"},bt={class:"compose-user"},It={class:"compose-line compose-options"},zt={class:"attachment"},Ct={class:"submit-wrap"},Dt={class:"attachment-list-wrap"},Tt={key:0,class:"attachment-price-wrap"},Ut=I("span",null," 附件价格¥",-1),Bt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Vt={key:1,class:"compose-wrap"},Et=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ft={key:0,class:"login-only-wrap"},Nt={key:1,class:"login-wrap"},Rt=ye({__name:"compose",emits:["post-success"],setup(K,{emit:g}){const l=ke(),q=r([]),_=r(!1),U=r(!1),h=r(!1),y=r(!1),A=r(""),F=r([]),G=r(),D=r(0),p=r("public/image"),T=r([]),N=r([]),d=r([]),f=r([]),B=r(V.PUBLIC),z=r(V.PUBLIC),R=+"400",Y=r("true".toLowerCase()==="true"),j="/v1/attachment",Q=_e(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),ee=_e(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return l.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),te=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},se=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},ae=we.debounce(s=>{Fe({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),H=we.debounce(s=>{Ne({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),Z=(s,a)=>{_.value||(_.value=!0,a==="@"?ae(s):H(s))},J=s=>{s.length>R?A.value=s.substring(0,R):A.value=s},P=s=>{p.value=s},ne=s=>{for(let o=0;o30&&(s[o].name=e.substring(0,18)+"..."+e.substring(e.length-9)+"."+t)}T.value=s},S=async s=>{var a,e,t,o,c;return p.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((a=s.file.file)==null?void 0:a.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):p.value==="image"&&((e=s.file.file)==null?void 0:e.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((t=s.file.file)==null?void 0:t.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((o=s.file.file)==null?void 0:o.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):p.value==="attachment"&&!await yt(s.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):p.value==="attachment"&&((c=s.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},oe=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);t.code===0&&(p.value==="public/image"&&N.value.push({id:s.id,content:t.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:t.data.content}),p.value==="attachment"&&f.value.push({id:s.id,content:t.data.content}))}catch{window.$message.error("上传失败")}},M=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);if(t.code!==0){let o=t.msg||"上传失败";t.details&&t.details.length>0&&t.details.map(c=>{o+=":"+c}),window.$message.error(o)}}catch{window.$message.error("上传失败")}},x=({file:s})=>{let a=N.value.findIndex(e=>e.id===s.id);a>-1&&N.value.splice(a,1),a=d.value.findIndex(e=>e.id===s.id),a>-1&&d.value.splice(a,1),a=f.value.findIndex(e=>e.id===s.id),a>-1&&f.value.splice(a,1)},X=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=We(A.value);const e=[];let t=100;e.push({content:A.value,type:L.TEXT,sort:t}),N.value.map(o=>{t++,e.push({content:o.content,type:L.IMAGEURL,sort:t})}),d.value.map(o=>{t++,e.push({content:o.content,type:L.VIDEOURL,sort:t})}),f.value.map(o=>{t++,e.push({content:o.content,type:L.ATTACHMENT,sort:t})}),F.value.length>0&&F.value.map(o=>{t++,e.push({content:o,type:L.LINKURL,sort:t})}),U.value=!0,Re({contents:e,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+D.value*100,visibility:B.value}).then(o=>{var c;window.$message.success("发布成功"),U.value=!1,g("post-success",o),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",F.value=[],N.value=[],d.value=[],f.value=[],B.value=z.value}).catch(o=>{U.value=!1})},W=s=>{l.commit("triggerAuth",!0),l.commit("triggerAuthKey",s)};return Ae(()=>{const s=l.state.profile.defaultTweetVisibility;l.state.profile.useFriendship&&s==="friend"?z.value=V.FRIEND:s==="following"?z.value=V.Following:s==="public"?z.value=V.PUBLIC:z.value=V.PRIVATE,B.value=z.value}),(s,a)=>{const e=be,t=Ze,o=Je,c=Xe,C=$e,le=et,ie=tt,re=st,ue=at,ce=nt,pe=ot,de=Ie,ve=lt,me=it;return u(),w("div",null,[m(l).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(e,{round:"",size:30,src:m(l).state.userInfo.avatar},null,8,["src"])]),n(t,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(ce,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:j,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:S,onFinish:oe,onError:M,onRemove:x,"onUpdate:fileList":ne},{default:i(()=>[I("div",It,[I("div",zt,[n(C,{abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("public/image"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),m(l).state.profile.allowTweetVideo?(u(),E(C,{key:0,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value!=="public/video"||T.value.length===9,onClick:()=>{P("public/video"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),m(l).state.profile.allowTweetAttachment?(u(),E(C,{key:1,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("attachment"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:he(te,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Qe))]),_:1})]),_:1},8,["onClick"]),Y.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:he(se,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(ie,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(le,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/m(R)*100},null,8,["percentage"])]),default:i(()=>[O(" "+$(A.value.length)+" / "+$(m(R)),1)]),_:1}),n(c,{loading:U.value,onClick:X,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Dt,[n(re),f.value.length>0?(u(),w("div",Tt,[m(l).state.profile.allowTweetAttachmentPrice?(u(),E(ue,{key:0,value:D.value,"onUpdate:value":a[0]||(a[0]=v=>D.value=v),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Ut]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),y.value?(u(),w("div",Bt,[n(ve,{value:B.value,"onUpdate:value":a[1]||(a[1]=v=>B.value=v),name:"radiogroup"},{default:i(()=>[n(de,null,{default:i(()=>[(u(!0),w(fe,null,ge(ee.value,v=>(u(),E(pe,{key:v.value,value:v.value,label:v.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),h.value?(u(),w("div",xt,[n(me,{value:F.value,"onUpdate:value":a[2]||(a[2]=v=>F.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,m(l).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),m(l).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>W("signup"))},{default:i(()=>[O(" 注册 ")]),_:1})])):b("",!0)]))])}}});const qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Gt="/assets/discover-tweets-ab101944.jpeg",Ot="/assets/following-tweets-e36b4410.jpeg",Pt={class:"slide-bar-item"},St={class:"slide-bar-item-title slide-bar-user-link"},Yt={key:1,class:"skeleton-wrap"},Mt={key:0,class:"empty-wrap"},Wt={key:1},Lt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=ye({__name:"Home",setup(K){const g=ke(),l=ft(),q=gt(),_=rt(),U=r(9),h=r(8),y=r([{title:"最新动态",style:1,username:"",avatar:qt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Gt,show:!1},{title:"正在关注",style:3,username:"",avatar:Ot,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),A=Ve({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),F=r(null),G=r("泡泡广场"),D=r(!1),p=r(!1),T=r(1),N=r(""),d=r([]),f=r(1),B=r(20),z=r(0),R=r(!1),Y=r(!1),j=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Q=e=>{j.value=e,R.value=!0},ee=()=>{R.value=!1},te=()=>{Y.value=!0},se=e=>{_.warning({title:"删除好友",content:"将好友 “"+e.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Ye({user_id:A.id}).then(t=>{window.$message.success("操作成功"),e.user.is_friend=!1}).catch(t=>{})}})},ae=()=>{Y.value=!1,F.value=null},H=e=>{F.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?se(e):te()},Z=e=>{_.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),J(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),J(e.user_id,!0)}).catch(t=>{})}})};function J(e,t){for(let o in d.value)d.value[o].user_id==e&&(d.value[o].user.is_following=t)}const P=()=>{G.value="泡泡广场",l.query&&l.query.q&&(l.query.t&&l.query.t==="tag"?G.value="#"+decodeURIComponent(l.query.q):G.value="搜索: "+decodeURIComponent(l.query.q))},ne=_e(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{D.value=!1,p.value=!1,d.value=[],f.value=1,z.value=0},oe=(e,t)=>{switch(S(),T.value=e.style,l.query.q&&(l.query.q=null,P()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:l.query.q=null,x("following");break;case 21:N.value=e.username,X();break}y.value[t].show=!1},M=()=>{y.value=y.value.slice(0,3),!(!g.state.profile.useFriendship||!g.state.profile.enableTrendsBar||g.state.userInfo.id===0)&&qe({page:1,page_size:50}).then(e=>{var t=0;const o=e.list||[];let c=[];for(;t0&&(y.value=y.value.concat(c))}).catch(e=>{console.log(e)})},x=e=>{D.value=!0,Ge({query:l.query.q?decodeURIComponent(l.query.q):null,type:l.query.t,style:e,page:f.value,page_size:B.value}).then(t=>{D.value=!1,t.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(t.list):(d.value=t.list,window.scrollTo(0,0)),z.value=Math.ceil(t.pager.total_rows/B.value)}).catch(t=>{D.value=!1,f.value>1&&f.value--})},X=()=>{D.value=!0,Oe({username:N.value,style:"post",page:f.value,page_size:B.value}).then(e=>{D.value=!1,e.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(e.list):(d.value=e.list||[],window.scrollTo(0,0)),z.value=Math.ceil(e.pager.total_rows/B.value)}).catch(e=>{d.value=[],f.value>1&&f.value--,D.value=!1})},W=e=>{q.push({name:"post",query:{id:e.id}})},s=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:l.query.q?x("search"):X();break}},a=()=>{f.value{S(),M(),x("newest")}),Ee(()=>({path:l.path,query:l.query,refresh:g.state.refresh}),(e,t)=>{if(P(),e.refresh!==t.refresh){S(),setTimeout(()=>{M(),s()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{M(),s()},0))}),(e,t)=>{const o=_t,c=Rt,C=ct,le=be,ie=pt,re=dt,ue=xe,ce=vt,pe=Ue,de=Be,ve=Te,me=De,v=ut,ze=mt,Ce=Ie;return u(),w("div",null,[n(o,{title:G.value},null,8,["title"]),n(v,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(C,null,{default:i(()=>[n(c,{onPostSuccess:W})]),_:1}),ne.value?(u(),E(C,{key:0},{default:i(()=>[n(m(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":U.value,onClick:oe,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(ie,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(le,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(re,{"line-clamp":2},{default:i(()=>[O($(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),D.value&&d.value.length===0?(u(),w("div",Yt,[n(ue,{num:B.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ce,{size:"large",description:"暂无数据"})])):b("",!0),m(g).state.desktopModelShow?(u(),w("div",Wt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Lt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(de,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(ve,{show:R.value,user:j.value,onSuccess:ee},null,8,["show","user"]),n(me,{show:Y.value,user:A,onSuccess:ae},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(m(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>a())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,$(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-040841fc"]]);export{Fs as default}; diff --git a/web/dist/assets/Messages-2895f627.js b/web/dist/assets/Messages-e06acc1a.js similarity index 98% rename from web/dist/assets/Messages-2895f627.js rename to web/dist/assets/Messages-e06acc1a.js index e7fa8134..7f8ed465 100644 --- a/web/dist/assets/Messages-2895f627.js +++ b/web/dist/assets/Messages-e06acc1a.js @@ -1 +1 @@ -import{d as K,c as T,r as me,e as a,f as i,k as s,w as t,bf as o,j as b,y as A,A as d,x as g,Y as _,q,l as ge,h as H,u as se,F as ne,H as f,b as fe}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{u as ve,b as ke}from"./vue-router-e5a2430e.js";import{J as ye,O as he,P as we,Q as be,u as $e,f as Ie,_ as L,R as Ce,S as Me}from"./index-15a0e03b.js";import{K as x,k as Se,N as qe,O as ze,Q as ee,U as Oe,r as N,s as Re,t as Ae,X as F,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-f0266f88.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Je,H as Ye}from"./naive-ui-eecf2ec3.js";import{_ as Ee}from"./whisper-29f2b0aa.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as Ke}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ze={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:v}){const c=Q,k=ve(),u=te(),y=Te(),$=e=>()=>H(m,null,{default:()=>H(e)}),I=T(()=>{let e=[{label:"私信",key:"whisper",icon:$(N)}],n=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return u.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:$(Re)}):e.push({label:"关注",key:"follow",icon:$(Ae)})),e}),p=e=>{let n=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?$e({user_id:n.id}).then(w=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:n.id}).then(w=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let w=n.type==4&&n.sender_user_id==u.state.userInfo.id?n.receiver_user:n.sender_user;v("send-whisper",w)}break;case"follow":case"unfollow":p(c.message);break}},C=T(()=>c.message.type!==4||c.message.sender_user_id!==u.state.userInfo.id),z=T(()=>c.message.type==4&&c.message.receiver_user_id==u.state.userInfo.id),O=T(()=>c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id),P=e=>{M(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?k.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},r=e=>{M(e),he({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const w=Ne,U=me("router-link"),W=Pe,S=Ue,Y=ae,l=oe,j=We,E=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=R=>M(e.message))},[s(E,{"content-indented":""},{avatar:t(()=>[s(w,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(u).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[b("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||z.value?(a(),i("span",Xe,[s(U,{onClick:n[0]||(n[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",Ze," @"+g(e.message.sender_user.username),1)):_("",!0)])):O.value?(a(),i("span",xe,[s(U,{onClick:n[1]||(n[1]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):_("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),q(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(u).state.userInfo.id?(a(),q(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",ns,[C.value&&e.message.is_read===0?(a(),q(S,{key:0,dot:"",processing:""})):_("",!0),b("span",ts,g(o(ye)(e.message.created_on)),1),s(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[s(Y,{quaternary:"",circle:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(j,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[d(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:n[2]||(n[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(qe))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):_("",!0),e.message.type===5?(a(),i("div",ls,[d(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:n[3]||(n[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:n[4]||(n[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[s(o(m),null,{default:t(()=>[s(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-d6e1bf7b"]]),ds={class:"content"},ps=K({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(v,c)=>{const k=Be;return a(!0),i(ne,null,se(new Array(v.num),u=>(a(),i("div",{class:"skeleton-item",key:u},[b("div",ds,[s(k,{text:"",repeat:2}),s(k,{text:"",style:{width:"60%"}})])]))),128)}}});const ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=K({__name:"Messages",setup(Q){const v=te(),c=ke(),k=f(!1),u=f(!1),y=f(+c.query.p||1),$=f(20),I=f(0),p=f([]),h=f("所有消息"),C=f("all"),z=f(!1),O=f({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),P=()=>{u.value=!1,y.value=1,I.value=0,p.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),J=T(()=>{let l;switch(h.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),M=l=>{switch(l){case"all":h.value="所有消息";break;case"system":h.value="系统消息";break;case"whisper":h.value="我的私信";break;case"requesting":h.value="好友申请";break;case"unread":h.value="未读消息";break}C.value=l,P(),S()},e=()=>{M("unread")},n=()=>{v.state.unreadMsgCount>0&&p.value.length>0&&Me().then(l=>{if(C.value!="unread")for(let j in p.value)p.value[j].is_read=1;else p.value=[];v.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},w=l=>{O.value=l,z.value=!0},U=()=>{z.value=!1},W=()=>{P(),S()},S=()=>{k.value=!0,Ce({style:C.value,page:y.value,page_size:$.value}).then(l=>{k.value=!1,l.list.length===0&&(u.value=!0),y.value>1?p.value=p.value.concat(l.list):(p.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/$.value)}).catch(l=>{k.value=!1,y.value>1&&y.value--})},Y=()=>{y.value{S()}),(l,j)=>{const E=Ge,R=Ee,G=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ye,de=De,pe=Je;return a(),i("div",null,[s(E,{title:"消息"}),s(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),s(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[s(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),s(le,{vertical:""}),s(G,{text:"",size:"small",focusable:!1,onClick:n},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[s(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[s(G,{text:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Fe))]),_:1})]),default:t(()=>[d(" "+g(h.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value&&p.value.length===0?(a(),i("div",vs,[s(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[s(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(p.value,Z=>(a(),q(_e,{key:Z.id},{default:t(()=>[s(ce,{message:Z,onSendWhisper:w,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),I.value>0?(a(),q(X,{key:0,justify:"center"},{default:t(()=>[s(o(Ke),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Y},{spinner:t(()=>[b("div",ws,[u.value?_("",!0):(a(),q(pe,{key:0,size:14})),b("span",bs,g(u.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ks=L($s,[["__scopeId","data-v-a2e6a3be"]]);export{Ks as default}; +import{d as K,c as T,r as me,e as a,f as i,k as s,w as t,bf as o,j as b,y as A,A as d,x as g,Y as _,q,l as ge,h as H,u as se,F as ne,H as f,b as fe}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{u as ve,b as ke}from"./vue-router-e5a2430e.js";import{J as ye,O as he,P as we,Q as be,u as $e,f as Ie,_ as L,R as Ce,S as Me}from"./index-428b5d53.js";import{K as x,k as Se,N as qe,O as ze,Q as ee,U as Oe,r as N,s as Re,t as Ae,X as F,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-f0266f88.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Je,H as Ye}from"./naive-ui-eecf2ec3.js";import{_ as Ee}from"./whisper-7ff8cab8.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{W as Ke}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ze={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:v}){const c=Q,k=ve(),u=te(),y=Te(),$=e=>()=>H(m,null,{default:()=>H(e)}),I=T(()=>{let e=[{label:"私信",key:"whisper",icon:$(N)}],n=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return u.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:$(Re)}):e.push({label:"关注",key:"follow",icon:$(Ae)})),e}),p=e=>{let n=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?$e({user_id:n.id}).then(w=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:n.id}).then(w=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let w=n.type==4&&n.sender_user_id==u.state.userInfo.id?n.receiver_user:n.sender_user;v("send-whisper",w)}break;case"follow":case"unfollow":p(c.message);break}},C=T(()=>c.message.type!==4||c.message.sender_user_id!==u.state.userInfo.id),z=T(()=>c.message.type==4&&c.message.receiver_user_id==u.state.userInfo.id),O=T(()=>c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id),P=e=>{M(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?k.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},r=e=>{M(e),he({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const w=Ne,U=me("router-link"),W=Pe,S=Ue,Y=ae,l=oe,j=We,E=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=R=>M(e.message))},[s(E,{"content-indented":""},{avatar:t(()=>[s(w,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(u).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[b("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||z.value?(a(),i("span",Xe,[s(U,{onClick:n[0]||(n[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",Ze," @"+g(e.message.sender_user.username),1)):_("",!0)])):O.value?(a(),i("span",xe,[s(U,{onClick:n[1]||(n[1]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):_("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),q(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(u).state.userInfo.id?(a(),q(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",ns,[C.value&&e.message.is_read===0?(a(),q(S,{key:0,dot:"",processing:""})):_("",!0),b("span",ts,g(o(ye)(e.message.created_on)),1),s(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[s(Y,{quaternary:"",circle:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(j,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[d(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:n[2]||(n[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(qe))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):_("",!0),e.message.type===5?(a(),i("div",ls,[d(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:n[3]||(n[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:n[4]||(n[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[s(o(m),null,{default:t(()=>[s(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-d6e1bf7b"]]),ds={class:"content"},ps=K({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(v,c)=>{const k=Be;return a(!0),i(ne,null,se(new Array(v.num),u=>(a(),i("div",{class:"skeleton-item",key:u},[b("div",ds,[s(k,{text:"",repeat:2}),s(k,{text:"",style:{width:"60%"}})])]))),128)}}});const ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=K({__name:"Messages",setup(Q){const v=te(),c=ke(),k=f(!1),u=f(!1),y=f(+c.query.p||1),$=f(20),I=f(0),p=f([]),h=f("所有消息"),C=f("all"),z=f(!1),O=f({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),P=()=>{u.value=!1,y.value=1,I.value=0,p.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),J=T(()=>{let l;switch(h.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),M=l=>{switch(l){case"all":h.value="所有消息";break;case"system":h.value="系统消息";break;case"whisper":h.value="我的私信";break;case"requesting":h.value="好友申请";break;case"unread":h.value="未读消息";break}C.value=l,P(),S()},e=()=>{M("unread")},n=()=>{v.state.unreadMsgCount>0&&p.value.length>0&&Me().then(l=>{if(C.value!="unread")for(let j in p.value)p.value[j].is_read=1;else p.value=[];v.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},w=l=>{O.value=l,z.value=!0},U=()=>{z.value=!1},W=()=>{P(),S()},S=()=>{k.value=!0,Ce({style:C.value,page:y.value,page_size:$.value}).then(l=>{k.value=!1,l.list.length===0&&(u.value=!0),y.value>1?p.value=p.value.concat(l.list):(p.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/$.value)}).catch(l=>{k.value=!1,y.value>1&&y.value--})},Y=()=>{y.value{S()}),(l,j)=>{const E=Ge,R=Ee,G=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ye,de=De,pe=Je;return a(),i("div",null,[s(E,{title:"消息"}),s(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),s(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[s(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),s(le,{vertical:""}),s(G,{text:"",size:"small",focusable:!1,onClick:n},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[s(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[s(G,{text:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Fe))]),_:1})]),default:t(()=>[d(" "+g(h.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value&&p.value.length===0?(a(),i("div",vs,[s(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[s(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(p.value,Z=>(a(),q(_e,{key:Z.id},{default:t(()=>[s(ce,{message:Z,onSendWhisper:w,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),I.value>0?(a(),q(X,{key:0,justify:"center"},{default:t(()=>[s(o(Ke),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Y},{spinner:t(()=>[b("div",ws,[u.value?_("",!0):(a(),q(pe,{key:0,size:14})),b("span",bs,g(u.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ks=L($s,[["__scopeId","data-v-a2e6a3be"]]);export{Ks as default}; diff --git a/web/dist/assets/Post-44974496.js b/web/dist/assets/Post-6b0900af.js similarity index 98% rename from web/dist/assets/Post-44974496.js rename to web/dist/assets/Post-6b0900af.js index f739ea99..9083ed8d 100644 --- a/web/dist/assets/Post-44974496.js +++ b/web/dist/assets/Post-6b0900af.js @@ -1 +1 @@ -import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-15a0e03b.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-a642a616.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-a15059e0.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-29f2b0aa.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-edac44ef"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-edac44ef"]]);export{fn as default}; +import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-428b5d53.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-3ace01ff.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-510366fa.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-7ff8cab8.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-edac44ef"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-edac44ef"]]);export{fn as default}; diff --git a/web/dist/assets/Profile-7682ee52.js b/web/dist/assets/Profile-11f878a8.js similarity index 95% rename from web/dist/assets/Profile-7682ee52.js rename to web/dist/assets/Profile-11f878a8.js index 5c578d47..78cb8398 100644 --- a/web/dist/assets/Profile-7682ee52.js +++ b/web/dist/assets/Profile-11f878a8.js @@ -1 +1 @@ -import{_ as ke}from"./whisper-29f2b0aa.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as Ie}from"./post-skeleton-a15059e0.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-15a0e03b.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},et={class:"info-item"},tt={class:"info-item"},at={class:"info-item"},st={key:0,class:"skeleton-wrap"},lt={key:1},ot={key:0,class:"empty-wrap"},nt={key:1},ut={key:0},it={key:1},rt={key:2},ct={key:3},_t={key:4},vt={key:2},dt={key:0},mt={key:1},ft={key:2},pt={key:3},ht={key:4},gt={class:"load-more-wrap"},wt={class:"load-more-spinner"},kt=Oe({__name:"Profile",setup(yt){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(p.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},re=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=G.value,_.value=X.value,H();break;case"comment":l.value=F.value,s.value=J.value,_.value=Z.value,N();break;case"highlight":l.value=x.value,s.value=K.value,_.value=ee.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=te.value,W();break;case"star":l.value=z.value,s.value=Q.value,_.value=ae.value,j();break}},ce=()=>{switch(p.value){case"post":G.value=s.value,H();break;case"comment":J.value=s.value,N();break;case"highlight":K.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":Q.value=s.value,j();break}},_e=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,ce()):P.value=!0};return Te(()=>{D()}),Ae(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const E=Pe,U=De,ve=He,oe=Fe("router-link"),$=Ne,de=Ve,me=Ie,fe=We,C=ye,y=Ee,S=be,pe=ke,he=Ue,ge=je,we=Be;return a(),u("div",null,[r(E,{title:"主页"}),n(o).state.userInfo.id>0?(a(),h(he,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[f("div",Re,[f("div",Ge,[r(U,{size:72,src:n(o).state.userInfo.avatar},null,8,["src"])]),f("div",Je,[f("div",Ke,[f("strong",null,O(n(o).state.userInfo.nickname),1),f("span",null," @"+O(n(o).state.userInfo.username),1),n(o).state.userInfo.is_admin?(a(),h(ve,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),f("div",Ye,[f("span",Qe,"UID. "+O(n(o).state.userInfo.id),1),f("span",Xe,O(n(ze)(n(o).state.userInfo.created_on))+" 加入",1)]),f("div",Ze,[f("span",et,[r(oe,{onClick:c[0]||(c[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(n(o).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",tt,[r(oe,{onClick:c[1]||(c[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(n(o).state.userInfo.followings),1)]),_:1},8,["to"])]),f("span",at," 泡泡  "+O(n(o).state.userInfo.tweets_count),1)])])]),r(de,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":re},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),u("div",st,[r(me,{num:g.value},null,8,["num"])])):(a(),u("div",lt,[l.value.length===0?(a(),u("div",ot,[r(fe,{size:"large",description:"暂无数据"})])):m("",!0),n(o).state.desktopModelShow?(a(),u("div",nt,[p.value==="post"?(a(),u("div",ut,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",it,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",rt,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",ct,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",_t,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(a(),u("div",vt,[p.value==="post"?(a(),u("div",dt,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",mt,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",ft,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",pt,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",ht,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(pe,{show:B.value,user:se.value,onSuccess:ie},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(a(),h(we,{key:1,justify:"center"},{default:v(()=>[r(n(Se),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>_e())},{spinner:v(()=>[f("div",gt,[P.value?m("",!0):(a(),h(ge,{key:0,size:14})),f("span",wt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const ea=Ce(kt,[["__scopeId","data-v-8cfd09d6"]]);export{ea as default}; +import{_ as ke}from"./whisper-7ff8cab8.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-093e4300.js";import{_ as Ie}from"./post-skeleton-510366fa.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-428b5d53.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-3ace01ff.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},et={class:"info-item"},tt={class:"info-item"},at={class:"info-item"},st={key:0,class:"skeleton-wrap"},lt={key:1},ot={key:0,class:"empty-wrap"},nt={key:1},ut={key:0},it={key:1},rt={key:2},ct={key:3},_t={key:4},vt={key:2},dt={key:0},mt={key:1},ft={key:2},pt={key:3},ht={key:4},gt={class:"load-more-wrap"},wt={class:"load-more-spinner"},kt=Oe({__name:"Profile",setup(yt){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(p.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},re=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=G.value,_.value=X.value,H();break;case"comment":l.value=F.value,s.value=J.value,_.value=Z.value,N();break;case"highlight":l.value=x.value,s.value=K.value,_.value=ee.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=te.value,W();break;case"star":l.value=z.value,s.value=Q.value,_.value=ae.value,j();break}},ce=()=>{switch(p.value){case"post":G.value=s.value,H();break;case"comment":J.value=s.value,N();break;case"highlight":K.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":Q.value=s.value,j();break}},_e=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,ce()):P.value=!0};return Te(()=>{D()}),Ae(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const E=Pe,U=De,ve=He,oe=Fe("router-link"),$=Ne,de=Ve,me=Ie,fe=We,C=ye,y=Ee,S=be,pe=ke,he=Ue,ge=je,we=Be;return a(),u("div",null,[r(E,{title:"主页"}),n(o).state.userInfo.id>0?(a(),h(he,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[f("div",Re,[f("div",Ge,[r(U,{size:72,src:n(o).state.userInfo.avatar},null,8,["src"])]),f("div",Je,[f("div",Ke,[f("strong",null,O(n(o).state.userInfo.nickname),1),f("span",null," @"+O(n(o).state.userInfo.username),1),n(o).state.userInfo.is_admin?(a(),h(ve,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),f("div",Ye,[f("span",Qe,"UID. "+O(n(o).state.userInfo.id),1),f("span",Xe,O(n(ze)(n(o).state.userInfo.created_on))+" 加入",1)]),f("div",Ze,[f("span",et,[r(oe,{onClick:c[0]||(c[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(n(o).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",tt,[r(oe,{onClick:c[1]||(c[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(n(o).state.userInfo.followings),1)]),_:1},8,["to"])]),f("span",at," 泡泡  "+O(n(o).state.userInfo.tweets_count),1)])])]),r(de,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":re},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),u("div",st,[r(me,{num:g.value},null,8,["num"])])):(a(),u("div",lt,[l.value.length===0?(a(),u("div",ot,[r(fe,{size:"large",description:"暂无数据"})])):m("",!0),n(o).state.desktopModelShow?(a(),u("div",nt,[p.value==="post"?(a(),u("div",ut,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",it,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",rt,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",ct,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",_t,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(a(),u("div",vt,[p.value==="post"?(a(),u("div",dt,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",mt,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",ft,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",pt,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",ht,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(pe,{show:B.value,user:se.value,onSuccess:ie},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(a(),h(we,{key:1,justify:"center"},{default:v(()=>[r(n(Se),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>_e())},{spinner:v(()=>[f("div",gt,[P.value?m("",!0):(a(),h(ge,{key:0,size:14})),f("span",wt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const ea=Ce(kt,[["__scopeId","data-v-8cfd09d6"]]);export{ea as default}; diff --git a/web/dist/assets/Setting-9923d3fd.js b/web/dist/assets/Setting-75fc0298.js similarity index 98% rename from web/dist/assets/Setting-9923d3fd.js rename to web/dist/assets/Setting-75fc0298.js index 365802ef..d90b79a4 100644 --- a/web/dist/assets/Setting-9923d3fd.js +++ b/web/dist/assets/Setting-75fc0298.js @@ -1 +1 @@ -import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as we,H as d,R as Z,b as ye,f as g,k as t,w as s,bf as r,q as k,Y as _,e as i,j as m,A as p,x as U,O as be,D as ke,Z as R,y as S,$ as Ce,a0 as Ie}from"./@vue-a481fc63.js";import{u as $e}from"./vuex-44de225f.js";import{a4 as Q,a5 as Pe,a6 as Be,a7 as Ue,a8 as Re,a9 as Se,aa as qe,_ as Ae}from"./index-15a0e03b.js";import{a2 as Ne}from"./@vicons-f0266f88.js";import{h as ze,o as xe,e as De,B as Ke,b as Fe,j as Te,T as je,$ as Oe,L as Ve,a0 as Ee,a1 as Le,d as Me}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const F=q=>(Ce("data-v-7bb19e7f"),q=q(),Ie(),q),We={class:"base-line avatar"},Ge={class:"base-line"},He=F(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ye={class:"base-line"},Ze=F(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},Xe={key:1},et=F(()=>m("br",null,null,-1)),tt={key:2,class:"phone-bind-wrap"},at={class:"captcha-img-wrap"},st={class:"captcha-img"},nt=["src"],ot={class:"form-submit-wrap"},lt={key:0},rt={key:1},it=F(()=>m("br",null,null,-1)),ut={key:2,class:"phone-bind-wrap"},dt={class:"captcha-img-wrap"},pt={class:"captcha-img"},ct=["src"],_t={class:"form-submit-wrap"},mt={key:1,class:"phone-bind-wrap"},vt={class:"form-submit-wrap"},ft=we({__name:"Setting",setup(q){const X="/v1/attachment",ee="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),A=d("public/avatar"),te="false".toLowerCase()==="true",o=$e(),$=d(!1),N=d(!1),z=d(!1),L=d(),M=d(),C=d(!1),x=d(!1),P=d(!1),B=d(!1),I=d(60),y=d(!1),b=d(!1),W=d(),G=d(),H=d(),J=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),u=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),ae=async n=>{var e,v;return A.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):A.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},se=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&A.value==="public/avatar"&&Pe({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=L.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},ne=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,oe=(n,e)=>e===a.password,le=()=>{var n;a.reenteredPassword&&((n=J.value)==null||n.validate({trigger:"password-input"}))},re=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Be({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,P.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ie=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Ue({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(u.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,v||(z.value=!0,Re({activate_code:u.activate_code,captcha_id:u.id,imgCaptcha:u.imgCaptcha}).then(f=>{z.value=!1,b.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:u.activate_code}),u.id="",u.b64s="",u.imgCaptcha="",u.activate_code=""}).catch(f=>{z.value=!1,f.code===20012&&j()}))})},T=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Q().then(n=>{u.id=n.id,u.b64s=n.b64s}).catch(n=>{console.log(n)})},de=()=>{Se({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&B.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,qe({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{B.value=!0,$.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,B.value=!1)},1e3)}).catch(n=>{$.value=!1,n.code===20012&&T(),console.log(n)})}},ce={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},_e={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},me={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:ne,message:"两次密码输入不一致",trigger:"input"},{validator:oe,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},ve=()=>{C.value=!0,setTimeout(()=>{var n;(n=M.value)==null||n.focus()},30)};return ye(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=he,f=xe,c=De,D=Ke,h=Fe,fe=Te,K=ze,Y=je,w=Oe,ge=Ve,O=Ee,V=Le,E=Me;return i(),g("div",null,[t(v,{title:"设置",theme:""}),t(K,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:r(o).state.userInfo.avatar},null,8,["src"]),!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),k(D,{key:0,ref_key:"avatarRef",ref:L,action:X,headers:{Authorization:ee},data:{type:A.value},onBeforeUpload:ae,onFinish:se},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[He,C.value?_("",!0):(i(),g("div",Je,U(r(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,class:"nickname-input",value:r(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>r(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:de,maxlength:16},null,8,["value"]),[[ke,C.value]]),!C.value&&(!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0&&r(o).state.userInfo.status==1)?(i(),k(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:ve},{icon:s(()=>[t(fe,null,{default:s(()=>[t(r(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,p(" @"+U(r(o).state.userInfo.username),1)])]),_:1}),r(o).state.profile.allowPhoneBind?(i(),k(K,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),g("div",Qe,[p(U(r(o).state.userInfo.phone)+" ",1),!y.value&&r(o).state.userInfo.status==1?(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(i(),g("div",Xe,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),et,y.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(i(),g("div",tt,[t(E,{ref_key:"phoneFormRef",ref:W,model:a,rules:ce},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",at,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",st,[a.b64s?(i(),g("img",{key:0,src:a.b64s,onClick:T},null,8,nt)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(ge,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:B.value,loading:$.value,onClick:pe},{default:s(()=>[p(U(I.value>0&&B.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ot,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ie},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),te?(i(),k(K,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.activation&&r(o).state.userInfo.activation.length>0?(i(),g("div",lt,[p(U(r(o).state.userInfo.activation)+" ",1),b.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>b.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(i(),g("div",rt,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),it,b.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>b.value=!0)}," 立即激活 "))]),_:1})])),b.value?(i(),g("div",ut,[t(E,{ref_key:"activateFormRef",ref:G,model:u,rules:_e},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:u.activate_code,"onUpdate:value":e[10]||(e[10]=l=>u.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",dt,[t(h,{value:u.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>u.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[u.b64s?(i(),g("img",{key:0,src:u.b64s,onClick:j},null,8,ct)):_("",!0)])])]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",_t,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>b.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(K,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),P.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>P.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),P.value?(i(),g("div",mt,[t(E,{ref_key:"formRef",ref:H,model:a,rules:me},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:le,onKeydown:e[18]||(e[18]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",vt,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>P.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:re},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const jt=Ae(ft,[["__scopeId","data-v-7bb19e7f"]]);export{jt as default}; +import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{d as we,H as d,R as Z,b as ye,f as g,k as t,w as s,bf as r,q as k,Y as _,e as i,j as m,A as p,x as U,O as be,D as ke,Z as R,y as S,$ as Ce,a0 as Ie}from"./@vue-a481fc63.js";import{u as $e}from"./vuex-44de225f.js";import{a4 as Q,a5 as Pe,a6 as Be,a7 as Ue,a8 as Re,a9 as Se,aa as qe,_ as Ae}from"./index-428b5d53.js";import{a2 as Ne}from"./@vicons-f0266f88.js";import{h as ze,o as xe,e as De,B as Ke,b as Fe,j as Te,T as je,$ as Oe,L as Ve,a0 as Ee,a1 as Le,d as Me}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const F=q=>(Ce("data-v-7bb19e7f"),q=q(),Ie(),q),We={class:"base-line avatar"},Ge={class:"base-line"},He=F(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ye={class:"base-line"},Ze=F(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},Xe={key:1},et=F(()=>m("br",null,null,-1)),tt={key:2,class:"phone-bind-wrap"},at={class:"captcha-img-wrap"},st={class:"captcha-img"},nt=["src"],ot={class:"form-submit-wrap"},lt={key:0},rt={key:1},it=F(()=>m("br",null,null,-1)),ut={key:2,class:"phone-bind-wrap"},dt={class:"captcha-img-wrap"},pt={class:"captcha-img"},ct=["src"],_t={class:"form-submit-wrap"},mt={key:1,class:"phone-bind-wrap"},vt={class:"form-submit-wrap"},ft=we({__name:"Setting",setup(q){const X="/v1/attachment",ee="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),A=d("public/avatar"),te="false".toLowerCase()==="true",o=$e(),$=d(!1),N=d(!1),z=d(!1),L=d(),M=d(),C=d(!1),x=d(!1),P=d(!1),B=d(!1),I=d(60),y=d(!1),b=d(!1),W=d(),G=d(),H=d(),J=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),u=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),ae=async n=>{var e,v;return A.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):A.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},se=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&A.value==="public/avatar"&&Pe({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=L.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},ne=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,oe=(n,e)=>e===a.password,le=()=>{var n;a.reenteredPassword&&((n=J.value)==null||n.validate({trigger:"password-input"}))},re=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Be({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,P.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ie=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Ue({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(u.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,v||(z.value=!0,Re({activate_code:u.activate_code,captcha_id:u.id,imgCaptcha:u.imgCaptcha}).then(f=>{z.value=!1,b.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:u.activate_code}),u.id="",u.b64s="",u.imgCaptcha="",u.activate_code=""}).catch(f=>{z.value=!1,f.code===20012&&j()}))})},T=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Q().then(n=>{u.id=n.id,u.b64s=n.b64s}).catch(n=>{console.log(n)})},de=()=>{Se({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&B.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,qe({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{B.value=!0,$.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,B.value=!1)},1e3)}).catch(n=>{$.value=!1,n.code===20012&&T(),console.log(n)})}},ce={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},_e={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},me={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:ne,message:"两次密码输入不一致",trigger:"input"},{validator:oe,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},ve=()=>{C.value=!0,setTimeout(()=>{var n;(n=M.value)==null||n.focus()},30)};return ye(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=he,f=xe,c=De,D=Ke,h=Fe,fe=Te,K=ze,Y=je,w=Oe,ge=Ve,O=Ee,V=Le,E=Me;return i(),g("div",null,[t(v,{title:"设置",theme:""}),t(K,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:r(o).state.userInfo.avatar},null,8,["src"]),!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),k(D,{key:0,ref_key:"avatarRef",ref:L,action:X,headers:{Authorization:ee},data:{type:A.value},onBeforeUpload:ae,onFinish:se},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[He,C.value?_("",!0):(i(),g("div",Je,U(r(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,class:"nickname-input",value:r(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>r(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:de,maxlength:16},null,8,["value"]),[[ke,C.value]]),!C.value&&(!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0&&r(o).state.userInfo.status==1)?(i(),k(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:ve},{icon:s(()=>[t(fe,null,{default:s(()=>[t(r(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,p(" @"+U(r(o).state.userInfo.username),1)])]),_:1}),r(o).state.profile.allowPhoneBind?(i(),k(K,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),g("div",Qe,[p(U(r(o).state.userInfo.phone)+" ",1),!y.value&&r(o).state.userInfo.status==1?(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(i(),g("div",Xe,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),et,y.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(i(),g("div",tt,[t(E,{ref_key:"phoneFormRef",ref:W,model:a,rules:ce},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",at,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",st,[a.b64s?(i(),g("img",{key:0,src:a.b64s,onClick:T},null,8,nt)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(ge,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:B.value,loading:$.value,onClick:pe},{default:s(()=>[p(U(I.value>0&&B.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ot,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ie},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),te?(i(),k(K,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.activation&&r(o).state.userInfo.activation.length>0?(i(),g("div",lt,[p(U(r(o).state.userInfo.activation)+" ",1),b.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>b.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(i(),g("div",rt,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),it,b.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>b.value=!0)}," 立即激活 "))]),_:1})])),b.value?(i(),g("div",ut,[t(E,{ref_key:"activateFormRef",ref:G,model:u,rules:_e},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:u.activate_code,"onUpdate:value":e[10]||(e[10]=l=>u.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",dt,[t(h,{value:u.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>u.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[u.b64s?(i(),g("img",{key:0,src:u.b64s,onClick:j},null,8,ct)):_("",!0)])])]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",_t,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>b.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(K,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),P.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>P.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),P.value?(i(),g("div",mt,[t(E,{ref_key:"formRef",ref:H,model:a,rules:me},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:le,onKeydown:e[18]||(e[18]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",vt,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>P.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:re},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const jt=Ae(ft,[["__scopeId","data-v-7bb19e7f"]]);export{jt as default}; diff --git a/web/dist/assets/Topic-a2ac0d74.js b/web/dist/assets/Topic-cbdeda07.js similarity index 95% rename from web/dist/assets/Topic-a2ac0d74.js rename to web/dist/assets/Topic-cbdeda07.js index 6a874f07..afbd0a3a 100644 --- a/web/dist/assets/Topic-a2ac0d74.js +++ b/web/dist/assets/Topic-cbdeda07.js @@ -1 +1 @@ -import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-15a0e03b.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-428b5d53.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-f3cd38fc.js b/web/dist/assets/User-d45b8d09.js similarity index 97% rename from web/dist/assets/User-f3cd38fc.js rename to web/dist/assets/User-d45b8d09.js index 75fd9e95..f007da07 100644 --- a/web/dist/assets/User-f3cd38fc.js +++ b/web/dist/assets/User-d45b8d09.js @@ -1 +1 @@ -import{_ as He,a as Ne}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as Re}from"./post-skeleton-a15059e0.js";import{_ as Ve}from"./whisper-29f2b0aa.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Ee,H as i,R as Ge,c as Je,b as Ke,E as Ye,r as Qe,f as u,k as o,w as r,q as g,Y as m,e as s,j as w,x as I,bf as c,A as H,y as de,F,u as T,h as me}from"./@vue-a481fc63.js";import{u as Xe}from"./vuex-44de225f.js";import{b as Ze}from"./vue-router-e5a2430e.js";import{L as ea,K as aa,e as N,h as sa,u as fe,f as pe,M as ta,_ as la}from"./index-15a0e03b.js";import{W as na}from"./whisper-add-friend-78adb41e.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as ua,r as ia,G as he,s as ra,t as ca,J as va,R as _a}from"./@vicons-f0266f88.js";import{F as da,G as ma,a as fa,j as ge,o as pa,M as ha,e as ga,P as wa,k as ka,f as ya,g as ba,J as Pa,H as Oa}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Fa={key:0,class:"profile-baseinfo"},Ta={class:"avatar"},Ia={class:"base-info"},xa={class:"username"},Aa={class:"userinfo"},$a={class:"info-item"},za={class:"info-item"},Ua={class:"userinfo"},qa={class:"info-item"},Ma={class:"info-item"},Ca={class:"info-item"},Sa={key:0,class:"user-opts"},Wa={key:0,class:"skeleton-wrap"},La={key:1},Ba={key:0,class:"empty-wrap"},Da={key:1},Ha={key:0},Na={key:1},Ra={key:2},Va={key:3},ja={key:4},Ea={key:2},Ga={key:0},Ja={key:1},Ka={key:2},Ya={key:3},Qa={key:4},Xa={class:"load-more-wrap"},Za={class:"load-more-spinner"},es=Ee({__name:"User",setup(as){const R=da(),v=Xe(),$=Ze(),f=i(!1),y=i(!1),a=Ge({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),M=i([]),C=i([]),x=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Y=i(1),Q=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?fe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ce(e.user_id,!1)}).catch(_=>{}):pe({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ce(e.user_id,!0)}).catch(_=>{})}})};function ce(e,_){S(z,e,_),S(U,e,_),S(q,e,_),S(M,e,_),S(C,e,_)}function S(e,_,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==_&&(e.value[E].user.is_following=ie)}const we=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],M.value=[],C.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Y.value=1,Q.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ke=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,N({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,N({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,N({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,N({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,N({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ye=e=>{switch(p.value=e,p.value){case"post":l.value=z.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=U.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Y.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Q.value,d.value=se.value,oe();break;case"star":l.value=C.value,n.value=X.value,d.value=te.value,ue();break}},W=()=>{h.value=!0,ea({username:x.value}).then(e=>{h.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),ke()}).catch(e=>{h.value=!1,console.log(e)})},be=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Y.value=n.value,ne();break;case"media":Q.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Pe=()=>{V.value=!0},Oe=()=>{G.value=!0},Fe=()=>{V.value=!1},Te=()=>{G.value=!1},A=e=>()=>me(ge,null,{default:()=>me(e)}),Ie=Je(()=>{let e=[{label:"私信",key:"whisper",icon:A(ia)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:A(he)}):e.push({label:"解封",key:"deblocking",icon:A(he)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:A(ra)}):e.push({label:"关注",key:"follow",icon:A(ca)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:A(va)}):e.push({label:"添加朋友",key:"requesting",icon:A(_a)})),e}),xe=e=>{switch(e){case"whisper":Pe();break;case"delete":Ae();break;case"requesting":Oe();break;case"follow":case"unfollow":$e();break;case"banned":case"deblocking":ze();break}},Ae=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,sa({user_id:a.id}).then(e=>{h.value=!1,a.is_friend=!1,j()}).catch(e=>{h.value=!1,console.log(e)})}})},$e=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,a.is_following?fe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)}):pe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},ze=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,ta({id:a.id,status:a.status===1?2:1}).then(e=>{h.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},Ue=()=>{n.value{W()}),Ye(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",we(),W())}),(e,_)=>{const ie=je,E=pa,re=ha,ve=Qe("router-link"),qe=ga,Me=wa,Ce=Ve,_e=ka,L=ya,Se=ba,We=Re,Le=Pa,B=He,O=Oa,D=Ne,Be=ma,De=fa;return s(),u("div",null,[o(ie,{title:"用户详情"}),o(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[o(_e,{show:h.value},{default:r(()=>[a.id>0?(s(),u("div",Fa,[w("div",Ta,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",Ia,[w("div",xa,[w("strong",null,I(a.nickname),1),w("span",null," @"+I(a.username),1),c(v).state.profile.useFriendship&&c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_friend?(s(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[H(" 好友 ")]),_:1})):m("",!0),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_following?(s(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[H(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(s(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[H(" 管理员 ")]),_:1})):m("",!0)]),w("div",Aa,[w("span",$a,"UID. "+I(a.id),1),w("span",za,I(c(aa)(a.created_on))+" 加入",1)]),w("div",Ua,[w("span",qa,[o(ve,{onClick:_[0]||(_[0]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[H(" 关注  "+I(a.follows),1)]),_:1},8,["to"])]),w("span",Ma,[o(ve,{onClick:_[1]||(_[1]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[H(" 粉丝  "+I(a.followings),1)]),_:1},8,["to"])]),w("span",Ca," 泡泡  "+I(a.tweets_count),1)])]),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username?(s(),u("div",Sa,[o(Me,{placement:"bottom-end",trigger:"click",size:"small",options:Ie.value,onSelect:xe},{default:r(()=>[o(qe,{quaternary:"",circle:""},{icon:r(()=>[o(c(ge),null,{default:r(()=>[o(c(ua))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(Ce,{show:V.value,user:a,onSuccess:Fe},null,8,["show","user"]),o(na,{show:G.value,user:a,onSuccess:Te},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":ye},{default:r(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),f.value&&l.value.length===0?(s(),u("div",Wa,[o(We,{num:k.value},null,8,["num"])])):(s(),u("div",La,[l.value.length===0?(s(),u("div",Ba,[o(Le,{size:"large",description:"暂无数据"})])):m("",!0),c(v).state.desktopModelShow?(s(),u("div",Da,[p.value==="post"?(s(),u("div",Ha,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Na,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ra,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Va,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",ja,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(s(),u("div",Ea,[p.value==="post"?(s(),u("div",Ga,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ja,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ka,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Ya,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Qa,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(s(),g(De,{key:0,justify:"center"},{default:r(()=>[o(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=t=>Ue())},{spinner:r(()=>[w("div",Xa,[y.value?m("",!0):(s(),g(_e,{key:0,size:14})),w("span",Za,I(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Cs=la(es,[["__scopeId","data-v-85a170e0"]]);export{Cs as default}; +import{_ as He,a as Ne}from"./post-item.vue_vue_type_style_index_0_lang-093e4300.js";import{_ as Re}from"./post-skeleton-510366fa.js";import{_ as Ve}from"./whisper-7ff8cab8.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{d as Ee,H as i,R as Ge,c as Je,b as Ke,E as Ye,r as Qe,f as u,k as o,w as r,q as g,Y as m,e as s,j as w,x as I,bf as c,A as H,y as de,F,u as T,h as me}from"./@vue-a481fc63.js";import{u as Xe}from"./vuex-44de225f.js";import{b as Ze}from"./vue-router-e5a2430e.js";import{L as ea,K as aa,e as N,h as sa,u as fe,f as pe,M as ta,_ as la}from"./index-428b5d53.js";import{W as na}from"./whisper-add-friend-55077e20.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as ua,r as ia,G as he,s as ra,t as ca,J as va,R as _a}from"./@vicons-f0266f88.js";import{F as da,G as ma,a as fa,j as ge,o as pa,M as ha,e as ga,P as wa,k as ka,f as ya,g as ba,J as Pa,H as Oa}from"./naive-ui-eecf2ec3.js";import"./content-3ace01ff.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Fa={key:0,class:"profile-baseinfo"},Ta={class:"avatar"},Ia={class:"base-info"},xa={class:"username"},Aa={class:"userinfo"},$a={class:"info-item"},za={class:"info-item"},Ua={class:"userinfo"},qa={class:"info-item"},Ma={class:"info-item"},Ca={class:"info-item"},Sa={key:0,class:"user-opts"},Wa={key:0,class:"skeleton-wrap"},La={key:1},Ba={key:0,class:"empty-wrap"},Da={key:1},Ha={key:0},Na={key:1},Ra={key:2},Va={key:3},ja={key:4},Ea={key:2},Ga={key:0},Ja={key:1},Ka={key:2},Ya={key:3},Qa={key:4},Xa={class:"load-more-wrap"},Za={class:"load-more-spinner"},es=Ee({__name:"User",setup(as){const R=da(),v=Xe(),$=Ze(),f=i(!1),y=i(!1),a=Ge({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),M=i([]),C=i([]),x=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Y=i(1),Q=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?fe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ce(e.user_id,!1)}).catch(_=>{}):pe({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ce(e.user_id,!0)}).catch(_=>{})}})};function ce(e,_){S(z,e,_),S(U,e,_),S(q,e,_),S(M,e,_),S(C,e,_)}function S(e,_,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==_&&(e.value[E].user.is_following=ie)}const we=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],M.value=[],C.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Y.value=1,Q.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ke=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,N({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,N({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,N({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,N({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,N({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ye=e=>{switch(p.value=e,p.value){case"post":l.value=z.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=U.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Y.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Q.value,d.value=se.value,oe();break;case"star":l.value=C.value,n.value=X.value,d.value=te.value,ue();break}},W=()=>{h.value=!0,ea({username:x.value}).then(e=>{h.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),ke()}).catch(e=>{h.value=!1,console.log(e)})},be=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Y.value=n.value,ne();break;case"media":Q.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Pe=()=>{V.value=!0},Oe=()=>{G.value=!0},Fe=()=>{V.value=!1},Te=()=>{G.value=!1},A=e=>()=>me(ge,null,{default:()=>me(e)}),Ie=Je(()=>{let e=[{label:"私信",key:"whisper",icon:A(ia)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:A(he)}):e.push({label:"解封",key:"deblocking",icon:A(he)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:A(ra)}):e.push({label:"关注",key:"follow",icon:A(ca)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:A(va)}):e.push({label:"添加朋友",key:"requesting",icon:A(_a)})),e}),xe=e=>{switch(e){case"whisper":Pe();break;case"delete":Ae();break;case"requesting":Oe();break;case"follow":case"unfollow":$e();break;case"banned":case"deblocking":ze();break}},Ae=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,sa({user_id:a.id}).then(e=>{h.value=!1,a.is_friend=!1,j()}).catch(e=>{h.value=!1,console.log(e)})}})},$e=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,a.is_following?fe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)}):pe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},ze=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,ta({id:a.id,status:a.status===1?2:1}).then(e=>{h.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},Ue=()=>{n.value{W()}),Ye(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",we(),W())}),(e,_)=>{const ie=je,E=pa,re=ha,ve=Qe("router-link"),qe=ga,Me=wa,Ce=Ve,_e=ka,L=ya,Se=ba,We=Re,Le=Pa,B=He,O=Oa,D=Ne,Be=ma,De=fa;return s(),u("div",null,[o(ie,{title:"用户详情"}),o(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[o(_e,{show:h.value},{default:r(()=>[a.id>0?(s(),u("div",Fa,[w("div",Ta,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",Ia,[w("div",xa,[w("strong",null,I(a.nickname),1),w("span",null," @"+I(a.username),1),c(v).state.profile.useFriendship&&c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_friend?(s(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[H(" 好友 ")]),_:1})):m("",!0),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_following?(s(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[H(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(s(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[H(" 管理员 ")]),_:1})):m("",!0)]),w("div",Aa,[w("span",$a,"UID. "+I(a.id),1),w("span",za,I(c(aa)(a.created_on))+" 加入",1)]),w("div",Ua,[w("span",qa,[o(ve,{onClick:_[0]||(_[0]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[H(" 关注  "+I(a.follows),1)]),_:1},8,["to"])]),w("span",Ma,[o(ve,{onClick:_[1]||(_[1]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[H(" 粉丝  "+I(a.followings),1)]),_:1},8,["to"])]),w("span",Ca," 泡泡  "+I(a.tweets_count),1)])]),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username?(s(),u("div",Sa,[o(Me,{placement:"bottom-end",trigger:"click",size:"small",options:Ie.value,onSelect:xe},{default:r(()=>[o(qe,{quaternary:"",circle:""},{icon:r(()=>[o(c(ge),null,{default:r(()=>[o(c(ua))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(Ce,{show:V.value,user:a,onSuccess:Fe},null,8,["show","user"]),o(na,{show:G.value,user:a,onSuccess:Te},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":ye},{default:r(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),f.value&&l.value.length===0?(s(),u("div",Wa,[o(We,{num:k.value},null,8,["num"])])):(s(),u("div",La,[l.value.length===0?(s(),u("div",Ba,[o(Le,{size:"large",description:"暂无数据"})])):m("",!0),c(v).state.desktopModelShow?(s(),u("div",Da,[p.value==="post"?(s(),u("div",Ha,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Na,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ra,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Va,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",ja,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(s(),u("div",Ea,[p.value==="post"?(s(),u("div",Ga,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ja,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ka,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Ya,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Qa,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(s(),g(De,{key:0,justify:"center"},{default:r(()=>[o(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=t=>Ue())},{spinner:r(()=>[w("div",Xa,[y.value?m("",!0):(s(),g(_e,{key:0,size:14})),w("span",Za,I(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Cs=la(es,[["__scopeId","data-v-85a170e0"]]);export{Cs as default}; diff --git a/web/dist/assets/Wallet-d200e3ec.js b/web/dist/assets/Wallet-3ded4712.js similarity index 95% rename from web/dist/assets/Wallet-d200e3ec.js rename to web/dist/assets/Wallet-3ded4712.js index a3438b8f..f3cd0ac1 100644 --- a/web/dist/assets/Wallet-d200e3ec.js +++ b/web/dist/assets/Wallet-3ded4712.js @@ -1 +1 @@ -import{_ as K}from"./post-skeleton-a15059e0.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Z,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{a0 as _e,a1 as re,a2 as ue,a3 as pe,J as de,_ as me}from"./index-15a0e03b.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Z({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,d=fe,F=ye,f=we,$=ke,L=be,U=K,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,G=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; +import{_ as K}from"./post-skeleton-510366fa.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js";import{d as Z,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{a0 as _e,a1 as re,a2 as ue,a3 as pe,J as de,_ as me}from"./index-428b5d53.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Z({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,d=fe,F=ye,f=we,$=ke,L=be,U=K,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,G=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; diff --git a/web/dist/assets/content-a642a616.js b/web/dist/assets/content-3ace01ff.js similarity index 98% rename from web/dist/assets/content-a642a616.js rename to web/dist/assets/content-3ace01ff.js index c8e770c8..0c26404e 100644 --- a/web/dist/assets/content-a642a616.js +++ b/web/dist/assets/content-3ace01ff.js @@ -1 +1 @@ -import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as z}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as F,X as L,e as T,i as U}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-15a0e03b.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},W={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},S=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",W,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,$(n.content),1)],8,q)])]))),128))])}}});const ot=B(S,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=F,_=A,f=V,w=L;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=T,i=U;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(z))]),_:1})]),default:o(()=>[D(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; +import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as z}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as F,X as L,e as T,i as U}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-428b5d53.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},W={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},S=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",W,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,$(n.content),1)],8,q)])]))),128))])}}});const ot=B(S,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=F,_=A,f=V,w=L;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=T,i=U;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(z))]),_:1})]),default:o(()=>[D(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/index-15a0e03b.js b/web/dist/assets/index-428b5d53.js similarity index 82% rename from web/dist/assets/index-15a0e03b.js rename to web/dist/assets/index-428b5d53.js index ada2fff0..4fd0a6d6 100644 --- a/web/dist/assets/index-15a0e03b.js +++ b/web/dist/assets/index-428b5d53.js @@ -1 +1 @@ -import{d as V,H as L,R as X,b as B,e as f,q as F,w as u,j as w,k as s,bf as d,f as R,A as U,Z as q,y as N,Y as E,c as Q,E as j,r as ue,F as ee,u as te,x as A,h as k,a5 as ve,s as oe,l as we,ag as ye}from"./@vue-a481fc63.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-e5a2430e.js";import{c as Pe,u as W}from"./vuex-44de225f.js";import{a as Te}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Oe,d as Ce,e as me,f as Me,g as Ie,h as _e,i as Ee,j as K,k as Ue,u as Se,l as $e,m as De,n as xe,o as qe,p as Ne,q as Fe,r as Ke,s as Ve,t as Be}from"./naive-ui-eecf2ec3.js";import{h as S}from"./moment-2ab8298d.js";import{S as We,M as ze,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-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.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"]'))h(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"&&h(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 h(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={},T=function(t,r,h){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"),I=c?'[rel="stylesheet"]':"";if(!!h)for(let _=n.length-1;_>=0;_--){const i=n[_];if(i.href===l&&(!c||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${I}`))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((_,i)=>{g.addEventListener("load",_),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:()=>T(()=>import("./Home-c19b4d50.js"),["assets/Home-c19b4d50.js","assets/whisper-add-friend-78adb41e.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-e6b13f04.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-44974496.js"),["assets/Post-44974496.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-a642a616.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-39447b75.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-a2ac0d74.js"),["assets/Topic-a2ac0d74.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-a1221d42.js"),["assets/Anouncement-a1221d42.js","assets/post-skeleton-a15059e0.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-7682ee52.js"),["assets/Profile-7682ee52.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-54de1ef0.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-f3cd38fc.js"),["assets/User-f3cd38fc.js","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-78adb41e.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-1ad57452.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-2895f627.js"),["assets/Messages-2895f627.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-9543d2b3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-55969243.js"),["assets/Collection-55969243.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-e605040f.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-669f91fa.js"),["assets/Contacts-669f91fa.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-3acd73c5.js"),["assets/Following-3acd73c5.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-d200e3ec.js"),["assets/Wallet-d200e3ec.js","assets/post-skeleton-a15059e0.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-9923d3fd.js"),["assets/Setting-9923d3fd.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-94ec4c57.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-c0c7310e.js"),["assets/404-c0c7310e.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],he=be({history:ke(),routes:et});he.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Pe({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,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.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=+"5000",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.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=Te.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=V({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),I={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,i)=>!!c.password&&c.password.startsWith(i)&&c.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},P=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(O=>{O||(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=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=l.value)==null||i.validate(O=>{O||(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 B(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Y(_).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(_,i)=>{const O=Ae,m=Re,b=pe,a=de,v=Oe,D=Ce,$=me,x=Me,p=Ie,C=_e,z=Ee;return f(),F(z,{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?E("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(O,{type:"success"},{default:u(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{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(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),F(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:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{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(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:I},{default:u(()=>[s(v,{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(v,{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(v,{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(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):E("",!0)]),_:1})])]),_:1},8,["show"])}}});const fe=(e,t)=>{const r=e.__vccOpts||e;for(const[h,n]of t)r[h]=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}),_o=e=>o({method:"get",url:"/v1/trends/index",params:e}),ho=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}),vo=e=>o({method:"post",url:"/v1/post/stick",data:e}),wo=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}),Po=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Oo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Io=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Eo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),So=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}),qo=e=>o({method:"post",url:"/v1/user/follow",data:e}),No=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}),Bo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),zo=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"});S.locale("zh-cn");const ut=e=>S.unix(e).fromNow(),ur=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>S.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"},_t={class:"copyright"},ht=["href"],ft=["href"],gt={class:"site-info-item"},vt=V({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),I=L(0),P=L(0),g=L(0),_=L(0),i=L(null),O=+"6",m=+"12",b=()=>{it().then(p=>{I.value=p.register_user_count,P.value=p.online_user_count,g.value=p.history_max_online,_.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{h.value=!0,lt({type:"hot_extral",num:m,extral_num:O}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,h.value=!1}).catch(p=>{h.value=!1})},v=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,C)=>{(p.refreshTopicFollow!==C.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(C=>{C.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return B(()=>{i.value&&x.observe(i.value),a()}),(p,C)=>{const z=K,y=de,G=ue("router-link"),J=Ue,H=_e,ge=pe;return d(l).state.collapsedRight?E("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":C[0]||(C[0]=M=>n.value=M),onKeyup:q(N(D,["prevent"]),["enter"])},{prefix:u(()=>[s(z,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),F(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):E("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",_t,"© "+A(d(l).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(l).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightLeft),9,ht),w("a",{href:d(l).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(l).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(I.value)+" 注册用户,"+A(P.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):E("",!0)]))}}});const wt=fe(vt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-52afee68.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Pt={class:"user-info"},Tt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Ot={class:"user-mini-wrap"},Ct={key:1,class:"user-wrap"},Mt={key:0,class:"login-only-wrap"},It={key:1,class:"login-wrap"},Et=V({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),I="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)}),B(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const P=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return I&&a.push({label:"公告",key:"anouncement",icon:()=>k(ze),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,_=a=>a.key==="messages"?k($e,{dot:!0,show:n.value,processing:!0},{default:()=>k(K,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(K,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},O=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),O()};return window.$store=t,window.$message=Se(),(a,v)=>{const D=De,$=xe,x=qe,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:O},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:P.value,"render-label":g,"render-icon":_,value:l.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",Pt,[w("div",Tt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(K),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Ot,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(K),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Ct,[d(t).state.profile.allowUserRegister?E("",!0):(f(),R("div",Mt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=C=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",It,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=C=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=C=>m("signup"))},{default:u(()=>[U(" 注册 ")]),_:1})])):E("",!0)]))])}}});const Ut=()=>o({method:"get",url:"/v1/site/profile"}),St={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=V({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?Fe:null);function h(){t.commit("loadDefaultSiteProfile"),Ut().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return B(()=>{h()}),(n,l)=>{const c=Et,I=ue("router-view"),P=wt,g=at,_=Ke,i=Ve,O=Be,m=Ne;return f(),F(m,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(_,null,{default:u(()=>{var b;return[w("div",{class:we(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",St,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):E("",!0),w("div",Dt,[s(I,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),F(ve,null,[n.$route.meta.keepAlive?(f(),F(oe(a),{key:0})):E("",!0)],1024)),n.$route.meta.keepAlive?E("",!0):(f(),F(oe(a),{key:0}))]),_:1})]),s(P)]),s(g)],2)]}),_:1})]),_:1}),s(O)]),_:1},8,["theme"])}}});ye(xt).use(he).use(tt).mount("#app");export{$o as $,io as A,co as B,ao as C,po as D,yt as E,Mo as F,Eo as G,Io as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Vo 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,Fo as Y,Ko as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,Uo as a4,jo as a5,Ho as a6,Wo as a7,zo as a8,Yo as a9,So as aa,Et as ab,_o as b,ho as c,no as d,er as e,qo as f,sr as g,Bo as h,ur as i,Po as j,Co as k,bo as l,ko as m,Oo as n,Ao as o,Ro as p,To as q,lo as r,uo as s,Lo as t,No as u,fo as v,go as w,vo as x,wo as y,yo as z}; +import{d as V,H as L,R as X,b as B,e as f,q as F,w as u,j as w,k as s,bf as d,f as R,A as U,Z as q,y as N,Y as E,c as Q,E as j,r as ue,F as ee,u as te,x as A,h as k,a5 as ve,s as oe,l as we,ag as ye}from"./@vue-a481fc63.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-e5a2430e.js";import{c as Pe,u as W}from"./vuex-44de225f.js";import{a as Te}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Ce,d as Oe,e as me,f as Me,g as Ie,h as _e,i as Ee,j as K,k as Ue,u as Se,l as $e,m as De,n as xe,o as qe,p as Ne,q as Fe,r as Ke,s as Ve,t as Be}from"./naive-ui-eecf2ec3.js";import{h as S}from"./moment-2ab8298d.js";import{S as We,M as ze,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-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.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"]'))h(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"&&h(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 h(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={},T=function(t,r,h){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"),I=c?'[rel="stylesheet"]':"";if(!!h)for(let _=n.length-1;_>=0;_--){const i=n[_];if(i.href===l&&(!c||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${I}`))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((_,i)=>{g.addEventListener("load",_),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:()=>T(()=>import("./Home-142cb625.js"),["assets/Home-142cb625.js","assets/whisper-add-friend-55077e20.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-7ff8cab8.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js","assets/content-3ace01ff.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-e6b13f04.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-6b0900af.js"),["assets/Post-6b0900af.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-3ace01ff.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-7ff8cab8.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-39447b75.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-cbdeda07.js"),["assets/Topic-cbdeda07.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-ade70010.js"),["assets/Anouncement-ade70010.js","assets/post-skeleton-510366fa.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-11f878a8.js"),["assets/Profile-11f878a8.js","assets/whisper-7ff8cab8.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js","assets/content-3ace01ff.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-54de1ef0.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-d45b8d09.js"),["assets/User-d45b8d09.js","assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js","assets/content-3ace01ff.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/whisper-7ff8cab8.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-55077e20.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-1ad57452.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-e06acc1a.js"),["assets/Messages-e06acc1a.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-7ff8cab8.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-9543d2b3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-71fe2540.js"),["assets/Collection-71fe2540.js","assets/whisper-7ff8cab8.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js","assets/content-3ace01ff.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-e605040f.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-c3dd71d7.js"),["assets/Contacts-c3dd71d7.js","assets/whisper-7ff8cab8.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-a53b2057.js"),["assets/Following-a53b2057.js","assets/whisper-7ff8cab8.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-510366fa.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-3ded4712.js"),["assets/Wallet-3ded4712.js","assets/post-skeleton-510366fa.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-75fc0298.js"),["assets/Setting-75fc0298.js","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-94ec4c57.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-7a651458.js"),["assets/404-7a651458.js","assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],he=be({history:ke(),routes:et});he.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Pe({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,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.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=+"5000",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.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=Te.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=V({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),I={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,i)=>!!c.password&&c.password.startsWith(i)&&c.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},P=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(C=>{C||(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=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=l.value)==null||i.validate(C=>{C||(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 B(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Y(_).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(_,i)=>{const C=Ae,m=Re,b=pe,a=de,v=Ce,D=Oe,$=me,x=Me,p=Ie,O=_e,z=Ee;return f(),F(z,{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(O,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?E("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(C,{type:"success"},{default:u(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{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(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),F(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:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{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(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:I},{default:u(()=>[s(v,{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(v,{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(v,{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(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):E("",!0)]),_:1})])]),_:1},8,["show"])}}});const fe=(e,t)=>{const r=e.__vccOpts||e;for(const[h,n]of t)r[h]=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}),_o=e=>o({method:"get",url:"/v1/trends/index",params:e}),ho=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}),vo=e=>o({method:"post",url:"/v1/post/stick",data:e}),wo=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}),Po=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Co=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Oo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Io=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Eo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),So=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}),qo=e=>o({method:"post",url:"/v1/user/follow",data:e}),No=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}),Bo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),zo=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"});S.locale("zh-cn");const ut=e=>S.unix(e).fromNow(),ur=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>S.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"},_t={class:"copyright"},ht=["href"],ft=["href"],gt={class:"site-info-item"},vt=V({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),I=L(0),P=L(0),g=L(0),_=L(0),i=L(null),C=+"6",m=+"12",b=()=>{it().then(p=>{I.value=p.register_user_count,P.value=p.online_user_count,g.value=p.history_max_online,_.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{h.value=!0,lt({type:"hot_extral",num:m,extral_num:C}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,h.value=!1}).catch(p=>{h.value=!1})},v=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,O)=>{(p.refreshTopicFollow!==O.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(O=>{O.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return B(()=>{i.value&&x.observe(i.value),a()}),(p,O)=>{const z=K,y=de,G=ue("router-link"),J=Ue,H=_e,ge=pe;return d(l).state.collapsedRight?E("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":O[0]||(O[0]=M=>n.value=M),onKeyup:q(N(D,["prevent"]),["enter"])},{prefix:u(()=>[s(z,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),F(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):E("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",_t,"© "+A(d(l).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(l).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightLeft),9,ht),w("a",{href:d(l).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(l).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(I.value)+" 注册用户,"+A(P.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):E("",!0)]))}}});const wt=fe(vt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-52afee68.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Pt={class:"user-info"},Tt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Ct={class:"user-mini-wrap"},Ot={key:1,class:"user-wrap"},Mt={key:0,class:"login-only-wrap"},It={key:1,class:"login-wrap"},Et=V({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),I="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)}),B(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const P=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return I&&a.push({label:"公告",key:"anouncement",icon:()=>k(ze),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,_=a=>a.key==="messages"?k($e,{dot:!0,show:n.value,processing:!0},{default:()=>k(K,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(K,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},C=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),C()};return window.$store=t,window.$message=Se(),(a,v)=>{const D=De,$=xe,x=qe,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:C},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:P.value,"render-label":g,"render-icon":_,value:l.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",Pt,[w("div",Tt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(K),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Ct,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(K),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Ot,[d(t).state.profile.allowUserRegister?E("",!0):(f(),R("div",Mt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=O=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",It,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=O=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=O=>m("signup"))},{default:u(()=>[U(" 注册 ")]),_:1})])):E("",!0)]))])}}});const Ut=()=>o({method:"get",url:"/v1/site/profile"}),St={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=V({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?Fe:null);function h(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&Ut().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return B(()=>{h()}),(n,l)=>{const c=Et,I=ue("router-view"),P=wt,g=at,_=Ke,i=Ve,C=Be,m=Ne;return f(),F(m,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(_,null,{default:u(()=>{var b;return[w("div",{class:we(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",St,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):E("",!0),w("div",Dt,[s(I,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),F(ve,null,[n.$route.meta.keepAlive?(f(),F(oe(a),{key:0})):E("",!0)],1024)),n.$route.meta.keepAlive?E("",!0):(f(),F(oe(a),{key:0}))]),_:1})]),s(P)]),s(g)],2)]}),_:1})]),_:1}),s(C)]),_:1},8,["theme"])}}});ye(xt).use(he).use(tt).mount("#app");export{$o as $,io as A,co as B,ao as C,po as D,yt as E,Mo as F,Eo as G,Io as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Vo 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,Fo as Y,Ko as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,Uo as a4,jo as a5,Ho as a6,Wo as a7,zo as a8,Yo as a9,So as aa,Et as ab,_o as b,ho as c,no as d,er as e,qo as f,sr as g,Bo as h,ur as i,Po as j,Oo as k,bo as l,ko as m,Co as n,Ao as o,Ro as p,To as q,lo as r,uo as s,Lo as t,No as u,fo as v,go as w,vo as x,wo as y,yo as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js index cb7eae9e..8684f73d 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-1c9035f6.js @@ -1 +1 @@ -import{ab as A}from"./index-15a0e03b.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; +import{ab as A}from"./index-428b5d53.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js index eccb1406..a6e65da4 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-093e4300.js @@ -1 +1 @@ -import{p as R,a as V,_ as E,b as J,c as U}from"./content-a642a616.js";import{d as W,c as x,r as Y,e as l,f as b,k as n,al as G,w as s,j as u,F as K,u as Q,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{U as ee,A as te,B as oe}from"./index-15a0e03b.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=W({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=W({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; +import{p as R,a as V,_ as E,b as J,c as U}from"./content-3ace01ff.js";import{d as W,c as x,r as Y,e as l,f as b,k as n,al as G,w as s,j as u,F as K,u as Q,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{U as ee,A as te,B as oe}from"./index-428b5d53.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=W({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=W({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; diff --git a/web/dist/assets/post-skeleton-a15059e0.js b/web/dist/assets/post-skeleton-510366fa.js similarity index 88% rename from web/dist/assets/post-skeleton-a15059e0.js rename to web/dist/assets/post-skeleton-510366fa.js index 9e3050d5..ce924896 100644 --- a/web/dist/assets/post-skeleton-a15059e0.js +++ b/web/dist/assets/post-skeleton-510366fa.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-15a0e03b.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-428b5d53.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/whisper-29f2b0aa.js b/web/dist/assets/whisper-7ff8cab8.js similarity index 95% rename from web/dist/assets/whisper-29f2b0aa.js rename to web/dist/assets/whisper-7ff8cab8.js index 89d899ba..e54a3f60 100644 --- a/web/dist/assets/whisper-29f2b0aa.js +++ b/web/dist/assets/whisper-7ff8cab8.js @@ -1 +1 @@ -import{$ as b,_ as k}from"./index-15a0e03b.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; +import{$ as b,_ as k}from"./index-428b5d53.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; diff --git a/web/dist/assets/whisper-add-friend-78adb41e.js b/web/dist/assets/whisper-add-friend-55077e20.js similarity index 95% rename from web/dist/assets/whisper-add-friend-78adb41e.js rename to web/dist/assets/whisper-add-friend-55077e20.js index 7f65d506..60da85ad 100644 --- a/web/dist/assets/whisper-add-friend-78adb41e.js +++ b/web/dist/assets/whisper-add-friend-55077e20.js @@ -1 +1 @@ -import{N as b,_ as k}from"./index-15a0e03b.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; +import{N as b,_ as k}from"./index-428b5d53.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; diff --git a/web/dist/index.html b/web/dist/index.html index 8f729bf4..3283bb55 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/App.vue b/web/src/App.vue index d62ec0a1..36b9ec92 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -53,11 +53,13 @@ const theme = computed(() => (store.state.theme === 'dark' ? darkTheme : null)); function loadSiteProfile() { store.commit('loadDefaultSiteProfile'); - getSiteProfile().then((res) => { - store.commit('updateSiteProfile', res); - }).catch((err) => { - console.log(err); - }); + if (import.meta.env.VITE_USE_WEB_PROFILE.toLowerCase() === "true") { + getSiteProfile().then((res) => { + store.commit('updateSiteProfile', res); + }).catch((err) => { + console.log(err); + }); + } } onMounted(() => { diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts index 5f8f6c68..efa62210 100644 --- a/web/src/vite-env.d.ts +++ b/web/src/vite-env.d.ts @@ -6,6 +6,7 @@ interface ImportMetaEnv { readonly VITE_HOST: string; readonly VITE_USE_FRIENDSHIP: string; + readonly VITE_USE_WEB_PROFILE: string; readonly VITE_ENABLE_ANOUNCEMENT: string; readonly VITE_ENABLE_WALLET: string; readonly VITE_ENABLE_TRENDS_BAR: string; From 53449b639e58ba3b0c13ec237062adce02ebc5d8 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 4 Oct 2023 21:06:46 +0800 Subject: [PATCH 2/3] fixed get follow index tweets incorrect problem --- internal/dao/jinzhu/messages.go | 2 +- internal/dao/jinzhu/tweets.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/dao/jinzhu/messages.go b/internal/dao/jinzhu/messages.go index ea9976fd..105618e9 100644 --- a/internal/dao/jinzhu/messages.go +++ b/internal/dao/jinzhu/messages.go @@ -48,7 +48,7 @@ func (s *messageSrv) ReadMessage(message *ms.Message) error { } func (s *messageSrv) ReadAllMessage(userId int64) error { - return s.db.Table(_message_).Where("receiver_user_id=?", userId).Update("is_read", 1).Error + return s.db.Table(_message_).Where("receiver_user_id=? AND is_del=0", userId).Update("is_read", 1).Error } func (s *messageSrv) GetMessages(userId int64, style cs.MessageStyle, limit int, offset int) (res []*ms.MessageFormated, total int64, err error) { diff --git a/internal/dao/jinzhu/tweets.go b/internal/dao/jinzhu/tweets.go index 4efce1f9..dd1499f6 100644 --- a/internal/dao/jinzhu/tweets.go +++ b/internal/dao/jinzhu/tweets.go @@ -393,7 +393,7 @@ func (s *tweetSrv) GetPosts(conditions ms.ConditionsT, offset, limit int) ([]*ms } func (s *tweetSrv) ListUserTweets(userId int64, style uint8, justEssence bool, limit, offset int) (res []*ms.Post, total int64, err error) { - db := s.db.Table(_post_).Where("user_id = ?", userId) + db := s.db.Model(&dbr.Post{}).Where("user_id = ?", userId) switch style { case cs.StyleUserTweetsAdmin: fallthrough @@ -438,7 +438,7 @@ func (s *tweetSrv) ListIndexNewestTweets(limit, offset int) (res []*ms.Post, tot } func (s *tweetSrv) ListIndexHotsTweets(limit, offset int) (res []*ms.Post, total int64, err error) { - db := s.db.Table(_post_).Joins(fmt.Sprintf("LEFT JOIN %s metric ON %s.id=metric.post_id", _post_metric_, _post_)).Where("visibility >= ?", cs.TweetVisitPublic) + db := s.db.Table(_post_).Joins(fmt.Sprintf("LEFT JOIN %s metric ON %s.id=metric.post_id", _post_metric_, _post_)).Where(fmt.Sprintf("visibility >= ? AND %s.is_del=0 AND metric.is_del=0", _post_), cs.TweetVisitPublic) if err = db.Count(&total).Error; err != nil { return } @@ -471,7 +471,7 @@ func (s *tweetSrv) ListFollowingTweets(userId int64, limit, offset int) (res []* return nil, 0, xerr } beFriendCount, beFollowCount := len(beFriendIds), len(beFollowIds) - db := s.db.Table(_post_) + db := s.db.Model(&dbr.Post{}) //可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开', switch { case beFriendCount > 0 && beFollowCount > 0: @@ -496,10 +496,10 @@ func (s *tweetSrv) ListFollowingTweets(userId int64, limit, offset int) (res []* } func (s *tweetSrv) getUserRelation(userId int64) (beFriendIds []int64, beFollowIds []int64, err error) { - if err = s.db.Table(_contact_).Where("friend_id=?", userId).Select("user_id").Find(&beFriendIds).Error; err != nil { + if err = s.db.Table(_contact_).Where("friend_id=? AND status=2 AND is_del=0", userId).Select("user_id").Find(&beFriendIds).Error; err != nil { return } - if err = s.db.Table(_following_).Where("user_id=?", userId).Select("follow_id").Find(&beFollowIds).Error; err != nil { + if err = s.db.Table(_following_).Where("follow_id=? AND is_del=0", userId).Select("user_id").Find(&beFollowIds).Error; err != nil { return } // 即是好友又是关注者,保留好友去除关注者 From cefe055a17c3e6952bf60acc0ff5df0289134cb7 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 4 Oct 2023 21:19:57 +0800 Subject: [PATCH 3/3] f*k be follow user ids --- internal/dao/jinzhu/tweets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dao/jinzhu/tweets.go b/internal/dao/jinzhu/tweets.go index dd1499f6..8139b1c1 100644 --- a/internal/dao/jinzhu/tweets.go +++ b/internal/dao/jinzhu/tweets.go @@ -499,7 +499,7 @@ func (s *tweetSrv) getUserRelation(userId int64) (beFriendIds []int64, beFollowI if err = s.db.Table(_contact_).Where("friend_id=? AND status=2 AND is_del=0", userId).Select("user_id").Find(&beFriendIds).Error; err != nil { return } - if err = s.db.Table(_following_).Where("follow_id=? AND is_del=0", userId).Select("user_id").Find(&beFollowIds).Error; err != nil { + if err = s.db.Table(_following_).Where("user_id=? AND is_del=0", userId).Select("follow_id").Find(&beFollowIds).Error; err != nil { return } // 即是好友又是关注者,保留好友去除关注者