diff --git a/internal/dao/cache/events.go b/internal/dao/cache/events.go index a1cc6d37..bd6c1b10 100644 --- a/internal/dao/cache/events.go +++ b/internal/dao/cache/events.go @@ -62,11 +62,13 @@ type cacheMyFollowIdsEvent struct { } func OnExpireIndexTweetEvent(userId int64) { + // TODO: 这里暴躁的将所有 最新/热门/关注 的推文列表缓存都过期掉,后续需要更精细话处理 events.OnEvent(&expireIndexTweetsEvent{ ac: _appCache, keysPattern: []string{ conf.PrefixIdxTweetsNewest + "*", conf.PrefixIdxTweetsHots + "*", + conf.PrefixIdxTweetsFollowing + "*", fmt.Sprintf("%s%d:*", conf.PrefixUserTweets, userId), }, }) diff --git a/internal/servants/web/core.go b/internal/servants/web/core.go index b0c42019..405d4889 100644 --- a/internal/servants/web/core.go +++ b/internal/servants/web/core.go @@ -191,7 +191,6 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection logrus.Errorf("Ds.GetUserPostCollectionCount err: %s", err) return nil, web.ErrGetCollectionsFailed } - var posts []*ms.Post for _, collection := range collections { posts = append(posts, collection.Post) @@ -201,8 +200,11 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection logrus.Errorf("Ds.MergePosts err: %s", err) return nil, web.ErrGetCollectionsFailed } + if err = s.PrepareTweets(req.UserId, postsFormated); err != nil { + logrus.Errorf("get collections prepare tweets err: %s", err) + return nil, web.ErrGetCollectionsFailed + } resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) - return (*web.GetCollectionsResp)(resp), nil } diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index ad6b40e6..c7b8972f 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -131,17 +131,17 @@ func (s *looseSrv) getIndexTweets(req *web.TimelineReq, limit int, offset int) ( } func (s *looseSrv) indexTweetsFromCache(req *web.TimelineReq, limit int, offset int) (res *web.TimelineResp, key string, ok bool) { + username := "_" + if req.User != nil { + username = req.User.Username + } switch req.Style { case web.StyleTweetsFollowing: - username := "_" - if req.User != nil { - username = req.User.Username - } key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsFollowing, username, offset, limit) case web.StyleTweetsNewest: - key = fmt.Sprintf("%s%d:%d", s.prefixIdxTweetsNewest, offset, limit) + key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsNewest, username, offset, limit) case web.StyleTweetsHots: - key = fmt.Sprintf("%s%d:%d", s.prefixIdxTweetsHots, offset, limit) + key = fmt.Sprintf("%s%s:%d:%d", s.prefixIdxTweetsHots, username, offset, limit) default: return } diff --git a/internal/servants/web/utils.go b/internal/servants/web/utils.go index aeea733f..0e2696e3 100644 --- a/internal/servants/web/utils.go +++ b/internal/servants/web/utils.go @@ -207,10 +207,3 @@ func checkPermision(user *ms.User, targetUserId int64) mir.Error { } return nil } - -// visbleTansform 可见性等价转换,暂时处理方式,后续需要去掉这个步骤 -func _visbleTansform(list []*ms.PostFormated) { - for _, post := range list { - post.Visibility = ms.PostVisibleT(post.Visibility.ToOutValue()) - } -} diff --git a/web/dist/assets/404-09f9c793.js b/web/dist/assets/404-e5d5dc43.js similarity index 85% rename from web/dist/assets/404-09f9c793.js rename to web/dist/assets/404-e5d5dc43.js index afbfe1ed..336a8527 100644 --- a/web/dist/assets/404-09f9c793.js +++ b/web/dist/assets/404-e5d5dc43.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-defd0b2d.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-537a241d.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-4ed09704.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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-d575a251.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-defd0b2d.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-fcdbde87.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-4ed09704.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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-4a243149.js b/web/dist/assets/Anouncement-bee49752.js similarity index 70% rename from web/dist/assets/Anouncement-4a243149.js rename to web/dist/assets/Anouncement-bee49752.js index cc2dc3b5..ef916b7c 100644 --- a/web/dist/assets/Anouncement-4a243149.js +++ b/web/dist/assets/Anouncement-bee49752.js @@ -1 +1 @@ -import{_ as N}from"./post-skeleton-5d89319a.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{H as F,_ as H}from"./index-537a241d.js";import{G as S,R as V,J as q,H as P}from"./naive-ui-defd0b2d.js";import{d as j,H as n,b as D,f as o,k as a,w as p,e as t,bf as u,Y as l,F as E,u as G,q as I,j as s,x as _,l as J}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-4ed09704.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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=j({__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 D(()=>{}),(m,K)=>{const k=R,y=V,x=N,w=q,B=P,C=S;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(E,null,G(i.value,e=>(t(),I(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:J({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=H(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; +import{_ as N}from"./post-skeleton-0e77ba18.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{I as F,_ as S}from"./index-fcdbde87.js";import{G as V,R as q,J as H,H as I}from"./naive-ui-defd0b2d.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 J}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-4ed09704.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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=I,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:J({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-501380ec.css b/web/dist/assets/Collection-501380ec.css new file mode 100644 index 00000000..32fe8884 --- /dev/null +++ b/web/dist/assets/Collection-501380ec.css @@ -0,0 +1 @@ +.pagination-wrap[data-v-c8f8eee7]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-c8f8eee7],.dark .empty-wrap[data-v-c8f8eee7],.dark .skeleton-wrap[data-v-c8f8eee7]{background-color:#101014bf} diff --git a/web/dist/assets/Collection-55aa094f.js b/web/dist/assets/Collection-55aa094f.js deleted file mode 100644 index a63c5d65..00000000 --- a/web/dist/assets/Collection-55aa094f.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as H}from"./whisper-7c8226c3.js";import{_ as N,a as V}from"./post-item.vue_vue_type_style_index_0_lang-1243f33f.js";import{_ as W}from"./post-skeleton-5d89319a.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as G}from"./vuex-44de225f.js";import{b as I}from"./vue-router-e5a2430e.js";import{R as J,_ as L}from"./index-537a241d.js";import{d as T,H as s,b as U,f as o,k as n,w as u,bf as h,Y as w,e,F as k,u as y,q as C}from"./@vue-a481fc63.js";import{G as Y,R as j,J as A,H as D}from"./naive-ui-defd0b2d.js";import"./content-f21e8034.js";import"./@vicons-4ed09704.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-39372edb.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 K={key:0,class:"skeleton-wrap"},O={key:1},Q={key:0,class:"empty-wrap"},X={key:1},Z={key:2},ee={key:0,class:"pagination-wrap"},oe=T({__name:"Collection",setup(te){const m=G(),S=I(),_=s(!1),i=s([]),l=s(+S.query.p||1),p=s(20),r=s(0),c=s(!1),d=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),f=t=>{d.value=t,c.value=!0},b=()=>{c.value=!1},v=()=>{_.value=!0,J({page:l.value,page_size:p.value}).then(t=>{_.value=!1,i.value=t.list,r.value=Math.ceil(t.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(t=>{_.value=!1})},x=t=>{l.value=t,v()};return U(()=>{v()}),(t,ne)=>{const R=E,$=W,z=A,B=N,g=D,M=V,P=H,q=Y,F=j;return e(),o("div",null,[n(R,{title:"收藏"}),n(q,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",K,[n($,{num:p.value},null,8,["num"])])):(e(),o("div",O,[i.value.length===0?(e(),o("div",Q,[n(z,{size:"large",description:"暂无数据"})])):w("",!0),h(m).state.desktopModelShow?(e(),o("div",X,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(B,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))])):(e(),o("div",Z,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(M,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))]))])),n(P,{show:c.value,user:d.value,onSuccess:b},null,8,["show","user"])]),_:1}),r.value>0?(e(),o("div",ee,[n(F,{page:l.value,"onUpdate:page":x,"page-slot":h(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):w("",!0)])}}});const Ne=L(oe,[["__scopeId","data-v-760779af"]]);export{Ne as default}; diff --git a/web/dist/assets/Collection-5c3a44e2.css b/web/dist/assets/Collection-5c3a44e2.css deleted file mode 100644 index 317e31eb..00000000 --- a/web/dist/assets/Collection-5c3a44e2.css +++ /dev/null @@ -1 +0,0 @@ -.pagination-wrap[data-v-760779af]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-760779af],.dark .empty-wrap[data-v-760779af],.dark .skeleton-wrap[data-v-760779af]{background-color:#101014bf} diff --git a/web/dist/assets/Collection-8e3b1ca0.js b/web/dist/assets/Collection-8e3b1ca0.js new file mode 100644 index 00000000..95a5a32f --- /dev/null +++ b/web/dist/assets/Collection-8e3b1ca0.js @@ -0,0 +1 @@ +import{_ as T}from"./whisper-1cd3d379.js";import{_ as U,a as q}from"./post-item.vue_vue_type_style_index_0_lang-4e8f8831.js";import{_ as N}from"./post-skeleton-0e77ba18.js";import{_ as V}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{u as W}from"./vuex-44de225f.js";import{b as D}from"./vue-router-e5a2430e.js";import{R as E,u as G,f as J,_ as L}from"./index-fcdbde87.js";import{d as Y,H as a,b as j,f as t,k as s,w as f,bf as c,Y as y,e as o,F as C,u as x,q as F}from"./@vue-a481fc63.js";import{F as K,G as Q,R as X,J as Z,H as ee}from"./naive-ui-defd0b2d.js";import"./content-aa5ad7a4.js";import"./@vicons-4ed09704.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-39372edb.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 oe={key:0,class:"skeleton-wrap"},te={key:1},se={key:0,class:"empty-wrap"},ne={key:1},ae={key:2},ie={key:0,class:"pagination-wrap"},le=Y({__name:"Collection",setup(re){const i=W(),S=D(),$=K(),l=a(!1),r=a([]),u=a(+S.query.p||1),p=a(20),m=a(0),d=a(!1),g=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),v=e=>{g.value=e,d.value=!0},b=()=>{d.value=!1},w=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?G({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(_=>{}):J({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(_=>{})}})},h=()=>{l.value=!0,E({page:u.value,page_size:p.value}).then(e=>{l.value=!1,r.value=e.list,m.value=Math.ceil(e.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(e=>{l.value=!1})},R=e=>{u.value=e,h()};return j(()=>{h()}),(e,_)=>{const O=V,P=N,z=Z,A=U,k=ee,B=q,H=T,I=Q,M=X;return o(),t("div",null,[s(O,{title:"收藏"}),s(I,{class:"main-content-wrap",bordered:""},{default:f(()=>[l.value?(o(),t("div",oe,[s(P,{num:p.value},null,8,["num"])])):(o(),t("div",te,[r.value.length===0?(o(),t("div",se,[s(z,{size:"large",description:"暂无数据"})])):y("",!0),c(i).state.desktopModelShow?(o(),t("div",ne,[(o(!0),t(C,null,x(r.value,n=>(o(),F(k,{key:n.id},{default:f(()=>[s(A,{post:n,isOwner:c(i).state.userInfo.id==n.user_id,addFollowAction:!0,onSendWhisper:v,onHandleFollowAction:w},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),t("div",ae,[(o(!0),t(C,null,x(r.value,n=>(o(),F(k,{key:n.id},{default:f(()=>[s(B,{post:n,isOwner:c(i).state.userInfo.id==n.user_id,addFollowAction:!0,onSendWhisper:v,onHandleFollowAction:w},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),s(H,{show:d.value,user:g.value,onSuccess:b},null,8,["show","user"])]),_:1}),m.value>0?(o(),t("div",ie,[s(M,{page:u.value,"onUpdate:page":R,"page-slot":c(i).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):y("",!0)])}}});const Ne=L(le,[["__scopeId","data-v-c8f8eee7"]]);export{Ne as default}; diff --git a/web/dist/assets/Contacts-f763ccad.js b/web/dist/assets/Contacts-471a9006.js similarity index 75% rename from web/dist/assets/Contacts-f763ccad.js rename to web/dist/assets/Contacts-471a9006.js index 8b77cb58..2c1b13a8 100644 --- a/web/dist/assets/Contacts-f763ccad.js +++ b/web/dist/assets/Contacts-471a9006.js @@ -1 +1 @@ -import{_ as O}from"./whisper-7c8226c3.js";import{d as N,c as T,r as j,e as s,f as c,k as t,w as n,j as _,y as A,A as U,x as v,bf as g,h as I,H as a,b as W,Y as S,F as z,u as E,q as G}from"./@vue-a481fc63.js";import{I as J,_ as P,b as L}from"./index-537a241d.js";import{k as Y,r as K}from"./@vicons-4ed09704.js";import{j as x,o as Q,e as X,P as Z,O as ee,G as te,R as ne,J as oe,H as se}from"./naive-ui-defd0b2d.js";import{_ as ae}from"./post-skeleton-5d89319a.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as _e}from"./vuex-44de225f.js";import{b as ie}from"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(C,{emit:h}){const i=C,r=e=>()=>I(x,null,{default:()=>I(e)}),l=T(()=>[{label:"私信",key:"whisper",icon:r(K)}]),u=e=>{switch(e){case"whisper":const o={id:i.contact.user_id,avatar:i.contact.avatar,username:i.contact.username,nickname:i.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=Q,d=j("router-link"),w=X,k=Z,y=ee;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",le,[t(d,{onClick:o[0]||(o[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[U(v(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",pe," @"+v(e.contact.username),1),_("div",ue,[_("span",me," UID. "+v(e.contact.user_id),1),_("span",de,v(g(J)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(x),null,{default:n(()=>[t(g(Y))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=P(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},Ce=N({__name:"Contacts",setup(C){const h=_e(),i=ie(),r=a(!1),l=a([]),u=a(+i.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,$()};W(()=>{$()});const $=(p=!1)=>{l.value.length===0&&(r.value=!0),L({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const q=ce,B=ae,M=oe,R=ge,V=se,D=O,F=te,H=ne;return s(),c(z,null,[_("div",null,[t(q,{title:"好友"}),t(F,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(B,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):S("",!0),(s(!0),c(z,null,E(l.value,b=>(s(),G(V,{class:"list-item",key:b.user_id},{default:n(()=>[t(R,{contact:b,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(H,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):S("",!0)],64)}}});const Le=P(Ce,[["__scopeId","data-v-e20fef94"]]);export{Le as default}; +import{_ as O}from"./whisper-1cd3d379.js";import{d as N,c as T,r as j,e as s,f as c,k as t,w as n,j as _,y as A,A as J,x as v,bf as g,h as S,H as a,b as U,Y as z,F as I,u as W,q as E}from"./@vue-a481fc63.js";import{J as G,_ as P,b as L}from"./index-fcdbde87.js";import{k as Y,r as K}from"./@vicons-4ed09704.js";import{j as x,o as Q,e as X,P as Z,O as ee,G as te,R as ne,J as oe,H as se}from"./naive-ui-defd0b2d.js";import{_ as ae}from"./post-skeleton-0e77ba18.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{u as _e}from"./vuex-44de225f.js";import{b as ie}from"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(C,{emit:h}){const i=C,r=e=>()=>S(x,null,{default:()=>S(e)}),l=T(()=>[{label:"私信",key:"whisper",icon:r(K)}]),u=e=>{switch(e){case"whisper":const o={id:i.contact.user_id,avatar:i.contact.avatar,username:i.contact.username,nickname:i.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=Q,d=j("router-link"),w=X,k=Z,y=ee;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",le,[t(d,{onClick:o[0]||(o[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[J(v(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",pe," @"+v(e.contact.username),1),_("div",ue,[_("span",me," UID. "+v(e.contact.user_id),1),_("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(x),null,{default:n(()=>[t(g(Y))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=P(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},Ce=N({__name:"Contacts",setup(C){const h=_e(),i=ie(),r=a(!1),l=a([]),u=a(+i.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,$()};U(()=>{$()});const $=(p=!1)=>{l.value.length===0&&(r.value=!0),L({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const q=ce,B=ae,M=oe,R=ge,V=se,D=O,F=te,H=ne;return s(),c(I,null,[_("div",null,[t(q,{title:"好友"}),t(F,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(B,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):z("",!0),(s(!0),c(I,null,W(l.value,b=>(s(),E(V,{class:"list-item",key:b.user_id},{default:n(()=>[t(R,{contact:b,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(H,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):z("",!0)],64)}}});const Le=P(Ce,[["__scopeId","data-v-e20fef94"]]);export{Le as default}; diff --git a/web/dist/assets/Following-4c00cbd6.js b/web/dist/assets/Following-2b4f2830.js similarity index 77% rename from web/dist/assets/Following-4c00cbd6.js rename to web/dist/assets/Following-2b4f2830.js index 2efebda1..155f1f22 100644 --- a/web/dist/assets/Following-4c00cbd6.js +++ b/web/dist/assets/Following-2b4f2830.js @@ -1 +1 @@ -import{_ as Y}from"./whisper-7c8226c3.js";import{d as B,c as K,r as Q,e as _,f as u,k as o,w as t,j as p,y as X,A as P,x as k,q as N,Y as U,bf as g,h as S,H as r,b as Z,F as C,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{I as te,u as se,f as ae,_ as O,V as le,W as ce}from"./index-537a241d.js";import{k as ie,r as _e,G as re,x as ue}from"./@vicons-4ed09704.js";import{F as pe,j as M,o as me,M as de,e as fe,P as ge,O as we,G as ve,R as he,f as ke,g as ye,J as be,H as $e}from"./naive-ui-defd0b2d.js";import{_ as Fe}from"./post-skeleton-5d89319a.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as Te}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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:"follow-item"},qe={class:"nickname-wrap"},xe={class:"username-wrap"},Ie={class:"user-info"},Pe={class:"info-item"},Se={class:"info-item"},Ce={class:"item-header-extra"},Me=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>S(M,null,{default:()=>S(e)}),b=()=>{c.success({title:"提示",content:"确定"+(n.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.contact.is_following?se({user_id:n.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),n.contact.is_following=!1}).catch(e=>{console.log(e)}):ae({user_id:n.contact.user_id}).then(e=>{window.$message.success("关注成功"),n.contact.is_following=!0}).catch(e=>{console.log(e)})}})},w=K(()=>{let e=[{label:"私信",key:"whisper",icon:s(_e)}];return n.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:s(re)}):e.push({label:"关注",key:"follow",icon:s(ue)}),e}),m=e=>{switch(e){case"follow":case"unfollow":b();break;case"whisper":const a={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};y("send-whisper",a);break}};return(e,a)=>{const d=me,f=Q("router-link"),v=de,$=fe,F=ge,z=we;return _(),u("div",Ue,[o(z,{"content-indented":""},{avatar:t(()=>[o(d,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",qe,[o(f,{onClick:a[0]||(a[0]=X(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[P(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",xe," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(v,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[P(" 已关注 ")]),_:1})):U("",!0),p("div",Ie,[p("span",Pe," UID. "+k(e.contact.user_id),1),p("span",Se,k(g(te)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Ce,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(M),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Me,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Re={key:0,class:"empty-wrap"},Ve={key:0,class:"pagination-wrap"},De=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",w=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),v=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{v.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},R=l=>{m.value=l,T()},T=()=>{m.value==="follows"?V(w):m.value==="followings"&&D(w)},V=(l,h=!1)=>{s.value.length===0&&(c.value=!0),le({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})},D=(l,h=!1)=>{s.value.length===0&&(c.value=!0),ce({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})};return Z(()=>{T()}),(l,h)=>{const i=ze,x=ke,W=ye,H=Fe,j=be,A=Be,G=$e,E=Y,J=ve,L=he;return _(),u(C,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(J,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(W,{type:"line",animated:"","default-value":m.value,"onUpdate:value":R},{default:t(()=>[o(x,{name:"follows",tab:"正在关注"}),o(x,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(H,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Re,[o(j,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(C,null,ee(s.value,I=>(_(),N(G,{key:I.user_id},{default:t(()=>[o(A,{contact:I,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(E,{show:f.value,user:v.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",Ve,[o(L,{page:e.value,"onUpdate:page":z,"page-slot":g(y).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):U("",!0)],64)}}});const po=O(De,[["__scopeId","data-v-0a10234f"]]);export{po as default}; +import{_ as Y}from"./whisper-1cd3d379.js";import{d as B,c as K,r as Q,e as _,f as u,k as o,w as t,j as p,y as X,A as S,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as I,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{J as te,u as se,f as ae,_ as O,V as le,W as ce}from"./index-fcdbde87.js";import{k as ie,r as _e,G as re,x as ue}from"./@vicons-4ed09704.js";import{F as pe,j as M,o as me,M as de,e as fe,P as ge,O as we,G as ve,R as he,f as ke,g as ye,J as be,H as $e}from"./naive-ui-defd0b2d.js";import{_ as Fe}from"./post-skeleton-0e77ba18.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{u as Te}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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:"follow-item"},qe={class:"nickname-wrap"},xe={class:"username-wrap"},Pe={class:"user-info"},Se={class:"info-item"},Ce={class:"info-item"},Ie={class:"item-header-extra"},Me=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(M,null,{default:()=>C(e)}),b=()=>{c.success({title:"提示",content:"确定"+(n.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.contact.is_following?se({user_id:n.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),n.contact.is_following=!1}).catch(e=>{console.log(e)}):ae({user_id:n.contact.user_id}).then(e=>{window.$message.success("关注成功"),n.contact.is_following=!0}).catch(e=>{console.log(e)})}})},w=K(()=>{let e=[{label:"私信",key:"whisper",icon:s(_e)}];return n.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:s(re)}):e.push({label:"关注",key:"follow",icon:s(ue)}),e}),m=e=>{switch(e){case"follow":case"unfollow":b();break;case"whisper":const a={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};y("send-whisper",a);break}};return(e,a)=>{const d=me,f=Q("router-link"),v=de,$=fe,F=ge,z=we;return _(),u("div",Ue,[o(z,{"content-indented":""},{avatar:t(()=>[o(d,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",qe,[o(f,{onClick:a[0]||(a[0]=X(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[S(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",xe," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(v,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[S(" 已关注 ")]),_:1})):U("",!0),p("div",Pe,[p("span",Se," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(te)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Ie,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(M),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Me,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Re={key:0,class:"empty-wrap"},Ve={key:0,class:"pagination-wrap"},De=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",w=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),v=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{v.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},R=l=>{m.value=l,T()},T=()=>{m.value==="follows"?V(w):m.value==="followings"&&D(w)},V=(l,h=!1)=>{s.value.length===0&&(c.value=!0),le({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})},D=(l,h=!1)=>{s.value.length===0&&(c.value=!0),ce({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})};return Z(()=>{T()}),(l,h)=>{const i=ze,x=ke,W=ye,H=Fe,j=be,A=Be,G=$e,J=Y,E=ve,L=he;return _(),u(I,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(E,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(W,{type:"line",animated:"","default-value":m.value,"onUpdate:value":R},{default:t(()=>[o(x,{name:"follows",tab:"正在关注"}),o(x,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(H,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Re,[o(j,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(I,null,ee(s.value,P=>(_(),N(G,{key:P.user_id},{default:t(()=>[o(A,{contact:P,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(J,{show:f.value,user:v.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",Ve,[o(L,{page:e.value,"onUpdate:page":z,"page-slot":g(y).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):U("",!0)],64)}}});const po=O(De,[["__scopeId","data-v-0a10234f"]]);export{po as default}; diff --git a/web/dist/assets/Home-7cea53ff.js b/web/dist/assets/Home-7cea53ff.js deleted file mode 100644 index 0edf552d..00000000 --- a/web/dist/assets/Home-7cea53ff.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Ue}from"./whisper-7c8226c3.js";import{_ as Be,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-1243f33f.js";import{_ as Ve}from"./post-skeleton-5d89319a.js";import{d as ge,H as o,c as pe,b as fe,e as p,f as w,bf as y,j as k,k as s,w as l,q as R,Y as A,y as me,A as L,x as se,F as de,u as ve,R as xe,E as Ne}from"./@vue-a481fc63.js";import{u as he}from"./vuex-44de225f.js";import{l as _e}from"./lodash-e0b37ac3.js";import{g as Re,a as qe,c as Ge,b as Oe,d as Pe,e as Fe,u as Ye,f as Le,_ as Se}from"./index-537a241d.js";import{p as Me}from"./content-f21e8034.js";import{V as N,P as J}from"./IEnum-5453a777.js";import{I as Ke,V as We,A as je,d as Qe,E as He}from"./@vicons-4ed09704.js";import{o as we,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 ot,C as nt,a as ye,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-defd0b2d.js";import{_ as _t}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{b as gt,u as ft}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-39372edb.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=X=>{const G=new FileReader,b=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),C=()=>{const r=new Uint8Array(G.result).subarray(0,4);let U="";for(let f=0;f{G.onloadend=()=>{const f=X.type;r(f===""||f==="application/octet-stream"?C():b(f))},G.readAsArrayBuffer(X.slice(0,4))})},At={key:0,class:"compose-wrap"},kt={class:"compose-line"},bt={class:"compose-user"},Ct={class:"compose-line compose-options"},It={class:"attachment"},zt={class:"submit-wrap"},Dt={class:"attachment-list-wrap"},Tt={key:0,class:"attachment-price-wrap"},Ut=k("span",null," 附件价格¥",-1),Bt={key:0,class:"eye-wrap"},Et={key:1,class:"link-wrap"},Vt={key:1,class:"compose-wrap"},xt=k("div",{class:"login-wrap"},[k("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Nt={key:0,class:"login-only-wrap"},Rt={key:1,class:"login-wrap"},qt=ge({__name:"compose",emits:["post-success"],setup(X,{emit:G}){const b=he(),C=o([]),r=o(!1),U=o(!1),f=o(!1),q=o(!1),B=o(""),I=o([]),P=o(),D=o(0),d=o("public/image"),T=o([]),O=o([]),m=o([]),_=o([]),E=o(N.PUBLIC),z=o(N.PUBLIC),S="true".toLowerCase()==="true",F=+"400",W=o("true".toLowerCase()==="true"),ae=o("true".toLowerCase()==="true"),$=o("true".toLowerCase()==="true"),ee=o("false".toLowerCase()==="true"),oe=o("true".toLowerCase()==="true"),M="/v1/attachment",ne=pe(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),j=pe(()=>{let e=[{value:N.PUBLIC,label:"公开"},{value:N.PRIVATE,label:"私密"},{value:N.Following,label:"关注可见"}];return S&&e.push({value:N.FRIEND,label:"好友可见"}),e}),V=()=>{f.value=!f.value,f.value&&q.value&&(q.value=!1)},te=()=>{q.value=!q.value,q.value&&f.value&&(f.value=!1)},le=_e.debounce(e=>{Re({k:e}).then(t=>{let n=[];t.suggest.map(a=>{n.push({label:a,value:a})}),C.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),Q=_e.debounce(e=>{qe({k:e}).then(t=>{let n=[];t.suggest.map(a=>{n.push({label:a,value:a})}),C.value=n,r.value=!1}).catch(t=>{r.value=!1})},200),ie=(e,t)=>{r.value||(r.value=!0,t==="@"?le(e):Q(e))},i=e=>{e.length>F?B.value=e.substring(0,F):B.value=e},c=e=>{d.value=e},K=e=>{for(let u=0;u30&&(e[u].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+a)}T.value=e},Y=async e=>{var t,n,a,u,v;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((n=e.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((a=e.file.file)==null?void 0:a.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!await yt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((v=e.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},x=({file:e,event:t})=>{var n;try{let a=JSON.parse((n=t.target)==null?void 0:n.response);a.code===0&&(d.value==="public/image"&&O.value.push({id:e.id,content:a.data.content}),d.value==="public/video"&&m.value.push({id:e.id,content:a.data.content}),d.value==="attachment"&&_.value.push({id:e.id,content:a.data.content}))}catch{window.$message.error("上传失败")}},re=({file:e,event:t})=>{var n;try{let a=JSON.parse((n=t.target)==null?void 0:n.response);if(a.code!==0){let u=a.msg||"上传失败";a.details&&a.details.length>0&&a.details.map(v=>{u+=":"+v}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ue=({file:e})=>{let t=O.value.findIndex(n=>n.id===e.id);t>-1&&O.value.splice(t,1),t=m.value.findIndex(n=>n.id===e.id),t>-1&&m.value.splice(t,1),t=_.value.findIndex(n=>n.id===e.id),t>-1&&_.value.splice(t,1)},ce=()=>{if(B.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Me(B.value);const n=[];let a=100;n.push({content:B.value,type:J.TEXT,sort:a}),O.value.map(u=>{a++,n.push({content:u.content,type:J.IMAGEURL,sort:a})}),m.value.map(u=>{a++,n.push({content:u.content,type:J.VIDEOURL,sort:a})}),_.value.map(u=>{a++,n.push({content:u.content,type:J.ATTACHMENT,sort:a})}),I.value.length>0&&I.value.map(u=>{a++,n.push({content:u,type:J.LINKURL,sort:a})}),U.value=!0,Ge({contents:n,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+D.value*100,visibility:E.value}).then(u=>{var v;window.$message.success("发布成功"),U.value=!1,G("post-success",u),f.value=!1,q.value=!1,(v=P.value)==null||v.clear(),T.value=[],B.value="",I.value=[],O.value=[],m.value=[],_.value=[],E.value=z.value}).catch(u=>{U.value=!1})},H=e=>{b.commit("triggerAuth",!0),b.commit("triggerAuthKey",e)};return fe(()=>{const e="friend".toLowerCase();S&&e==="friend"?z.value=N.FRIEND:e==="following"?z.value=N.Following:e==="public"?z.value=N.PUBLIC:z.value=N.PRIVATE,E.value=z.value}),(e,t)=>{const n=we,a=Ze,u=Je,v=Xe,Z=$e,h=et,Ae=tt,ke=st,be=at,Ce=ot,Ie=nt,ze=ye,De=lt,Te=it;return p(),w("div",null,[y(b).state.userInfo.id>0?(p(),w("div",At,[k("div",kt,[k("div",bt,[s(n,{round:"",size:30,src:y(b).state.userInfo.avatar},null,8,["src"])]),s(a,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:B.value,prefix:["@","#"],options:C.value,onSearch:ie,"onUpdate:value":i,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),s(Ce,{ref_key:"uploadRef",ref:P,abstract:"","list-type":"image",multiple:!0,max:9,action:M,headers:{Authorization:ne.value},data:{type:d.value},"file-list":T.value,onBeforeUpload:Y,onFinish:x,onError:re,onRemove:ue,"onUpdate:fileList":K},{default:l(()=>[k("div",Ct,[k("div",It,[s(Z,{abstract:""},{default:l(({handleClick:g})=>[s(v,{disabled:T.value.length>0&&d.value==="public/video"||T.value.length===9,onClick:()=>{c("public/image"),g()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[s(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[s(y(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),ae.value?(p(),R(Z,{key:0,abstract:""},{default:l(({handleClick:g})=>[s(v,{disabled:T.value.length>0&&d.value!=="public/video"||T.value.length===9,onClick:()=>{c("public/video"),g()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[s(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[s(y(We))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):A("",!0),$.value?(p(),R(Z,{key:1,abstract:""},{default:l(({handleClick:g})=>[s(v,{disabled:T.value.length>0&&d.value==="public/video"||T.value.length===9,onClick:()=>{c("attachment"),g()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[s(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[s(y(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):A("",!0),s(v,{quaternary:"",circle:"",type:"primary",onClick:me(V,["stop"])},{icon:l(()=>[s(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[s(y(Qe))]),_:1})]),_:1},8,["onClick"]),oe.value?(p(),R(v,{key:2,quaternary:"",circle:"",type:"primary",onClick:me(te,["stop"])},{icon:l(()=>[s(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[s(y(He))]),_:1})]),_:1},8,["onClick"])):A("",!0)]),k("div",zt,[s(Ae,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[s(h,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:B.value.length/y(F)*100},null,8,["percentage"])]),default:l(()=>[L(" "+se(B.value.length)+" / "+se(y(F)),1)]),_:1}),s(v,{loading:U.value,onClick:ce,type:"primary",secondary:"",round:""},{default:l(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),k("div",Dt,[s(ke),_.value.length>0?(p(),w("div",Tt,[ee.value?(p(),R(be,{key:0,value:D.value,"onUpdate:value":t[0]||(t[0]=g=>D.value=g),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:l(()=>[Ut]),_:1},8,["value"])):A("",!0)])):A("",!0)])]),_:1},8,["headers","data","file-list"]),q.value?(p(),w("div",Bt,[s(De,{value:E.value,"onUpdate:value":t[1]||(t[1]=g=>E.value=g),name:"radiogroup"},{default:l(()=>[s(ze,null,{default:l(()=>[(p(!0),w(de,null,ve(j.value,g=>(p(),R(Ie,{key:g.value,value:g.value,label:g.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):A("",!0),f.value?(p(),w("div",Et,[s(Te,{value:I.value,"onUpdate:value":t[2]||(t[2]=g=>I.value=g),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":l(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):A("",!0)])):(p(),w("div",Vt,[xt,W.value?A("",!0):(p(),w("div",Nt,[s(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=g=>H("signin"))},{default:l(()=>[L(" 登录 ")]),_:1})])),W.value?(p(),w("div",Rt,[s(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=g=>H("signin"))},{default:l(()=>[L(" 登录 ")]),_:1}),s(v,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=g=>H("signup"))},{default:l(()=>[L(" 注册 ")]),_:1})])):A("",!0)]))])}}});const Gt="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=",Ot="/assets/discover-tweets-ab101944.jpeg",Pt="/assets/following-tweets-e36b4410.jpeg",Ft={class:"slide-bar-item"},Yt={class:"slide-bar-item-title slide-bar-user-link"},Lt={key:1,class:"skeleton-wrap"},St={key:0,class:"empty-wrap"},Mt={key:1},Kt={key:2},Wt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=ge({__name:"Home",setup(X){const G="true".toLowerCase()==="true",b="true".toLowerCase()==="true",C=he(),r=gt(),U=ft(),f=rt(),q=o(9),B=o(8),I=o([{title:"最新动态",style:1,username:"",avatar:Gt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Ot,show:!1},{title:"正在关注",style:3,username:"",avatar:Pt,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}]);xe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),o(null);const P=o("泡泡广场"),D=o(!1),d=o(!1),T=o(1),O=o(""),m=o([]),_=o(1),E=o(20),z=o(0),S=o(!1);o(!1);const F=o({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),W=i=>{F.value=i,S.value=!0},ae=()=>{S.value=!1},$=i=>{f.success({title:"提示",content:"确定"+(i.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.user.is_following?Ye({user_id:i.user.id}).then(c=>{window.$message.success("操作成功"),i.user.is_following=!1}).catch(c=>{}):Le({user_id:i.user.id}).then(c=>{window.$message.success("关注成功"),i.user.is_following=!0}).catch(c=>{})}})},ee=()=>{P.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?P.value="#"+decodeURIComponent(r.query.q):P.value="搜索: "+decodeURIComponent(r.query.q))},oe=pe(()=>G&&b&&C.state.desktopModelShow&&C.state.userInfo.id>0),M=()=>{D.value=!1,d.value=!1,m.value=[],_.value=1,z.value=0},ne=(i,c)=>{switch(M(),T.value=i.style,r.query.q&&(r.query.q=null,ee()),i.style){case 1:V("newest");break;case 2:V("hots");break;case 3:r.query.q=null,V("following");break;case 21:O.value=i.username,te();break}I.value[c].show=!1},j=()=>{I.value=I.value.slice(0,3),!(!G||!b||C.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(i=>{var c=0;const K=i.list||[];let Y=[];for(;c0&&(I.value=I.value.concat(Y))}).catch(i=>{console.log(i)})},V=i=>{D.value=!0,Pe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,style:i,page:_.value,page_size:E.value}).then(c=>{D.value=!1,c.list.length===0&&(d.value=!0),_.value>1?m.value=m.value.concat(c.list):(m.value=c.list,window.scrollTo(0,0)),z.value=Math.ceil(c.pager.total_rows/E.value)}).catch(c=>{D.value=!1,_.value>1&&_.value--})},te=()=>{D.value=!0,Fe({username:O.value,style:"post",page:_.value,page_size:E.value}).then(i=>{D.value=!1,i.list.length===0&&(d.value=!0),_.value>1?m.value=m.value.concat(i.list):(m.value=i.list||[],window.scrollTo(0,0)),z.value=Math.ceil(i.pager.total_rows/E.value)}).catch(i=>{m.value=[],_.value>1&&_.value--,D.value=!1})},le=i=>{U.push({name:"post",query:{id:i.id}})},Q=()=>{switch(T.value){case 1:V("newest");break;case 2:V("hots");break;case 3:V("following");break;case 21:r.query.q?V("search"):te();break}},ie=()=>{_.value{M(),j(),V("newest")}),Ne(()=>({path:r.path,query:r.query,refresh:C.state.refresh}),(i,c)=>{if(ee(),i.refresh!==c.refresh){M(),setTimeout(()=>{j(),Q()},0);return}c.path!=="/post"&&i.path==="/"&&(M(),setTimeout(()=>{j(),Q()},0))}),(i,c)=>{const K=_t,Y=qt,x=ct,re=we,ue=pt,ce=dt,H=Ve,e=vt,t=Be,n=Ee,a=Ue,u=ut,v=mt,Z=ye;return p(),w("div",null,[s(K,{title:P.value},null,8,["title"]),s(u,{class:"main-content-wrap",bordered:""},{default:l(()=>[s(x,null,{default:l(()=>[s(Y,{onPostSuccess:le})]),_:1}),oe.value?(p(),R(x,{key:0},{default:l(()=>[s(y(wt),{modelValue:I.value,"onUpdate:modelValue":c[0]||(c[0]=h=>I.value=h),"wheel-blocks":B.value,"init-blocks":q.value,onClick:ne,tag:"div","sub-tag":"div"},{default:l(h=>[k("div",Ft,[s(ue,{value:"1",offset:[-4,48],dot:"",show:h.slotData.show},{default:l(()=>[s(re,{round:"",size:48,src:h.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),k("div",Yt,[s(ce,{"line-clamp":2},{default:l(()=>[L(se(h.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):A("",!0),D.value&&m.value.length===0?(p(),w("div",Lt,[s(H,{num:E.value},null,8,["num"])])):A("",!0),k("div",null,[m.value.length===0?(p(),w("div",St,[s(e,{size:"large",description:"暂无数据"})])):A("",!0),y(C).state.desktopModelShow?(p(),w("div",Mt,[(p(!0),w(de,null,ve(m.value,h=>(p(),R(x,{key:h.id},{default:l(()=>[s(t,{post:h,isOwner:y(C).state.userInfo.Id===h.user_id,addExtraAction:!0,onSendWhisper:W,onHandleFollowAction:$},null,8,["post","isOwner"])]),_:2},1024))),128))])):(p(),w("div",Kt,[(p(!0),w(de,null,ve(m.value,h=>(p(),R(x,{key:h.id},{default:l(()=>[s(n,{post:h,isOwner:y(C).state.userInfo.Id===h.user_id,addExtraAction:!0,onSendWhisper:W,onHandleFollowAction:$},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),s(a,{show:S.value,user:F.value,onSuccess:ae},null,8,["show","user"])]),_:1}),z.value>0?(p(),R(Z,{key:0,justify:"center"},{default:l(()=>[s(y(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[1]||(c[1]=h=>ie())},{spinner:l(()=>[k("div",Wt,[d.value?A("",!0):(p(),R(v,{key:0,size:14})),k("span",jt,se(d.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):A("",!0)])}}});const xs=Se(Qt,[["__scopeId","data-v-aee71446"]]);export{xs as default}; diff --git a/web/dist/assets/Home-9031ce9a.js b/web/dist/assets/Home-9031ce9a.js new file mode 100644 index 00000000..4daf4974 --- /dev/null +++ b/web/dist/assets/Home-9031ce9a.js @@ -0,0 +1 @@ +import{W as Ue}from"./whisper-add-friend-7bcff3b6.js";import{_ as Be}from"./whisper-1cd3d379.js";import{_ as Ee,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-4e8f8831.js";import{_ as xe}from"./post-skeleton-0e77ba18.js";import{d as Ce,H as l,c as we,b as Ie,e as p,f as y,bf as A,j as b,k as a,w as i,q as x,Y as k,y as ke,A as S,x as se,F as ye,u as Ae,R as Fe,E as Ne}from"./@vue-a481fc63.js";import{u as ze}from"./vuex-44de225f.js";import{l as be}from"./lodash-e0b37ac3.js";import{g as Re,a as qe,c as Ge,b as Oe,d as Pe,e as Se,u as Ye,f as Le,h as Me,_ as We}from"./index-fcdbde87.js";import{p as Ke}from"./content-aa5ad7a4.js";import{V,P as Q}from"./IEnum-5453a777.js";import{I as je,V as Qe,A as He,d as Ze,E as Je}from"./@vicons-4ed09704.js";import{o as De,v as Xe,j as $e,e as et,w as tt,x as st,y as at,z as nt,A as ot,B as lt,C as it,a as Te,D as rt,E as ut,F as ct,G as pt,H as dt,l as vt,I as mt,J as _t,k as ft}from"./naive-ui-defd0b2d.js";import{_ as gt}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{b as ht,u as wt}from"./vue-router-e5a2430e.js";import{W as yt}from"./v3-infinite-loading-2c58ec2f.js";import{S as At}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-39372edb.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 kt=H=>{const R=new FileReader,C=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),I=()=>{const r=new Uint8Array(R.result).subarray(0,4);let T="";for(let m=0;m{R.onloadend=()=>{const m=H.type;r(m===""||m==="application/octet-stream"?I():C(m))},R.readAsArrayBuffer(H.slice(0,4))})},bt={key:0,class:"compose-wrap"},Ct={class:"compose-line"},It={class:"compose-user"},zt={class:"compose-line compose-options"},Dt={class:"attachment"},Tt={class:"submit-wrap"},Ut={class:"attachment-list-wrap"},Bt={key:0,class:"attachment-price-wrap"},Et=b("span",null," 附件价格¥",-1),Vt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Ft={key:1,class:"compose-wrap"},Nt=b("div",{class:"login-wrap"},[b("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Rt={key:0,class:"login-only-wrap"},qt={key:1,class:"login-wrap"},Gt=Ce({__name:"compose",emits:["post-success"],setup(H,{emit:R}){const C=ze(),I=l([]),r=l(!1),T=l(!1),m=l(!1),F=l(!1),U=l(""),z=l([]),q=l(),Y=l(0),d=l("public/image"),_=l([]),D=l([]),G=l([]),N=l([]),f=l(V.PUBLIC),g=l(V.PUBLIC),O="true".toLowerCase()==="true",B=+"400",L=l("true".toLowerCase()==="true"),W=l("true".toLowerCase()==="true"),Z=l("true".toLowerCase()==="true"),J=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),ne="https://okbiu.com/v1/attachment",oe=we(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),le=we(()=>{let e=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return O&&e.push({value:V.FRIEND,label:"好友可见"}),e}),X=()=>{m.value=!m.value,m.value&&F.value&&(F.value=!1)},$=()=>{F.value=!F.value,F.value&&m.value&&(m.value=!1)},ee=be.debounce(e=>{Re({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),ie=be.debounce(e=>{qe({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),M=(e,t)=>{r.value||(r.value=!0,t==="@"?ee(e):ie(e))},re=e=>{e.length>B?U.value=e.substring(0,B):U.value=e},P=e=>{d.value=e},E=e=>{for(let c=0;c30&&(e[c].name=s.substring(0,18)+"..."+s.substring(s.length-9)+"."+o)}_.value=e},te=async e=>{var t,s,o,c,v;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((s=e.file.file)==null?void 0:s.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=e.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((c=e.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!await kt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((v=e.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ue=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);o.code===0&&(d.value==="public/image"&&D.value.push({id:e.id,content:o.data.content}),d.value==="public/video"&&G.value.push({id:e.id,content:o.data.content}),d.value==="attachment"&&N.value.push({id:e.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},K=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);if(o.code!==0){let c=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(v=>{c+=":"+v}),window.$message.error(c)}}catch{window.$message.error("上传失败")}},ce=({file:e})=>{let t=D.value.findIndex(s=>s.id===e.id);t>-1&&D.value.splice(t,1),t=G.value.findIndex(s=>s.id===e.id),t>-1&&G.value.splice(t,1),t=N.value.findIndex(s=>s.id===e.id),t>-1&&N.value.splice(t,1)},n=()=>{if(U.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Ke(U.value);const s=[];let o=100;s.push({content:U.value,type:Q.TEXT,sort:o}),D.value.map(c=>{o++,s.push({content:c.content,type:Q.IMAGEURL,sort:o})}),G.value.map(c=>{o++,s.push({content:c.content,type:Q.VIDEOURL,sort:o})}),N.value.map(c=>{o++,s.push({content:c.content,type:Q.ATTACHMENT,sort:o})}),z.value.length>0&&z.value.map(c=>{o++,s.push({content:c,type:Q.LINKURL,sort:o})}),T.value=!0,Ge({contents:s,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+Y.value*100,visibility:f.value}).then(c=>{var v;window.$message.success("发布成功"),T.value=!1,R("post-success",c),m.value=!1,F.value=!1,(v=q.value)==null||v.clear(),_.value=[],U.value="",z.value=[],D.value=[],G.value=[],N.value=[],f.value=g.value}).catch(c=>{T.value=!1})},u=e=>{C.commit("triggerAuth",!0),C.commit("triggerAuthKey",e)};return Ie(()=>{const e="friend".toLowerCase();O&&e==="friend"?g.value=V.FRIEND:e==="following"?g.value=V.Following:e==="public"?g.value=V.PUBLIC:g.value=V.PRIVATE,f.value=g.value}),(e,t)=>{const s=De,o=Xe,c=$e,v=et,j=tt,pe=st,de=at,ve=nt,me=ot,_e=lt,fe=it,ge=Te,he=rt,w=ut;return p(),y("div",null,[A(C).state.userInfo.id>0?(p(),y("div",bt,[b("div",Ct,[b("div",It,[a(s,{round:"",size:30,src:A(C).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:U.value,prefix:["@","#"],options:I.value,onSearch:M,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(_e,{ref_key:"uploadRef",ref:q,abstract:"","list-type":"image",multiple:!0,max:9,action:ne,headers:{Authorization:oe.value},data:{type:d.value},"file-list":_.value,onBeforeUpload:te,onFinish:ue,onError:K,onRemove:ce,"onUpdate:fileList":E},{default:i(()=>[b("div",zt,[b("div",Dt,[a(j,{abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("public/image"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),W.value?(p(),x(j,{key:0,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value!=="public/video"||_.value.length===9,onClick:()=>{P("public/video"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),Z.value?(p(),x(j,{key:1,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("attachment"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(He))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(v,{quaternary:"",circle:"",type:"primary",onClick:ke(X,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Ze))]),_:1})]),_:1},8,["onClick"]),ae.value?(p(),x(v,{key:2,quaternary:"",circle:"",type:"primary",onClick:ke($,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Je))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),b("div",Tt,[a(de,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(pe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:U.value.length/A(B)*100},null,8,["percentage"])]),default:i(()=>[S(" "+se(U.value.length)+" / "+se(A(B)),1)]),_:1}),a(v,{loading:T.value,onClick:n,type:"primary",secondary:"",round:""},{default:i(()=>[S(" 发布 ")]),_:1},8,["loading"])])]),b("div",Ut,[a(ve),N.value.length>0?(p(),y("div",Bt,[J.value?(p(),x(me,{key:0,value:Y.value,"onUpdate:value":t[0]||(t[0]=h=>Y.value=h),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Et]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),F.value?(p(),y("div",Vt,[a(he,{value:f.value,"onUpdate:value":t[1]||(t[1]=h=>f.value=h),name:"radiogroup"},{default:i(()=>[a(ge,null,{default:i(()=>[(p(!0),y(ye,null,Ae(le.value,h=>(p(),x(fe,{key:h.value,value:h.value,label:h.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),m.value?(p(),y("div",xt,[a(w,{value:z.value,"onUpdate:value":t[2]||(t[2]=h=>z.value=h),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[S(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(p(),y("div",Ft,[Nt,L.value?k("",!0):(p(),y("div",Rt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1})])),L.value?(p(),y("div",qt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1}),a(v,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=h=>u("signup"))},{default:i(()=>[S(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Ot="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=",Pt="/assets/discover-tweets-ab101944.jpeg",St="/assets/following-tweets-e36b4410.jpeg",Yt={class:"slide-bar-item"},Lt={class:"slide-bar-item-title slide-bar-user-link"},Mt={key:1,class:"skeleton-wrap"},Wt={key:0,class:"empty-wrap"},Kt={key:1},jt={key:2},Qt={class:"load-more-wrap"},Ht={class:"load-more-spinner"},Zt=Ce({__name:"Home",setup(H){const R="true".toLowerCase()==="true",C="true".toLowerCase()==="true",I=ze(),r=ht(),T=wt(),m=ct(),F=l(9),U=l(8),z=l([{title:"最新动态",style:1,username:"",avatar:Ot,show:!0},{title:"热门推荐",style:2,username:"",avatar:Pt,show:!1},{title:"正在关注",style:3,username:"",avatar:St,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}]),q=Fe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=l(null),d=l("泡泡广场"),_=l(!1),D=l(!1),G=l(1),N=l(""),f=l([]),g=l(1),O=l(20),B=l(0),L=l(!1),W=l(!1),Z=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=n=>{Z.value=n,L.value=!0},ae=()=>{L.value=!1},ne=()=>{W.value=!0},oe=n=>{m.warning({title:"删除好友",content:"将好友 “"+n.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Me({user_id:q.id}).then(u=>{window.$message.success("操作成功"),n.user.is_friend=!1}).catch(u=>{})}})},le=()=>{W.value=!1,Y.value=null},X=n=>{Y.value=n,q.id=n.user.id,q.username=n.user.username,q.nickname=n.user.nickname,n.user.is_friend?oe(n):ne()},$=n=>{m.success({title:"提示",content:"确定"+(n.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.user.is_following?Ye({user_id:n.user.id}).then(u=>{window.$message.success("操作成功"),n.user.is_following=!1}).catch(u=>{}):Le({user_id:n.user.id}).then(u=>{window.$message.success("关注成功"),n.user.is_following=!0}).catch(u=>{})}})},ee=()=>{d.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?d.value="#"+decodeURIComponent(r.query.q):d.value="搜索: "+decodeURIComponent(r.query.q))},ie=we(()=>R&&C&&I.state.desktopModelShow&&I.state.userInfo.id>0),M=()=>{_.value=!1,D.value=!1,f.value=[],g.value=1,B.value=0},re=(n,u)=>{switch(M(),G.value=n.style,r.query.q&&(r.query.q=null,ee()),n.style){case 1:E("newest");break;case 2:E("hots");break;case 3:r.query.q=null,E("following");break;case 21:N.value=n.username,te();break}z.value[u].show=!1},P=()=>{z.value=z.value.slice(0,3),!(!R||!C||I.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(n=>{var u=0;const e=n.list||[];let t=[];for(;u0&&(z.value=z.value.concat(t))}).catch(n=>{console.log(n)})},E=n=>{_.value=!0,Pe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,style:n,page:g.value,page_size:O.value}).then(u=>{_.value=!1,u.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(u.list):(f.value=u.list,window.scrollTo(0,0)),B.value=Math.ceil(u.pager.total_rows/O.value)}).catch(u=>{_.value=!1,g.value>1&&g.value--})},te=()=>{_.value=!0,Se({username:N.value,style:"post",page:g.value,page_size:O.value}).then(n=>{_.value=!1,n.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(n.list):(f.value=n.list||[],window.scrollTo(0,0)),B.value=Math.ceil(n.pager.total_rows/O.value)}).catch(n=>{f.value=[],g.value>1&&g.value--,_.value=!1})},ue=n=>{T.push({name:"post",query:{id:n.id}})},K=()=>{switch(G.value){case 1:E("newest");break;case 2:E("hots");break;case 3:E("following");break;case 21:r.query.q?E("search"):te();break}},ce=()=>{g.value{M(),P(),E("newest")}),Ne(()=>({path:r.path,query:r.query,refresh:I.state.refresh}),(n,u)=>{if(ee(),n.refresh!==u.refresh){M(),setTimeout(()=>{P(),K()},0);return}u.path!=="/post"&&n.path==="/"&&(M(),setTimeout(()=>{P(),K()},0))}),(n,u)=>{const e=gt,t=Gt,s=dt,o=De,c=vt,v=mt,j=xe,pe=_t,de=Ee,ve=Ve,me=Be,_e=Ue,fe=pt,ge=ft,he=Te;return p(),y("div",null,[a(e,{title:d.value},null,8,["title"]),a(fe,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(s,null,{default:i(()=>[a(t,{onPostSuccess:ue})]),_:1}),ie.value?(p(),x(s,{key:0},{default:i(()=>[a(A(At),{modelValue:z.value,"onUpdate:modelValue":u[0]||(u[0]=w=>z.value=w),"wheel-blocks":U.value,"init-blocks":F.value,onClick:re,tag:"div","sub-tag":"div"},{default:i(w=>[b("div",Yt,[a(c,{value:"1",offset:[-4,48],dot:"",show:w.slotData.show},{default:i(()=>[a(o,{round:"",size:48,src:w.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),b("div",Lt,[a(v,{"line-clamp":2},{default:i(()=>[S(se(w.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),_.value&&f.value.length===0?(p(),y("div",Mt,[a(j,{num:O.value},null,8,["num"])])):k("",!0),b("div",null,[f.value.length===0?(p(),y("div",Wt,[a(pe,{size:"large",description:"暂无数据"})])):k("",!0),A(I).state.desktopModelShow?(p(),y("div",Kt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(de,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))])):(p(),y("div",jt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(ve,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),a(me,{show:L.value,user:Z.value,onSuccess:ae},null,8,["show","user"]),a(_e,{show:W.value,user:q,onSuccess:le},null,8,["show","user"])]),_:1}),B.value>0?(p(),x(he,{key:0,justify:"center"},{default:i(()=>[a(A(yt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:u[1]||(u[1]=w=>ce())},{spinner:i(()=>[b("div",Qt,[D.value?k("",!0):(p(),x(ge,{key:0,size:14})),b("span",Ht,se(D.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Rs=We(Zt,[["__scopeId","data-v-c53a3615"]]);export{Rs as default}; diff --git a/web/dist/assets/Home-1731577c.css b/web/dist/assets/Home-a97c2703.css similarity index 62% rename from web/dist/assets/Home-1731577c.css rename to web/dist/assets/Home-a97c2703.css index 862eff7d..09c5b94a 100644 --- a/web/dist/assets/Home-1731577c.css +++ b/web/dist/assets/Home-a97c2703.css @@ -1 +1 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-aee71446]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-aee71446]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-aee71446]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-aee71446]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-aee71446]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-aee71446]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-aee71446]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-aee71446]{margin:20px}.load-more .load-more-wrap[data-v-aee71446]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-aee71446]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-aee71446],.dark .pagination-wrap[data-v-aee71446],.dark .empty-wrap[data-v-aee71446],.dark .skeleton-wrap[data-v-aee71446]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-aee71446]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-aee71446]{color:#63e2b7;opacity:.8} +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-c53a3615]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-c53a3615]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-c53a3615]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-c53a3615]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-c53a3615]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-c53a3615]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-c53a3615]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-c53a3615]{margin:20px}.load-more .load-more-wrap[data-v-c53a3615]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-c53a3615]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-c53a3615],.dark .pagination-wrap[data-v-c53a3615],.dark .empty-wrap[data-v-c53a3615],.dark .skeleton-wrap[data-v-c53a3615]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-c53a3615]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-c53a3615]{color:#63e2b7;opacity:.8} diff --git a/web/dist/assets/Messages-31e222da.js b/web/dist/assets/Messages-49780aa6.js similarity index 86% rename from web/dist/assets/Messages-31e222da.js rename to web/dist/assets/Messages-49780aa6.js index e090dbd2..23ab5619 100644 --- a/web/dist/assets/Messages-31e222da.js +++ b/web/dist/assets/Messages-49780aa6.js @@ -1 +1 @@ -import{d as V,c as N,r as L,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as Y,h as T,u as E,F as G,H as v,b as K}from"./@vue-a481fc63.js";import{u as J}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{H as x,N as ee,O as se,P as ne,_ as D,Q as te}from"./index-537a241d.js";import{N as U,k as ae,O as oe,Q as re,R as Q,U as ie,r as le}from"./@vicons-4ed09704.js";import{j as d,o as ue,M as _e,l as pe,e as ce,P as de,T as me,O as ge,U as ve,G as fe,R as ye,J as ke,H as he}from"./naive-ui-defd0b2d.js";import{_ as we}from"./whisper-7c8226c3.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Oe={class:"timestamp"},Re={class:"timestamp-txt"},Ne={key:0,class:"brief-content"},qe={key:1,class:"whisper-content-wrap"},Fe={key:2,class:"requesting-friend-wrap"},Pe={key:2,class:"status-info"},Ae={key:3,class:"status-info"},We="https://assets.paopao.info/public/avatar/default/admin.png",je=V({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(q,{emit:y}){const p=q,c=X(),l=J(),k=e=>()=>T(d,null,{default:()=>T(e)}),h=N(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=N(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=N(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=N(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),F=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},P=e=>{u(e),se({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&ne({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,O=L("router-link"),b=_e,A=pe,W=ce,j=de,B=me,R=ge;return t(),r("div",{class:Y(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=H=>u(e.message))},[s(R,{"content-indented":""},{avatar:a(()=>[s($,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:We},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(O,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(O,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(U)},null,8,["component"])]),default:a(()=>[_(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(t(),I(b,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(U)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Oe,[g.value&&e.message.is_read===0?(t(),I(A,{key:0,dot:"",processing:""})):i("",!0),f("span",Re,m(o(x)(e.message.created_on)),1),s(j,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:w},{default:a(()=>[s(W,{quaternary:"",circle:""},{icon:a(()=>[s(o(d),null,{default:a(()=>[s(o(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:a(()=>[s(B,{"show-icon":!1,class:"brief-wrap",type:!g.value||e.message.is_read>0?"default":"success"},{default:a(()=>[e.message.type!=4?(t(),r("div",Ne,[_(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),r("span",{key:0,onClick:n[2]||(n[2]=C(H=>F(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(oe))]),_:1}),_(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(t(),r("div",qe,m(e.message.content),1)):i("",!0),e.message.type===5?(t(),r("div",Fe,[_(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),r("span",{key:0,onClick:n[3]||(n[3]=C(H=>z(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(re))]),_:1}),_(" 同意 ")])):i("",!0),e.message.reply_id===1?(t(),r("span",{key:1,onClick:n[4]||(n[4]=C(H=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(t(),r("span",Pe,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",Ae,[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Be=D(je,[["__scopeId","data-v-2e510758"]]),He={class:"content"},Ve=V({__name:"message-skeleton",props:{num:{default:1}},setup(q){return(y,p)=>{const c=ve;return t(!0),r(G,null,E(new Array(y.num),l=>(t(),r("div",{class:"skeleton-item",key:l},[f("div",He,[s(c,{text:"",repeat:2}),s(c,{text:"",style:{width:"60%"}})])]))),128)}}});const De=D(Ve,[["__scopeId","data-v-01d2e871"]]),Te={key:0,class:"skeleton-wrap"},Ue={key:1},Qe={key:0,class:"empty-wrap"},Ee={key:0,class:"pagination-wrap"},Ge=V({__name:"Messages",setup(q){const y=Z(),p=J(),c=v(!1),l=v(+y.query.p||1),k=v(10),h=v(0),w=v([]),g=v(!1),M=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),S=u=>{M.value=u,g.value=!0},F=()=>{g.value=!1},z=()=>{c.value=!0,te({page:l.value,page_size:k.value}).then(u=>{c.value=!1,w.value=u.list,h.value=Math.ceil(u.pager.total_rows/k.value)}).catch(u=>{c.value=!1})},P=u=>{l.value=u,z()};return K(()=>{z()}),(u,e)=>{const n=$e,$=we,O=De,b=ke,A=Be,W=he,j=fe,B=ye;return t(),r("div",null,[s(n,{title:"消息"}),s(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:a(()=>[s($,{show:g.value,user:M.value,onSuccess:F},null,8,["show","user"]),c.value?(t(),r("div",Te,[s(O,{num:k.value},null,8,["num"])])):(t(),r("div",Ue,[w.value.length===0?(t(),r("div",Qe,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(G,null,E(w.value,R=>(t(),I(W,{key:R.id},{default:a(()=>[s(A,{message:R,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Ee,[s(B,{page:l.value,"onUpdate:page":P,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const fs=D(Ge,[["__scopeId","data-v-b40dcbaf"]]);export{fs as default}; +import{d as D,c as N,r as L,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as Y,h as T,u as E,F as G,H as v,b as K}from"./@vue-a481fc63.js";import{u as J}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{I as x,N as ee,O as se,P as ne,_ as H,Q as te}from"./index-fcdbde87.js";import{N as U,k as ae,O as oe,Q as re,R as Q,U as ie,r as le}from"./@vicons-4ed09704.js";import{j as d,o as ue,M as _e,l as pe,e as ce,P as de,T as me,O as ge,U as ve,G as fe,R as ye,J as ke,H as he}from"./naive-ui-defd0b2d.js";import{_ as we}from"./whisper-1cd3d379.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Oe={class:"timestamp"},Re={class:"timestamp-txt"},Ne={key:0,class:"brief-content"},qe={key:1,class:"whisper-content-wrap"},Fe={key:2,class:"requesting-friend-wrap"},Pe={key:2,class:"status-info"},Ae={key:3,class:"status-info"},We="https://assets.paopao.info/public/avatar/default/admin.png",je=D({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(q,{emit:y}){const p=q,c=X(),l=J(),k=e=>()=>T(d,null,{default:()=>T(e)}),h=N(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=N(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=N(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=N(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),F=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},P=e=>{u(e),se({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&ne({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,O=L("router-link"),b=_e,A=pe,W=ce,j=de,B=me,R=ge;return t(),r("div",{class:Y(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(R,{"content-indented":""},{avatar:a(()=>[s($,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:We},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(O,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(O,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(U)},null,8,["component"])]),default:a(()=>[_(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(t(),I(b,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(U)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Oe,[g.value&&e.message.is_read===0?(t(),I(A,{key:0,dot:"",processing:""})):i("",!0),f("span",Re,m(o(x)(e.message.created_on)),1),s(j,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:w},{default:a(()=>[s(W,{quaternary:"",circle:""},{icon:a(()=>[s(o(d),null,{default:a(()=>[s(o(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:a(()=>[s(B,{"show-icon":!1,class:"brief-wrap",type:!g.value||e.message.is_read>0?"default":"success"},{default:a(()=>[e.message.type!=4?(t(),r("div",Ne,[_(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),r("span",{key:0,onClick:n[2]||(n[2]=C(V=>F(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(oe))]),_:1}),_(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(t(),r("div",qe,m(e.message.content),1)):i("",!0),e.message.type===5?(t(),r("div",Fe,[_(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),r("span",{key:0,onClick:n[3]||(n[3]=C(V=>z(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(re))]),_:1}),_(" 同意 ")])):i("",!0),e.message.reply_id===1?(t(),r("span",{key:1,onClick:n[4]||(n[4]=C(V=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(t(),r("span",Pe,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",Ae,[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Be=H(je,[["__scopeId","data-v-2e510758"]]),Ve={class:"content"},De=D({__name:"message-skeleton",props:{num:{default:1}},setup(q){return(y,p)=>{const c=ve;return t(!0),r(G,null,E(new Array(y.num),l=>(t(),r("div",{class:"skeleton-item",key:l},[f("div",Ve,[s(c,{text:"",repeat:2}),s(c,{text:"",style:{width:"60%"}})])]))),128)}}});const He=H(De,[["__scopeId","data-v-01d2e871"]]),Te={key:0,class:"skeleton-wrap"},Ue={key:1},Qe={key:0,class:"empty-wrap"},Ee={key:0,class:"pagination-wrap"},Ge=D({__name:"Messages",setup(q){const y=Z(),p=J(),c=v(!1),l=v(+y.query.p||1),k=v(10),h=v(0),w=v([]),g=v(!1),M=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),S=u=>{M.value=u,g.value=!0},F=()=>{g.value=!1},z=()=>{c.value=!0,te({page:l.value,page_size:k.value}).then(u=>{c.value=!1,w.value=u.list,h.value=Math.ceil(u.pager.total_rows/k.value)}).catch(u=>{c.value=!1})},P=u=>{l.value=u,z()};return K(()=>{z()}),(u,e)=>{const n=$e,$=we,O=He,b=ke,A=Be,W=he,j=fe,B=ye;return t(),r("div",null,[s(n,{title:"消息"}),s(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:a(()=>[s($,{show:g.value,user:M.value,onSuccess:F},null,8,["show","user"]),c.value?(t(),r("div",Te,[s(O,{num:k.value},null,8,["num"])])):(t(),r("div",Ue,[w.value.length===0?(t(),r("div",Qe,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(G,null,E(w.value,R=>(t(),I(W,{key:R.id},{default:a(()=>[s(A,{message:R,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Ee,[s(B,{page:l.value,"onUpdate:page":P,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const fs=H(Ge,[["__scopeId","data-v-b40dcbaf"]]);export{fs as default}; diff --git a/web/dist/assets/Post-3666e80b.js b/web/dist/assets/Post-3666e80b.js new file mode 100644 index 00000000..b2da27e3 --- /dev/null +++ b/web/dist/assets/Post-3666e80b.js @@ -0,0 +1 @@ +import{d as se,H as r,r as ye,e as o,f as _,j as p,k as t,w as n,A as U,x as z,q as T,Y as u,bf as a,y as j,c as le,al as Ye,F as de,u as me,$ as Te,a0 as Ue,b as ze,h as Ce,E as Je}from"./@vue-a481fc63.js";import{u as ie}from"./vuex-44de225f.js";import{i as ve,t as Ke,j as We,k as Ge,_ as ue,l as Qe,m as Xe,n as Ze,o as et,p as tt,g as st,q as ot,r as nt,s as at,v as lt,w as it,x as ut,y as ct,z as rt,A as _t,B as pt,C as dt,D as ge}from"./index-fcdbde87.js";import{Y as ee,V as X}from"./IEnum-5453a777.js";import{T as Re,e as he,f as Se,g as fe,h as Le,i as mt,j as vt,I as ht,k as ft,l as gt,m as yt,n as kt,o as wt,p as bt,q as $t,r as Ct,s as xt,t as It,u as Pt,v as xe,F as Ie,E as re,w as _e,x as pe,y as Pe}from"./@vicons-4ed09704.js";import{j as J,e as ce,K as Oe,I as Tt,b as Ut,L as zt,o as ke,M as Ae,O as De,v as Rt,w as St,x as Lt,y as Ot,z as At,B as Dt,P as Mt,i as Et,Q as Nt,a as Me,G as qt,J as Bt,k as Ht,H as jt,f as Ft,g as Vt}from"./naive-ui-defd0b2d.js";import{p as we,_ as Ee,a as Yt,b as Jt,c as Kt}from"./content-aa5ad7a4.js";import{u as Ne,b as Wt}from"./vue-router-e5a2430e.js";import{_ as Gt}from"./post-skeleton-0e77ba18.js";import{l as Qt}from"./lodash-e0b37ac3.js";import{_ as Xt}from"./whisper-1cd3d379.js";import{c as Zt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as es}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{W as ts}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 ss={class:"reply-item"},os={class:"header-wrap"},ns={class:"username"},as={class:"reply-name"},ls={class:"timestamp"},is={class:"base-wrap"},us={class:"content"},cs={class:"reply-switch"},rs={class:"time-item"},_s={class:"actions"},ps={class:"upvote-count"},ds=["onClick"],ms={class:"upvote-count"},vs={key:2,class:"action-item"},hs=["onClick"],fs=se({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:N}){const l=E,d=ie(),m=r(l.reply.is_thumbs_up==ee.YES),g=r(l.reply.is_thumbs_down==ee.YES),w=r(l.reply.thumbs_up_count),A=()=>{Ke({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{m.value=!m.value,m.value?(w.value++,g.value=!1):w.value--}).catch(v=>{console.log(v)})},c=()=>{We({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{g.value=!g.value,g.value&&m.value&&(w.value--,m.value=!1)}).catch(v=>{console.log(v)})},R=()=>{N("focusReply",l.reply)},O=()=>{Ge({id:l.reply.id}).then(v=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(v=>{console.log(v)})};return(v,C)=>{const D=ye("router-link"),x=J,b=ce,P=Oe,y=Tt;return o(),_("div",ss,[p("div",os,[p("div",ns,[t(D,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[U(z(l.reply.user.username),1)]),_:1},8,["to"]),p("span",as,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),T(D,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[U(z(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),p("div",ls,[U(z(l.reply.ip_loc)+" ",1),a(d).state.userInfo.is_admin||a(d).state.userInfo.id===l.reply.user.id?(o(),T(P,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(x,null,{default:n(()=>[t(a(Re))]),_:1})]),_:1})]),default:n(()=>[U(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),p("div",is,[p("div",us,[t(y,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[U(z(l.reply.content),1)]),_:1})]),p("div",cs,[p("span",rs,z(a(ve)(l.reply.created_on)),1),p("div",_s,[a(d).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:C[0]||(C[0]=j(()=>{},["stop"]))},[t(x,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),p("span",ps,z(w.value),1)])),a(d).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:j(A,["stop"])},[t(x,{size:"medium"},{default:n(()=>[m.value?u("",!0):(o(),T(a(he),{key:0})),m.value?(o(),T(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),p("span",ms,z(w.value>0?w.value:"赞"),1)],8,ds)):u("",!0),a(d).state.userLogined?u("",!0):(o(),_("div",vs,[t(x,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(d).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:j(c,["stop"])},[t(x,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),T(a(fe),{key:0})),g.value?(o(),T(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,hs)):u("",!0),a(d).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):u("",!0)])])])])}}});const gs=ue(fs,[["__scopeId","data-v-eccdbbd8"]]),ys={class:"reply-compose-wrap"},ks={class:"reply-switch"},ws={class:"time-item"},bs={class:"actions"},$s={key:0,class:"action-item"},Cs={class:"upvote-count"},xs=["onClick"],Is={class:"upvote-count"},Ps={key:2,class:"action-item"},Ts=["onClick"],Us={key:0,class:"reply-input-wrap"},zs=se({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:N,emit:l}){const d=E,m=ie(),g=r(),w=r(!1),A=r(""),c=r(!1),R=+"300",O=r(d.comment.is_thumbs_up==ee.YES),v=r(d.comment.is_thumbs_down==ee.YES),C=r(d.comment.thumbs_up_count),D=()=>{Qe({tweet_id:d.comment.post_id,comment_id:d.comment.id}).then(y=>{O.value=!O.value,O.value?(C.value++,v.value=!1):C.value--}).catch(y=>{console.log(y)})},x=()=>{Xe({tweet_id:d.comment.post_id,comment_id:d.comment.id}).then(y=>{v.value=!v.value,v.value&&O.value&&(C.value--,O.value=!1)}).catch(y=>{console.log(y)})},b=y=>{w.value=y,y?setTimeout(()=>{var S;(S=g.value)==null||S.focus()},10):(c.value=!1,A.value="",l("reset"))},P=()=>{c.value=!0,Ze({comment_id:d.comment.id,at_user_id:d.atUserid,content:A.value}).then(y=>{b(!1),window.$message.success("评论成功"),l("reload")}).catch(y=>{c.value=!1})};return N({switchReply:b}),(y,S)=>{const s=J,h=Ut,B=ce,q=zt;return o(),_("div",ys,[p("div",ks,[p("span",ws,z(a(ve)(y.comment.created_on)),1),p("div",bs,[a(m).state.userLogined?u("",!0):(o(),_("div",$s,[t(s,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),p("span",Cs,z(C.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:j(D,["stop"])},[t(s,{size:"medium"},{default:n(()=>[O.value?u("",!0):(o(),T(a(he),{key:0})),O.value?(o(),T(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),p("span",Is,z(C.value>0?C.value:"赞"),1)],8,xs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",Ps,[t(s,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:j(x,["stop"])},[t(s,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),T(a(fe),{key:0})),v.value?(o(),T(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ts)):u("",!0),a(m).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=F=>b(!0))}," 回复 ")):u("",!0),a(m).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=F=>b(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Us,[t(q,null,{default:n(()=>[t(h,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:d.atUsername?"@"+d.atUsername:"请输入回复内容..",maxlength:a(R),value:A.value,"onUpdate:value":S[2]||(S[2]=F=>A.value=F),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:c.value,onClick:P},{default:n(()=>[U(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Rs=ue(zs,[["__scopeId","data-v-f9af7a93"]]),Ss={class:"comment-item"},Ls={class:"nickname-wrap"},Os={class:"username-wrap"},As={class:"opt-wrap"},Ds={class:"timestamp"},Ms=["innerHTML"],Es={class:"reply-wrap"},Ns=se({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:N}){const l=E,d=ie(),m=Ne(),g=r(0),w=r(""),A=r(),c=le(()=>{let b=Object.assign({texts:[],imgs:[]},l.comment);return b.contents.map(P=>{(+P.type==1||+P.type==2)&&b.texts.push(P),+P.type==3&&b.imgs.push(P)}),b}),R=(b,P)=>{let y=b.target;if(y.dataset.detail){const S=y.dataset.detail.split(":");S.length===2&&(d.commit("refresh"),S[0]==="tag"?window.$message.warning("评论内的无效话题"):m.push({name:"user",query:{s:S[1]}}))}},O=b=>{var P,y;g.value=b.user_id,w.value=((P=b.user)==null?void 0:P.username)||"",(y=A.value)==null||y.switchReply(!0)},v=()=>{N("reload")},C=()=>{g.value=0,w.value=""},D=()=>{et({id:c.value.id}).then(b=>{window.$message.success("删除成功"),setTimeout(()=>{v()},50)}).catch(b=>{})},x=()=>{tt({id:c.value.id}).then(b=>{c.value.is_essence=b.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{v()},50)}).catch(b=>{})};return(b,P)=>{const y=ke,S=ye("router-link"),s=Ae,h=J,B=ce,q=Oe,F=Ee,V=Rs,K=gs,L=De;return o(),_("div",Ss,[t(L,{"content-indented":""},Ye({avatar:n(()=>[t(y,{round:"",size:30,src:c.value.user.avatar},null,8,["src"])]),header:n(()=>[p("span",Ls,[t(S,{onClick:P[0]||(P[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:c.value.user.username}}},{default:n(()=>[U(z(c.value.user.nickname),1)]),_:1},8,["to"])]),p("span",Os," @"+z(c.value.user.username),1),c.value.is_essence==a(ee).YES?(o(),T(s,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[U(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[p("div",As,[p("span",Ds,z(c.value.ip_loc),1),a(d).state.userInfo.id===b.postUserId?(o(),T(q,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:x},{trigger:n(()=>[t(B,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[c.value.is_essence==a(ee).NO?(o(),T(h,{key:0},{default:n(()=>[t(a(mt))]),_:1})):(o(),T(h,{key:1},{default:n(()=>[t(a(vt))]),_:1}))]),_:1})]),default:n(()=>[U(" "+z(c.value.is_essence==a(ee).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(d).state.userInfo.is_admin||a(d).state.userInfo.id===c.value.user.id?(o(),T(q,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:D},{trigger:n(()=>[t(B,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(h,null,{default:n(()=>[t(a(Re))]),_:1})]),_:1})]),default:n(()=>[U(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[c.value.imgs.length>0?(o(),T(F,{key:0,imgs:c.value.imgs},null,8,["imgs"])):u("",!0),t(V,{ref_key:"replyComposeRef",ref:A,comment:c.value,"at-userid":g.value,"at-username":w.value,onReload:v,onReset:C},null,8,["comment","at-userid","at-username"]),p("div",Es,[(o(!0),_(de,null,me(c.value.replies,I=>(o(),T(K,{key:I.id,reply:I,"tweet-id":c.value.post_id,onFocusReply:O,onReload:v},null,8,["reply","tweet-id"]))),128))])]),_:2},[c.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(de,null,me(c.value.texts,I=>(o(),_("span",{key:I.id,class:"comment-text",onClick:P[1]||(P[1]=j(W=>R(W,c.value.id),["stop"])),innerHTML:a(we)(I.content).content},null,8,Ms))),128))]),key:"0"}:void 0]),1024)])}}});const qs=ue(Ns,[["__scopeId","data-v-e1f04c6b"]]),Bs=E=>(Te("data-v-d9073453"),E=E(),Ue(),E),Hs={key:0,class:"compose-wrap"},js={class:"compose-line"},Fs={class:"compose-user"},Vs={class:"compose-line compose-options"},Ys={class:"attachment"},Js={class:"submit-wrap"},Ks={class:"attachment-list-wrap"},Ws={key:1,class:"compose-wrap"},Gs=Bs(()=>p("div",{class:"login-wrap"},[p("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Qs={key:0,class:"login-only-wrap"},Xs={key:1,class:"login-wrap"},Zs=se({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:N}){const l=E,d=ie(),m=r([]),g=r(!1),w=r(!1),A=r(!1),c=r(""),R=r(),O=r("public/image"),v=r([]),C=r([]),D=r("true".toLowerCase()==="true"),x=+"300",b="https://okbiu.com/v1/attachment",P=le(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),y=Qt.debounce(f=>{st({k:f}).then(k=>{let $=[];k.suggest.map(e=>{$.push({label:e,value:e})}),m.value=$,w.value=!1}).catch(k=>{w.value=!1})},200),S=(f,k)=>{w.value||(w.value=!0,k==="@"&&y(f))},s=f=>{f.length>x?c.value=f.substring(0,x):c.value=f},h=f=>{O.value=f},B=f=>{for(let i=0;i30&&(f[i].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+e)}v.value=f},q=async f=>{var k,$;return O.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):O.value==="image"&&(($=f.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},F=({file:f,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);e.code===0&&O.value==="public/image"&&C.value.push({id:f.id,content:e.data.content})}catch{window.$message.error("上传失败")}},V=({file:f,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);if(e.code!==0){let i=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(M=>{i+=":"+M}),window.$message.error(i)}}catch{window.$message.error("上传失败")}},K=({file:f})=>{let k=C.value.findIndex($=>$.id===f.id);k>-1&&C.value.splice(k,1)},L=()=>{g.value=!0},I=()=>{var f;g.value=!1,(f=R.value)==null||f.clear(),v.value=[],c.value="",C.value=[]},W=()=>{if(c.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=we(c.value);const k=[];let $=100;k.push({content:c.value,type:2,sort:$}),C.value.map(e=>{$++,k.push({content:e.content,type:3,sort:$})}),A.value=!0,ot({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(e=>{window.$message.success("发布成功"),A.value=!1,N("post-success"),I()}).catch(e=>{A.value=!1})},G=f=>{d.commit("triggerAuth",!0),d.commit("triggerAuthKey",f)};return(f,k)=>{const $=ke,e=Rt,i=J,M=ce,oe=St,Q=Lt,ne=Ot,ae=At,Y=Dt;return o(),_("div",null,[a(d).state.userInfo.id>0?(o(),_("div",Hs,[p("div",js,[p("div",Fs,[t($,{round:"",size:30,src:a(d).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:m.value,prefix:["@"],loading:w.value,value:c.value,disabled:l.lock===1,"onUpdate:value":s,onSearch:S,onFocus:L,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),T(Y,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:b,headers:{Authorization:P.value},data:{type:O.value},"file-list":v.value,onBeforeUpload:q,onFinish:F,onError:V,onRemove:K,"onUpdate:fileList":B},{default:n(()=>[p("div",Vs,[p("div",Ys,[t(oe,{abstract:""},{default:n(({handleClick:te})=>[t(M,{disabled:v.value.length>0&&O.value==="public/video"||v.value.length===9,onClick:()=>{h("public/image"),te()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(i,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(ht))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(Q,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:c.value.length/a(x)*100},null,8,["percentage"])]),default:n(()=>[U(" "+z(c.value.length)+" / "+z(a(x)),1)]),_:1})]),p("div",Js,[t(M,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:I},{default:n(()=>[U(" 取消 ")]),_:1}),t(M,{loading:A.value,onClick:W,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[U(" 发布 ")]),_:1},8,["loading"])])]),p("div",Ks,[t(ae)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ws,[Gs,D.value?u("",!0):(o(),_("div",Qs,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=te=>G("signin"))},{default:n(()=>[U(" 登录 ")]),_:1})])),D.value?(o(),_("div",Xs,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=te=>G("signin"))},{default:n(()=>[U(" 登录 ")]),_:1}),t(M,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=te=>G("signup"))},{default:n(()=>[U(" 注册 ")]),_:1})])):u("",!0)]))])}}});const eo=ue(Zs,[["__scopeId","data-v-d9073453"]]),to={class:"username-wrap"},so={class:"options"},oo={key:0},no=["innerHTML"],ao={class:"timestamp"},lo={key:0},io={key:1},uo={class:"opts-wrap"},co=["onClick"],ro={class:"opt-item"},_o=["onClick"],po=["onClick"],mo=se({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:N}){const l=E,d="true".toLowerCase()==="true",m=ie(),g=Ne(),w=r(!1),A=r(!1),c=r(!1),R=r(!1),O=r(!1),v=r(!1),C=r(!1),D=r(!1),x=r(X.PUBLIC),b=r(!1),P=r({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=>{P.value=e,b.value=!0},S=()=>{b.value=!1},s=le({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(i=>{(+i.type==1||+i.type==2)&&e.texts.push(i),+i.type==3&&e.imgs.push(i),+i.type==4&&e.videos.push(i),+i.type==6&&e.links.push(i),+i.type==7&&e.attachments.push(i),+i.type==8&&e.charge_attachments.push(i)}),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=>()=>Ce(J,null,{default:()=>Ce(e)}),B=le(()=>{var M;let e=[];if(!m.state.userInfo.is_admin&&m.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Ct)}),e;e.push({label:"删除",key:"delete",icon:h(xt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(It)}):e.push({label:"解锁",key:"unlock",icon:h(Pt)}),m.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(xe)}):e.push({label:"取消置顶",key:"unstick",icon:h(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Ie)});let i;return s.value.visibility===X.PUBLIC?i={label:"公开",key:"vpublic",icon:h(re),children:[{label:"私密",key:"vprivate",icon:h(_e)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:s.value.visibility===X.PRIVATE?i={label:"私密",key:"vprivate",icon:h(_e),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:d&&s.value.visibility===X.FRIEND?i={label:"好友可见",key:"vfriend",icon:h(Pe),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"私密",key:"vprivate",icon:h(_e)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:i={label:"关注可见",key:"vfollowing",icon:h(pe),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"私密",key:"vprivate",icon:h(_e)}]},d&&s.value.visibility!==X.FRIEND&&((M=i.children)==null||M.push({label:"好友可见",key:"vfriend",icon:h(Pe)})),e.push(i),e}),q=e=>{g.push({name:"post",query:{id:e}})},F=(e,i)=>{if(e.target.dataset.detail){const M=e.target.dataset.detail.split(":");if(M.length===2){m.commit("refresh"),M[0]==="tag"?g.push({name:"home",query:{q:M[1],t:"tag"}}):g.push({name:"user",query:{s:M[1]}});return}}q(i)},V=e=>{switch(e){case"whisper":y(l.post.user);break;case"delete":c.value=!0;break;case"lock":case"unlock":R.value=!0;break;case"stick":case"unstick":O.value=!0;break;case"highlight":case"unhighlight":v.value=!0;break;case"vpublic":x.value=0,C.value=!0;break;case"vprivate":x.value=1,C.value=!0;break;case"vfriend":x.value=2,C.value=!0;break;case"vfollowing":x.value=3,C.value=!0;break}},K=()=>{lt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{m.commit("refresh")},50)}).catch(e=>{D.value=!1})},L=()=>{it({id:s.value.id}).then(e=>{N("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{D.value=!1})},I=()=>{ut({id:s.value.id}).then(e=>{N("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{D.value=!1})},W=()=>{ct({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=>{D.value=!1})},G=()=>{rt({id:s.value.id,visibility:x.value}).then(e=>{N("reload"),window.$message.success("修改可见性成功")}).catch(e=>{D.value=!1})},f=()=>{_t({id:s.value.id}).then(e=>{w.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)})},k=()=>{pt({id:s.value.id}).then(e=>{A.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)})},$=()=>{Zt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return ze(()=>{m.state.userInfo.id>0&&(nt({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),at({id:s.value.id}).then(e=>{A.value=e.status}).catch(e=>{console.log(e)}))}),(e,i)=>{const M=ke,oe=ye("router-link"),Q=Ae,ne=ce,ae=Mt,Y=Et,te=Xt,be=Yt,qe=Ee,Be=Jt,He=Kt,$e=Nt,je=Me,Fe=De;return o(),_("div",{class:"detail-item",onClick:i[7]||(i[7]=H=>q(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(M,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(oe,{onClick:i[0]||(i[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[U(z(s.value.user.nickname),1)]),_:1},8,["to"]),p("span",to," @"+z(s.value.user.username),1),s.value.is_top?(o(),T(Q,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[U(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(X).PRIVATE?(o(),T(Q,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[U(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(X).FRIEND?(o(),T(Q,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[U(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[p("div",so,[t(ae,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:V},{default:n(()=>[t(ne,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(ft))]),_:1})]),_:1})]),_:1},8,["options"])]),t(Y,{show:c.value,"onUpdate:show":i[1]||(i[1]=H=>c.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show"]),t(Y,{show:R.value,"onUpdate:show":i[2]||(i[2]=H=>R.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(Y,{show:O.value,"onUpdate:show":i[3]||(i[3]=H=>O.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(Y,{show:v.value,"onUpdate:show":i[4]||(i[4]=H=>v.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:W},null,8,["show","content"]),t(Y,{show:C.value,"onUpdate:show":i[5]||(i[5]=H=>C.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(x.value==0?"公开":x.value==1?"私密":x.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:G},null,8,["show","content"]),t(te,{show:b.value,user:P.value,onSuccess:S},null,8,["show","user"])]),footer:n(()=>[t(be,{attachments:s.value.attachments},null,8,["attachments"]),t(be,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(qe,{imgs:s.value.imgs},null,8,["imgs"]),t(Be,{videos:s.value.videos,full:!0},null,8,["videos"]),t(He,{links:s.value.links},null,8,["links"]),p("div",ao,[U(" 发布于 "+z(a(ve)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",lo,[t($e,{vertical:""}),U(" "+z(s.value.ip_loc),1)])):u("",!0),!a(m).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",io,[t($e,{vertical:""}),U(" 最后回复 "+z(a(ve)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[p("div",uo,[t(je,{justify:"space-between"},{default:n(()=>[p("div",{class:"opt-item hover",onClick:j(f,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),T(a(gt),{key:0})),w.value?(o(),T(a(yt),{key:1,color:"red"})):u("",!0)]),_:1}),U(" "+z(s.value.upvote_count),1)],8,co),p("div",ro,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(kt))]),_:1}),U(" "+z(s.value.comment_count),1)]),p("div",{class:"opt-item hover",onClick:j(k,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[A.value?u("",!0):(o(),T(a(wt),{key:0})),A.value?(o(),T(a(bt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),U(" "+z(s.value.collection_count),1)],8,_o),p("div",{class:"opt-item hover",onClick:j($,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a($t))]),_:1}),U(" "+z(s.value.share_count),1)],8,po)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",oo,[(o(!0),_(de,null,me(s.value.texts,H=>(o(),_("span",{key:H.id,class:"post-text",onClick:i[6]||(i[6]=j(Ve=>F(Ve,s.value.id),["stop"])),innerHTML:a(we)(H.content).content},null,8,no))),128))])):u("",!0)]),_:1})])}}});const vo=E=>(Te("data-v-c5bf4463"),E=E(),Ue(),E),ho={key:0,class:"detail-wrap"},fo={key:1,class:"empty-wrap"},go={key:0,class:"comment-opts-wrap"},yo=vo(()=>p("span",{class:"comment-title-item"},"评论",-1)),ko={key:2},wo={key:0,class:"skeleton-wrap"},bo={key:1},$o={key:0,class:"empty-wrap"},Co={key:0,class:"load-more-spinner"},xo={key:1,class:"load-more-spinner"},Io={key:2,class:"load-more-spinner"},Po={key:3,class:"load-more-spinner"},To={key:4,class:"load-more-spinner"},Uo={key:5,class:"load-more-spinner"},Z=20,zo=se({__name:"Post",setup(E){const N=Wt(),l=r({}),d=r(!1),m=r(!1),g=r([]),w=le(()=>+N.query.id),A=r("default"),c=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const O=L=>{A.value=L,L==="default"&&(c.value=!0),V(R)},v=()=>{l.value={id:0},d.value=!0,dt({id:w.value}).then(L=>{d.value=!1,l.value=L,V(R)}).catch(L=>{d.value=!1})};let C=1;const D=r(!1),x=r([]),b=L=>{D.value||ge({id:l.value.id,style:"default",page:C,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(C===1?x.value=I.list:x.value.push(...I.list),g.value=x.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})};let P=1,y=r(!1);const S=r([]),s=L=>{y.value||ge({id:l.value.id,style:"hots",page:P,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(P===1?S.value=I.list:S.value.push(...I.list),g.value=S.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})};let h=1,B=r(!1);const q=r([]),F=L=>{B.value||ge({id:l.value.id,style:"newest",page:h,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(h===1?q.value=I.list:q.value.push(...I.list),g.value=q.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})},V=L=>{w.value<1||(g.value.length===0&&(m.value=!0),A.value==="default"?(g.value=x.value,b(L)):A.value==="hots"?(g.value=S.value,s(L)):(g.value=q.value,F(L)),m.value=!1)},K=()=>{C=1,D.value=!1,x.value=[],P=1,y.value=!1,S.value=[],h=1,B.value=!1,q.value=[],V(R)};return ze(()=>{v()}),Je(w,()=>{w.value>0&&N.name==="post"&&v()}),(L,I)=>{const W=es,G=mo,f=Bt,k=Ht,$=jt,e=Ft,i=Vt,M=eo,oe=Gt,Q=qs,ne=Me,ae=qt;return o(),_("div",null,[t(W,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t($,null,{default:n(()=>[t(k,{show:d.value},{default:n(()=>[l.value.id>1?(o(),_("div",ho,[t(G,{post:l.value,onReload:v},null,8,["post"])])):(o(),_("div",fo,[t(f,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",go,[t(i,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":O},{prefix:n(()=>[yo]),default:n(()=>[t(e,{name:"default",tab:"推荐"}),t(e,{name:"hots",tab:"热门"}),t(e,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),T($,{key:1},{default:n(()=>[t(M,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:K},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",ko,[m.value?(o(),_("div",wo,[t(oe,{num:5})])):(o(),_("div",bo,[g.value.length===0?(o(),_("div",$o,[t(f,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(de,null,me(g.value,Y=>(o(),T($,{key:Y.id},{default:n(()=>[t(Q,{comment:Y,postUserId:l.value.user_id,onReload:K},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=Z?(o(),T(ne,{key:3,justify:"center"},{default:n(()=>[t(a(ts),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:V},{spinner:n(()=>[c.value&&D.value?(o(),_("span",Co)):u("",!0),!c.value&&a(y)?(o(),_("span",xo)):u("",!0),!c.value&&a(B)?(o(),_("span",Io)):u("",!0),c.value&&!D.value?(o(),_("span",Po,"加载评论")):u("",!0),!c.value&&!a(y)?(o(),_("span",To,"加载评论")):u("",!0),!c.value&&!a(B)?(o(),_("span",Uo,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const _n=ue(zo,[["__scopeId","data-v-c5bf4463"]]);export{_n as default}; diff --git a/web/dist/assets/Post-e7289232.js b/web/dist/assets/Post-e7289232.js deleted file mode 100644 index 38bf5927..00000000 --- a/web/dist/assets/Post-e7289232.js +++ /dev/null @@ -1 +0,0 @@ -import{d as se,H as r,r as ye,e as o,f as _,j as p,k as t,w as n,A as U,x as z,q as T,Y as u,bf as a,y as j,c as le,al as Ye,F as de,u as me,$ as Te,a0 as Ue,b as ze,h as Ce,E as Je}from"./@vue-a481fc63.js";import{u as ie}from"./vuex-44de225f.js";import{h as ve,t as Ke,i as We,j as Ge,_ as ue,k as Qe,l as Xe,m as Ze,n as et,o as tt,g as st,p as ot,q as nt,r as at,s as lt,v as it,w as ut,x as ct,y as rt,z as _t,A as pt,B as dt,C as ge}from"./index-537a241d.js";import{Y as ee,V as X}from"./IEnum-5453a777.js";import{T as Re,e as he,f as Se,g as fe,h as Le,i as mt,j as vt,I as ht,k as ft,l as gt,m as yt,n as kt,o as wt,p as bt,q as $t,r as Ct,s as xt,t as It,u as Pt,v as xe,F as Ie,E as re,w as _e,x as pe,y as Pe}from"./@vicons-4ed09704.js";import{j as J,e as ce,K as Oe,I as Tt,b as Ut,L as zt,o as ke,M as Ae,O as De,v as Rt,w as St,x as Lt,y as Ot,z as At,B as Dt,P as Mt,i as Et,Q as Nt,a as Me,G as qt,J as Bt,k as Ht,H as jt,f as Ft,g as Vt}from"./naive-ui-defd0b2d.js";import{p as we,_ as Ee,a as Yt,b as Jt,c as Kt}from"./content-f21e8034.js";import{u as Ne,b as Wt}from"./vue-router-e5a2430e.js";import{_ as Gt}from"./post-skeleton-5d89319a.js";import{l as Qt}from"./lodash-e0b37ac3.js";import{_ as Xt}from"./whisper-7c8226c3.js";import{c as Zt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as es}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{W as ts}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 ss={class:"reply-item"},os={class:"header-wrap"},ns={class:"username"},as={class:"reply-name"},ls={class:"timestamp"},is={class:"base-wrap"},us={class:"content"},cs={class:"reply-switch"},rs={class:"time-item"},_s={class:"actions"},ps={class:"upvote-count"},ds=["onClick"],ms={class:"upvote-count"},vs={key:2,class:"action-item"},hs=["onClick"],fs=se({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:N}){const l=E,d=ie(),m=r(l.reply.is_thumbs_up==ee.YES),g=r(l.reply.is_thumbs_down==ee.YES),w=r(l.reply.thumbs_up_count),A=()=>{Ke({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{m.value=!m.value,m.value?(w.value++,g.value=!1):w.value--}).catch(v=>{console.log(v)})},c=()=>{We({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{g.value=!g.value,g.value&&m.value&&(w.value--,m.value=!1)}).catch(v=>{console.log(v)})},R=()=>{N("focusReply",l.reply)},O=()=>{Ge({id:l.reply.id}).then(v=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(v=>{console.log(v)})};return(v,C)=>{const D=ye("router-link"),x=J,b=ce,P=Oe,y=Tt;return o(),_("div",ss,[p("div",os,[p("div",ns,[t(D,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[U(z(l.reply.user.username),1)]),_:1},8,["to"]),p("span",as,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),T(D,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[U(z(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),p("div",ls,[U(z(l.reply.ip_loc)+" ",1),a(d).state.userInfo.is_admin||a(d).state.userInfo.id===l.reply.user.id?(o(),T(P,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(x,null,{default:n(()=>[t(a(Re))]),_:1})]),_:1})]),default:n(()=>[U(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),p("div",is,[p("div",us,[t(y,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[U(z(l.reply.content),1)]),_:1})]),p("div",cs,[p("span",rs,z(a(ve)(l.reply.created_on)),1),p("div",_s,[a(d).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:C[0]||(C[0]=j(()=>{},["stop"]))},[t(x,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),p("span",ps,z(w.value),1)])),a(d).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:j(A,["stop"])},[t(x,{size:"medium"},{default:n(()=>[m.value?u("",!0):(o(),T(a(he),{key:0})),m.value?(o(),T(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),p("span",ms,z(w.value>0?w.value:"赞"),1)],8,ds)):u("",!0),a(d).state.userLogined?u("",!0):(o(),_("div",vs,[t(x,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(d).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:j(c,["stop"])},[t(x,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),T(a(fe),{key:0})),g.value?(o(),T(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,hs)):u("",!0),a(d).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):u("",!0)])])])])}}});const gs=ue(fs,[["__scopeId","data-v-eccdbbd8"]]),ys={class:"reply-compose-wrap"},ks={class:"reply-switch"},ws={class:"time-item"},bs={class:"actions"},$s={key:0,class:"action-item"},Cs={class:"upvote-count"},xs=["onClick"],Is={class:"upvote-count"},Ps={key:2,class:"action-item"},Ts=["onClick"],Us={key:0,class:"reply-input-wrap"},zs=se({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:N,emit:l}){const d=E,m=ie(),g=r(),w=r(!1),A=r(""),c=r(!1),R=+"300",O=r(d.comment.is_thumbs_up==ee.YES),v=r(d.comment.is_thumbs_down==ee.YES),C=r(d.comment.thumbs_up_count),D=()=>{Qe({tweet_id:d.comment.post_id,comment_id:d.comment.id}).then(y=>{O.value=!O.value,O.value?(C.value++,v.value=!1):C.value--}).catch(y=>{console.log(y)})},x=()=>{Xe({tweet_id:d.comment.post_id,comment_id:d.comment.id}).then(y=>{v.value=!v.value,v.value&&O.value&&(C.value--,O.value=!1)}).catch(y=>{console.log(y)})},b=y=>{w.value=y,y?setTimeout(()=>{var S;(S=g.value)==null||S.focus()},10):(c.value=!1,A.value="",l("reset"))},P=()=>{c.value=!0,Ze({comment_id:d.comment.id,at_user_id:d.atUserid,content:A.value}).then(y=>{b(!1),window.$message.success("评论成功"),l("reload")}).catch(y=>{c.value=!1})};return N({switchReply:b}),(y,S)=>{const s=J,h=Ut,B=ce,q=zt;return o(),_("div",ys,[p("div",ks,[p("span",ws,z(a(ve)(y.comment.created_on)),1),p("div",bs,[a(m).state.userLogined?u("",!0):(o(),_("div",$s,[t(s,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),p("span",Cs,z(C.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:j(D,["stop"])},[t(s,{size:"medium"},{default:n(()=>[O.value?u("",!0):(o(),T(a(he),{key:0})),O.value?(o(),T(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),p("span",Is,z(C.value>0?C.value:"赞"),1)],8,xs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",Ps,[t(s,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:j(x,["stop"])},[t(s,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),T(a(fe),{key:0})),v.value?(o(),T(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ts)):u("",!0),a(m).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=F=>b(!0))}," 回复 ")):u("",!0),a(m).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=F=>b(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Us,[t(q,null,{default:n(()=>[t(h,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:d.atUsername?"@"+d.atUsername:"请输入回复内容..",maxlength:a(R),value:A.value,"onUpdate:value":S[2]||(S[2]=F=>A.value=F),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:c.value,onClick:P},{default:n(()=>[U(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Rs=ue(zs,[["__scopeId","data-v-f9af7a93"]]),Ss={class:"comment-item"},Ls={class:"nickname-wrap"},Os={class:"username-wrap"},As={class:"opt-wrap"},Ds={class:"timestamp"},Ms=["innerHTML"],Es={class:"reply-wrap"},Ns=se({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:N}){const l=E,d=ie(),m=Ne(),g=r(0),w=r(""),A=r(),c=le(()=>{let b=Object.assign({texts:[],imgs:[]},l.comment);return b.contents.map(P=>{(+P.type==1||+P.type==2)&&b.texts.push(P),+P.type==3&&b.imgs.push(P)}),b}),R=(b,P)=>{let y=b.target;if(y.dataset.detail){const S=y.dataset.detail.split(":");S.length===2&&(d.commit("refresh"),S[0]==="tag"?window.$message.warning("评论内的无效话题"):m.push({name:"user",query:{s:S[1]}}))}},O=b=>{var P,y;g.value=b.user_id,w.value=((P=b.user)==null?void 0:P.username)||"",(y=A.value)==null||y.switchReply(!0)},v=()=>{N("reload")},C=()=>{g.value=0,w.value=""},D=()=>{et({id:c.value.id}).then(b=>{window.$message.success("删除成功"),setTimeout(()=>{v()},50)}).catch(b=>{})},x=()=>{tt({id:c.value.id}).then(b=>{c.value.is_essence=b.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{v()},50)}).catch(b=>{})};return(b,P)=>{const y=ke,S=ye("router-link"),s=Ae,h=J,B=ce,q=Oe,F=Ee,V=Rs,K=gs,L=De;return o(),_("div",Ss,[t(L,{"content-indented":""},Ye({avatar:n(()=>[t(y,{round:"",size:30,src:c.value.user.avatar},null,8,["src"])]),header:n(()=>[p("span",Ls,[t(S,{onClick:P[0]||(P[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:c.value.user.username}}},{default:n(()=>[U(z(c.value.user.nickname),1)]),_:1},8,["to"])]),p("span",Os," @"+z(c.value.user.username),1),c.value.is_essence==a(ee).YES?(o(),T(s,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[U(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[p("div",As,[p("span",Ds,z(c.value.ip_loc),1),a(d).state.userInfo.id===b.postUserId?(o(),T(q,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:x},{trigger:n(()=>[t(B,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[c.value.is_essence==a(ee).NO?(o(),T(h,{key:0},{default:n(()=>[t(a(mt))]),_:1})):(o(),T(h,{key:1},{default:n(()=>[t(a(vt))]),_:1}))]),_:1})]),default:n(()=>[U(" "+z(c.value.is_essence==a(ee).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(d).state.userInfo.is_admin||a(d).state.userInfo.id===c.value.user.id?(o(),T(q,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:D},{trigger:n(()=>[t(B,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(h,null,{default:n(()=>[t(a(Re))]),_:1})]),_:1})]),default:n(()=>[U(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[c.value.imgs.length>0?(o(),T(F,{key:0,imgs:c.value.imgs},null,8,["imgs"])):u("",!0),t(V,{ref_key:"replyComposeRef",ref:A,comment:c.value,"at-userid":g.value,"at-username":w.value,onReload:v,onReset:C},null,8,["comment","at-userid","at-username"]),p("div",Es,[(o(!0),_(de,null,me(c.value.replies,I=>(o(),T(K,{key:I.id,reply:I,"tweet-id":c.value.post_id,onFocusReply:O,onReload:v},null,8,["reply","tweet-id"]))),128))])]),_:2},[c.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(de,null,me(c.value.texts,I=>(o(),_("span",{key:I.id,class:"comment-text",onClick:P[1]||(P[1]=j(W=>R(W,c.value.id),["stop"])),innerHTML:a(we)(I.content).content},null,8,Ms))),128))]),key:"0"}:void 0]),1024)])}}});const qs=ue(Ns,[["__scopeId","data-v-e1f04c6b"]]),Bs=E=>(Te("data-v-d9073453"),E=E(),Ue(),E),Hs={key:0,class:"compose-wrap"},js={class:"compose-line"},Fs={class:"compose-user"},Vs={class:"compose-line compose-options"},Ys={class:"attachment"},Js={class:"submit-wrap"},Ks={class:"attachment-list-wrap"},Ws={key:1,class:"compose-wrap"},Gs=Bs(()=>p("div",{class:"login-wrap"},[p("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Qs={key:0,class:"login-only-wrap"},Xs={key:1,class:"login-wrap"},Zs=se({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:N}){const l=E,d=ie(),m=r([]),g=r(!1),w=r(!1),A=r(!1),c=r(""),R=r(),O=r("public/image"),v=r([]),C=r([]),D=r("true".toLowerCase()==="true"),x=+"300",b="/v1/attachment",P=le(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),y=Qt.debounce(f=>{st({k:f}).then(k=>{let $=[];k.suggest.map(e=>{$.push({label:e,value:e})}),m.value=$,w.value=!1}).catch(k=>{w.value=!1})},200),S=(f,k)=>{w.value||(w.value=!0,k==="@"&&y(f))},s=f=>{f.length>x?c.value=f.substring(0,x):c.value=f},h=f=>{O.value=f},B=f=>{for(let i=0;i30&&(f[i].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+e)}v.value=f},q=async f=>{var k,$;return O.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):O.value==="image"&&(($=f.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},F=({file:f,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);e.code===0&&O.value==="public/image"&&C.value.push({id:f.id,content:e.data.content})}catch{window.$message.error("上传失败")}},V=({file:f,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);if(e.code!==0){let i=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(M=>{i+=":"+M}),window.$message.error(i)}}catch{window.$message.error("上传失败")}},K=({file:f})=>{let k=C.value.findIndex($=>$.id===f.id);k>-1&&C.value.splice(k,1)},L=()=>{g.value=!0},I=()=>{var f;g.value=!1,(f=R.value)==null||f.clear(),v.value=[],c.value="",C.value=[]},W=()=>{if(c.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=we(c.value);const k=[];let $=100;k.push({content:c.value,type:2,sort:$}),C.value.map(e=>{$++,k.push({content:e.content,type:3,sort:$})}),A.value=!0,ot({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(e=>{window.$message.success("发布成功"),A.value=!1,N("post-success"),I()}).catch(e=>{A.value=!1})},G=f=>{d.commit("triggerAuth",!0),d.commit("triggerAuthKey",f)};return(f,k)=>{const $=ke,e=Rt,i=J,M=ce,oe=St,Q=Lt,ne=Ot,ae=At,Y=Dt;return o(),_("div",null,[a(d).state.userInfo.id>0?(o(),_("div",Hs,[p("div",js,[p("div",Fs,[t($,{round:"",size:30,src:a(d).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:m.value,prefix:["@"],loading:w.value,value:c.value,disabled:l.lock===1,"onUpdate:value":s,onSearch:S,onFocus:L,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),T(Y,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:b,headers:{Authorization:P.value},data:{type:O.value},"file-list":v.value,onBeforeUpload:q,onFinish:F,onError:V,onRemove:K,"onUpdate:fileList":B},{default:n(()=>[p("div",Vs,[p("div",Ys,[t(oe,{abstract:""},{default:n(({handleClick:te})=>[t(M,{disabled:v.value.length>0&&O.value==="public/video"||v.value.length===9,onClick:()=>{h("public/image"),te()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(i,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(ht))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(Q,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:c.value.length/a(x)*100},null,8,["percentage"])]),default:n(()=>[U(" "+z(c.value.length)+" / "+z(a(x)),1)]),_:1})]),p("div",Js,[t(M,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:I},{default:n(()=>[U(" 取消 ")]),_:1}),t(M,{loading:A.value,onClick:W,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[U(" 发布 ")]),_:1},8,["loading"])])]),p("div",Ks,[t(ae)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ws,[Gs,D.value?u("",!0):(o(),_("div",Qs,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=te=>G("signin"))},{default:n(()=>[U(" 登录 ")]),_:1})])),D.value?(o(),_("div",Xs,[t(M,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=te=>G("signin"))},{default:n(()=>[U(" 登录 ")]),_:1}),t(M,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=te=>G("signup"))},{default:n(()=>[U(" 注册 ")]),_:1})])):u("",!0)]))])}}});const eo=ue(Zs,[["__scopeId","data-v-d9073453"]]),to={class:"username-wrap"},so={class:"options"},oo={key:0},no=["innerHTML"],ao={class:"timestamp"},lo={key:0},io={key:1},uo={class:"opts-wrap"},co=["onClick"],ro={class:"opt-item"},_o=["onClick"],po=["onClick"],mo=se({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:N}){const l=E,d="true".toLowerCase()==="true",m=ie(),g=Ne(),w=r(!1),A=r(!1),c=r(!1),R=r(!1),O=r(!1),v=r(!1),C=r(!1),D=r(!1),x=r(X.PUBLIC),b=r(!1),P=r({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=>{P.value=e,b.value=!0},S=()=>{b.value=!1},s=le({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(i=>{(+i.type==1||+i.type==2)&&e.texts.push(i),+i.type==3&&e.imgs.push(i),+i.type==4&&e.videos.push(i),+i.type==6&&e.links.push(i),+i.type==7&&e.attachments.push(i),+i.type==8&&e.charge_attachments.push(i)}),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=>()=>Ce(J,null,{default:()=>Ce(e)}),B=le(()=>{var M;let e=[];if(!m.state.userInfo.is_admin&&m.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Ct)}),e;e.push({label:"删除",key:"delete",icon:h(xt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(It)}):e.push({label:"解锁",key:"unlock",icon:h(Pt)}),m.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(xe)}):e.push({label:"取消置顶",key:"unstick",icon:h(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Ie)});let i;return s.value.visibility===X.PUBLIC?i={label:"公开",key:"vpublic",icon:h(re),children:[{label:"私密",key:"vprivate",icon:h(_e)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:s.value.visibility===X.PRIVATE?i={label:"私密",key:"vprivate",icon:h(_e),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:d&&s.value.visibility===X.FRIEND?i={label:"好友可见",key:"vfriend",icon:h(Pe),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"私密",key:"vprivate",icon:h(_e)},{label:"关注可见",key:"vfollowing",icon:h(pe)}]}:i={label:"关注可见",key:"vfollowing",icon:h(pe),children:[{label:"公开",key:"vpublic",icon:h(re)},{label:"私密",key:"vprivate",icon:h(_e)}]},d&&s.value.visibility!==X.FRIEND&&((M=i.children)==null||M.push({label:"好友可见",key:"vfriend",icon:h(Pe)})),e.push(i),e}),q=e=>{g.push({name:"post",query:{id:e}})},F=(e,i)=>{if(e.target.dataset.detail){const M=e.target.dataset.detail.split(":");if(M.length===2){m.commit("refresh"),M[0]==="tag"?g.push({name:"home",query:{q:M[1],t:"tag"}}):g.push({name:"user",query:{s:M[1]}});return}}q(i)},V=e=>{switch(e){case"whisper":y(l.post.user);break;case"delete":c.value=!0;break;case"lock":case"unlock":R.value=!0;break;case"stick":case"unstick":O.value=!0;break;case"highlight":case"unhighlight":v.value=!0;break;case"vpublic":x.value=0,C.value=!0;break;case"vprivate":x.value=1,C.value=!0;break;case"vfriend":x.value=2,C.value=!0;break;case"vfollowing":x.value=3,C.value=!0;break}},K=()=>{lt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{m.commit("refresh")},50)}).catch(e=>{D.value=!1})},L=()=>{it({id:s.value.id}).then(e=>{N("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{D.value=!1})},I=()=>{ut({id:s.value.id}).then(e=>{N("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{D.value=!1})},W=()=>{ct({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=>{D.value=!1})},G=()=>{rt({id:s.value.id,visibility:x.value}).then(e=>{N("reload"),window.$message.success("修改可见性成功")}).catch(e=>{D.value=!1})},f=()=>{_t({id:s.value.id}).then(e=>{w.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)})},k=()=>{pt({id:s.value.id}).then(e=>{A.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)})},$=()=>{Zt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return ze(()=>{m.state.userInfo.id>0&&(nt({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),at({id:s.value.id}).then(e=>{A.value=e.status}).catch(e=>{console.log(e)}))}),(e,i)=>{const M=ke,oe=ye("router-link"),Q=Ae,ne=ce,ae=Mt,Y=Et,te=Xt,be=Yt,qe=Ee,Be=Jt,He=Kt,$e=Nt,je=Me,Fe=De;return o(),_("div",{class:"detail-item",onClick:i[7]||(i[7]=H=>q(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(M,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(oe,{onClick:i[0]||(i[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[U(z(s.value.user.nickname),1)]),_:1},8,["to"]),p("span",to," @"+z(s.value.user.username),1),s.value.is_top?(o(),T(Q,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[U(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(X).PRIVATE?(o(),T(Q,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[U(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(X).FRIEND?(o(),T(Q,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[U(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[p("div",so,[t(ae,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:V},{default:n(()=>[t(ne,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(ft))]),_:1})]),_:1})]),_:1},8,["options"])]),t(Y,{show:c.value,"onUpdate:show":i[1]||(i[1]=H=>c.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show"]),t(Y,{show:R.value,"onUpdate:show":i[2]||(i[2]=H=>R.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(Y,{show:O.value,"onUpdate:show":i[3]||(i[3]=H=>O.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(Y,{show:v.value,"onUpdate:show":i[4]||(i[4]=H=>v.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:W},null,8,["show","content"]),t(Y,{show:C.value,"onUpdate:show":i[5]||(i[5]=H=>C.value=H),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(x.value==0?"公开":x.value==1?"私密":x.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:G},null,8,["show","content"]),t(te,{show:b.value,user:P.value,onSuccess:S},null,8,["show","user"])]),footer:n(()=>[t(be,{attachments:s.value.attachments},null,8,["attachments"]),t(be,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(qe,{imgs:s.value.imgs},null,8,["imgs"]),t(Be,{videos:s.value.videos,full:!0},null,8,["videos"]),t(He,{links:s.value.links},null,8,["links"]),p("div",ao,[U(" 发布于 "+z(a(ve)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",lo,[t($e,{vertical:""}),U(" "+z(s.value.ip_loc),1)])):u("",!0),!a(m).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",io,[t($e,{vertical:""}),U(" 最后回复 "+z(a(ve)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[p("div",uo,[t(je,{justify:"space-between"},{default:n(()=>[p("div",{class:"opt-item hover",onClick:j(f,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),T(a(gt),{key:0})),w.value?(o(),T(a(yt),{key:1,color:"red"})):u("",!0)]),_:1}),U(" "+z(s.value.upvote_count),1)],8,co),p("div",ro,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(kt))]),_:1}),U(" "+z(s.value.comment_count),1)]),p("div",{class:"opt-item hover",onClick:j(k,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[A.value?u("",!0):(o(),T(a(wt),{key:0})),A.value?(o(),T(a(bt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),U(" "+z(s.value.collection_count),1)],8,_o),p("div",{class:"opt-item hover",onClick:j($,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a($t))]),_:1}),U(" "+z(s.value.share_count),1)],8,po)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",oo,[(o(!0),_(de,null,me(s.value.texts,H=>(o(),_("span",{key:H.id,class:"post-text",onClick:i[6]||(i[6]=j(Ve=>F(Ve,s.value.id),["stop"])),innerHTML:a(we)(H.content).content},null,8,no))),128))])):u("",!0)]),_:1})])}}});const vo=E=>(Te("data-v-c5bf4463"),E=E(),Ue(),E),ho={key:0,class:"detail-wrap"},fo={key:1,class:"empty-wrap"},go={key:0,class:"comment-opts-wrap"},yo=vo(()=>p("span",{class:"comment-title-item"},"评论",-1)),ko={key:2},wo={key:0,class:"skeleton-wrap"},bo={key:1},$o={key:0,class:"empty-wrap"},Co={key:0,class:"load-more-spinner"},xo={key:1,class:"load-more-spinner"},Io={key:2,class:"load-more-spinner"},Po={key:3,class:"load-more-spinner"},To={key:4,class:"load-more-spinner"},Uo={key:5,class:"load-more-spinner"},Z=20,zo=se({__name:"Post",setup(E){const N=Wt(),l=r({}),d=r(!1),m=r(!1),g=r([]),w=le(()=>+N.query.id),A=r("default"),c=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const O=L=>{A.value=L,L==="default"&&(c.value=!0),V(R)},v=()=>{l.value={id:0},d.value=!0,dt({id:w.value}).then(L=>{d.value=!1,l.value=L,V(R)}).catch(L=>{d.value=!1})};let C=1;const D=r(!1),x=r([]),b=L=>{D.value||ge({id:l.value.id,style:"default",page:C,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(C===1?x.value=I.list:x.value.push(...I.list),g.value=x.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})};let P=1,y=r(!1);const S=r([]),s=L=>{y.value||ge({id:l.value.id,style:"hots",page:P,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(P===1?S.value=I.list:S.value.push(...I.list),g.value=S.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})};let h=1,B=r(!1);const q=r([]),F=L=>{B.value||ge({id:l.value.id,style:"newest",page:h,page_size:Z}).then(I=>{L!==null&&(R=L),I.list.length0&&(h===1?q.value=I.list:q.value.push(...I.list),g.value=q.value),R.loaded(),m.value=!1}).catch(I=>{m.value=!1,R.error()})},V=L=>{w.value<1||(g.value.length===0&&(m.value=!0),A.value==="default"?(g.value=x.value,b(L)):A.value==="hots"?(g.value=S.value,s(L)):(g.value=q.value,F(L)),m.value=!1)},K=()=>{C=1,D.value=!1,x.value=[],P=1,y.value=!1,S.value=[],h=1,B.value=!1,q.value=[],V(R)};return ze(()=>{v()}),Je(w,()=>{w.value>0&&N.name==="post"&&v()}),(L,I)=>{const W=es,G=mo,f=Bt,k=Ht,$=jt,e=Ft,i=Vt,M=eo,oe=Gt,Q=qs,ne=Me,ae=qt;return o(),_("div",null,[t(W,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t($,null,{default:n(()=>[t(k,{show:d.value},{default:n(()=>[l.value.id>1?(o(),_("div",ho,[t(G,{post:l.value,onReload:v},null,8,["post"])])):(o(),_("div",fo,[t(f,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",go,[t(i,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":O},{prefix:n(()=>[yo]),default:n(()=>[t(e,{name:"default",tab:"推荐"}),t(e,{name:"hots",tab:"热门"}),t(e,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),T($,{key:1},{default:n(()=>[t(M,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:K},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",ko,[m.value?(o(),_("div",wo,[t(oe,{num:5})])):(o(),_("div",bo,[g.value.length===0?(o(),_("div",$o,[t(f,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(de,null,me(g.value,Y=>(o(),T($,{key:Y.id},{default:n(()=>[t(Q,{comment:Y,postUserId:l.value.user_id,onReload:K},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=Z?(o(),T(ne,{key:3,justify:"center"},{default:n(()=>[t(a(ts),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:V},{spinner:n(()=>[c.value&&D.value?(o(),_("span",Co)):u("",!0),!c.value&&a(y)?(o(),_("span",xo)):u("",!0),!c.value&&a(B)?(o(),_("span",Io)):u("",!0),c.value&&!D.value?(o(),_("span",Po,"加载评论")):u("",!0),!c.value&&!a(y)?(o(),_("span",To,"加载评论")):u("",!0),!c.value&&!a(B)?(o(),_("span",Uo,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const _n=ue(zo,[["__scopeId","data-v-c5bf4463"]]);export{_n as default}; diff --git a/web/dist/assets/Profile-240ea45a.js b/web/dist/assets/Profile-240ea45a.js deleted file mode 100644 index 1383042f..00000000 --- a/web/dist/assets/Profile-240ea45a.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as fe}from"./whisper-7c8226c3.js";import{_ as he,a as ge}from"./post-item.vue_vue_type_style_index_0_lang-1243f33f.js";import{_ as ke}from"./post-skeleton-5d89319a.js";import{_ as ye}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{d as we,H as n,b as be,E as Pe,r as Ie,f as o,k as u,bf as _,q as d,w as c,Y as m,e,j as f,x as I,A as E,y as ae,F as y,u as w}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as x,I as ze,_ as qe}from"./index-537a241d.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{G as Se,a as $e,o as Ce,M as Le,f as Be,g as Ne,J as Ve,k as De,H as He}from"./naive-ui-defd0b2d.js";import"./content-f21e8034.js";import"./@vicons-4ed09704.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-39372edb.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 Ue={class:"profile-baseinfo"},We={class:"avatar"},je={class:"base-info"},Ee={class:"username"},Fe={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Je={class:"info-item"},Ye={class:"info-item"},Ke={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Xe={key:1},Ze={key:0},ea={key:1},aa={key:2},ta={key:3},sa={key:4},la={key:2},oa={key:0},na={key:1},ua={key:2},ia={key:3},ra={key:4},ca={class:"load-more-wrap"},va={class:"load-more-spinner"},_a=we({__name:"Profile",setup(ma){const i=Te(),T=Me(),v=n(!1),b=n(!1),s=n([]),S=n([]),$=n([]),C=n([]),L=n([]),B=n([]),p=n("post"),F=n(+T.query.p||1),R=n(1),A=n(1),G=n(1),J=n(1),t=n(+T.query.p||1),h=n(20),r=n(0),Y=n(0),K=n(0),O=n(0),Q=n(0),X=n(0),N=n(!1),Z=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),g=a=>{Z.value=a,N.value=!0},te=()=>{N.value=!1},V=()=>{switch(p.value){case"post":D();break;case"comment":H();break;case"highlight":U();break;case"media":W();break;case"star":j();break}},D=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"post",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),S.value=s.value,Y.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},H=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"comment",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),$.value=s.value,K.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},U=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"highlight",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),C.value=s.value,O.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},W=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"media",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),L.value=s.value,Q.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},j=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"star",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),B.value=s.value,X.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},se=a=>{switch(p.value=a,p.value){case"post":s.value=S.value,t.value=F.value,r.value=Y.value,D();break;case"comment":s.value=$.value,t.value=R.value,r.value=K.value,H();break;case"highlight":s.value=C.value,t.value=A.value,r.value=O.value,U();break;case"media":s.value=L.value,t.value=G.value,r.value=Q.value,W();break;case"star":s.value=B.value,t.value=J.value,r.value=X.value,j();break}},le=()=>{switch(p.value){case"post":F.value=t.value,D();break;case"comment":R.value=t.value,H();break;case"highlight":A.value=t.value,U();break;case"media":G.value=t.value,W();break;case"star":J.value=t.value,j();break}},oe=()=>{t.value{V()}),Pe(()=>({path:T.path,query:T.query,refresh:i.state.refresh}),(a,P)=>{if(a.refresh!==P.refresh){t.value=+T.query.p||1,setTimeout(()=>{V()},0);return}P.path!=="/post"&&a.path==="/profile"&&(t.value=+T.query.p||1,setTimeout(()=>{V()},0))}),(a,P)=>{const ne=ye,ue=Ce,ie=Le,ee=Ie("router-link"),M=Be,re=Ne,ce=ke,ve=Ve,z=he,k=He,q=ge,_e=fe,me=Se,pe=De,de=$e;return e(),o("div",null,[u(ne,{title:"主页"}),_(i).state.userInfo.id>0?(e(),d(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[f("div",Ue,[f("div",We,[u(ue,{size:72,src:_(i).state.userInfo.avatar},null,8,["src"])]),f("div",je,[f("div",Ee,[f("strong",null,I(_(i).state.userInfo.nickname),1),f("span",null," @"+I(_(i).state.userInfo.username),1),_(i).state.userInfo.is_admin?(e(),d(ie,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[E(" 管理员 ")]),_:1})):m("",!0)]),f("div",Fe,[f("span",Re,"UID. "+I(_(i).state.userInfo.id),1),f("span",Ae,I(_(ze)(_(i).state.userInfo.created_on))+" 加入",1)]),f("div",Ge,[f("span",Je,[u(ee,{onClick:P[0]||(P[0]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:_(i).state.userInfo.username,n:_(i).state.userInfo.nickname,t:"follows"}}},{default:c(()=>[E(" 关注  "+I(_(i).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",Ye,[u(ee,{onClick:P[1]||(P[1]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:_(i).state.userInfo.username,n:_(i).state.userInfo.nickname,t:"followings"}}},{default:c(()=>[E(" 粉丝  "+I(_(i).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(re,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":se},{default:c(()=>[u(M,{name:"post",tab:"泡泡"}),u(M,{name:"comment",tab:"评论"}),u(M,{name:"highlight",tab:"亮点"}),u(M,{name:"media",tab:"图文"}),u(M,{name:"star",tab:"喜欢"})]),_:1}),v.value&&s.value.length===0?(e(),o("div",Ke,[u(ce,{num:h.value},null,8,["num"])])):(e(),o("div",Oe,[s.value.length===0?(e(),o("div",Qe,[u(ve,{size:"large",description:"暂无数据"})])):m("",!0),_(i).state.desktopModelShow?(e(),o("div",Xe,[p.value==="post"?(e(),o("div",Ze,[(e(!0),o(y,null,w(S.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(e(),o("div",ea,[(e(!0),o(y,null,w($.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(e(),o("div",aa,[(e(!0),o(y,null,w(C.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(e(),o("div",ta,[(e(!0),o(y,null,w(L.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(e(),o("div",sa,[(e(!0),o(y,null,w(B.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0)])):(e(),o("div",la,[p.value==="post"?(e(),o("div",oa,[(e(!0),o(y,null,w(S.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(e(),o("div",na,[(e(!0),o(y,null,w($.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(e(),o("div",ua,[(e(!0),o(y,null,w(C.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(e(),o("div",ia,[(e(!0),o(y,null,w(L.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(e(),o("div",ra,[(e(!0),o(y,null,w(B.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0)]))])),u(_e,{show:N.value,user:Z.value,onSuccess:te},null,8,["show","user"])]),_:1})):m("",!0),r.value>0?(e(),d(de,{key:1,justify:"center"},{default:c(()=>[u(_(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:P[2]||(P[2]=l=>oe())},{spinner:c(()=>[f("div",ca,[b.value?m("",!0):(e(),d(pe,{key:0,size:14})),f("span",va,I(b.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Ga=qe(_a,[["__scopeId","data-v-756dadd0"]]);export{Ga as default}; diff --git a/web/dist/assets/Profile-2c2e2db9.js b/web/dist/assets/Profile-2c2e2db9.js new file mode 100644 index 00000000..082b07ae --- /dev/null +++ b/web/dist/assets/Profile-2c2e2db9.js @@ -0,0 +1 @@ +import{_ as ge}from"./whisper-1cd3d379.js";import{_ as we,a as ke}from"./post-item.vue_vue_type_style_index_0_lang-4e8f8831.js";import{_ as ye}from"./post-skeleton-0e77ba18.js";import{_ as be}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{d as Ie,H as i,b as Pe,E as Oe,r as Te,f as n,k as r,bf as u,q as f,w as _,Y as d,e as a,j as p,x as O,A as W,y as ae,F as b,u as I}from"./@vue-a481fc63.js";import{u as Fe}from"./vuex-44de225f.js";import{b as Ae}from"./vue-router-e5a2430e.js";import{e as x,J as Me,u as xe,f as ze,_ as $e}from"./index-fcdbde87.js";import{W as qe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ce,G as Se,a as Le,o as Ue,M as Be,f as De,g as He,J as Ne,k as Ve,H as We}from"./naive-ui-defd0b2d.js";import"./content-aa5ad7a4.js";import"./@vicons-4ed09704.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-39372edb.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 je={class:"profile-baseinfo"},Ee={class:"avatar"},Je={class:"base-info"},Re={class:"username"},Ge={class:"userinfo"},Ye={class:"info-item"},Ke={class:"info-item"},Qe={class:"userinfo"},Xe={class:"info-item"},Ze={class:"info-item"},et={key:0,class:"skeleton-wrap"},tt={key:1},at={key:0,class:"empty-wrap"},st={key:1},lt={key:0},ot={key:1},nt={key:2},ut={key:3},it={key:4},rt={key:2},ct={key:0},_t={key:1},vt={key:2},dt={key:3},mt={key:4},ft={class:"load-more-wrap"},pt={class:"load-more-spinner"},ht=Ie({__name:"Profile",setup(gt){const o=Fe(),T=Ae(),se=Ce(),v=i(!1),P=i(!1),l=i([]),z=i([]),$=i([]),q=i([]),C=i([]),S=i([]),m=i("post"),j=i(+T.query.p||1),E=i(1),J=i(1),R=i(1),G=i(1),s=i(+T.query.p||1),g=i(20),c=i(0),Y=i(0),K=i(0),Q=i(0),X=i(0),Z=i(0),L=i(!1),ee=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=>{ee.value=e,L.value=!0},le=()=>{L.value=!1},k=e=>{se.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?xe({user_id:e.user.id}).then(h=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(h=>{}):ze({user_id:e.user.id}).then(h=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(h=>{})}})},U=()=>{switch(m.value){case"post":B();break;case"comment":D();break;case"highlight":H();break;case"media":N();break;case"star":V();break}},B=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{v.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)),c.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,Y.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},D=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{v.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)),c.value=Math.ceil(e.pager.total_rows/g.value),$.value=l.value,K.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},H=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{v.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)),c.value=Math.ceil(e.pager.total_rows/g.value),q.value=l.value,Q.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},N=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{v.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)),c.value=Math.ceil(e.pager.total_rows/g.value),C.value=l.value,X.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},V=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{v.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)),c.value=Math.ceil(e.pager.total_rows/g.value),S.value=l.value,Z.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},oe=e=>{switch(m.value=e,m.value){case"post":l.value=z.value,s.value=j.value,c.value=Y.value,B();break;case"comment":l.value=$.value,s.value=E.value,c.value=K.value,D();break;case"highlight":l.value=q.value,s.value=J.value,c.value=Q.value,H();break;case"media":l.value=C.value,s.value=R.value,c.value=X.value,N();break;case"star":l.value=S.value,s.value=G.value,c.value=Z.value,V();break}},ne=()=>{switch(m.value){case"post":j.value=s.value,B();break;case"comment":E.value=s.value,D();break;case"highlight":J.value=s.value,H();break;case"media":R.value=s.value,N();break;case"star":G.value=s.value,V();break}},ue=()=>{s.value{U()}),Oe(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,h)=>{if(e.refresh!==h.refresh){s.value=+T.query.p||1,setTimeout(()=>{U()},0);return}h.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{U()},0))}),(e,h)=>{const ie=be,re=Ue,ce=Be,te=Te("router-link"),F=De,_e=He,ve=ye,de=Ne,A=we,y=We,M=ke,me=ge,fe=Se,pe=Ve,he=Le;return a(),n("div",null,[r(ie,{title:"主页"}),u(o).state.userInfo.id>0?(a(),f(fe,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[p("div",je,[p("div",Ee,[r(re,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),p("div",Je,[p("div",Re,[p("strong",null,O(u(o).state.userInfo.nickname),1),p("span",null," @"+O(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(a(),f(ce,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[W(" 管理员 ")]),_:1})):d("",!0)]),p("div",Ge,[p("span",Ye,"UID. "+O(u(o).state.userInfo.id),1),p("span",Ke,O(u(Me)(u(o).state.userInfo.created_on))+" 加入",1)]),p("div",Qe,[p("span",Xe,[r(te,{onClick:h[0]||(h[0]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[W(" 关注  "+O(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),p("span",Ze,[r(te,{onClick:h[1]||(h[1]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[W(" 粉丝  "+O(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),r(_e,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":oe},{default:_(()=>[r(F,{name:"post",tab:"泡泡"}),r(F,{name:"comment",tab:"评论"}),r(F,{name:"highlight",tab:"亮点"}),r(F,{name:"media",tab:"图文"}),r(F,{name:"star",tab:"喜欢"})]),_:1}),v.value&&l.value.length===0?(a(),n("div",et,[r(ve,{num:g.value},null,8,["num"])])):(a(),n("div",tt,[l.value.length===0?(a(),n("div",at,[r(de,{size:"large",description:"暂无数据"})])):d("",!0),u(o).state.desktopModelShow?(a(),n("div",st,[m.value==="post"?(a(),n("div",lt,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",ot,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",nt,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",ut,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",it,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(a(),n("div",rt,[m.value==="post"?(a(),n("div",ct,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",_t,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",vt,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",dt,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",mt,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))])),r(me,{show:L.value,user:ee.value,onSuccess:le},null,8,["show","user"])]),_:1})):d("",!0),c.value>0?(a(),f(he,{key:1,justify:"center"},{default:_(()=>[r(u(qe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:h[2]||(h[2]=t=>ue())},{spinner:_(()=>[p("div",ft,[P.value?d("",!0):(a(),f(pe,{key:0,size:14})),p("span",pt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Qt=$e(ht,[["__scopeId","data-v-4727fe2e"]]);export{Qt as default}; diff --git a/web/dist/assets/Profile-3ffb7be9.css b/web/dist/assets/Profile-3ffb7be9.css deleted file mode 100644 index f5f36861..00000000 --- a/web/dist/assets/Profile-3ffb7be9.css +++ /dev/null @@ -1 +0,0 @@ -.profile-baseinfo[data-v-756dadd0]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-756dadd0]{width:72px}.profile-baseinfo .base-info[data-v-756dadd0]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-756dadd0]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-756dadd0]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-756dadd0]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-756dadd0]{transform:scale(.75)}.profile-tabs-wrap[data-v-756dadd0]{padding:0 16px}.load-more[data-v-756dadd0]{margin:20px}.load-more .load-more-wrap[data-v-756dadd0]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-756dadd0]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-756dadd0],.dark .pagination-wrap[data-v-756dadd0]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-5fc46d20.css b/web/dist/assets/Profile-5fc46d20.css new file mode 100644 index 00000000..95a122d3 --- /dev/null +++ b/web/dist/assets/Profile-5fc46d20.css @@ -0,0 +1 @@ +.profile-baseinfo[data-v-4727fe2e]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-4727fe2e]{width:72px}.profile-baseinfo .base-info[data-v-4727fe2e]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-4727fe2e]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-4727fe2e]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-4727fe2e]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-4727fe2e]{transform:scale(.75)}.profile-tabs-wrap[data-v-4727fe2e]{padding:0 16px}.load-more[data-v-4727fe2e]{margin:20px}.load-more .load-more-wrap[data-v-4727fe2e]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-4727fe2e]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-4727fe2e],.dark .pagination-wrap[data-v-4727fe2e]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-79b379f8.js b/web/dist/assets/Setting-79b379f8.js new file mode 100644 index 00000000..3e47dd35 --- /dev/null +++ b/web/dist/assets/Setting-79b379f8.js @@ -0,0 +1 @@ +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{d as ye,H as d,R as Q,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as p,x as S,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{a1 as X,a2 as Ue,a3 as Re,a4 as Se,a5 as qe,a6 as Ae,a7 as Be,_ as Ne}from"./index-fcdbde87.js";import{_ as ze}from"./@vicons-4ed09704.js";import{h as xe,o as De,e as Ke,B as Fe,b as Te,j as je,T as Oe,$ as Ve,L as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-defd0b2d.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-39372edb.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 T=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ge={class:"base-line avatar"},He={class:"base-line"},Je=T(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},Qe=T(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=T(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=T(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},pt={class:"captcha-img-wrap"},ct={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(B){const ee="https://okbiu.com/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),R=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),H=d(),J=d(),Y=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.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):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=M.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Re({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Se({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.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=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&O()}))})},j=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},pe=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},ce=()=>{if(!(I.value>0&&R.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{R.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,R.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),O()}),(n,e)=>{const v=we,f=De,c=Ke,K=Fe,h=Te,ge=je,F=xe,Z=Oe,w=Ve,he=Ee,V=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",He,[Je,C.value?_("",!0):(r(),g("div",Ye,S(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:pe,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[Qe,p(" @"+S(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[p(S(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{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]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:j},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,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:R.value,loading:P.value,onClick:ce},{default:s(()=>[p(S(I.value>0&&R.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.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),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[p(S(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:H,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",pt,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",ct,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:O},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:de},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),U.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{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]=q(A(()=>{},["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:re,onKeydown:e[18]||(e[18]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,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]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; diff --git a/web/dist/assets/Setting-c02f9e94.js b/web/dist/assets/Setting-c02f9e94.js deleted file mode 100644 index 8efd9890..00000000 --- a/web/dist/assets/Setting-c02f9e94.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{d as ye,H as d,R as Q,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as p,x as S,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{a1 as X,a2 as Ue,a3 as Re,a4 as Se,a5 as qe,a6 as Ae,a7 as Be,_ as Ne}from"./index-537a241d.js";import{_ as ze}from"./@vicons-4ed09704.js";import{h as xe,o as De,e as Ke,B as Fe,b as Te,j as je,T as Oe,$ as Ve,L as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-defd0b2d.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-39372edb.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 T=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ge={class:"base-line avatar"},He={class:"base-line"},Je=T(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},Qe=T(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=T(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=T(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},pt={class:"captcha-img-wrap"},ct={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(B){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),R=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),H=d(),J=d(),Y=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.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):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=M.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Re({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Se({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.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=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&O()}))})},j=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},pe=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},ce=()=>{if(!(I.value>0&&R.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{R.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,R.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),O()}),(n,e)=>{const v=we,f=De,c=Ke,K=Fe,h=Te,ge=je,F=xe,Z=Oe,w=Ve,he=Ee,V=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",He,[Je,C.value?_("",!0):(r(),g("div",Ye,S(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:pe,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[Qe,p(" @"+S(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[p(S(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{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]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:j},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,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:R.value,loading:P.value,onClick:ce},{default:s(()=>[p(S(I.value>0&&R.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.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),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[p(S(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:H,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",pt,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",ct,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:O},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:de},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),U.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{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]=q(A(()=>{},["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:re,onKeydown:e[18]||(e[18]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,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]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; diff --git a/web/dist/assets/Topic-f788b49d.js b/web/dist/assets/Topic-dec980fd.js similarity index 89% rename from web/dist/assets/Topic-f788b49d.js rename to web/dist/assets/Topic-dec980fd.js index 1c7ac030..5f4c6afc 100644 --- a/web/dist/assets/Topic-f788b49d.js +++ b/web/dist/assets/Topic-dec980fd.js @@ -1 +1 @@ -import{D as $,E as I,F as M,G as O,_ as D}from"./index-537a241d.js";import{z as G}from"./@vicons-4ed09704.js";import{d as F,H as i,c as q,b as A,r as U,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as u,bf as h,E as j,al as x,F as H,u as P}from"./@vue-a481fc63.js";import{o as Y,M as C,j as J,e as K,P as Q,O as R,G as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-defd0b2d.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{u as ne}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-39372edb.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.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":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=U("router-link"),g=Y,k=C,a=J,d=K,v=Q,p=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(G))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);j(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=X,V=C,E=Z,L=ie,N=ee,S=oe,z=W;return c(),_("div",null,[n(v,{title:"话题"}),n(z,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},x({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(V,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(S,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(H,null,P(r.value,y=>(c(),b(L,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=D(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{E as $,F as I,G as M,H as O,_ as G}from"./index-fcdbde87.js";import{z as H}from"./@vicons-4ed09704.js";import{d as F,H as i,c as q,b as A,r as U,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as u,bf as h,E as j,al as x,F as D,u as P}from"./@vue-a481fc63.js";import{o as Y,M as C,j as J,e as K,P as Q,O as R,G as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-defd0b2d.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{u as ne}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-39372edb.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.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":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=U("router-link"),g=Y,k=C,a=J,d=K,v=Q,p=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(H))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);j(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=X,V=C,E=Z,L=ie,N=ee,S=oe,z=W;return c(),_("div",null,[n(v,{title:"话题"}),n(z,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},x({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(V,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(S,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(D,null,P(r.value,y=>(c(),b(L,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=G(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-4853e1bd.css b/web/dist/assets/User-4853e1bd.css new file mode 100644 index 00000000..9a65894c --- /dev/null +++ b/web/dist/assets/User-4853e1bd.css @@ -0,0 +1 @@ +.profile-tabs-wrap[data-v-8046429c]{padding:0 16px}.profile-baseinfo[data-v-8046429c]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-8046429c]{width:72px}.profile-baseinfo .base-info[data-v-8046429c]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-8046429c]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-8046429c]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-8046429c]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-8046429c]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-8046429c]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-8046429c]{margin:20px}.load-more .load-more-wrap[data-v-8046429c]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-8046429c]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-8046429c],.dark .pagination-wrap[data-v-8046429c]{background-color:#101014bf} diff --git a/web/dist/assets/User-4e887c94.js b/web/dist/assets/User-4e887c94.js new file mode 100644 index 00000000..6e742476 --- /dev/null +++ b/web/dist/assets/User-4e887c94.js @@ -0,0 +1 @@ +import{_ as Be,a as He}from"./post-item.vue_vue_type_style_index_0_lang-4e8f8831.js";import{_ as Ne}from"./post-skeleton-0e77ba18.js";import{_ as Ve}from"./whisper-1cd3d379.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{d as Je,H as i,R as Re,c as Ee,b as Ge,E as Ke,r as Ye,f as u,k as n,w as r,q as g,Y as d,e as s,j as h,x as A,bf as c,A as B,y as ce,F,u as I,h as ve}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{K as Ze,J as ea,e as H,h as aa,u as _e,f as de,L as sa,_ as ta}from"./index-fcdbde87.js";import{W as la}from"./whisper-add-friend-7bcff3b6.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as na,r as ua,D as me,G as ia,x as ra,J as ca,K as va}from"./@vicons-4ed09704.js";import{F as _a,G as da,a as ma,j as fe,o as fa,M as pa,e as ga,P as ha,k as wa,f as ka,g as ya,J as ba,H as Pa}from"./naive-ui-defd0b2d.js";import"./content-aa5ad7a4.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-39372edb.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 Oa={key:0,class:"profile-baseinfo"},Fa={class:"avatar"},Ia={class:"base-info"},Ta={class:"username"},xa={class:"userinfo"},Aa={class:"info-item"},$a={class:"info-item"},za={class:"userinfo"},Ua={class:"info-item"},Ca={class:"info-item"},qa={key:0,class:"user-opts"},Ma={key:0,class:"skeleton-wrap"},Sa={key:1},Wa={key:0,class:"empty-wrap"},La={key:1},Da={key:0},Ba={key:1},Ha={key:2},Na={key:3},Va={key:4},ja={key:2},Ja={key:0},Ra={key:1},Ea={key:2},Ga={key:3},Ka={key:4},Ya={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=Je({__name:"User",setup(Za){const N=_a(),_=Qe(),$=Xe(),ue="true".toLowerCase()==="true",m=i(!1),y=i(!1),a=Re({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),p=i(!1),V=i(!1),J=i(!1),l=i([]),z=i([]),U=i([]),C=i([]),q=i([]),M=i([]),T=i($.query.s||""),o=i(+$.query.p||1),f=i("post"),R=i(+$.query.p||1),E=i(1),G=i(1),K=i(1),Y=i(1),k=i(20),v=i(0),Q=i(0),X=i(0),Z=i(0),ee=i(0),ae=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=>{N.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?_e({user_id:e.user.id}).then(w=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(w=>{}):de({user_id:e.user.id}).then(w=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(w=>{})}})},pe=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],C.value=[],q.value=[],M.value=[],f.value="post",o.value=1,R.value=1,E.value=1,G.value=1,K.value=1,Y.value=1,v.value=0,Q.value=0,X.value=0,Z.value=0,ee.value=0,ae.value=0},ge=()=>{switch(f.value){case"post":j();break;case"comment":se();break;case"highlight":te();break;case"media":le();break;case"star":oe();break}},j=()=>{m.value=!0,H({username:T.value,style:"post",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Q.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},se=()=>{m.value=!0,H({username:T.value,style:"comment",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,X.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},te=()=>{m.value=!0,H({username:T.value,style:"highlight",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,Z.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},le=()=>{m.value=!0,H({username:T.value,style:"media",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},oe=()=>{m.value=!0,H({username:T.value,style:"star",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},he=e=>{switch(f.value=e,f.value){case"post":l.value=z.value,o.value=R.value,v.value=Q.value,j();break;case"comment":l.value=U.value,o.value=E.value,v.value=X.value,se();break;case"highlight":l.value=C.value,o.value=G.value,v.value=Z.value,te();break;case"media":l.value=q.value,o.value=K.value,v.value=ee.value,le();break;case"star":l.value=M.value,o.value=Y.value,v.value=ae.value,oe();break}},S=()=>{p.value=!0,Ze({username:T.value}).then(e=>{p.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,ge()}).catch(e=>{p.value=!1,console.log(e)})},we=()=>{switch(f.value){case"post":R.value=o.value,j();break;case"comment":E.value=o.value,se();break;case"highlight":G.value=o.value,te();break;case"media":K.value=o.value,le();break;case"star":Y.value=o.value,oe();break}},ke=()=>{V.value=!0},ye=()=>{J.value=!0},be=()=>{V.value=!1},Pe=()=>{J.value=!1},x=e=>()=>ve(fe,null,{default:()=>ve(e)}),Oe=Ee(()=>{let e=[{label:"私信",key:"whisper",icon:x(ua)}];return _.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:x(me)}):e.push({label:"解封",key:"deblocking",icon:x(me)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:x(ia)}):e.push({label:"关注",key:"follow",icon:x(ra)}),ue&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:x(ca)}):e.push({label:"添加朋友",key:"requesting",icon:x(va)})),e}),Fe=e=>{switch(e){case"whisper":ke();break;case"delete":Ie();break;case"requesting":ye();break;case"follow":case"unfollow":Te();break;case"banned":case"deblocking":xe();break}},Ie=()=>{N.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,aa({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,j()}).catch(e=>{p.value=!1,console.log(e)})}})},Te=()=>{N.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?_e({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("取消关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)}):de({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},xe=()=>{N.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,sa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},Ae=()=>{o.value{S()}),Ke(()=>({path:$.path,query:$.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&(T.value=$.query.s||"",pe(),S())}),(e,w)=>{const $e=je,ze=fa,ne=pa,ie=Ye("router-link"),Ue=ga,Ce=ha,qe=Ve,re=wa,W=ka,Me=ya,Se=Ne,We=ba,L=Be,O=Pa,D=He,Le=da,De=ma;return s(),u("div",null,[n($e,{title:"用户详情"}),n(Le,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[n(re,{show:p.value},{default:r(()=>[a.id>0?(s(),u("div",Oa,[h("div",Fa,[n(ze,{size:72,src:a.avatar},null,8,["src"])]),h("div",Ia,[h("div",Ta,[h("strong",null,A(a.nickname),1),h("span",null," @"+A(a.username),1),ue&&c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_friend?(s(),g(ne,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[B(" 好友 ")]),_:1})):d("",!0),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_following?(s(),g(ne,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[B(" 已关注 ")]),_:1})):d("",!0),a.is_admin?(s(),g(ne,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[B(" 管理员 ")]),_:1})):d("",!0)]),h("div",xa,[h("span",Aa,"UID. "+A(a.id),1),h("span",$a,A(c(ea)(a.created_on))+" 加入",1)]),h("div",za,[h("span",Ua,[n(ie,{onClick:w[0]||(w[0]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[B(" 关注  "+A(a.follows),1)]),_:1},8,["to"])]),h("span",Ca,[n(ie,{onClick:w[1]||(w[1]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[B(" 粉丝  "+A(a.followings),1)]),_:1},8,["to"])])])]),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username?(s(),u("div",qa,[n(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Oe.value,onSelect:Fe},{default:r(()=>[n(Ue,{quaternary:"",circle:""},{icon:r(()=>[n(c(fe),null,{default:r(()=>[n(c(na))]),_:1})]),_:1})]),_:1},8,["options"])])):d("",!0)])):d("",!0),n(qe,{show:V.value,user:a,onSuccess:be},null,8,["show","user"]),n(la,{show:J.value,user:a,onSuccess:Pe},null,8,["show","user"])]),_:1},8,["show"]),n(Me,{class:"profile-tabs-wrap",type:"line",animated:"",value:f.value,"onUpdate:value":he},{default:r(()=>[n(W,{name:"post",tab:"泡泡"}),n(W,{name:"comment",tab:"评论"}),n(W,{name:"highlight",tab:"亮点"}),n(W,{name:"media",tab:"图文"}),n(W,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),m.value&&l.value.length===0?(s(),u("div",Ma,[n(Se,{num:k.value},null,8,["num"])])):(s(),u("div",Sa,[l.value.length===0?(s(),u("div",Wa,[n(We,{size:"large",description:"暂无数据"})])):d("",!0),c(_).state.desktopModelShow?(s(),u("div",La,[f.value==="post"?(s(),u("div",Da,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Ba,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ha,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Na,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Va,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(s(),u("div",ja,[f.value==="post"?(s(),u("div",Ja,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(D,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Ra,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(D,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ea,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(D,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Ga,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(D,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Ka,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(D,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))]))]),_:1}),v.value>0?(s(),g(De,{key:0,justify:"center"},{default:r(()=>[n(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=t=>Ae())},{spinner:r(()=>[h("div",Ya,[y.value?d("",!0):(s(),g(re,{key:0,size:14})),h("span",Qa,A(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Cs=ta(Xa,[["__scopeId","data-v-8046429c"]]);export{Cs as default}; diff --git a/web/dist/assets/User-ae210ca8.js b/web/dist/assets/User-ae210ca8.js deleted file mode 100644 index 6a3145d8..00000000 --- a/web/dist/assets/User-ae210ca8.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Ne,a as Re}from"./post-item.vue_vue_type_style_index_0_lang-1243f33f.js";import{_ as He}from"./post-skeleton-5d89319a.js";import{_ as Ve}from"./whisper-7c8226c3.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{d as pe,H as i,e as s,q as m,w as r,j as f,k as t,A as U,x as T,R as Je,c as Ee,b as Ge,E as Ke,r as Ye,f as u,Y as d,bf as k,y as ce,F as $,u as x,h as _e}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{J as Ze,_ as me,K as ea,I as aa,e as V,L as sa,u as ta,f as la,M as na}from"./index-537a241d.js";import{S as oa,I as ua,T as ia,b as ra,e as fe,i as ca,F as _a,G as va,a as da,j as ve,o as pa,M as ma,P as fa,k as ha,f as ga,g as wa,J as ka,H as ya}from"./naive-ui-defd0b2d.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{k as Pa,r as $a,D as de,G as xa,x as Ta,J as za,K as Ua}from"./@vicons-4ed09704.js";import"./content-f21e8034.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-39372edb.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 Ia={class:"whisper-wrap"},Fa={class:"whisper-line"},Ma={class:"whisper-line send-wrap"},qa=pe({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ue,{emit:A}){const y=ue,g=i(""),I=i(!1),c=()=>{A("success")},h=()=>{I.value=!0,Ze({user_id:y.user.id,greetings:g.value}).then(a=>{window.$message.success("发送成功"),I.value=!1,g.value="",c()}).catch(a=>{I.value=!1})};return(a,v)=>{const L=oa,O=ua,l=ia,F=ra,M=fe,q=ca;return s(),m(q,{show:a.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:r(()=>[f("div",Ia,[t(l,{"show-icon":!1},{default:r(()=>[U(" 发送添加朋友申请给: "),t(O,{style:{"max-width":"100%"}},{default:r(()=>[t(L,{type:"success"},{default:r(()=>[U(T(a.user.nickname)+"@"+T(a.user.username),1)]),_:1})]),_:1})]),_:1}),f("div",Fa,[t(F,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:g.value,"onUpdate:value":v[0]||(v[0]=C=>g.value=C),maxlength:"120","show-count":""},null,8,["value"])]),f("div",Ma,[t(M,{strong:"",secondary:"",type:"primary",loading:I.value,onClick:h},{default:r(()=>[U(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ca=me(qa,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Aa={class:"username"},Oa={class:"userinfo"},Ba={class:"info-item"},Da={class:"info-item"},Na={class:"userinfo"},Ra={class:"info-item"},Ha={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ja={key:1},Ea={key:0,class:"empty-wrap"},Ga={key:1},Ka={key:0},Ya={key:1},Qa={key:2},Xa={key:3},Za={key:4},es={key:2},as={key:0},ss={key:1},ts={key:2},ls={key:3},ns={key:4},os={class:"load-more-wrap"},us={class:"load-more-spinner"},is=pe({__name:"User",setup(ue){const A=_a(),y=Qe(),g=Xe(),I="true".toLowerCase()==="true",c=i(!1),h=i(!1),a=Je({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),v=i(!1),L=i(!1),O=i(!1),l=i([]),F=i([]),M=i([]),q=i([]),C=i([]),B=i([]),S=i(g.query.s||""),n=i(+g.query.p||1),p=i("post"),J=i(+g.query.p||1),E=i(1),G=i(1),K=i(1),Y=i(1),w=i(20),_=i(0),Q=i(0),X=i(0),Z=i(0),ee=i(0),ae=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,L.value=!0},he=()=>{h.value=!1,l.value=[],F.value=[],M.value=[],q.value=[],C.value=[],B.value=[],p.value="post",n.value=1,J.value=1,E.value=1,G.value=1,K.value=1,Y.value=1,_.value=0,Q.value=0,X.value=0,Z.value=0,ee.value=0,ae.value=0},ge=()=>{switch(p.value){case"post":j();break;case"comment":se();break;case"highlight":te();break;case"media":le();break;case"star":ne();break}},j=()=>{c.value=!0,V({username:S.value,style:"post",page:n.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(h.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/w.value),F.value=l.value,Q.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,c.value=!1})},se=()=>{c.value=!0,V({username:S.value,style:"comment",page:n.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(h.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/w.value),M.value=l.value,X.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,c.value=!1})},te=()=>{c.value=!0,V({username:S.value,style:"highlight",page:n.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(h.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/w.value),q.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,c.value=!1})},le=()=>{c.value=!0,V({username:S.value,style:"media",page:n.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(h.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/w.value),C.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,c.value=!1})},ne=()=>{c.value=!0,V({username:S.value,style:"star",page:n.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(h.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/w.value),B.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,c.value=!1})},we=e=>{switch(p.value=e,p.value){case"post":l.value=F.value,n.value=J.value,_.value=Q.value,j();break;case"comment":l.value=M.value,n.value=E.value,_.value=X.value,se();break;case"highlight":l.value=q.value,n.value=G.value,_.value=Z.value,te();break;case"media":l.value=C.value,n.value=K.value,_.value=ee.value,le();break;case"star":l.value=B.value,n.value=Y.value,_.value=ae.value,ne();break}},D=()=>{v.value=!0,ea({username:S.value}).then(e=>{v.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,ge()}).catch(e=>{v.value=!1,console.log(e)})},ke=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":E.value=n.value,se();break;case"highlight":G.value=n.value,te();break;case"media":K.value=n.value,le();break;case"star":Y.value=n.value,ne();break}},ye=()=>{L.value=!0},be=()=>{O.value=!0},Pe=()=>{L.value=!1},$e=()=>{O.value=!1},W=e=>()=>_e(ve,null,{default:()=>_e(e)}),xe=Ee(()=>{let e=[{label:"私信",key:"whisper",icon:W($a)}];return y.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:W(de)}):e.push({label:"解封",key:"deblocking",icon:W(de)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:W(xa)}):e.push({label:"关注",key:"follow",icon:W(Ta)}),I&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:W(za)}):e.push({label:"添加朋友",key:"requesting",icon:W(Ua)})),e}),Te=e=>{switch(e){case"whisper":ye();break;case"delete":ze();break;case"requesting":be();break;case"follow":case"unfollow":Ue();break;case"banned":case"deblocking":Ie();break}},ze=()=>{A.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,sa({user_id:a.id}).then(e=>{v.value=!1,a.is_friend=!1,j()}).catch(e=>{v.value=!1,console.log(e)})}})},Ue=()=>{A.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,a.is_following?ta({user_id:a.id}).then(e=>{v.value=!1,window.$message.success("取消关注成功"),D()}).catch(e=>{v.value=!1,console.log(e)}):la({user_id:a.id}).then(e=>{v.value=!1,window.$message.success("关注成功"),D()}).catch(e=>{v.value=!1,console.log(e)})}})},Ie=()=>{A.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,na({id:a.id,status:a.status===1?2:1}).then(e=>{v.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),D()}).catch(e=>{v.value=!1,console.log(e)})}})},Fe=()=>{n.value<_.value||_.value==0?(h.value=!1,n.value++,ke()):h.value=!0};return Ge(()=>{D()}),Ke(()=>({path:g.path,query:g.query}),(e,z)=>{z.path==="/u"&&e.path==="/u"&&(S.value=g.query.s||"",he(),D())}),(e,z)=>{const Me=je,qe=pa,oe=ma,ie=Ye("router-link"),Ce=fe,Se=fa,We=Ve,re=ha,N=ga,Le=wa,Ae=He,Oe=ka,R=Ne,P=ya,H=Re,Be=va,De=da;return s(),u("div",null,[t(Me,{title:"用户详情"}),t(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[t(re,{show:v.value},{default:r(()=>[a.id>0?(s(),u("div",Sa,[f("div",Wa,[t(qe,{size:72,src:a.avatar},null,8,["src"])]),f("div",La,[f("div",Aa,[f("strong",null,T(a.nickname),1),f("span",null," @"+T(a.username),1),I&&k(y).state.userInfo.id>0&&k(y).state.userInfo.username!=a.username&&a.is_friend?(s(),m(oe,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[U(" 好友 ")]),_:1})):d("",!0),k(y).state.userInfo.id>0&&k(y).state.userInfo.username!=a.username&&a.is_following?(s(),m(oe,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[U(" 已关注 ")]),_:1})):d("",!0),a.is_admin?(s(),m(oe,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[U(" 管理员 ")]),_:1})):d("",!0)]),f("div",Oa,[f("span",Ba,"UID. "+T(a.id),1),f("span",Da,T(k(aa)(a.created_on))+" 加入",1)]),f("div",Na,[f("span",Ra,[t(ie,{onClick:z[0]||(z[0]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[U(" 关注  "+T(a.follows),1)]),_:1},8,["to"])]),f("span",Ha,[t(ie,{onClick:z[1]||(z[1]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[U(" 粉丝  "+T(a.followings),1)]),_:1},8,["to"])])])]),k(y).state.userInfo.id>0&&k(y).state.userInfo.username!=a.username?(s(),u("div",Va,[t(Se,{placement:"bottom-end",trigger:"click",size:"small",options:xe.value,onSelect:Te},{default:r(()=>[t(Ce,{quaternary:"",circle:""},{icon:r(()=>[t(k(ve),null,{default:r(()=>[t(k(Pa))]),_:1})]),_:1})]),_:1},8,["options"])])):d("",!0)])):d("",!0),t(We,{show:L.value,user:a,onSuccess:Pe},null,8,["show","user"]),t(Ca,{show:O.value,user:a,onSuccess:$e},null,8,["show","user"])]),_:1},8,["show"]),t(Le,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":we},{default:r(()=>[t(N,{name:"post",tab:"泡泡"}),t(N,{name:"comment",tab:"评论"}),t(N,{name:"highlight",tab:"亮点"}),t(N,{name:"media",tab:"图文"}),t(N,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),c.value&&l.value.length===0?(s(),u("div",ja,[t(Ae,{num:w.value},null,8,["num"])])):(s(),u("div",Ja,[l.value.length===0?(s(),u("div",Ea,[t(Oe,{size:"large",description:"暂无数据"})])):d("",!0),k(y).state.desktopModelShow?(s(),u("div",Ga,[p.value==="post"?(s(),u("div",Ka,[(s(!0),u($,null,x(F.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(R,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="comment"?(s(),u("div",Ya,[(s(!0),u($,null,x(M.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(R,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="highlight"?(s(),u("div",Qa,[(s(!0),u($,null,x(q.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(R,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="media"?(s(),u("div",Xa,[(s(!0),u($,null,x(C.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(R,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="star"?(s(),u("div",Za,[(s(!0),u($,null,x(B.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(R,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0)])):(s(),u("div",es,[p.value==="post"?(s(),u("div",as,[(s(!0),u($,null,x(F.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="comment"?(s(),u("div",ss,[(s(!0),u($,null,x(M.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="highlight"?(s(),u("div",ts,[(s(!0),u($,null,x(q.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="media"?(s(),u("div",ls,[(s(!0),u($,null,x(C.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="star"?(s(),u("div",ns,[(s(!0),u($,null,x(B.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0)]))]))]),_:1}),_.value>0?(s(),m(De,{key:0,justify:"center"},{default:r(()=>[t(k(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:z[2]||(z[2]=o=>Fe())},{spinner:r(()=>[f("div",os,[h.value?d("",!0):(s(),m(re,{key:0,size:14})),f("span",us,T(h.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Ns=me(is,[["__scopeId","data-v-ebc19734"]]);export{Ns as default}; diff --git a/web/dist/assets/User-b21ba7c9.css b/web/dist/assets/User-b21ba7c9.css deleted file mode 100644 index bc185ee1..00000000 --- a/web/dist/assets/User-b21ba7c9.css +++ /dev/null @@ -1 +0,0 @@ -.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-ebc19734]{padding:0 16px}.profile-baseinfo[data-v-ebc19734]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-ebc19734]{width:72px}.profile-baseinfo .base-info[data-v-ebc19734]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-ebc19734]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-ebc19734]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-ebc19734]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-ebc19734]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-ebc19734]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-ebc19734]{margin:20px}.load-more .load-more-wrap[data-v-ebc19734]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-ebc19734]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-ebc19734],.dark .pagination-wrap[data-v-ebc19734]{background-color:#101014bf} diff --git a/web/dist/assets/Wallet-dca40beb.js b/web/dist/assets/Wallet-000501d8.js similarity index 77% rename from web/dist/assets/Wallet-dca40beb.js rename to web/dist/assets/Wallet-000501d8.js index cdfd8e5c..f317f158 100644 --- a/web/dist/assets/Wallet-dca40beb.js +++ b/web/dist/assets/Wallet-000501d8.js @@ -1 +1 @@ -import{_ as J}from"./post-skeleton-5d89319a.js";import{_ as K}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import{d as Q,H as c,b as X,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,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 ne,$ as ae,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{Y as _e,Z as re,$ as ue,a0 as pe,H as de,_ as me}from"./index-537a241d.js";import{Z as ge}from"./@vicons-4ed09704.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-defd0b2d.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-39372edb.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=>(ae("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(()=>n("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Q({__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=K,d=fe,F=ye,f=we,$=ke,L=be,U=J,V=xe,H=Re,M=ve,Y=Ce,Z=Se,j=Ie,G=he;return a(),_("div",null,[e(I,{title:"钱包"}),e(M,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(a(),_("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(()=>[n("div",Ae,[n("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}),n("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?(a(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(a(),_("div",Be,[b.value.length===0?(a(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(H,{key:t.id},{default:o(()=>[n("div",Pe,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("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(j,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(P.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(He=>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?(a(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(Y,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",De,[Ee,n("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",Le,[e(Z,{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 J}from"./post-skeleton-0e77ba18.js";import{_ as K}from"./main-nav.vue_vue_type_style_index_0_lang-d575a251.js";import{d as Q,H as c,b as X,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,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 ne,$ as ae,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{Y as _e,Z as re,$ as ue,a0 as pe,I as de,_ as me}from"./index-fcdbde87.js";import{Z as ge}from"./@vicons-4ed09704.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 Ie,h as Se,H as Re}from"./naive-ui-defd0b2d.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-39372edb.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=>(ae("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(()=>n("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Q({__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),I=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,I.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 S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),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 S=K,d=fe,F=ye,f=we,$=ke,L=be,U=J,V=xe,M=Re,Y=ve,Z=Ce,j=Ie,H=Se,G=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(Y,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[n("div",Ae,[n("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}),n("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?(a(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(a(),_("div",Be,[b.value.length===0?(a(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Pe,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("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(H,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(P.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(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?(a(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(Z,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",De,[Ee,n("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("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-f21e8034.js b/web/dist/assets/content-aa5ad7a4.js similarity index 98% rename from web/dist/assets/content-f21e8034.js rename to web/dist/assets/content-aa5ad7a4.js index d4c89518..ca107836 100644 --- a/web/dist/assets/content-f21e8034.js +++ b/web/dist/assets/content-aa5ad7a4.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 I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{X as V,Y as T}from"./@vicons-4ed09704.js";import{j as $,V as A,W as B,m as U,X as z,e as F,i as L}from"./naive-ui-defd0b2d.js";import{_ as D,T as M,U as O}from"./index-537a241d.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},X={class:"link-txt-wrap"},Y=["href"],q={class:"link-txt"},H=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;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(V))]),_:1}),C("div",X,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",q,I(n.content),1)],8,Y)])]))),128))])}}});const ot=D(H,[["__scopeId","data-v-36eef76b"]]),S={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=B;return l.videos.length>0?(e(),r("div",S,[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)}}}),W={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=U,_=A,f=B,w=z;return e(),r("div",W,[[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=$,t=F,i=L;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(T))]),_:1})]),default:o(()=>[N(" "+I(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=D(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 I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{X as V,Y as T}from"./@vicons-4ed09704.js";import{j as $,V as A,W as B,m as U,X as z,e as F,i as L}from"./naive-ui-defd0b2d.js";import{_ as D,T as M,U as O}from"./index-fcdbde87.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},X={class:"link-txt-wrap"},Y=["href"],q={class:"link-txt"},H=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;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(V))]),_:1}),C("div",X,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",q,I(n.content),1)],8,Y)])]))),128))])}}});const ot=D(H,[["__scopeId","data-v-36eef76b"]]),S={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=B;return l.videos.length>0?(e(),r("div",S,[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)}}}),W={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=U,_=A,f=B,w=z;return e(),r("div",W,[[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=$,t=F,i=L;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(T))]),_:1})]),default:o(()=>[N(" "+I(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=D(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-537a241d.js b/web/dist/assets/index-537a241d.js deleted file mode 100644 index b44c7c21..00000000 --- a/web/dist/assets/index-537a241d.js +++ /dev/null @@ -1 +0,0 @@ -import{d as Y,H as k,R as oe,b as Z,e as w,q as K,w as a,j as y,k as s,f as E,A as U,Z as q,y as N,Y as M,bf as f,c as J,E as Q,r as me,F as se,u as ne,x as A,h as P,a5 as Pe,s as re,l as Oe,ag as Le}from"./@vue-a481fc63.js";import{c as Te,a as Ae,u as pe,b as Ee}from"./vue-router-e5a2430e.js";import{c as Ie,u as B}from"./vuex-44de225f.js";import{a as Re}from"./axios-4a70c6fc.js";import{_ as Ce,N as $e,a as _e,b as he,c as Me,d as Se,e as ge,f as Ue,g as De,h as fe,i as xe,j as W,k as qe,u as Ne,l as Ke,m as Fe,n as Ve,o as ze,p as He,q as We,r as Ye,s as Be,t as je}from"./naive-ui-defd0b2d.js";import{h as D}from"./moment-2ab8298d.js";import{S as Ge,M as Qe,L as Ze,C as Je,B as Xe,P as et,W as tt,a as ot,H as ae,b as le,c as ue}from"./@vicons-4ed09704.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();const st="modulepreload",nt=function(e){return"/"+e},ie={},T=function(t,r,c){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(n=>{if(n=nt(n),n in ie)return;ie[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":st,m||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),m)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},rt=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-7cea53ff.js"),["assets/Home-7cea53ff.js","assets/whisper-7c8226c3.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-1243f33f.js","assets/content-f21e8034.js","assets/@vicons-4ed09704.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-5d89319a.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.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-1731577c.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-e7289232.js"),["assets/Post-e7289232.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-f21e8034.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-5d89319a.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-7c8226c3.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-832ff0ed.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-cb9db946.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-f788b49d.js"),["assets/Topic-f788b49d.js","assets/@vicons-4ed09704.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-832ff0ed.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-4a243149.js"),["assets/Anouncement-4a243149.js","assets/post-skeleton-5d89319a.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-832ff0ed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.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-240ea45a.js"),["assets/Profile-240ea45a.js","assets/whisper-7c8226c3.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-1243f33f.js","assets/content-f21e8034.js","assets/@vicons-4ed09704.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-5d89319a.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.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-3ffb7be9.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-ae210ca8.js"),["assets/User-ae210ca8.js","assets/post-item.vue_vue_type_style_index_0_lang-1243f33f.js","assets/content-f21e8034.js","assets/@vue-a481fc63.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-5d89319a.js","assets/post-skeleton-f1900002.css","assets/whisper-7c8226c3.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.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/User-b21ba7c9.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-31e222da.js"),["assets/Messages-31e222da.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-7c8226c3.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-3c6066fb.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-55aa094f.js"),["assets/Collection-55aa094f.js","assets/whisper-7c8226c3.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-1243f33f.js","assets/content-f21e8034.js","assets/@vicons-4ed09704.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-5d89319a.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-5c3a44e2.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-f763ccad.js"),["assets/Contacts-f763ccad.js","assets/whisper-7c8226c3.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-4ed09704.js","assets/post-skeleton-5d89319a.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-7fa3e0d6.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-4c00cbd6.js"),["assets/Following-4c00cbd6.js","assets/whisper-7c8226c3.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-4ed09704.js","assets/post-skeleton-5d89319a.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-6aa7d36c.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-dca40beb.js"),["assets/Wallet-dca40beb.js","assets/post-skeleton-5d89319a.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-832ff0ed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.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-c02f9e94.js"),["assets/Setting-c02f9e94.js","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-09f9c793.js"),["assets/404-09f9c793.js","assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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"}],ve=Te({history:Ae(),routes:rt});ve.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const at=Ie({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",userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,is_admin:!1}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},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)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),X=Re.create({baseURL:"",timeout:3e4});X.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));X.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 X(e)}const ce=e=>o({method:"post",url:"/v1/auth/login",data:e}),lt=e=>o({method:"post",url:"/v1/auth/register",data:e}),G=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),ut={class:"auth-wrap"},it={key:0},ct=Y({__name:"auth",setup(e){const t=k("true".toLowerCase()==="true"),r=B(),c=k(!1),i=k(),n=oe({username:"",password:""}),m=k(),d=oe({username:"",password:"",repassword:""}),S={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},v=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(I=>{I||(c.value=!0,ce({username:n.username,password:n.password}).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),G(R)}).then(h=>{window.$message.success("登录成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),r.commit("refresh"),n.username="",n.password=""}).catch(h=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(I=>{I||(c.value=!0,lt({username:d.username,password:d.password}).then(h=>ce({username:d.username,password:d.password})).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),G(R)}).then(h=>{window.$message.success("注册成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(h=>{c.value=!1}))})};return Z(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?G(_).then(u=>{r.commit("updateUserinfo",u),r.commit("triggerAuth",!1)}).catch(u=>{r.commit("userLogout")}):r.commit("userLogout")}),(_,u)=>{const I=Ce,h=$e,R=_e,C=he,O=Me,x=Se,l=ge,L=Ue,F=De,H=fe,V=xe;return w(),K(V,{show:f(r).state.authModalShow,"onUpdate:show":u[7]||(u[7]=p=>f(r).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",ut,[s(H,{bordered:!1},{default:a(()=>[t.value?M("",!0):(w(),E("div",it,[s(R,{justify:"center"},{default:a(()=>[s(h,null,{default:a(()=>[s(I,{type:"success"},{default:a(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(O,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[0]||(u[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),K(F,{key:1,"default-value":f(r).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(L,{name:"signin",tab:"登录"},{default:a(()=>[s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(O,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[2]||(u[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(L,{name:"signup",tab:"注册"},{default:a(()=>[s(x,{ref_key:"registerRef",ref:m,model:d,rules:S},{default:a(()=>[s(O,{label:"用户名",path:"username"},{default:a(()=>[s(C,{value:d.username,"onUpdate:value":u[4]||(u[4]=p=>d.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=p=>d.password=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"重复密码",path:"repassword"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=p=>d.repassword=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const we=(e,t)=>{const r=e.__vccOpts||e;for(const[c,i]of t)r[c]=i;return r},dt=we(ct,[["__scopeId","data-v-053dfa44"]]),io=e=>o({method:"get",url:"/v1/posts",params:e}),mt=e=>o({method:"get",url:"/v1/tags",params:e}),co=e=>o({method:"get",url:"/v1/post",params:e}),mo=e=>o({method:"get",url:"/v1/post/star",params:e}),po=e=>o({method:"post",url:"/v1/post/star",data:e}),_o=e=>o({method:"get",url:"/v1/post/collection",params:e}),ho=e=>o({method:"post",url:"/v1/post/collection",data:e}),go=e=>o({method:"get",url:"/v1/post/comments",params:e}),fo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),vo=e=>o({method:"post",url:"/v1/post",data:e}),wo=e=>o({method:"delete",url:"/v1/post",data:e}),yo=e=>o({method:"post",url:"/v1/post/lock",data:e}),bo=e=>o({method:"post",url:"/v1/post/stick",data:e}),ko=e=>o({method:"post",url:"/v1/post/highlight",data:e}),Po=e=>o({method:"post",url:"/v1/post/visibility",data:e}),Oo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Ao=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Eo=e=>o({method:"post",url:"/v1/post/comment",data:e}),Io=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}),$o=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Uo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Do=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),xo=e=>o({method:"post",url:"/v1/captcha",data:e}),qo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),No=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Ko=e=>o({method:"post",url:"/v1/friend/add",data:e}),Fo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Vo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ho=e=>o({method:"get",url:"/v1/user/followings",params:e}),Wo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Yo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),jo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Go=e=>o({method:"post",url:"/v1/user/password",data:e}),Qo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Zo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Jo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),es=e=>o({method:"get",url:"/v1/user/collections",params:e}),ts=e=>o({method:"get",url:"/v1/user/profile",params:e}),os=e=>o({method:"get",url:"/v1/user/posts",params:e}),ss=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ns=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rs=e=>o({method:"get",url:"/v1/user/recharge",params:e}),as=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ls=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),us=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),is=e=>o({method:"get",url:"/v1/attachment",params:e}),cs=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),pt=()=>o({method:"get",url:"/v1/admin/site/status"});D.locale("zh-cn");const _t=e=>D.unix(e).fromNow(),ds=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},ms=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},ps=e=>D.unix(e).utc(!0).format("YYYY年MM月"),ht={key:0,class:"rightbar-wrap"},gt={class:"search-wrap"},ft={class:"post-num"},vt={class:"post-num"},wt={class:"copyright"},yt=["href"],bt=["href"],kt={class:"site-info-item"},Pt=Y({__name:"rightbar",setup(e){const t=k([]),r=k([]),c=k(!1),i=k(""),n=B(),m=pe(),d=k(0),S=k(0),v=k(0),b=k(0),_=k(null),u="2023 paopao.info",I="Roc's Me",h="",R="泡泡(PaoPao)开源社区",C="https://www.paopao.info",O=+"6",x=+"12",l=()=>{pt().then(g=>{d.value=g.register_user_count,S.value=g.online_user_count,v.value=g.history_max_online,b.value=g.server_up_time}).catch(g=>{}),p.disconnect()},L=()=>{c.value=!0,mt({type:"hot_extral",num:x,extral_num:O}).then(g=>{t.value=g.topics,r.value=g.extral_topics??[],V.value=!0,c.value=!1}).catch(g=>{c.value=!1})},F=g=>g>=1e3?(g/1e3).toFixed(1)+"k":g,H=()=>{m.push({name:"home",query:{q:i.value}})},V=J({get:()=>n.state.userLogined&&r.value.length!==0,set:g=>{}});Q(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(g,z)=>{(g.refreshTopicFollow!==z.refreshTopicFollow||g.userLogined)&&L(),n.state.userInfo.is_admin&&l()});const p=new IntersectionObserver(g=>{g.forEach(z=>{z.isIntersecting&&l()})},{root:null,rootMargin:"0px",threshold:1});return Z(()=>{_.value&&p.observe(_.value),L()}),(g,z)=>{const ye=W,be=he,ee=me("router-link"),te=qe,j=fe,ke=_e;return f(n).state.collapsedRight?M("",!0):(w(),E("div",ht,[y("div",gt,[s(be,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":z[0]||(z[0]=$=>i.value=$),onKeyup:q(N(H,["prevent"]),["enter"])},{prefix:a(()=>[s(ye,{component:f(Ge)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),V.value?(w(),K(j,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(r.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",ft,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),s(j,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(t.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",vt,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(j,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",wt,"© "+A(f(u)),1),y("div",null,[s(ke,null,{default:a(()=>[y("a",{href:f(h),target:"_blank",class:"hash-link"},A(f(I)),9,yt),y("a",{href:f(C),target:"_blank",class:"hash-link"},A(f(R)),9,bt)]),_:1})])]),_:1}),f(n).state.userInfo.is_admin?(w(),E("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:_},[y("span",kt,A(d.value)+" 注册用户,"+A(S.value)+" 人在线,最高在线 "+A(v.value)+" 人,站点上线于 "+A(f(_t)(b.value)),1)],512)):M("",!0)]))}}});const Ot=we(Pt,[["__scopeId","data-v-0a6cd0b6"]]),Lt="/assets/logo-52afee68.png",Tt={class:"sidebar-wrap"},At={class:"logo-wrap"},Et={key:0,class:"user-wrap"},It={class:"user-info"},Rt={class:"nickname"},Ct={class:"nickname-txt"},$t={class:"username"},Mt={class:"user-mini-wrap"},St={key:1,class:"user-wrap"},Ut={key:0,class:"login-only-wrap"},Dt={key:1,class:"login-wrap"},xt=Y({__name:"sidebar",setup(e){const t=B(),r=Ee(),c=pe(),i=k(!1),n=k(r.name||""),m=k(),d="true".toLowerCase()==="true",S="false".toLowerCase()==="true",v="false".toLocaleLowerCase()==="true",b=k("true".toLowerCase()==="true"),_=+"5000";Q(r,()=>{n.value=r.name}),Q(t.state,()=>{t.state.userInfo.id>0?m.value||(de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)}),m.value=setInterval(()=>{de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)})},_)):m.value&&clearInterval(m.value)}),Z(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=J(()=>{const l=[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}];return S&&l.push({label:"公告",key:"anouncement",icon:()=>P(Qe),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>P(Ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>P(Je),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>P(Xe),href:"/collection"}),d&&l.push({label:"好友",key:"contacts",icon:()=>P(et),href:"/contacts"}),v&&l.push({label:"钱包",key:"wallet",icon:()=>P(tt),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>P(ot),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}]}),I=l=>"href"in l?P("div",{},l.label):l.label,h=l=>l.key==="messages"?P(Ke,{dot:!0,show:i.value,processing:!0},{default:()=>P(W,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):P(W,null,{default:l.icon}),R=(l,L={})=>{n.value=l,c.push({name:l,query:{t:new Date().getTime()}})},C=()=>{r.path==="/"&&t.commit("refresh"),R("home")},O=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},x=()=>{t.commit("userLogout"),t.commit("refresh"),C()};return window.$store=t,window.$message=Ne(),(l,L)=>{const F=Fe,H=Ve,V=ze,p=ge;return w(),E("div",Tt,[y("div",At,[s(F,{class:"logo-img",width:"36",src:f(Lt),"preview-disabled":!0,onClick:C},null,8,["src"])]),s(H,{accordion:!0,"icon-size":24,options:u.value,"render-label":I,"render-icon":h,value:n.value,"onUpdate:value":R},null,8,["options","value"]),f(t).state.userInfo.id>0?(w(),E("div",Et,[s(V,{class:"user-avatar",round:"",size:34,src:f(t).state.userInfo.avatar},null,8,["src"]),y("div",It,[y("div",Rt,[y("span",Ct,A(f(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:x},{icon:a(()=>[s(f(W),null,{default:a(()=>[s(f(ue))]),_:1})]),_:1})]),y("div",$t,"@"+A(f(t).state.userInfo.username),1)]),y("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:x},{icon:a(()=>[s(f(W),{size:24},{default:a(()=>[s(f(ue))]),_:1})]),_:1})])])):(w(),E("div",St,[b.value?M("",!0):(w(),E("div",Ut,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:L[0]||(L[0]=g=>O("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),b.value?(w(),E("div",Dt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:L[1]||(L[1]=g=>O("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:L[2]||(L[2]=g=>O("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):M("",!0)]))])}}});const qt={"has-sider":"",class:"main-wrap",position:"static"},Nt={key:0},Kt={class:"content-wrap"},Ft=Y({__name:"App",setup(e){const t=B(),r=J(()=>t.state.theme==="dark"?We:null);return(c,i)=>{const n=xt,m=me("router-view"),d=Ot,S=dt,v=Ye,b=Be,_=je,u=He;return w(),K(u,{theme:r.value},{default:a(()=>[s(b,null,{default:a(()=>[s(v,null,{default:a(()=>{var I;return[y("div",{class:Oe(["app-container",{dark:((I=r.value)==null?void 0:I.name)==="dark",mobile:!f(t).state.desktopModelShow}])},[y("div",qt,[f(t).state.desktopModelShow?(w(),E("div",Nt,[s(n)])):M("",!0),y("div",Kt,[s(m,{class:"app-wrap"},{default:a(({Component:h})=>[(w(),K(Pe,null,[c.$route.meta.keepAlive?(w(),K(re(h),{key:0})):M("",!0)],1024)),c.$route.meta.keepAlive?M("",!0):(w(),K(re(h),{key:0}))]),_:1})]),s(d)]),s(S)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});Le(Ft).use(ve).use(at).mount("#app");export{ns as $,ho as A,co as B,go as C,Mo as D,Uo as E,So as F,mt as G,_t as H,ps as I,No as J,ts as K,Yo as L,cs as M,Ko as N,Wo as O,Xo as P,Jo as Q,es as R,ms as S,us as T,is as U,zo as V,Ho as W,qo as X,G as Y,ss as Z,we as _,ls as a,rs as a0,Do as a1,Zo as a2,Go as a3,Bo as a4,jo as a5,Qo as a6,xo as a7,xt as a8,fo as b,vo as c,io as d,os as e,Fo as f,as as g,ds as h,Ao as i,$o as j,Oo as k,Lo as l,Co as m,Io as n,Ro as o,Eo as p,mo as q,_o as r,wo as s,To as t,Vo as u,yo as v,bo as w,ko as x,Po as y,po as z}; diff --git a/web/dist/assets/index-fcdbde87.js b/web/dist/assets/index-fcdbde87.js new file mode 100644 index 00000000..bd67b7f7 --- /dev/null +++ b/web/dist/assets/index-fcdbde87.js @@ -0,0 +1 @@ +import{d as Y,H as k,R as oe,b as Z,e as w,q as K,w as a,j as y,k as s,f as E,A as U,Z as q,y as N,Y as M,bf as f,c as J,E as Q,r as me,F as se,u as ne,x as A,h as P,a5 as Pe,s as re,l as Oe,ag as Le}from"./@vue-a481fc63.js";import{c as Te,a as Ae,u as pe,b as Ee}from"./vue-router-e5a2430e.js";import{c as Ie,u as B}from"./vuex-44de225f.js";import{a as Re}from"./axios-4a70c6fc.js";import{_ as Ce,N as $e,a as _e,b as he,c as Me,d as Se,e as ge,f as Ue,g as De,h as fe,i as xe,j as W,k as qe,u as Ne,l as Ke,m as Fe,n as Ve,o as ze,p as He,q as We,r as Ye,s as Be,t as je}from"./naive-ui-defd0b2d.js";import{h as D}from"./moment-2ab8298d.js";import{S as Ge,M as Qe,L as Ze,C as Je,B as Xe,P as et,W as tt,a as ot,H as ae,b as le,c as ue}from"./@vicons-4ed09704.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();const st="modulepreload",nt=function(e){return"/"+e},ie={},T=function(t,r,c){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(n=>{if(n=nt(n),n in ie)return;ie[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":st,m||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),m)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},rt=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-9031ce9a.js"),["assets/Home-9031ce9a.js","assets/whisper-add-friend-7bcff3b6.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-1cd3d379.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4e8f8831.js","assets/content-aa5ad7a4.js","assets/@vicons-4ed09704.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-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.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-a97c2703.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-3666e80b.js"),["assets/Post-3666e80b.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-aa5ad7a4.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-1cd3d379.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-d575a251.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-cb9db946.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-dec980fd.js"),["assets/Topic-dec980fd.js","assets/@vicons-4ed09704.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-d575a251.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-bee49752.js"),["assets/Anouncement-bee49752.js","assets/post-skeleton-0e77ba18.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-d575a251.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.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-2c2e2db9.js"),["assets/Profile-2c2e2db9.js","assets/whisper-1cd3d379.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-4e8f8831.js","assets/content-aa5ad7a4.js","assets/@vicons-4ed09704.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-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.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-5fc46d20.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-4e887c94.js"),["assets/User-4e887c94.js","assets/post-item.vue_vue_type_style_index_0_lang-4e8f8831.js","assets/content-aa5ad7a4.js","assets/@vue-a481fc63.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/whisper-1cd3d379.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-7bcff3b6.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-4853e1bd.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-49780aa6.js"),["assets/Messages-49780aa6.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-1cd3d379.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-3c6066fb.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-8e3b1ca0.js"),["assets/Collection-8e3b1ca0.js","assets/whisper-1cd3d379.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-4e8f8831.js","assets/content-aa5ad7a4.js","assets/@vicons-4ed09704.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-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-501380ec.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-471a9006.js"),["assets/Contacts-471a9006.js","assets/whisper-1cd3d379.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-4ed09704.js","assets/post-skeleton-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-7fa3e0d6.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-2b4f2830.js"),["assets/Following-2b4f2830.js","assets/whisper-1cd3d379.js","assets/@vue-a481fc63.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-4ed09704.js","assets/post-skeleton-0e77ba18.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-6aa7d36c.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-000501d8.js"),["assets/Wallet-000501d8.js","assets/post-skeleton-0e77ba18.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-d575a251.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-4ed09704.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-79b379f8.js"),["assets/Setting-79b379f8.js","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-e5d5dc43.js"),["assets/404-e5d5dc43.js","assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-4ed09704.js","assets/naive-ui-defd0b2d.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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"}],ve=Te({history:Ae(),routes:rt});ve.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const at=Ie({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",userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,is_admin:!1}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},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)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),X=Re.create({baseURL:"https://okbiu.com",timeout:3e4});X.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));X.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 X(e)}const ce=e=>o({method:"post",url:"/v1/auth/login",data:e}),lt=e=>o({method:"post",url:"/v1/auth/register",data:e}),G=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),ut={class:"auth-wrap"},it={key:0},ct=Y({__name:"auth",setup(e){const t=k("true".toLowerCase()==="true"),r=B(),c=k(!1),i=k(),n=oe({username:"",password:""}),m=k(),d=oe({username:"",password:"",repassword:""}),S={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},v=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(I=>{I||(c.value=!0,ce({username:n.username,password:n.password}).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),G(R)}).then(h=>{window.$message.success("登录成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),r.commit("refresh"),n.username="",n.password=""}).catch(h=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(I=>{I||(c.value=!0,lt({username:d.username,password:d.password}).then(h=>ce({username:d.username,password:d.password})).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),G(R)}).then(h=>{window.$message.success("注册成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(h=>{c.value=!1}))})};return Z(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?G(_).then(u=>{r.commit("updateUserinfo",u),r.commit("triggerAuth",!1)}).catch(u=>{r.commit("userLogout")}):r.commit("userLogout")}),(_,u)=>{const I=Ce,h=$e,R=_e,C=he,O=Me,x=Se,l=ge,L=Ue,F=De,H=fe,V=xe;return w(),K(V,{show:f(r).state.authModalShow,"onUpdate:show":u[7]||(u[7]=p=>f(r).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",ut,[s(H,{bordered:!1},{default:a(()=>[t.value?M("",!0):(w(),E("div",it,[s(R,{justify:"center"},{default:a(()=>[s(h,null,{default:a(()=>[s(I,{type:"success"},{default:a(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(O,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[0]||(u[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),K(F,{key:1,"default-value":f(r).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(L,{name:"signin",tab:"登录"},{default:a(()=>[s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(O,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[2]||(u[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(L,{name:"signup",tab:"注册"},{default:a(()=>[s(x,{ref_key:"registerRef",ref:m,model:d,rules:S},{default:a(()=>[s(O,{label:"用户名",path:"username"},{default:a(()=>[s(C,{value:d.username,"onUpdate:value":u[4]||(u[4]=p=>d.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(O,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=p=>d.password=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(O,{label:"重复密码",path:"repassword"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=p=>d.repassword=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const we=(e,t)=>{const r=e.__vccOpts||e;for(const[c,i]of t)r[c]=i;return r},dt=we(ct,[["__scopeId","data-v-053dfa44"]]),io=e=>o({method:"get",url:"/v1/posts",params:e}),mt=e=>o({method:"get",url:"/v1/tags",params:e}),co=e=>o({method:"get",url:"/v1/post",params:e}),mo=e=>o({method:"get",url:"/v1/post/star",params:e}),po=e=>o({method:"post",url:"/v1/post/star",data:e}),_o=e=>o({method:"get",url:"/v1/post/collection",params:e}),ho=e=>o({method:"post",url:"/v1/post/collection",data:e}),go=e=>o({method:"get",url:"/v1/post/comments",params:e}),fo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),vo=e=>o({method:"post",url:"/v1/post",data:e}),wo=e=>o({method:"delete",url:"/v1/post",data:e}),yo=e=>o({method:"post",url:"/v1/post/lock",data:e}),bo=e=>o({method:"post",url:"/v1/post/stick",data:e}),ko=e=>o({method:"post",url:"/v1/post/highlight",data:e}),Po=e=>o({method:"post",url:"/v1/post/visibility",data:e}),Oo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Ao=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Eo=e=>o({method:"post",url:"/v1/post/comment",data:e}),Io=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}),$o=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Uo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Do=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),xo=e=>o({method:"post",url:"/v1/captcha",data:e}),qo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),No=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Ko=e=>o({method:"post",url:"/v1/friend/add",data:e}),Fo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Vo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ho=e=>o({method:"get",url:"/v1/user/followings",params:e}),Wo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Yo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),jo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Go=e=>o({method:"post",url:"/v1/user/password",data:e}),Qo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Zo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Jo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),es=e=>o({method:"get",url:"/v1/user/collections",params:e}),ts=e=>o({method:"get",url:"/v1/user/profile",params:e}),os=e=>o({method:"get",url:"/v1/user/posts",params:e}),ss=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ns=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rs=e=>o({method:"get",url:"/v1/user/recharge",params:e}),as=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ls=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),us=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),is=e=>o({method:"get",url:"/v1/attachment",params:e}),cs=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),pt=()=>o({method:"get",url:"/v1/admin/site/status"});D.locale("zh-cn");const _t=e=>D.unix(e).fromNow(),ds=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},ms=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},ps=e=>D.unix(e).utc(!0).format("YYYY年MM月"),ht={key:0,class:"rightbar-wrap"},gt={class:"search-wrap"},ft={class:"post-num"},vt={class:"post-num"},wt={class:"copyright"},yt=["href"],bt=["href"],kt={class:"site-info-item"},Pt=Y({__name:"rightbar",setup(e){const t=k([]),r=k([]),c=k(!1),i=k(""),n=B(),m=pe(),d=k(0),S=k(0),v=k(0),b=k(0),_=k(null),u="2023 paopao.info",I="Roc's Me",h="",R="泡泡(PaoPao)开源社区",C="https://www.paopao.info",O=+"6",x=+"12",l=()=>{pt().then(g=>{d.value=g.register_user_count,S.value=g.online_user_count,v.value=g.history_max_online,b.value=g.server_up_time}).catch(g=>{}),p.disconnect()},L=()=>{c.value=!0,mt({type:"hot_extral",num:x,extral_num:O}).then(g=>{t.value=g.topics,r.value=g.extral_topics??[],V.value=!0,c.value=!1}).catch(g=>{c.value=!1})},F=g=>g>=1e3?(g/1e3).toFixed(1)+"k":g,H=()=>{m.push({name:"home",query:{q:i.value}})},V=J({get:()=>n.state.userLogined&&r.value.length!==0,set:g=>{}});Q(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(g,z)=>{(g.refreshTopicFollow!==z.refreshTopicFollow||g.userLogined)&&L(),n.state.userInfo.is_admin&&l()});const p=new IntersectionObserver(g=>{g.forEach(z=>{z.isIntersecting&&l()})},{root:null,rootMargin:"0px",threshold:1});return Z(()=>{_.value&&p.observe(_.value),L()}),(g,z)=>{const ye=W,be=he,ee=me("router-link"),te=qe,j=fe,ke=_e;return f(n).state.collapsedRight?M("",!0):(w(),E("div",ht,[y("div",gt,[s(be,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":z[0]||(z[0]=$=>i.value=$),onKeyup:q(N(H,["prevent"]),["enter"])},{prefix:a(()=>[s(ye,{component:f(Ge)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),V.value?(w(),K(j,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(r.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",ft,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),s(j,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(t.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",vt,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(j,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",wt,"© "+A(f(u)),1),y("div",null,[s(ke,null,{default:a(()=>[y("a",{href:f(h),target:"_blank",class:"hash-link"},A(f(I)),9,yt),y("a",{href:f(C),target:"_blank",class:"hash-link"},A(f(R)),9,bt)]),_:1})])]),_:1}),f(n).state.userInfo.is_admin?(w(),E("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:_},[y("span",kt,A(d.value)+" 注册用户,"+A(S.value)+" 人在线,最高在线 "+A(v.value)+" 人,站点上线于 "+A(f(_t)(b.value)),1)],512)):M("",!0)]))}}});const Ot=we(Pt,[["__scopeId","data-v-0a6cd0b6"]]),Lt="/assets/logo-52afee68.png",Tt={class:"sidebar-wrap"},At={class:"logo-wrap"},Et={key:0,class:"user-wrap"},It={class:"user-info"},Rt={class:"nickname"},Ct={class:"nickname-txt"},$t={class:"username"},Mt={class:"user-mini-wrap"},St={key:1,class:"user-wrap"},Ut={key:0,class:"login-only-wrap"},Dt={key:1,class:"login-wrap"},xt=Y({__name:"sidebar",setup(e){const t=B(),r=Ee(),c=pe(),i=k(!1),n=k(r.name||""),m=k(),d="true".toLowerCase()==="true",S="false".toLowerCase()==="true",v="false".toLocaleLowerCase()==="true",b=k("true".toLowerCase()==="true"),_=+"5000";Q(r,()=>{n.value=r.name}),Q(t.state,()=>{t.state.userInfo.id>0?m.value||(de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)}),m.value=setInterval(()=>{de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)})},_)):m.value&&clearInterval(m.value)}),Z(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=J(()=>{const l=[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}];return S&&l.push({label:"公告",key:"anouncement",icon:()=>P(Qe),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>P(Ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>P(Je),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>P(Xe),href:"/collection"}),d&&l.push({label:"好友",key:"contacts",icon:()=>P(et),href:"/contacts"}),v&&l.push({label:"钱包",key:"wallet",icon:()=>P(tt),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>P(ot),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}]}),I=l=>"href"in l?P("div",{},l.label):l.label,h=l=>l.key==="messages"?P(Ke,{dot:!0,show:i.value,processing:!0},{default:()=>P(W,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):P(W,null,{default:l.icon}),R=(l,L={})=>{n.value=l,c.push({name:l,query:{t:new Date().getTime()}})},C=()=>{r.path==="/"&&t.commit("refresh"),R("home")},O=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},x=()=>{t.commit("userLogout"),t.commit("refresh"),C()};return window.$store=t,window.$message=Ne(),(l,L)=>{const F=Fe,H=Ve,V=ze,p=ge;return w(),E("div",Tt,[y("div",At,[s(F,{class:"logo-img",width:"36",src:f(Lt),"preview-disabled":!0,onClick:C},null,8,["src"])]),s(H,{accordion:!0,"icon-size":24,options:u.value,"render-label":I,"render-icon":h,value:n.value,"onUpdate:value":R},null,8,["options","value"]),f(t).state.userInfo.id>0?(w(),E("div",Et,[s(V,{class:"user-avatar",round:"",size:34,src:f(t).state.userInfo.avatar},null,8,["src"]),y("div",It,[y("div",Rt,[y("span",Ct,A(f(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:x},{icon:a(()=>[s(f(W),null,{default:a(()=>[s(f(ue))]),_:1})]),_:1})]),y("div",$t,"@"+A(f(t).state.userInfo.username),1)]),y("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:x},{icon:a(()=>[s(f(W),{size:24},{default:a(()=>[s(f(ue))]),_:1})]),_:1})])])):(w(),E("div",St,[b.value?M("",!0):(w(),E("div",Ut,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:L[0]||(L[0]=g=>O("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),b.value?(w(),E("div",Dt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:L[1]||(L[1]=g=>O("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:L[2]||(L[2]=g=>O("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):M("",!0)]))])}}});const qt={"has-sider":"",class:"main-wrap",position:"static"},Nt={key:0},Kt={class:"content-wrap"},Ft=Y({__name:"App",setup(e){const t=B(),r=J(()=>t.state.theme==="dark"?We:null);return(c,i)=>{const n=xt,m=me("router-view"),d=Ot,S=dt,v=Ye,b=Be,_=je,u=He;return w(),K(u,{theme:r.value},{default:a(()=>[s(b,null,{default:a(()=>[s(v,null,{default:a(()=>{var I;return[y("div",{class:Oe(["app-container",{dark:((I=r.value)==null?void 0:I.name)==="dark",mobile:!f(t).state.desktopModelShow}])},[y("div",qt,[f(t).state.desktopModelShow?(w(),E("div",Nt,[s(n)])):M("",!0),y("div",Kt,[s(m,{class:"app-wrap"},{default:a(({Component:h})=>[(w(),K(Pe,null,[c.$route.meta.keepAlive?(w(),K(re(h),{key:0})):M("",!0)],1024)),c.$route.meta.keepAlive?M("",!0):(w(),K(re(h),{key:0}))]),_:1})]),s(d)]),s(S)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});Le(Ft).use(ve).use(at).mount("#app");export{ns as $,po as A,ho as B,co as C,go as D,Mo as E,Uo as F,So as G,mt as H,_t as I,ps as J,ts as K,cs as L,No as M,Ko as N,Wo as O,Xo as P,Jo as Q,es as R,ms as S,us as T,is as U,zo as V,Ho as W,qo as X,G as Y,ss as Z,we as _,ls as a,rs as a0,Do as a1,Zo as a2,Go as a3,Bo as a4,jo as a5,Qo as a6,xo as a7,xt as a8,fo as b,vo as c,io as d,os as e,Fo as f,as as g,Yo as h,ds as i,Ao as j,$o as k,Oo as l,Lo as m,Co as n,Io as o,Ro as p,Eo as q,mo as r,_o as s,To as t,Vo as u,wo as v,yo as w,bo as x,ko as y,Po as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js index 12659db2..72d12d63 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-d575a251.js @@ -1 +1 @@ -import{a8 as A}from"./index-537a241d.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{$ as C,a0 as N,a1 as P,a2 as D}from"./@vicons-4ed09704.js";import{u as R,a3 as $,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-defd0b2d.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=$,M=x,r=H,p=I,O=V,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{a8 as A}from"./index-fcdbde87.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{$ as C,a0 as N,a1 as P,a2 as D}from"./@vicons-4ed09704.js";import{u as R,a3 as $,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-defd0b2d.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=$,M=x,r=H,p=I,O=V,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-1243f33f.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-1243f33f.js deleted file mode 100644 index 6050e866..00000000 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-1243f33f.js +++ /dev/null @@ -1 +0,0 @@ -import{p as F,a as V,_ as G,b as R,c as W}from"./content-f21e8034.js";import{d as Y,c as C,r as J,e as a,f as b,k as n,al as K,w as s,j as u,F as Q,u as U,y as d,bf as l,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{S as ee,z as te,A as oe}from"./index-537a241d.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,G as ce,x as re,q as pe}from"./@vicons-4ed09704.js";import{j as v,o as _e,M as me,e as de,P as ve,a as he,O as fe}from"./naive-ui-defd0b2d.js";const ge={class:"post-item"},ke={class:"nickname-wrap"},ye={class:"username-wrap"},we={class:"timestamp-mobile"},be={class:"item-header-extra"},xe=["innerHTML"],Ce=["onClick"],$e=["onClick"],Ne=Y({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addExtraAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(z,{emit:g}){const i=z,k=Z(),q=X(),h=t=>()=>$(v,null,{default:()=>$(t)}),O=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:h(ue)}),!i.isOwner&&i.addExtraAction&&(i.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:h(ce)}):t.push({label:"关注",key:"follow",icon:h(re)})),t.push({label:"复制链接",key:"copyTweetLink",icon:h(pe)}),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":g("send-whisper",i.post.user);break;case"delete":case"requesting":g("handle-friend-action",i.post);break;case"follow":case"unfollow":g("handle-follow-action",i.post);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.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=>{i.post.upvote_count=t.upvote_count,i.post.collection_count=t.collection_count}}),P=()=>{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)})},S=()=>{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=>{k.push({name:"post",query:{id:t}})},B=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?k.push({name:"home",query:{q:m[1],t:"tag"}}):k.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=_e,L=J("router-link"),w=me,A=de,M=ve,x=V,j=G,D=R,H=W,E=he,I=fe;return a(),b("div",ge,[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ke,[n(L,{onClick:o[0]||(o[0]=d(()=>{},["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",ye," @"+_(e.value.user.username),1),e.value.is_top?(a(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(a(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(a(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",we,_(l(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",be,[n(M,{placement:"bottom-end",trigger:"click",size:"small",options:O.value,onSelect:T},{default:s(()=>[n(A,{quaternary:"",circle:""},{icon:s(()=>[n(l(v),null,{default:s(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(a(),c(x,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(a(),c(x,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(a(),c(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(a(),c(D,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(a(),c(H,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(E,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:d(P,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Ce),u("div",{class:"opt-item",onClick:o[3]||(o[3]=d(f=>y(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:d(S,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,$e)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(a(!0),b(Q,null,U(e.value.texts,f=>(a(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=d(N=>B(N,e.value.id),["stop"])),innerHTML:l(F)(f.content).content},null,8,xe))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},qe={class:"username-wrap"},Oe={class:"item-header-extra"},Te={class:"timestamp"},Pe=["innerHTML"],Se=["onClick"],Be=["onClick"],Fe=Y({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addExtraAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(z,{emit:g}){const i=z,k=Z(),q=X(),h=t=>()=>$(v,null,{default:()=>$(t)}),O=C(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:h(ue)}),!i.isOwner&&i.addExtraAction&&(i.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:h(ce)}):t.push({label:"关注",key:"follow",icon:h(re)})),t.push({label:"复制链接",key:"copyTweetLink",icon:h(pe)}),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":g("send-whisper",i.post.user);break;case"delete":case"requesting":g("handle-friend-action",i.post);break;case"follow":case"unfollow":g("handle-follow-action",i.post);break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.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=>{i.post.upvote_count=t.upvote_count,i.post.collection_count=t.collection_count}}),P=()=>{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)})},S=()=>{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=>{k.push({name:"post",query:{id:t}})},B=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?k.push({name:"home",query:{q:m[1],t:"tag"}}):k.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=_e,L=J("router-link"),w=me,A=de,M=ve,x=V,j=G,D=R,H=W,E=he,I=fe;return a(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(L,{onClick:o[0]||(o[0]=d(()=>{},["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",qe," @"+_(e.value.user.username),1),e.value.is_top?(a(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(a(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(a(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Oe,[u("span",Te,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(l(ee)(e.value.created_on)),1),n(M,{placement:"bottom-end",trigger:"hover",size:"small",options:O.value,onSelect:T},{default:s(()=>[n(A,{quaternary:"",circle:""},{icon:s(()=>[n(l(v),null,{default:s(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(a(),c(x,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(a(),c(x,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(a(),c(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(a(),c(D,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(a(),c(H,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(E,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:d(P,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Se),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=d(f=>y(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:d(S,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Be)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(a(!0),b(Q,null,U(e.value.texts,f=>(a(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=d(N=>B(N,e.value.id),["stop"])),innerHTML:l(F)(f.content).content},null,8,Pe))),128))]),key:"0"}:void 0]),1024)])}}});export{Fe as _,Ne as a}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4e8f8831.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4e8f8831.js new file mode 100644 index 00000000..8e3711a2 --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4e8f8831.js @@ -0,0 +1 @@ +import{p as R,a as V,_ as E,b as G,c as J}from"./content-aa5ad7a4.js";import{d as K,c as C,r as W,e as l,f as b,k as n,al as Y,w as s,j as u,F as Q,u as U,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{S as ee,A as te,B as oe}from"./index-fcdbde87.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,G as ce,x as re,J as pe,K as _e,q as de}from"./@vicons-4ed09704.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-defd0b2d.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},xe={class:"timestamp-mobile"},Ce={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=K({__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=C(()=>{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=C({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}}),P=()=>{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)})},A=()=>{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}})},B=(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=W("router-link"),w=ve,S=he,L=fe,x=V,M=E,j=G,D=J,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},Y({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",xe,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",Ce,[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(x,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(x,{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(P,["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(A,["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(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>B(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"},Pe={class:"item-header-extra"},Ae={class:"timestamp"},Be=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=K({__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=C(()=>{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=C({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}}),P=()=>{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)})},A=()=>{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}})},B=(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=W("router-link"),w=ve,S=he,L=fe,x=V,M=E,j=G,D=J,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":""},Y({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",Pe,[u("span",Ae,_(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(x,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(x,{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(P,["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(A,["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(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>B(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Be))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; diff --git a/web/dist/assets/post-skeleton-5d89319a.js b/web/dist/assets/post-skeleton-0e77ba18.js similarity index 88% rename from web/dist/assets/post-skeleton-5d89319a.js rename to web/dist/assets/post-skeleton-0e77ba18.js index 396e3154..fd40d085 100644 --- a/web/dist/assets/post-skeleton-5d89319a.js +++ b/web/dist/assets/post-skeleton-0e77ba18.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-defd0b2d.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-537a241d.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-defd0b2d.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-fcdbde87.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-7c8226c3.js b/web/dist/assets/whisper-1cd3d379.js similarity index 63% rename from web/dist/assets/whisper-7c8226c3.js rename to web/dist/assets/whisper-1cd3d379.js index 0da54e38..234a39eb 100644 --- a/web/dist/assets/whisper-7c8226c3.js +++ b/web/dist/assets/whisper-1cd3d379.js @@ -1 +1 @@ -import{X as b,_ as k}from"./index-537a241d.js";import{S as B,I as C,T as N,b as U,e as V,i as $}from"./naive-ui-defd0b2d.js";import{d as z,H as p,e as I,q as R,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=z({__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=B,w=C,f=N,v=U,g=V,y=$;return I(),R(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{X as b,_ as k}from"./index-fcdbde87.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 z,b as I,e as R,i as S}from"./naive-ui-defd0b2d.js";const T={class:"whisper-wrap"},W={class:"whisper-line"},$={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=z,v=I,g=R,y=S;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",T,[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",W,[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",$,[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-01aea97d.css b/web/dist/assets/whisper-add-friend-01aea97d.css new file mode 100644 index 00000000..1d423c25 --- /dev/null +++ b/web/dist/assets/whisper-add-friend-01aea97d.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf} diff --git a/web/dist/assets/whisper-add-friend-7bcff3b6.js b/web/dist/assets/whisper-add-friend-7bcff3b6.js new file mode 100644 index 00000000..e6ec5986 --- /dev/null +++ b/web/dist/assets/whisper-add-friend-7bcff3b6.js @@ -0,0 +1 @@ +import{M as b,_ as k}from"./index-fcdbde87.js";import{S as B,I as A,T as C,b as F,e as N,i as V}from"./naive-ui-defd0b2d.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"},M={class:"whisper-line"},R={class:"whisper-line send-wrap"},S=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=A,f=C,g=F,v=N,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",M,[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",R,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const D=k(S,[["__scopeId","data-v-60be56a2"]]);export{D as W}; diff --git a/web/dist/index.html b/web/dist/index.html index ac1fdcb5..4f3ac044 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/mobile-post-item.vue b/web/src/components/mobile-post-item.vue index 6ce6a2ba..e8291931 100644 --- a/web/src/components/mobile-post-item.vue +++ b/web/src/components/mobile-post-item.vue @@ -158,7 +158,8 @@ const store = useStore(); const props = withDefaults(defineProps<{ post: Item.PostProps, isOwner: boolean, - addExtraAction: boolean, + addFriendAction: boolean, + addFollowAction: boolean, }>(), {}); const emit = defineEmits<{ @@ -177,20 +178,14 @@ const renderIcon = (icon: Component) => { const tweetOptions = computed(() => { let options: DropdownOption[] = []; - // TODO: f*k 为什么这里会卡? - // if (store.state.userinfo.id > 0) { - // options.push({ - // label: '私信', - // key: 'whisper', - // icon: renderIcon(PaperPlaneOutline) - // }); - // } - options.push({ - label: '私信', - key: 'whisper', - icon: renderIcon(PaperPlaneOutline) - }); - if (!props.isOwner && props.addExtraAction) { + if (!props.isOwner) { + options.push({ + label: '私信', + key: 'whisper', + icon: renderIcon(PaperPlaneOutline) + }); + } + if (!props.isOwner && props.addFollowAction) { if (props.post.user.is_following) { options.push({ label: '取消关注', @@ -204,19 +199,21 @@ const tweetOptions = computed(() => { icon: renderIcon(BodyOutline) }) } - // if (props.post.user.is_friend) { - // options.push({ - // label: '删除好友', - // key: 'delete', - // icon: renderIcon(PersonRemoveOutline) - // }); - // } else { - // options.push({ - // label: '添加朋友', - // key: 'requesting', - // icon: renderIcon(PersonAddOutline) - // }); - // } + } + if (!props.isOwner && props.addFriendAction) { + if (props.post.user.is_friend) { + options.push({ + label: '删除好友', + key: 'delete', + icon: renderIcon(PersonRemoveOutline) + }); + } else { + options.push({ + label: '添加朋友', + key: 'requesting', + icon: renderIcon(PersonAddOutline) + }); + } } options.push({ label: '复制链接', diff --git a/web/src/components/post-item.vue b/web/src/components/post-item.vue index 1aa1d9d3..25deea70 100644 --- a/web/src/components/post-item.vue +++ b/web/src/components/post-item.vue @@ -156,7 +156,8 @@ const store = useStore(); const props = withDefaults(defineProps<{ post: Item.PostProps, isOwner: boolean, - addExtraAction: boolean, + addFriendAction: boolean, + addFollowAction: boolean, }>(), {}); const emit = defineEmits<{ @@ -175,20 +176,14 @@ const renderIcon = (icon: Component) => { const tweetOptions = computed(() => { let options: DropdownOption[] = []; - // TODO: f*k 为什么这里会卡? - // if (store.state.userinfo.id > 0) { - // options.push({ - // label: '私信', - // key: 'whisper', - // icon: renderIcon(PaperPlaneOutline) - // }); - // } - options.push({ - label: '私信', - key: 'whisper', - icon: renderIcon(PaperPlaneOutline) - }); - if (!props.isOwner && props.addExtraAction) { + if (!props.isOwner) { + options.push({ + label: '私信', + key: 'whisper', + icon: renderIcon(PaperPlaneOutline) + }); + } + if (!props.isOwner && props.addFollowAction) { if (props.post.user.is_following) { options.push({ label: '取消关注', @@ -202,19 +197,21 @@ const tweetOptions = computed(() => { icon: renderIcon(BodyOutline) }) } - // if (props.post.user.is_friend) { - // options.push({ - // label: '删除好友', - // key: 'delete', - // icon: renderIcon(PersonRemoveOutline) - // }); - // } else { - // options.push({ - // label: '添加朋友', - // key: 'requesting', - // icon: renderIcon(PersonAddOutline) - // }); - // } + } + if (!props.isOwner && props.addFriendAction) { + if (props.post.user.is_friend) { + options.push({ + label: '删除好友', + key: 'delete', + icon: renderIcon(PersonRemoveOutline) + }); + } else { + options.push({ + label: '添加朋友', + key: 'requesting', + icon: renderIcon(PersonAddOutline) + }); + } } options.push({ label: '复制链接', diff --git a/web/src/views/Collection.vue b/web/src/views/Collection.vue index 404f49c2..15c9a6a3 100644 --- a/web/src/views/Collection.vue +++ b/web/src/views/Collection.vue @@ -13,12 +13,20 @@
- +
- +
@@ -40,10 +48,12 @@ import { ref, onMounted } from 'vue'; import { useStore } from 'vuex'; import { useRoute } from 'vue-router'; -import { getCollections } from '@/api/user'; +import { useDialog } from 'naive-ui'; +import { getCollections, followUser, unfollowUser } from '@/api/user'; const store = useStore(); const route = useRoute(); +const dialog = useDialog(); const loading = ref(false); const list = ref([]); @@ -74,6 +84,35 @@ const whisperSuccess = () => { showWhisper.value = false; }; +const onHandleFollowAction = (post: Item.PostProps) => { + dialog.success({ + title: '提示', + content: + '确定' + (post.user.is_following ? '取消关注' : '关注') + '该用户吗?', + positiveText: '确定', + negativeText: '取消', + onPositiveClick: () => { + if (post.user.is_following) { + unfollowUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('操作成功'); + post.user.is_following = false; + }) + .catch((_err) => {}); + } else { + followUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('关注成功'); + post.user.is_following = true; + }) + .catch((_err) => {}); + } + }, + }); +}; + const loadPosts = () => { loading.value = true; getCollections({ diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 2dca3545..3cce4053 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -41,26 +41,28 @@
+ @handle-follow-action="onHandleFollowAction" + @handle-friend-action="onHandleFriendAction" />
+ @handle-follow-action="onHandleFollowAction" + @handle-friend-action="onHandleFriendAction" />
- + diff --git a/web/src/views/Profile.vue b/web/src/views/Profile.vue index 6ea16e16..18bb6124 100644 --- a/web/src/views/Profile.vue +++ b/web/src/views/Profile.vue @@ -77,54 +77,94 @@
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -150,12 +190,14 @@ import { ref, onMounted, watch } from 'vue'; import { useStore } from 'vuex'; import { useRoute } from 'vue-router'; -import { getUserPosts } from '@/api/user'; +import { useDialog } from 'naive-ui'; +import { getUserPosts, followUser, unfollowUser } from '@/api/user'; import { formatDate } from '@/utils/formatTime'; import InfiniteLoading from "v3-infinite-loading"; const store = useStore(); const route = useRoute(); +const dialog = useDialog(); const loading = ref(false); const noMore = ref(false); const list = ref([]); @@ -202,6 +244,35 @@ const whisperSuccess = () => { showWhisper.value = false; }; +const onHandleFollowAction = (post: Item.PostProps) => { + dialog.success({ + title: '提示', + content: + '确定' + (post.user.is_following ? '取消关注' : '关注') + '该用户吗?', + positiveText: '确定', + negativeText: '取消', + onPositiveClick: () => { + if (post.user.is_following) { + unfollowUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('操作成功'); + post.user.is_following = false; + }) + .catch((_err) => {}); + } else { + followUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('关注成功'); + post.user.is_following = true; + }) + .catch((_err) => {}); + } + }, + }); +}; + const loadPage = () => { switch(pageType.value) { case "post": diff --git a/web/src/views/User.vue b/web/src/views/User.vue index 0a68ae5f..a3d58648 100644 --- a/web/src/views/User.vue +++ b/web/src/views/User.vue @@ -104,54 +104,94 @@
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -246,6 +286,35 @@ const onSendWhisper = (receiver: Item.UserInfo) => { showWhisper.value = true; }; +const onHandleFollowAction = (post: Item.PostProps) => { + dialog.success({ + title: '提示', + content: + '确定' + (post.user.is_following ? '取消关注' : '关注') + '该用户吗?', + positiveText: '确定', + negativeText: '取消', + onPositiveClick: () => { + if (post.user.is_following) { + unfollowUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('操作成功'); + post.user.is_following = false; + }) + .catch((_err) => {}); + } else { + followUser({ + user_id: post.user.id, + }).then((_res) => { + window.$message.success('关注成功'); + post.user.is_following = true; + }) + .catch((_err) => {}); + } + }, + }); +}; + const reset = () => { noMore.value = false; list.value = [];