From c7c68770b5302d24d4281e55f33543b374895024 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 19 Sep 2023 15:59:28 +0800 Subject: [PATCH] optimize get post comment logic --- internal/core/comments.go | 3 +-- .../cs/{comment_thumbs.go => comments.go} | 8 ++++++ internal/dao/jinzhu/comments.go | 22 ++++++++++++++-- internal/model/web/loose.go | 26 +++++++++++++++---- internal/servants/web/loose.go | 18 +------------ .../{404-7c70356e.js => 404-e41e3193.js} | 2 +- ...nt-21a92532.js => Anouncement-2531033c.js} | 2 +- ...ion-b826e3a0.js => Collection-6b9226c9.js} | 2 +- ...tacts-ed0b9b43.js => Contacts-cf96d2d4.js} | 2 +- ...wing-53d3b5dc.js => Following-3b99fb7a.js} | 2 +- .../{Home-fc24bae7.js => Home-0ca93a27.js} | 2 +- ...sages-5c4e999b.js => Messages-8ba7b532.js} | 2 +- .../{Post-c15711ff.js => Post-8403b241.js} | 2 +- .../{Post-0b1f6baf.css => Post-8fdcb727.css} | 2 +- ...rofile-bdfe7ab1.js => Profile-6e748e2f.js} | 2 +- ...etting-eb815798.js => Setting-bde8e499.js} | 2 +- .../{Topic-2c2b98aa.js => Topic-a63673d1.js} | 2 +- .../{User-606a2446.js => User-9ecd5433.js} | 2 +- ...{Wallet-cd5136fb.js => Wallet-22a3cef6.js} | 2 +- ...ontent-ebf88604.js => content-0e30acaf.js} | 2 +- .../{index-121dfc2d.js => index-4a465428.js} | 2 +- ...e_vue_type_style_index_0_lang-2982e04a.js} | 2 +- ...e_vue_type_style_index_0_lang-a5e9cab2.js} | 2 +- ...-f6905e5e.js => post-skeleton-4d2b103e.js} | 2 +- ...hisper-1cdd2a38.js => whisper-7dcedd50.js} | 2 +- web/dist/index.html | 2 +- web/src/types/NetParams.d.ts | 2 +- web/src/views/Post.vue | 6 ++--- 28 files changed, 76 insertions(+), 51 deletions(-) rename internal/core/cs/{comment_thumbs.go => comments.go} (82%) rename web/dist/assets/{404-7c70356e.js => 404-e41e3193.js} (85%) rename web/dist/assets/{Anouncement-21a92532.js => Anouncement-2531033c.js} (91%) rename web/dist/assets/{Collection-b826e3a0.js => Collection-6b9226c9.js} (84%) rename web/dist/assets/{Contacts-ed0b9b43.js => Contacts-cf96d2d4.js} (92%) rename web/dist/assets/{Following-53d3b5dc.js => Following-3b99fb7a.js} (95%) rename web/dist/assets/{Home-fc24bae7.js => Home-0ca93a27.js} (98%) rename web/dist/assets/{Messages-5c4e999b.js => Messages-8ba7b532.js} (97%) rename web/dist/assets/{Post-c15711ff.js => Post-8403b241.js} (87%) rename web/dist/assets/{Post-0b1f6baf.css => Post-8fdcb727.css} (94%) rename web/dist/assets/{Profile-bdfe7ab1.js => Profile-6e748e2f.js} (95%) rename web/dist/assets/{Setting-eb815798.js => Setting-bde8e499.js} (98%) rename web/dist/assets/{Topic-2c2b98aa.js => Topic-a63673d1.js} (97%) rename web/dist/assets/{User-606a2446.js => User-9ecd5433.js} (97%) rename web/dist/assets/{Wallet-cd5136fb.js => Wallet-22a3cef6.js} (95%) rename web/dist/assets/{content-ebf88604.js => content-0e30acaf.js} (98%) rename web/dist/assets/{index-121dfc2d.js => index-4a465428.js} (90%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-03282050.js => main-nav.vue_vue_type_style_index_0_lang-2982e04a.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-e778d128.js => post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js} (98%) rename web/dist/assets/{post-skeleton-f6905e5e.js => post-skeleton-4d2b103e.js} (88%) rename web/dist/assets/{whisper-1cdd2a38.js => whisper-7dcedd50.js} (95%) diff --git a/internal/core/comments.go b/internal/core/comments.go index cf917a82..c4b8dac9 100644 --- a/internal/core/comments.go +++ b/internal/core/comments.go @@ -11,9 +11,8 @@ import ( // CommentService 评论检索服务 type CommentService interface { - GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) + GetComments(tweetId int64, style cs.StyleCommentType, limit int, offset int) ([]*ms.Comment, int64, error) GetCommentByID(id int64) (*ms.Comment, error) - GetCommentCount(conditions *ms.ConditionsT) (int64, error) GetCommentReplyByID(id int64) (*ms.CommentReply, error) GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error) diff --git a/internal/core/cs/comment_thumbs.go b/internal/core/cs/comments.go similarity index 82% rename from internal/core/cs/comment_thumbs.go rename to internal/core/cs/comments.go index cb6f7d0d..84a287b0 100644 --- a/internal/core/cs/comment_thumbs.go +++ b/internal/core/cs/comments.go @@ -4,6 +4,14 @@ package cs +const ( + StyleCommentDefault StyleCommentType = iota + StyleCommentHots + StyleCommentNewest +) + +type StyleCommentType uint8 + type CommentThumbs struct { UserID int64 `json:"user_id"` TweetID int64 `json:"tweet_id"` diff --git a/internal/dao/jinzhu/comments.go b/internal/dao/jinzhu/comments.go index 4ac08e18..e4d9debf 100644 --- a/internal/dao/jinzhu/comments.go +++ b/internal/dao/jinzhu/comments.go @@ -60,8 +60,26 @@ func (s *commentSrv) GetCommentThumbsMap(userId int64, tweetId int64) (cs.Commen return commentThumbs, replyThumbs, nil } -func (s *commentSrv) GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) { - return (&dbr.Comment{}).List(s.db, conditions, offset, limit) +func (s *commentSrv) GetComments(tweetId int64, style cs.StyleCommentType, limit int, offset int) (res []*ms.Comment, total int64, err error) { + // TODO: 需要优化一下,更精细的调整评论排序策略 + sort := "id ASC" + switch style { + case cs.StyleCommentHots: + // TOOD: 暂时简单排序,后续需要根据 rank_score=评论回复数*2+点赞*4-点踩, order byrank_score DESC + sort = "thumbs_up_count DESC, id DESC" + case cs.StyleCommentNewest: + sort = "id DESC" + case cs.StyleCommentDefault: + fallthrough + default: + // sort = "id ASC" + } + db := s.db.Table(_comment_).Where("post_id=?", tweetId) + if err = db.Count(&total).Error; err != nil { + return + } + err = db.Order(sort).Limit(limit).Offset(offset).Find(&res).Error + return } func (s *commentSrv) GetCommentByID(id int64) (*ms.Comment, error) { diff --git a/internal/model/web/loose.go b/internal/model/web/loose.go index 83d426ac..50b1502a 100644 --- a/internal/model/web/loose.go +++ b/internal/model/web/loose.go @@ -35,12 +35,14 @@ const ( type TagType = cs.TagType +type CommentStyleType string + type TweetCommentsReq struct { - SimpleInfo `form:"-" binding:"-"` - TweetId int64 `form:"id" binding:"required"` - SortStrategy string `form:"sort_strategy"` - Page int `form:"-" binding:"-"` - PageSize int `form:"-" binding:"-"` + SimpleInfo `form:"-" binding:"-"` + TweetId int64 `form:"id" binding:"required"` + Style CommentStyleType `form:"style"` + Page int `form:"-" binding:"-"` + PageSize int `form:"-" binding:"-"` } type TweetCommentsResp base.PageResp @@ -121,3 +123,17 @@ func (r *TimelineReq) Bind(c *gin.Context) mir.Error { r.Query, r.Type, r.Style = c.Query("query"), "search", c.Query("style") return nil } + +func (s CommentStyleType) ToInnerValue() (res cs.StyleCommentType) { + switch s { + case "hots": + res = cs.StyleCommentHots + case "newest": + res = cs.StyleCommentNewest + case "default": + fallthrough + default: + res = cs.StyleCommentDefault + } + return +} diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index 40bc3c93..dc04382e 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -364,20 +364,7 @@ func (s *looseSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Err } func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { - // TODO: 需要优化一下,更精细的调整评论排序策略 - sort := "id ASC" - if req.SortStrategy == "newest" { - sort = "id DESC" - } else if req.SortStrategy == "hots" { - // TOOD: 暂时简单排序,后续需要根据 rank_score=评论回复数*2+点赞*4-点踩, order byrank_score DESC - sort = "thumbs_up_count DESC, id DESC" - } - conditions := &ms.ConditionsT{ - "post_id": req.TweetId, - "ORDER": sort, - } - - comments, err := s.Ds.GetComments(conditions, (req.Page-1)*req.PageSize, req.PageSize) + comments, totalRows, err := s.Ds.GetComments(req.TweetId, req.Style.ToInnerValue(), req.PageSize, (req.Page-1)*req.PageSize) if err != nil { return nil, web.ErrGetCommentsFailed } @@ -447,9 +434,6 @@ func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsR } commentsFormated = append(commentsFormated, commentFormated) } - - // 获取总量 - totalRows, _ := s.Ds.GetCommentCount(conditions) resp := base.PageRespFrom(commentsFormated, req.Page, req.PageSize, totalRows) return (*web.TweetCommentsResp)(resp), nil } diff --git a/web/dist/assets/404-7c70356e.js b/web/dist/assets/404-e41e3193.js similarity index 85% rename from web/dist/assets/404-7c70356e.js rename to web/dist/assets/404-e41e3193.js index fa63ac22..044017e5 100644 --- a/web/dist/assets/404-7c70356e.js +++ b/web/dist/assets/404-e41e3193.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{u as i}from"./vue-router-e5a2430e.js";import{F as a,e as c,a2 as u}from"./naive-ui-d8de3dda.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-121dfc2d.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.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-2982e04a.js";import{u as i}from"./vue-router-e5a2430e.js";import{F as a,e as c,a2 as u}from"./naive-ui-d8de3dda.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-4a465428.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.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-21a92532.js b/web/dist/assets/Anouncement-2531033c.js similarity index 91% rename from web/dist/assets/Anouncement-21a92532.js rename to web/dist/assets/Anouncement-2531033c.js index c8dd935d..d6d85276 100644 --- a/web/dist/assets/Anouncement-21a92532.js +++ b/web/dist/assets/Anouncement-2531033c.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-f6905e5e.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{E as R,_ as S}from"./index-121dfc2d.js";import{F as V,Q as q,I as E,G as I}from"./naive-ui-d8de3dda.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 G,q as H,j as s,x as _,l as L}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.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 M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={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,J)=>{const k=N,y=q,x=F,w=E,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",M,[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",O,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",Q,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,G(i.value,e=>(t(),H(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:L({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(R)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; +import{_ as F}from"./post-skeleton-4d2b103e.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{E as R,_ as S}from"./index-4a465428.js";import{F as V,Q as q,I as E,G as I}from"./naive-ui-d8de3dda.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 G,q as H,j as s,x as _,l as L}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.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 M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={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,J)=>{const k=N,y=q,x=F,w=E,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",M,[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",O,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",Q,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,G(i.value,e=>(t(),H(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:L({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(R)(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-b826e3a0.js b/web/dist/assets/Collection-6b9226c9.js similarity index 84% rename from web/dist/assets/Collection-b826e3a0.js rename to web/dist/assets/Collection-6b9226c9.js index bdf0b807..8c6e5607 100644 --- a/web/dist/assets/Collection-b826e3a0.js +++ b/web/dist/assets/Collection-6b9226c9.js @@ -1 +1 @@ -import{_ as I}from"./whisper-1cdd2a38.js";import{_ as N,a as Q}from"./post-item.vue_vue_type_style_index_0_lang-e778d128.js";import{_ as V}from"./post-skeleton-f6905e5e.js";import{_ as W}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{u as E}from"./vuex-44de225f.js";import{b as G}from"./vue-router-e5a2430e.js";import{Q as H,_ as L}from"./index-121dfc2d.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{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-ebf88604.js";import"./@vicons-7a4ef312.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 J={key:0,class:"skeleton-wrap"},K={key:1},O={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=E(),S=G(),_=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,H({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 $=W,z=V,B=A,F=N,g=D,M=Q,P=I,R=Y,q=j;return e(),o("div",null,[n($,{title:"收藏"}),n(R,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{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(F,{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(q,{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}; +import{_ as I}from"./whisper-7dcedd50.js";import{_ as N,a as Q}from"./post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js";import{_ as V}from"./post-skeleton-4d2b103e.js";import{_ as W}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{u as E}from"./vuex-44de225f.js";import{b as G}from"./vue-router-e5a2430e.js";import{Q as H,_ as L}from"./index-4a465428.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{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-0e30acaf.js";import"./@vicons-7a4ef312.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 J={key:0,class:"skeleton-wrap"},K={key:1},O={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=E(),S=G(),_=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,H({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 $=W,z=V,B=A,F=N,g=D,M=Q,P=I,R=Y,q=j;return e(),o("div",null,[n($,{title:"收藏"}),n(R,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{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(F,{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(q,{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/Contacts-ed0b9b43.js b/web/dist/assets/Contacts-cf96d2d4.js similarity index 92% rename from web/dist/assets/Contacts-ed0b9b43.js rename to web/dist/assets/Contacts-cf96d2d4.js index 4c422bd5..44e5f346 100644 --- a/web/dist/assets/Contacts-ed0b9b43.js +++ b/web/dist/assets/Contacts-cf96d2d4.js @@ -1 +1 @@ -import{_ as T}from"./whisper-1cdd2a38.js";import{d as F,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as z,u as W,q as E}from"./@vue-a481fc63.js";import{F as G,_ as N,b as Q}from"./index-121dfc2d.js";import{i as Y,p as J}from"./@vicons-7a4ef312.js";import{j as x,o as K,e as X,O as Z,L as ee,F as te,Q as ne,I as oe,G as se}from"./naive-ui-d8de3dda.js";import{_ as ae}from"./post-skeleton-f6905e5e.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}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=F({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(C,{emit:h}){const _=C,r=e=>()=>I(x,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(J)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.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=K,d=A("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(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("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=N(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=F({__name:"Contacts",setup(C){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.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),Q({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,P=ge,V=se,D=T,O=te,R=ne;return s(),c(z,null,[i("div",null,[t(q,{title:"好友"}),t(O,{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,W(l.value,b=>(s(),E(V,{class:"list-item",key:b.user_id},{default:n(()=>[t(P,{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(R,{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 Qe=N(Ce,[["__scopeId","data-v-e20fef94"]]);export{Qe as default}; +import{_ as T}from"./whisper-7dcedd50.js";import{d as F,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as z,u as W,q as E}from"./@vue-a481fc63.js";import{F as G,_ as N,b as Q}from"./index-4a465428.js";import{i as Y,p as J}from"./@vicons-7a4ef312.js";import{j as x,o as K,e as X,O as Z,L as ee,F as te,Q as ne,I as oe,G as se}from"./naive-ui-d8de3dda.js";import{_ as ae}from"./post-skeleton-4d2b103e.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}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=F({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(C,{emit:h}){const _=C,r=e=>()=>I(x,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(J)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.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=K,d=A("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(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("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=N(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=F({__name:"Contacts",setup(C){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.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),Q({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,P=ge,V=se,D=T,O=te,R=ne;return s(),c(z,null,[i("div",null,[t(q,{title:"好友"}),t(O,{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,W(l.value,b=>(s(),E(V,{class:"list-item",key:b.user_id},{default:n(()=>[t(P,{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(R,{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 Qe=N(Ce,[["__scopeId","data-v-e20fef94"]]);export{Qe as default}; diff --git a/web/dist/assets/Following-53d3b5dc.js b/web/dist/assets/Following-3b99fb7a.js similarity index 95% rename from web/dist/assets/Following-53d3b5dc.js rename to web/dist/assets/Following-3b99fb7a.js index 29017777..dee9585a 100644 --- a/web/dist/assets/Following-53d3b5dc.js +++ b/web/dist/assets/Following-3b99fb7a.js @@ -1 +1 @@ -import{_ as K}from"./whisper-1cdd2a38.js";import{d as B,c as Q,r as Y,e as _,f as u,k as o,w as t,j as p,y as X,A as x,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as M,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{F as te,J as se,K as ae,_ as O,U as le,V as ce}from"./index-121dfc2d.js";import{i as ie,p as _e,z as re,v as ue}from"./@vicons-7a4ef312.js";import{T as pe,j as P,o as me,M as de,e as fe,O as ge,L as ve,F as we,Q as he,f as ke,g as ye,I as be,G as $e}from"./naive-ui-d8de3dda.js";import{_ as Fe}from"./post-skeleton-f6905e5e.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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"},Ie={class:"username-wrap"},Se={class:"user-info"},xe={class:"info-item"},Ce={class:"info-item"},Me={class:"item-header-extra"},Pe=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(P,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)})}})},v=Q(()=>{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=Y("router-link"),w=de,$=fe,F=ge,z=ve;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(()=>[x(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",Ie," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(w,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[x(" 已关注 ")]),_:1})):U("",!0),p("div",Se,[p("span",xe," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(te)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Me,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:v.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(P),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Pe,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Ve={key:0,class:"empty-wrap"},De={key:0,class:"pagination-wrap"},Re=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",v=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{w.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},V=l=>{m.value=l,T()},T=()=>{m.value==="follows"?D(v):m.value==="followings"&&R(v)},D=(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})},R=(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,I=ke,W=ye,j=Fe,A=be,H=Be,L=$e,E=K,G=we,J=he;return _(),u(M,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(G,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(W,{type:"line",animated:"","default-value":m.value,"onUpdate:value":V},{default:t(()=>[o(I,{name:"follows",tab:"正在关注"}),o(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(j,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Ve,[o(A,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(M,null,ee(s.value,S=>(_(),N(L,{key:S.user_id},{default:t(()=>[o(H,{contact:S,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(E,{show:f.value,user:w.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",De,[o(J,{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(Re,[["__scopeId","data-v-0a10234f"]]);export{po as default}; +import{_ as K}from"./whisper-7dcedd50.js";import{d as B,c as Q,r as Y,e as _,f as u,k as o,w as t,j as p,y as X,A as x,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as M,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{F as te,J as se,K as ae,_ as O,U as le,V as ce}from"./index-4a465428.js";import{i as ie,p as _e,z as re,v as ue}from"./@vicons-7a4ef312.js";import{T as pe,j as P,o as me,M as de,e as fe,O as ge,L as ve,F as we,Q as he,f as ke,g as ye,I as be,G as $e}from"./naive-ui-d8de3dda.js";import{_ as Fe}from"./post-skeleton-4d2b103e.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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"},Ie={class:"username-wrap"},Se={class:"user-info"},xe={class:"info-item"},Ce={class:"info-item"},Me={class:"item-header-extra"},Pe=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(P,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)})}})},v=Q(()=>{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=Y("router-link"),w=de,$=fe,F=ge,z=ve;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(()=>[x(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",Ie," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(w,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[x(" 已关注 ")]),_:1})):U("",!0),p("div",Se,[p("span",xe," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(te)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Me,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:v.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(P),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Pe,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Ve={key:0,class:"empty-wrap"},De={key:0,class:"pagination-wrap"},Re=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",v=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{w.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},V=l=>{m.value=l,T()},T=()=>{m.value==="follows"?D(v):m.value==="followings"&&R(v)},D=(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})},R=(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,I=ke,W=ye,j=Fe,A=be,H=Be,L=$e,E=K,G=we,J=he;return _(),u(M,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(G,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(W,{type:"line",animated:"","default-value":m.value,"onUpdate:value":V},{default:t(()=>[o(I,{name:"follows",tab:"正在关注"}),o(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(j,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Ve,[o(A,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(M,null,ee(s.value,S=>(_(),N(L,{key:S.user_id},{default:t(()=>[o(H,{contact:S,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(E,{show:f.value,user:w.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",De,[o(J,{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(Re,[["__scopeId","data-v-0a10234f"]]);export{po as default}; diff --git a/web/dist/assets/Home-fc24bae7.js b/web/dist/assets/Home-0ca93a27.js similarity index 98% rename from web/dist/assets/Home-fc24bae7.js rename to web/dist/assets/Home-0ca93a27.js index d9d08dd1..424214f4 100644 --- a/web/dist/assets/Home-fc24bae7.js +++ b/web/dist/assets/Home-0ca93a27.js @@ -1 +1 @@ -import{_ as Te}from"./whisper-1cdd2a38.js";import{_ as Ue,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-e778d128.js";import{_ as Ve}from"./post-skeleton-f6905e5e.js";import{d as _e,H as n,c as ce,b as ge,e as c,f as w,bf as I,j as A,k as a,w as l,q,Y as y,y as ve,A as F,x as $,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Ye}from"./index-121dfc2d.js";import{p as Fe}from"./content-ebf88604.js";import{V as R,P as Q}from"./IEnum-5453a777.js";import{I as Le,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}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 gt=H=>{const P=new FileReader,k=i=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(i),D=()=>{const i=new Uint8Array(P.result).subarray(0,4);let B="";for(let _=0;_{P.onloadend=()=>{const _=H.type;i(_===""||_==="application/octet-stream"?D():k(_))},P.readAsArrayBuffer(H.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},At={class:"attachment"},kt={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Tt=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ut={key:0,class:"login-only-wrap"},Et={key:1,class:"login-wrap"},Vt=_e({__name:"compose",emits:["post-success"],setup(H,{emit:P}){const k=fe(),D=n([]),i=n(!1),B=n(!1),_=n(!1),G=n(!1),g=n(""),E=n([]),T=n(),U=n(0),f=n("public/image"),b=n([]),v=n([]),h=n([]),C=n([]),z=n(R.PUBLIC),V=n(R.PUBLIC),M="true".toLowerCase()==="true",Y=+"400",Z=n("true".toLowerCase()==="true"),J=n("true".toLowerCase()==="true"),ee=n("true".toLowerCase()==="true"),L=n("false".toLowerCase()==="true"),te=n("true".toLowerCase()==="true"),K="/v1/attachment",N=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),X=ce(()=>{let e=[{value:R.PUBLIC,label:"公开"},{value:R.PRIVATE,label:"私密"},{value:R.Following,label:"关注可见"}];return M&&e.push({value:R.FRIEND,label:"好友可见"}),e}),ae=()=>{_.value=!_.value,_.value&&G.value&&(G.value=!1)},W=()=>{G.value=!G.value,G.value&&_.value&&(_.value=!1)},se=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),p=me.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),d=(e,t)=>{i.value||(i.value=!0,t==="@"?se(e):p(e))},S=e=>{e.length>Y?g.value=e.substring(0,Y):g.value=e},O=e=>{f.value=e},x=e=>{for(let u=0;u30&&(e[u].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}b.value=e},oe=async e=>{var t,o,s,u,r;return f.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):f.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((r=e.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ne=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(f.value==="public/image"&&v.value.push({id:e.id,content:s.data.content}),f.value==="public/video"&&h.value.push({id:e.id,content:s.data.content}),f.value==="attachment"&&C.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let u=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(r=>{u+=":"+r}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ie=({file:e})=>{let t=v.value.findIndex(o=>o.id===e.id);t>-1&&v.value.splice(t,1),t=h.value.findIndex(o=>o.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(o=>o.id===e.id),t>-1&&C.value.splice(t,1)},re=()=>{if(g.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Fe(g.value);const o=[];let s=100;o.push({content:g.value,type:Q.TEXT,sort:s}),v.value.map(u=>{s++,o.push({content:u.content,type:Q.IMAGEURL,sort:s})}),h.value.map(u=>{s++,o.push({content:u.content,type:Q.VIDEOURL,sort:s})}),C.value.map(u=>{s++,o.push({content:u.content,type:Q.ATTACHMENT,sort:s})}),E.value.length>0&&E.value.map(u=>{s++,o.push({content:u,type:Q.LINKURL,sort:s})}),B.value=!0,qe({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+U.value*100,visibility:z.value}).then(u=>{var r;window.$message.success("发布成功"),B.value=!1,P("post-success",u),_.value=!1,G.value=!1,(r=T.value)==null||r.clear(),b.value=[],g.value="",E.value=[],v.value=[],h.value=[],C.value=[],z.value=V.value}).catch(u=>{B.value=!1})},j=e=>{k.commit("triggerAuth",!0),k.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();M&&e==="friend"?V.value=R.FRIEND:e==="following"?V.value=R.Following:e==="public"?V.value=R.PUBLIC:V.value=R.PRIVATE,z.value=V.value}),(e,t)=>{const o=he,s=je,u=Qe,r=He,ue=Ze,ye=Je,Ae=Xe,ke=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return c(),w("div",null,[I(k).state.userInfo.id>0?(c(),w("div",ft,[A("div",ht,[A("div",wt,[a(o,{round:"",size:30,src:I(k).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:i.value,value:g.value,prefix:["@","#"],options:D.value,onSearch:d,"onUpdate:value":S,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:T,abstract:"","list-type":"image",multiple:!0,max:9,action:K,headers:{Authorization:N.value},data:{type:f.value},"file-list":b.value,onBeforeUpload:oe,onFinish:ne,onError:le,onRemove:ie,"onUpdate:fileList":x},{default:l(()=>[A("div",yt,[A("div",At,[a(ue,{abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),J.value?(c(),q(ue,{key:0,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value!=="public/video"||b.value.length===9,onClick:()=>{O("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),ee.value?(c(),q(ue,{key:1,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),a(r,{quaternary:"",circle:"",type:"primary",onClick:ve(ae,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Ke))]),_:1})]),_:1},8,["onClick"]),te.value?(c(),q(r,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(W,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(We))]),_:1})]),_:1},8,["onClick"])):y("",!0)]),A("div",kt,[a(Ae,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/I(Y)*100},null,8,["percentage"])]),default:l(()=>[F(" "+$(g.value.length)+" / "+$(I(Y)),1)]),_:1}),a(r,{loading:B.value,onClick:re,type:"primary",secondary:"",round:""},{default:l(()=>[F(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(ke),C.value.length>0?(c(),w("div",Ct,[L.value?(c(),q(be,{key:0,value:U.value,"onUpdate:value":t[0]||(t[0]=m=>U.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:l(()=>[zt]),_:1},8,["value"])):y("",!0)])):y("",!0)])]),_:1},8,["headers","data","file-list"]),G.value?(c(),w("div",It,[a(De,{value:z.value,"onUpdate:value":t[1]||(t[1]=m=>z.value=m),name:"radiogroup"},{default:l(()=>[a(Ie,null,{default:l(()=>[(c(!0),w(pe,null,de(X.value,m=>(c(),q(ze,{key:m.value,value:m.value,label:m.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):y("",!0),_.value?(c(),w("div",Dt,[a(Be,{value:E.value,"onUpdate:value":t[2]||(t[2]=m=>E.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":l(()=>[F(" 创建链接 ")]),_:1},8,["value"])])):y("",!0)])):(c(),w("div",Bt,[Tt,Z.value?y("",!0):(c(),w("div",Ut,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1})])),Z.value?(c(),w("div",Et,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1}),a(r,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=m=>j("signup"))},{default:l(()=>[F(" 注册 ")]),_:1})])):y("",!0)]))])}}});const Nt="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=",xt="/assets/discover-tweets-ab101944.jpeg",Rt="/assets/following-tweets-e36b4410.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Yt={key:1},Ft={key:2},Lt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(H){const P="true".toLowerCase()==="true",k="true".toLowerCase()==="true",D=fe(),i=dt(),B=vt(),_=n(9),G=n(8),g=n([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,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}]),E=n("泡泡广场"),T=n(!1),U=n(!1),f=n(1),b=n(""),v=n([]),h=n(1),C=n(20),z=n(0),V=n(!1),M=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=p=>{M.value=p,V.value=!0},Z=()=>{V.value=!1},J=()=>{E.value="泡泡广场",i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?E.value="#"+decodeURIComponent(i.query.q):E.value="搜索: "+decodeURIComponent(i.query.q))},ee=ce(()=>P&&k&&D.state.desktopModelShow&&D.state.userInfo.id>0),L=()=>{T.value=!1,U.value=!1,v.value=[],h.value=1,z.value=0},te=(p,d)=>{switch(L(),f.value=p.style,i.query.q&&(i.query.q=null,J()),p.style){case 1:N("newest");break;case 2:N("hots");break;case 3:i.query.q=null,N("following");break;case 21:b.value=p.username,X();break}g.value[d].show=!1},K=()=>{g.value=g.value.slice(0,3),!(!P||!k||D.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(p=>{var d=0;const S=p.list||[];let O=[];for(;d0&&(g.value=g.value.concat(O))}).catch(p=>{console.log(p)})},N=p=>{T.value=!0,Oe({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,style:p,page:h.value,page_size:C.value}).then(d=>{T.value=!1,d.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(d.list):(v.value=d.list,window.scrollTo(0,0)),z.value=Math.ceil(d.pager.total_rows/C.value)}).catch(d=>{T.value=!1,h.value>1&&h.value--})},X=()=>{T.value=!0,Pe({username:b.value,style:"post",page:h.value,page_size:C.value}).then(p=>{T.value=!1,p.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(p.list):(v.value=p.list||[],window.scrollTo(0,0)),z.value=Math.ceil(p.pager.total_rows/C.value)}).catch(p=>{v.value=[],h.value>1&&h.value--,T.value=!1})},ae=p=>{B.push({name:"post",query:{id:p.id}})},W=()=>{switch(f.value){case 1:N("newest");break;case 2:N("hots");break;case 3:N("following");break;case 21:i.query.q?N("search"):X();break}},se=()=>{h.value{L(),K(),N("newest")}),Ne(()=>({path:i.path,query:i.query,refresh:D.state.refresh}),(p,d)=>{if(J(),p.refresh!==d.refresh){L(),setTimeout(()=>{K(),W()},0);return}d.path!=="/post"&&p.path==="/"&&(L(),setTimeout(()=>{K(),W()},0))}),(p,d)=>{const S=pt,O=Vt,x=lt,oe=he,ne=it,le=rt,ie=Ve,re=ut,j=Ue,e=Ee,t=Te,o=nt,s=ct,u=we;return c(),w("div",null,[a(S,{title:E.value},null,8,["title"]),a(o,{class:"main-content-wrap",bordered:""},{default:l(()=>[a(x,null,{default:l(()=>[a(O,{onPostSuccess:ae})]),_:1}),ee.value?(c(),q(x,{key:0},{default:l(()=>[a(I(_t),{modelValue:g.value,"onUpdate:modelValue":d[0]||(d[0]=r=>g.value=r),"wheel-blocks":G.value,"init-blocks":_.value,onClick:te,tag:"div","sub-tag":"div"},{default:l(r=>[A("div",qt,[a(ne,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:l(()=>[a(oe,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(le,{"line-clamp":2},{default:l(()=>[F($(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):y("",!0),T.value&&v.value.length===0?(c(),w("div",Ot,[a(ie,{num:C.value},null,8,["num"])])):y("",!0),A("div",null,[v.value.length===0?(c(),w("div",Pt,[a(re,{size:"large",description:"暂无数据"})])):y("",!0),I(D).state.desktopModelShow?(c(),w("div",Yt,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(j,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))])):(c(),w("div",Ft,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(e,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:V.value,user:M.value,onSuccess:Z},null,8,["show","user"])]),_:1}),z.value>0?(c(),q(u,{key:0,justify:"center"},{default:l(()=>[a(I(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:d[1]||(d[1]=r=>se())},{spinner:l(()=>[A("div",Lt,[U.value?y("",!0):(c(),q(s,{key:0,size:14})),A("span",St,$(U.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Ta=Ye(Mt,[["__scopeId","data-v-b0cbbdc2"]]);export{Ta as default}; +import{_ as Te}from"./whisper-7dcedd50.js";import{_ as Ue,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js";import{_ as Ve}from"./post-skeleton-4d2b103e.js";import{d as _e,H as n,c as ce,b as ge,e as c,f as w,bf as I,j as A,k as a,w as l,q,Y as y,y as ve,A as F,x as $,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Ye}from"./index-4a465428.js";import{p as Fe}from"./content-0e30acaf.js";import{V as R,P as Q}from"./IEnum-5453a777.js";import{I as Le,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}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 gt=H=>{const P=new FileReader,k=i=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(i),D=()=>{const i=new Uint8Array(P.result).subarray(0,4);let B="";for(let _=0;_{P.onloadend=()=>{const _=H.type;i(_===""||_==="application/octet-stream"?D():k(_))},P.readAsArrayBuffer(H.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},At={class:"attachment"},kt={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Tt=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ut={key:0,class:"login-only-wrap"},Et={key:1,class:"login-wrap"},Vt=_e({__name:"compose",emits:["post-success"],setup(H,{emit:P}){const k=fe(),D=n([]),i=n(!1),B=n(!1),_=n(!1),G=n(!1),g=n(""),E=n([]),T=n(),U=n(0),f=n("public/image"),b=n([]),v=n([]),h=n([]),C=n([]),z=n(R.PUBLIC),V=n(R.PUBLIC),M="true".toLowerCase()==="true",Y=+"400",Z=n("true".toLowerCase()==="true"),J=n("true".toLowerCase()==="true"),ee=n("true".toLowerCase()==="true"),L=n("false".toLowerCase()==="true"),te=n("true".toLowerCase()==="true"),K="/v1/attachment",N=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),X=ce(()=>{let e=[{value:R.PUBLIC,label:"公开"},{value:R.PRIVATE,label:"私密"},{value:R.Following,label:"关注可见"}];return M&&e.push({value:R.FRIEND,label:"好友可见"}),e}),ae=()=>{_.value=!_.value,_.value&&G.value&&(G.value=!1)},W=()=>{G.value=!G.value,G.value&&_.value&&(_.value=!1)},se=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),p=me.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),d=(e,t)=>{i.value||(i.value=!0,t==="@"?se(e):p(e))},S=e=>{e.length>Y?g.value=e.substring(0,Y):g.value=e},O=e=>{f.value=e},x=e=>{for(let u=0;u30&&(e[u].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}b.value=e},oe=async e=>{var t,o,s,u,r;return f.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):f.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((r=e.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ne=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(f.value==="public/image"&&v.value.push({id:e.id,content:s.data.content}),f.value==="public/video"&&h.value.push({id:e.id,content:s.data.content}),f.value==="attachment"&&C.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let u=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(r=>{u+=":"+r}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ie=({file:e})=>{let t=v.value.findIndex(o=>o.id===e.id);t>-1&&v.value.splice(t,1),t=h.value.findIndex(o=>o.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(o=>o.id===e.id),t>-1&&C.value.splice(t,1)},re=()=>{if(g.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Fe(g.value);const o=[];let s=100;o.push({content:g.value,type:Q.TEXT,sort:s}),v.value.map(u=>{s++,o.push({content:u.content,type:Q.IMAGEURL,sort:s})}),h.value.map(u=>{s++,o.push({content:u.content,type:Q.VIDEOURL,sort:s})}),C.value.map(u=>{s++,o.push({content:u.content,type:Q.ATTACHMENT,sort:s})}),E.value.length>0&&E.value.map(u=>{s++,o.push({content:u,type:Q.LINKURL,sort:s})}),B.value=!0,qe({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+U.value*100,visibility:z.value}).then(u=>{var r;window.$message.success("发布成功"),B.value=!1,P("post-success",u),_.value=!1,G.value=!1,(r=T.value)==null||r.clear(),b.value=[],g.value="",E.value=[],v.value=[],h.value=[],C.value=[],z.value=V.value}).catch(u=>{B.value=!1})},j=e=>{k.commit("triggerAuth",!0),k.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();M&&e==="friend"?V.value=R.FRIEND:e==="following"?V.value=R.Following:e==="public"?V.value=R.PUBLIC:V.value=R.PRIVATE,z.value=V.value}),(e,t)=>{const o=he,s=je,u=Qe,r=He,ue=Ze,ye=Je,Ae=Xe,ke=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return c(),w("div",null,[I(k).state.userInfo.id>0?(c(),w("div",ft,[A("div",ht,[A("div",wt,[a(o,{round:"",size:30,src:I(k).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:i.value,value:g.value,prefix:["@","#"],options:D.value,onSearch:d,"onUpdate:value":S,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:T,abstract:"","list-type":"image",multiple:!0,max:9,action:K,headers:{Authorization:N.value},data:{type:f.value},"file-list":b.value,onBeforeUpload:oe,onFinish:ne,onError:le,onRemove:ie,"onUpdate:fileList":x},{default:l(()=>[A("div",yt,[A("div",At,[a(ue,{abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),J.value?(c(),q(ue,{key:0,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value!=="public/video"||b.value.length===9,onClick:()=>{O("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),ee.value?(c(),q(ue,{key:1,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),a(r,{quaternary:"",circle:"",type:"primary",onClick:ve(ae,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Ke))]),_:1})]),_:1},8,["onClick"]),te.value?(c(),q(r,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(W,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(We))]),_:1})]),_:1},8,["onClick"])):y("",!0)]),A("div",kt,[a(Ae,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/I(Y)*100},null,8,["percentage"])]),default:l(()=>[F(" "+$(g.value.length)+" / "+$(I(Y)),1)]),_:1}),a(r,{loading:B.value,onClick:re,type:"primary",secondary:"",round:""},{default:l(()=>[F(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(ke),C.value.length>0?(c(),w("div",Ct,[L.value?(c(),q(be,{key:0,value:U.value,"onUpdate:value":t[0]||(t[0]=m=>U.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:l(()=>[zt]),_:1},8,["value"])):y("",!0)])):y("",!0)])]),_:1},8,["headers","data","file-list"]),G.value?(c(),w("div",It,[a(De,{value:z.value,"onUpdate:value":t[1]||(t[1]=m=>z.value=m),name:"radiogroup"},{default:l(()=>[a(Ie,null,{default:l(()=>[(c(!0),w(pe,null,de(X.value,m=>(c(),q(ze,{key:m.value,value:m.value,label:m.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):y("",!0),_.value?(c(),w("div",Dt,[a(Be,{value:E.value,"onUpdate:value":t[2]||(t[2]=m=>E.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":l(()=>[F(" 创建链接 ")]),_:1},8,["value"])])):y("",!0)])):(c(),w("div",Bt,[Tt,Z.value?y("",!0):(c(),w("div",Ut,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1})])),Z.value?(c(),w("div",Et,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1}),a(r,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=m=>j("signup"))},{default:l(()=>[F(" 注册 ")]),_:1})])):y("",!0)]))])}}});const Nt="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=",xt="/assets/discover-tweets-ab101944.jpeg",Rt="/assets/following-tweets-e36b4410.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Yt={key:1},Ft={key:2},Lt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(H){const P="true".toLowerCase()==="true",k="true".toLowerCase()==="true",D=fe(),i=dt(),B=vt(),_=n(9),G=n(8),g=n([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,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}]),E=n("泡泡广场"),T=n(!1),U=n(!1),f=n(1),b=n(""),v=n([]),h=n(1),C=n(20),z=n(0),V=n(!1),M=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=p=>{M.value=p,V.value=!0},Z=()=>{V.value=!1},J=()=>{E.value="泡泡广场",i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?E.value="#"+decodeURIComponent(i.query.q):E.value="搜索: "+decodeURIComponent(i.query.q))},ee=ce(()=>P&&k&&D.state.desktopModelShow&&D.state.userInfo.id>0),L=()=>{T.value=!1,U.value=!1,v.value=[],h.value=1,z.value=0},te=(p,d)=>{switch(L(),f.value=p.style,i.query.q&&(i.query.q=null,J()),p.style){case 1:N("newest");break;case 2:N("hots");break;case 3:i.query.q=null,N("following");break;case 21:b.value=p.username,X();break}g.value[d].show=!1},K=()=>{g.value=g.value.slice(0,3),!(!P||!k||D.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(p=>{var d=0;const S=p.list||[];let O=[];for(;d0&&(g.value=g.value.concat(O))}).catch(p=>{console.log(p)})},N=p=>{T.value=!0,Oe({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,style:p,page:h.value,page_size:C.value}).then(d=>{T.value=!1,d.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(d.list):(v.value=d.list,window.scrollTo(0,0)),z.value=Math.ceil(d.pager.total_rows/C.value)}).catch(d=>{T.value=!1,h.value>1&&h.value--})},X=()=>{T.value=!0,Pe({username:b.value,style:"post",page:h.value,page_size:C.value}).then(p=>{T.value=!1,p.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(p.list):(v.value=p.list||[],window.scrollTo(0,0)),z.value=Math.ceil(p.pager.total_rows/C.value)}).catch(p=>{v.value=[],h.value>1&&h.value--,T.value=!1})},ae=p=>{B.push({name:"post",query:{id:p.id}})},W=()=>{switch(f.value){case 1:N("newest");break;case 2:N("hots");break;case 3:N("following");break;case 21:i.query.q?N("search"):X();break}},se=()=>{h.value{L(),K(),N("newest")}),Ne(()=>({path:i.path,query:i.query,refresh:D.state.refresh}),(p,d)=>{if(J(),p.refresh!==d.refresh){L(),setTimeout(()=>{K(),W()},0);return}d.path!=="/post"&&p.path==="/"&&(L(),setTimeout(()=>{K(),W()},0))}),(p,d)=>{const S=pt,O=Vt,x=lt,oe=he,ne=it,le=rt,ie=Ve,re=ut,j=Ue,e=Ee,t=Te,o=nt,s=ct,u=we;return c(),w("div",null,[a(S,{title:E.value},null,8,["title"]),a(o,{class:"main-content-wrap",bordered:""},{default:l(()=>[a(x,null,{default:l(()=>[a(O,{onPostSuccess:ae})]),_:1}),ee.value?(c(),q(x,{key:0},{default:l(()=>[a(I(_t),{modelValue:g.value,"onUpdate:modelValue":d[0]||(d[0]=r=>g.value=r),"wheel-blocks":G.value,"init-blocks":_.value,onClick:te,tag:"div","sub-tag":"div"},{default:l(r=>[A("div",qt,[a(ne,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:l(()=>[a(oe,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(le,{"line-clamp":2},{default:l(()=>[F($(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):y("",!0),T.value&&v.value.length===0?(c(),w("div",Ot,[a(ie,{num:C.value},null,8,["num"])])):y("",!0),A("div",null,[v.value.length===0?(c(),w("div",Pt,[a(re,{size:"large",description:"暂无数据"})])):y("",!0),I(D).state.desktopModelShow?(c(),w("div",Yt,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(j,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))])):(c(),w("div",Ft,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(e,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:V.value,user:M.value,onSuccess:Z},null,8,["show","user"])]),_:1}),z.value>0?(c(),q(u,{key:0,justify:"center"},{default:l(()=>[a(I(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:d[1]||(d[1]=r=>se())},{spinner:l(()=>[A("div",Lt,[U.value?y("",!0):(c(),q(s,{key:0,size:14})),A("span",St,$(U.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Ta=Ye(Mt,[["__scopeId","data-v-b0cbbdc2"]]);export{Ta as default}; diff --git a/web/dist/assets/Messages-5c4e999b.js b/web/dist/assets/Messages-8ba7b532.js similarity index 97% rename from web/dist/assets/Messages-5c4e999b.js rename to web/dist/assets/Messages-8ba7b532.js index cc5ceee1..b295ca73 100644 --- a/web/dist/assets/Messages-5c4e999b.js +++ b/web/dist/assets/Messages-8ba7b532.js @@ -1 +1 @@ -import{d as D,c as N,r as J,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 K,h as H,u as T,F as U,H as v,b as Y}from"./@vue-a481fc63.js";import{u as G}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{E as x,M as ee,N as se,O as ne,_ as E,P as te}from"./index-121dfc2d.js";import{J as L,i as ae,K as oe,N as re,O as Q,Q as ie,p as le}from"./@vicons-7a4ef312.js";import{j as d,o as ue,M as _e,l as pe,e as ce,O as de,S as me,L as ge,U as ve,F as fe,Q as ye,I as ke,G as he}from"./naive-ui-d8de3dda.js";import{_ as we}from"./whisper-1cdd2a38.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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"},Fe={class:"timestamp-txt"},Ne={key:0,class:"brief-content"},qe={key:1,class:"whisper-content-wrap"},Re={key:2,class:"requesting-friend-wrap"},Ae={key:2,class:"status-info"},Pe={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=G(),k=e=>()=>H(d,null,{default:()=>H(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),R=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)})},A=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=J("router-link"),b=_e,P=pe,W=ce,j=de,B=me,F=ge;return t(),r("div",{class:K(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(F,{"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(L)},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(L)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Oe,[g.value&&e.message.is_read===0?(t(),I(P,{key:0,dot:"",processing:""})):i("",!0),f("span",Fe,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=>R(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",Re,[_(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=>A(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",Ae,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",Pe,[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Be=E(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(U,null,T(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 Ee=E(De,[["__scopeId","data-v-01d2e871"]]),He={key:0,class:"skeleton-wrap"},Le={key:1},Qe={key:0,class:"empty-wrap"},Te={key:0,class:"pagination-wrap"},Ue=D({__name:"Messages",setup(q){const y=Z(),p=G(),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},R=()=>{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})},A=u=>{l.value=u,z()};return Y(()=>{z()}),(u,e)=>{const n=$e,$=we,O=Ee,b=ke,P=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:R},null,8,["show","user"]),c.value?(t(),r("div",He,[s(O,{num:k.value},null,8,["num"])])):(t(),r("div",Le,[w.value.length===0?(t(),r("div",Qe,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(U,null,T(w.value,F=>(t(),I(W,{key:F.id},{default:a(()=>[s(P,{message:F,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Te,[s(B,{page:l.value,"onUpdate:page":A,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const fs=E(Ue,[["__scopeId","data-v-b40dcbaf"]]);export{fs as default}; +import{d as D,c as N,r as J,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 K,h as H,u as T,F as U,H as v,b as Y}from"./@vue-a481fc63.js";import{u as G}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{E as x,M as ee,N as se,O as ne,_ as E,P as te}from"./index-4a465428.js";import{J as L,i as ae,K as oe,N as re,O as Q,Q as ie,p as le}from"./@vicons-7a4ef312.js";import{j as d,o as ue,M as _e,l as pe,e as ce,O as de,S as me,L as ge,U as ve,F as fe,Q as ye,I as ke,G as he}from"./naive-ui-d8de3dda.js";import{_ as we}from"./whisper-7dcedd50.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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"},Fe={class:"timestamp-txt"},Ne={key:0,class:"brief-content"},qe={key:1,class:"whisper-content-wrap"},Re={key:2,class:"requesting-friend-wrap"},Ae={key:2,class:"status-info"},Pe={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=G(),k=e=>()=>H(d,null,{default:()=>H(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),R=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)})},A=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=J("router-link"),b=_e,P=pe,W=ce,j=de,B=me,F=ge;return t(),r("div",{class:K(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(F,{"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(L)},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(L)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Oe,[g.value&&e.message.is_read===0?(t(),I(P,{key:0,dot:"",processing:""})):i("",!0),f("span",Fe,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=>R(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",Re,[_(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=>A(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",Ae,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",Pe,[s(o(d),null,{default:a(()=>[s(o(Q))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Be=E(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(U,null,T(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 Ee=E(De,[["__scopeId","data-v-01d2e871"]]),He={key:0,class:"skeleton-wrap"},Le={key:1},Qe={key:0,class:"empty-wrap"},Te={key:0,class:"pagination-wrap"},Ue=D({__name:"Messages",setup(q){const y=Z(),p=G(),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},R=()=>{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})},A=u=>{l.value=u,z()};return Y(()=>{z()}),(u,e)=>{const n=$e,$=we,O=Ee,b=ke,P=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:R},null,8,["show","user"]),c.value?(t(),r("div",He,[s(O,{num:k.value},null,8,["num"])])):(t(),r("div",Le,[w.value.length===0?(t(),r("div",Qe,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(U,null,T(w.value,F=>(t(),I(W,{key:F.id},{default:a(()=>[s(P,{message:F,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Te,[s(B,{page:l.value,"onUpdate:page":A,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const fs=E(Ue,[["__scopeId","data-v-b40dcbaf"]]);export{fs as default}; diff --git a/web/dist/assets/Post-c15711ff.js b/web/dist/assets/Post-8403b241.js similarity index 87% rename from web/dist/assets/Post-c15711ff.js rename to web/dist/assets/Post-8403b241.js index bf08f815..77c07d1b 100644 --- a/web/dist/assets/Post-c15711ff.js +++ b/web/dist/assets/Post-8403b241.js @@ -1 +1 @@ -import{d as ee,H as c,r as ye,e as o,f as _,j as d,k as t,w as n,A as T,x as z,q as U,Y as u,bf as a,y as H,c as ae,al as Ve,F as pe,u as de,$ as Te,a0 as ze,b as Re,h as Ce,E as Ye}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{f as me,t as Je,h as Ke,i as We,_ as ie,j as Ge,k as Qe,l as Xe,m as Ze,g as et,n as tt,o as st,p as ot,q as nt,r as at,s as lt,u as it,v as ut,w as ct,x as rt,y as _t,z as ge}from"./index-121dfc2d.js";import{Y as ve,V as Q}from"./IEnum-5453a777.js";import{T as Ue,e as he,f as Se,g as fe,h as Le,I as pt,i as dt,j as mt,k as vt,l as ht,m as ft,n as gt,o as yt,p as kt,q as wt,r as bt,s as $t,t as xe,F as Ie,E as ce,u as re,v as _e,w as Pe}from"./@vicons-7a4ef312.js";import{j as K,e as ue,J as Oe,H as Ct,b as xt,K as It,o as ke,L as De,v as Pt,w as Tt,x as zt,y as Rt,z as Ut,B as St,M as Lt,O as Ot,i as Dt,P as Mt,a as Me,F as At,I as Et,k as qt,G as Nt,f as Bt,g as jt}from"./naive-ui-d8de3dda.js";import{p as we,_ as Ae,a as Ft,b as Ht,c as Vt}from"./content-ebf88604.js";import{u as Ee,b as Yt}from"./vue-router-e5a2430e.js";import{_ as Jt}from"./post-skeleton-f6905e5e.js";import{l as Kt}from"./lodash-e0b37ac3.js";import{_ as Wt}from"./whisper-1cdd2a38.js";import{c as Gt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Qt}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{W as Xt}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 Zt={class:"reply-item"},es={class:"header-wrap"},ts={class:"username"},ss={class:"reply-name"},os={class:"timestamp"},ns={class:"base-wrap"},as={class:"content"},ls={class:"reply-switch"},is={class:"time-item"},us={class:"actions"},cs={class:"upvote-count"},rs=["onClick"],_s={class:"upvote-count"},ps={key:2,class:"action-item"},ds=["onClick"],ms=ee({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,v=le(),m=c(l.reply.is_thumbs_up==ve.YES),g=c(l.reply.is_thumbs_down==ve.YES),w=c(l.reply.thumbs_up_count),S=()=>{Je({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{m.value=!m.value,m.value?(w.value++,g.value=!1):w.value--}).catch(f=>{console.log(f)})},r=()=>{Ke({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{g.value=!g.value,g.value&&m.value&&(w.value--,m.value=!1)}).catch(f=>{console.log(f)})},I=()=>{q("focusReply",l.reply)},R=()=>{We({id:l.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(f=>{console.log(f)})};return(f,C)=>{const O=ye("router-link"),p=K,x=ue,D=Oe,b=Ct;return o(),_("div",Zt,[d("div",es,[d("div",ts,[t(O,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(z(l.reply.user.username),1)]),_:1},8,["to"]),d("span",ss,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),U(O,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(z(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",os,[T(z(l.reply.ip_loc)+" ",1),a(v).state.userInfo.is_admin||a(v).state.userInfo.id===l.reply.user.id?(o(),U(D,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:R},{trigger:n(()=>[t(x,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(p,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):u("",!0)])]),d("div",ns,[d("div",as,[t(b,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(z(l.reply.content),1)]),_:1})]),d("div",ls,[d("span",is,z(a(me)(l.reply.created_on)),1),d("div",us,[a(v).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:C[0]||(C[0]=H(()=>{},["stop"]))},[t(p,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),d("span",cs,z(w.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:H(S,["stop"])},[t(p,{size:"medium"},{default:n(()=>[m.value?u("",!0):(o(),U(a(he),{key:0})),m.value?(o(),U(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",_s,z(w.value>0?w.value:"赞"),1)],8,rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",ps,[t(p,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:H(r,["stop"])},[t(p,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),U(a(fe),{key:0})),g.value?(o(),U(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,ds)):u("",!0),a(v).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:I}," 回复 ")):u("",!0)])])])])}}});const vs=ie(ms,[["__scopeId","data-v-187a4ed3"]]),hs={class:"reply-compose-wrap"},fs={class:"reply-switch"},gs={class:"time-item"},ys={class:"actions"},ks={key:0,class:"action-item"},ws={class:"upvote-count"},bs=["onClick"],$s={class:"upvote-count"},Cs={key:2,class:"action-item"},xs=["onClick"],Is={key:0,class:"reply-input-wrap"},Ps=ee({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const v=E,m=le(),g=c(),w=c(!1),S=c(""),r=c(!1),I=+"300",R=c(v.comment.is_thumbs_up==ve.YES),f=c(v.comment.is_thumbs_down==ve.YES),C=c(v.comment.thumbs_up_count),O=()=>{Ge({tweet_id:v.comment.post_id,comment_id:v.comment.id}).then(b=>{R.value=!R.value,R.value?(C.value++,f.value=!1):C.value--}).catch(b=>{console.log(b)})},p=()=>{Qe({tweet_id:v.comment.post_id,comment_id:v.comment.id}).then(b=>{f.value=!f.value,f.value&&R.value&&(C.value--,R.value=!1)}).catch(b=>{console.log(b)})},x=b=>{w.value=b,b?setTimeout(()=>{var M;(M=g.value)==null||M.focus()},10):(r.value=!1,S.value="",l("reset"))},D=()=>{r.value=!0,Xe({comment_id:v.comment.id,at_user_id:v.atUserid,content:S.value}).then(b=>{x(!1),window.$message.success("评论成功"),l("reload")}).catch(b=>{r.value=!1})};return q({switchReply:x}),(b,M)=>{const s=K,y=xt,B=ue,N=It;return o(),_("div",hs,[d("div",fs,[d("span",gs,z(a(me)(b.comment.created_on)),1),d("div",ys,[a(m).state.userLogined?u("",!0):(o(),_("div",ks,[t(s,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),d("span",ws,z(C.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:H(O,["stop"])},[t(s,{size:"medium"},{default:n(()=>[R.value?u("",!0):(o(),U(a(he),{key:0})),R.value?(o(),U(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",$s,z(C.value>0?C.value:"赞"),1)],8,bs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",Cs,[t(s,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:H(p,["stop"])},[t(s,{size:"medium"},{default:n(()=>[f.value?u("",!0):(o(),U(a(fe),{key:0})),f.value?(o(),U(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,xs)):u("",!0),a(m).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:M[0]||(M[0]=V=>x(!0))}," 回复 ")):u("",!0),a(m).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:M[1]||(M[1]=V=>x(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Is,[t(N,null,{default:n(()=>[t(y,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:v.atUsername?"@"+v.atUsername:"请输入回复内容..",maxlength:a(I),value:S.value,"onUpdate:value":M[2]||(M[2]=V=>S.value=V),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:D},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ts=ie(Ps,[["__scopeId","data-v-f9af7a93"]]),zs={class:"comment-item"},Rs={class:"nickname-wrap"},Us={class:"username-wrap"},Ss={class:"opt-wrap"},Ls={class:"timestamp"},Os=["innerHTML"],Ds={class:"reply-wrap"},Ms=ee({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(E,{emit:q}){const l=E,v=le(),m=Ee(),g=c(0),w=c(""),S=c(),r=ae(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(x=>{(+x.type==1||+x.type==2)&&p.texts.push(x),+x.type==3&&p.imgs.push(x)}),p}),I=(p,x)=>{let D=p.target;if(D.dataset.detail){const b=D.dataset.detail.split(":");b.length===2&&(v.commit("refresh"),b[0]==="tag"?window.$message.warning("评论内的无效话题"):m.push({name:"user",query:{s:b[1]}}))}},R=p=>{var x,D;g.value=p.user_id,w.value=((x=p.user)==null?void 0:x.username)||"",(D=S.value)==null||D.switchReply(!0)},f=()=>{q("reload")},C=()=>{g.value=0,w.value=""},O=()=>{Ze({id:r.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{f()},50)}).catch(p=>{})};return(p,x)=>{const D=ke,b=ye("router-link"),M=K,s=ue,y=Oe,B=Ae,N=Ts,V=vs,Y=De;return o(),_("div",zs,[t(Y,{"content-indented":""},Ve({avatar:n(()=>[t(D,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Rs,[t(b,{onClick:x[0]||(x[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:r.value.user.username}}},{default:n(()=>[T(z(r.value.user.nickname),1)]),_:1},8,["to"])]),d("span",Us," @"+z(r.value.user.username),1)]),"header-extra":n(()=>[d("div",Ss,[d("span",Ls,z(r.value.ip_loc),1),a(v).state.userInfo.is_admin||a(v).state.userInfo.id===r.value.user.id?(o(),U(y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(s,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(M,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),U(B,{key:0,imgs:r.value.imgs},null,8,["imgs"])):u("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:r.value,"at-userid":g.value,"at-username":w.value,onReload:f,onReset:C},null,8,["comment","at-userid","at-username"]),d("div",Ds,[(o(!0),_(pe,null,de(r.value.replies,F=>(o(),U(V,{key:F.id,reply:F,"tweet-id":r.value.post_id,onFocusReply:R,onReload:f},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(pe,null,de(r.value.texts,F=>(o(),_("span",{key:F.id,class:"comment-text",onClick:x[1]||(x[1]=H(P=>I(P,r.value.id),["stop"])),innerHTML:a(we)(F.content).content},null,8,Os))),128))]),key:"0"}:void 0]),1024)])}}});const As=ie(Ms,[["__scopeId","data-v-36dac8c8"]]),Es=E=>(Te("data-v-d9073453"),E=E(),ze(),E),qs={key:0,class:"compose-wrap"},Ns={class:"compose-line"},Bs={class:"compose-user"},js={class:"compose-line compose-options"},Fs={class:"attachment"},Hs={class:"submit-wrap"},Vs={class:"attachment-list-wrap"},Ys={key:1,class:"compose-wrap"},Js=Es(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ks={key:0,class:"login-only-wrap"},Ws={key:1,class:"login-wrap"},Gs=ee({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,v=le(),m=c([]),g=c(!1),w=c(!1),S=c(!1),r=c(""),I=c(),R=c("public/image"),f=c([]),C=c([]),O=c("true".toLowerCase()==="true"),p=+"300",x="/v1/attachment",D=ae(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),b=Kt.debounce(h=>{et({k:h}).then(k=>{let $=[];k.suggest.map(e=>{$.push({label:e,value:e})}),m.value=$,w.value=!1}).catch(k=>{w.value=!1})},200),M=(h,k)=>{w.value||(w.value=!0,k==="@"&&b(h))},s=h=>{h.length>p?r.value=h.substring(0,p):r.value=h},y=h=>{R.value=h},B=h=>{for(let i=0;i30&&(h[i].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+e)}f.value=h},N=async h=>{var k,$;return R.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=h.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):R.value==="image"&&(($=h.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},V=({file:h,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);e.code===0&&R.value==="public/image"&&C.value.push({id:h.id,content:e.data.content})}catch{window.$message.error("上传失败")}},Y=({file:h,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(A=>{i+=":"+A}),window.$message.error(i)}}catch{window.$message.error("上传失败")}},F=({file:h})=>{let k=C.value.findIndex($=>$.id===h.id);k>-1&&C.value.splice(k,1)},P=()=>{g.value=!0},L=()=>{var h;g.value=!1,(h=I.value)==null||h.clear(),f.value=[],r.value="",C.value=[]},te=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:h}=we(r.value);const k=[];let $=100;k.push({content:r.value,type:2,sort:$}),C.value.map(e=>{$++,k.push({content:e.content,type:3,sort:$})}),S.value=!0,tt({contents:k,post_id:l.postId,users:Array.from(new Set(h))}).then(e=>{window.$message.success("发布成功"),S.value=!1,q("post-success"),L()}).catch(e=>{S.value=!1})},W=h=>{v.commit("triggerAuth",!0),v.commit("triggerAuthKey",h)};return(h,k)=>{const $=ke,e=Pt,i=K,A=ue,se=Tt,G=zt,oe=Rt,ne=Ut,J=St;return o(),_("div",null,[a(v).state.userInfo.id>0?(o(),_("div",qs,[d("div",Ns,[d("div",Bs,[t($,{round:"",size:30,src:a(v).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:m.value,prefix:["@"],loading:w.value,value:r.value,disabled:l.lock===1,"onUpdate:value":s,onSearch:M,onFocus:P,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),U(J,{key:0,ref_key:"uploadRef",ref:I,abstract:"","list-type":"image",multiple:!0,max:9,action:x,headers:{Authorization:D.value},data:{type:R.value},"file-list":f.value,onBeforeUpload:N,onFinish:V,onError:Y,onRemove:F,"onUpdate:fileList":B},{default:n(()=>[d("div",js,[d("div",Fs,[t(se,{abstract:""},{default:n(({handleClick:Z})=>[t(A,{disabled:f.value.length>0&&R.value==="public/video"||f.value.length===9,onClick:()=>{y("public/image"),Z()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(i,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(pt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(oe,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(G,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(p)*100},null,8,["percentage"])]),default:n(()=>[T(" "+z(r.value.length)+" / "+z(a(p)),1)]),_:1})]),d("div",Hs,[t(A,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:L},{default:n(()=>[T(" 取消 ")]),_:1}),t(A,{loading:S.value,onClick:te,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",Vs,[t(ne)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ys,[Js,O.value?u("",!0):(o(),_("div",Ks,[t(A,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=Z=>W("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),O.value?(o(),_("div",Ws,[t(A,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=Z=>W("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(A,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=Z=>W("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Qs=ie(Gs,[["__scopeId","data-v-d9073453"]]),Xs={class:"username-wrap"},Zs={class:"options"},eo={key:0},to=["innerHTML"],so={class:"timestamp"},oo={key:0},no={key:1},ao={class:"opts-wrap"},lo=["onClick"],io={class:"opt-item"},uo=["onClick"],co=["onClick"],ro=ee({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,v="true".toLowerCase()==="true",m=le(),g=Ee(),w=c(!1),S=c(!1),r=c(!1),I=c(!1),R=c(!1),f=c(!1),C=c(!1),O=c(!1),p=c(Q.PUBLIC),x=c(!1),D=c({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),b=e=>{D.value=e,x.value=!0},M=()=>{x.value=!1},s=ae({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}}),y=e=>()=>Ce(K,null,{default:()=>Ce(e)}),B=ae(()=>{var A;let e=[];if(!m.state.userInfo.is_admin&&m.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:y(kt)}),e;e.push({label:"删除",key:"delete",icon:y(wt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:y(bt)}):e.push({label:"解锁",key:"unlock",icon:y($t)}),m.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:y(xe)}):e.push({label:"取消置顶",key:"unstick",icon:y(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:y(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:y(Ie)});let i;return s.value.visibility===Q.PUBLIC?i={label:"公开",key:"vpublic",icon:y(ce),children:[{label:"私密",key:"vprivate",icon:y(re)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:s.value.visibility===Q.PRIVATE?i={label:"私密",key:"vprivate",icon:y(re),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:v&&s.value.visibility===Q.FRIEND?i={label:"好友可见",key:"vfriend",icon:y(Pe),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"私密",key:"vprivate",icon:y(re)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:i={label:"关注可见",key:"vfollowing",icon:y(_e),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"私密",key:"vprivate",icon:y(re)}]},v&&s.value.visibility!==Q.FRIEND&&((A=i.children)==null||A.push({label:"好友可见",key:"vfriend",icon:y(Pe)})),e.push(i),e}),N=e=>{g.push({name:"post",query:{id:e}})},V=(e,i)=>{if(e.target.dataset.detail){const A=e.target.dataset.detail.split(":");if(A.length===2){m.commit("refresh"),A[0]==="tag"?g.push({name:"home",query:{q:A[1],t:"tag"}}):g.push({name:"user",query:{s:A[1]}});return}}N(i)},Y=e=>{switch(e){case"whisper":b(l.post.user);break;case"delete":r.value=!0;break;case"lock":case"unlock":I.value=!0;break;case"stick":case"unstick":R.value=!0;break;case"highlight":case"unhighlight":f.value=!0;break;case"vpublic":p.value=0,C.value=!0;break;case"vprivate":p.value=1,C.value=!0;break;case"vfriend":p.value=2,C.value=!0;break;case"vfollowing":p.value=3,C.value=!0;break}},F=()=>{nt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{m.commit("refresh")},50)}).catch(e=>{O.value=!1})},P=()=>{at({id:s.value.id}).then(e=>{q("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{O.value=!1})},L=()=>{lt({id:s.value.id}).then(e=>{q("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{O.value=!1})},te=()=>{it({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=>{O.value=!1})},W=()=>{ut({id:s.value.id,visibility:p.value}).then(e=>{q("reload"),window.$message.success("修改可见性成功")}).catch(e=>{O.value=!1})},h=()=>{ct({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=()=>{rt({id:s.value.id}).then(e=>{S.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)})},$=()=>{Gt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Re(()=>{m.state.userInfo.id>0&&(st({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),ot({id:s.value.id}).then(e=>{S.value=e.status}).catch(e=>{console.log(e)}))}),(e,i)=>{const A=ke,se=ye("router-link"),G=Lt,oe=ue,ne=Ot,J=Dt,Z=Wt,be=Ft,qe=Ae,Ne=Ht,Be=Vt,$e=Mt,je=Me,Fe=De;return o(),_("div",{class:"detail-item",onClick:i[7]||(i[7]=j=>N(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(A,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(se,{onClick:i[0]||(i[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(z(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",Xs," @"+z(s.value.user.username),1),s.value.is_top?(o(),U(G,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(Q).PRIVATE?(o(),U(G,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(Q).FRIEND?(o(),U(G,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Zs,[t(ne,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:Y},{default:n(()=>[t(oe,{quaternary:"",circle:""},{icon:n(()=>[t(a(K),null,{default:n(()=>[t(a(dt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(J,{show:r.value,"onUpdate:show":i[1]||(i[1]=j=>r.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show"]),t(J,{show:I.value,"onUpdate:show":i[2]||(i[2]=j=>I.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:P},null,8,["show","content"]),t(J,{show:R.value,"onUpdate:show":i[3]||(i[3]=j=>R.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(J,{show:f.value,"onUpdate:show":i[4]||(i[4]=j=>f.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:te},null,8,["show","content"]),t(J,{show:C.value,"onUpdate:show":i[5]||(i[5]=j=>C.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:W},null,8,["show","content"]),t(Z,{show:x.value,user:D.value,onSuccess:M},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(Ne,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Be,{links:s.value.links},null,8,["links"]),d("div",so,[T(" 发布于 "+z(a(me)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",oo,[t($e,{vertical:""}),T(" "+z(s.value.ip_loc),1)])):u("",!0),!a(m).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",no,[t($e,{vertical:""}),T(" 最后回复 "+z(a(me)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",ao,[t(je,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:H(h,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),U(a(mt),{key:0})),w.value?(o(),U(a(vt),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+z(s.value.upvote_count),1)],8,lo),d("div",io,[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ht))]),_:1}),T(" "+z(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:H(k,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[S.value?u("",!0):(o(),U(a(ft),{key:0})),S.value?(o(),U(a(gt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+z(s.value.collection_count),1)],8,uo),d("div",{class:"opt-item hover",onClick:H($,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(yt))]),_:1}),T(" "+z(s.value.share_count),1)],8,co)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",eo,[(o(!0),_(pe,null,de(s.value.texts,j=>(o(),_("span",{key:j.id,class:"post-text",onClick:i[6]||(i[6]=H(He=>V(He,s.value.id),["stop"])),innerHTML:a(we)(j.content).content},null,8,to))),128))])):u("",!0)]),_:1})])}}});const _o=E=>(Te("data-v-121ae886"),E=E(),ze(),E),po={key:0,class:"detail-wrap"},mo={key:1,class:"empty-wrap"},vo={key:0,class:"comment-opts-wrap"},ho=_o(()=>d("span",{class:"comment-title-item"},"评论",-1)),fo={key:2},go={key:0,class:"skeleton-wrap"},yo={key:1},ko={key:0,class:"empty-wrap"},wo={key:0,class:"load-more-spinner"},bo={key:1,class:"load-more-spinner"},$o={key:2,class:"load-more-spinner"},Co={key:3,class:"load-more-spinner"},xo={key:4,class:"load-more-spinner"},Io={key:5,class:"load-more-spinner"},X=20,Po=ee({__name:"Post",setup(E){const q=Yt(),l=c({}),v=c(!1),m=c(!1),g=c([]),w=ae(()=>+q.query.id),S=c("default"),r=c(!0);let I={loading(){},loaded(){},complete(){},error(){}};const R=P=>{S.value=P,P==="default"&&(r.value=!0),Y(I)},f=()=>{l.value={id:0},v.value=!0,_t({id:w.value}).then(P=>{v.value=!1,l.value=P,Y(I)}).catch(P=>{v.value=!1})};let C=1;const O=c(!1),p=c([]),x=P=>{O.value||ge({id:l.value.id,sort_strategy:"default",page:C,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(C===1?p.value=L.list:p.value.push(...L.list),g.value=p.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})};let D=1,b=c(!1);const M=c([]),s=P=>{b.value||ge({id:l.value.id,sort_strategy:"hots",page:D,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(D===1?M.value=L.list:M.value.push(...L.list),g.value=M.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})};let y=1,B=c(!1);const N=c([]),V=P=>{B.value||ge({id:l.value.id,sort_strategy:"newest",page:y,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(y===1?N.value=L.list:N.value.push(...L.list),g.value=N.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})},Y=P=>{w.value<1||(g.value.length===0&&(m.value=!0),S.value==="default"?(g.value=p.value,x(P)):S.value==="hots"?(g.value=M.value,s(P)):(g.value=N.value,V(P)),m.value=!1)},F=()=>{C=1,O.value=!1,p.value=[],D=1,b.value=!1,M.value=[],y=1,B.value=!1,N.value=[],Y(I)};return Re(()=>{f()}),Ye(w,()=>{w.value>0&&q.name==="post"&&f()}),(P,L)=>{const te=Qt,W=ro,h=Et,k=qt,$=Nt,e=Bt,i=jt,A=Qs,se=Jt,G=As,oe=Me,ne=At;return o(),_("div",null,[t(te,{title:"泡泡详情",back:!0}),t(ne,{class:"main-content-wrap",bordered:""},{default:n(()=>[t($,null,{default:n(()=>[t(k,{show:v.value},{default:n(()=>[l.value.id>1?(o(),_("div",po,[t(W,{post:l.value,onReload:f},null,8,["post"])])):(o(),_("div",mo,[t(h,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",vo,[t(i,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":R},{prefix:n(()=>[ho]),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(),U($,{key:1},{default:n(()=>[t(A,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",fo,[m.value?(o(),_("div",go,[t(se,{num:5})])):(o(),_("div",yo,[g.value.length===0?(o(),_("div",ko,[t(h,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(pe,null,de(g.value,J=>(o(),U($,{key:J.id},{default:n(()=>[t(G,{comment:J,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=X?(o(),U(oe,{key:3,justify:"center"},{default:n(()=>[t(a(Xt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:Y},{spinner:n(()=>[r.value&&O.value?(o(),_("span",wo)):u("",!0),!r.value&&a(b)?(o(),_("span",bo)):u("",!0),!r.value&&a(B)?(o(),_("span",$o)):u("",!0),r.value&&!O.value?(o(),_("span",Co,"加载评论")):u("",!0),!r.value&&!a(b)?(o(),_("span",xo,"加载评论")):u("",!0),!r.value&&!a(B)?(o(),_("span",Io,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const un=ie(Po,[["__scopeId","data-v-121ae886"]]);export{un as default}; +import{d as ee,H as c,r as ye,e as o,f as _,j as d,k as t,w as n,A as T,x as z,q as U,Y as u,bf as a,y as H,c as ae,al as Ve,F as pe,u as de,$ as Te,a0 as ze,b as Re,h as Ce,E as Ye}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{f as me,t as Je,h as Ke,i as We,_ as ie,j as Ge,k as Qe,l as Xe,m as Ze,g as et,n as tt,o as st,p as ot,q as nt,r as at,s as lt,u as it,v as ut,w as ct,x as rt,y as _t,z as ge}from"./index-4a465428.js";import{Y as ve,V as Q}from"./IEnum-5453a777.js";import{T as Ue,e as he,f as Se,g as fe,h as Le,I as pt,i as dt,j as mt,k as vt,l as ht,m as ft,n as gt,o as yt,p as kt,q as wt,r as bt,s as $t,t as xe,F as Ie,E as ce,u as re,v as _e,w as Pe}from"./@vicons-7a4ef312.js";import{j as K,e as ue,J as Oe,H as Ct,b as xt,K as It,o as ke,L as De,v as Pt,w as Tt,x as zt,y as Rt,z as Ut,B as St,M as Lt,O as Ot,i as Dt,P as Mt,a as Me,F as At,I as Et,k as qt,G as Nt,f as Bt,g as jt}from"./naive-ui-d8de3dda.js";import{p as we,_ as Ae,a as Ft,b as Ht,c as Vt}from"./content-0e30acaf.js";import{u as Ee,b as Yt}from"./vue-router-e5a2430e.js";import{_ as Jt}from"./post-skeleton-4d2b103e.js";import{l as Kt}from"./lodash-e0b37ac3.js";import{_ as Wt}from"./whisper-7dcedd50.js";import{c as Gt}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Qt}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{W as Xt}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 Zt={class:"reply-item"},es={class:"header-wrap"},ts={class:"username"},ss={class:"reply-name"},os={class:"timestamp"},ns={class:"base-wrap"},as={class:"content"},ls={class:"reply-switch"},is={class:"time-item"},us={class:"actions"},cs={class:"upvote-count"},rs=["onClick"],_s={class:"upvote-count"},ps={key:2,class:"action-item"},ds=["onClick"],ms=ee({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,v=le(),m=c(l.reply.is_thumbs_up==ve.YES),g=c(l.reply.is_thumbs_down==ve.YES),w=c(l.reply.thumbs_up_count),S=()=>{Je({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{m.value=!m.value,m.value?(w.value++,g.value=!1):w.value--}).catch(f=>{console.log(f)})},r=()=>{Ke({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(f=>{g.value=!g.value,g.value&&m.value&&(w.value--,m.value=!1)}).catch(f=>{console.log(f)})},I=()=>{q("focusReply",l.reply)},R=()=>{We({id:l.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(f=>{console.log(f)})};return(f,C)=>{const O=ye("router-link"),p=K,x=ue,D=Oe,b=Ct;return o(),_("div",Zt,[d("div",es,[d("div",ts,[t(O,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(z(l.reply.user.username),1)]),_:1},8,["to"]),d("span",ss,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),U(O,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(z(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",os,[T(z(l.reply.ip_loc)+" ",1),a(v).state.userInfo.is_admin||a(v).state.userInfo.id===l.reply.user.id?(o(),U(D,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:R},{trigger:n(()=>[t(x,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(p,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):u("",!0)])]),d("div",ns,[d("div",as,[t(b,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(z(l.reply.content),1)]),_:1})]),d("div",ls,[d("span",is,z(a(me)(l.reply.created_on)),1),d("div",us,[a(v).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:C[0]||(C[0]=H(()=>{},["stop"]))},[t(p,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),d("span",cs,z(w.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:H(S,["stop"])},[t(p,{size:"medium"},{default:n(()=>[m.value?u("",!0):(o(),U(a(he),{key:0})),m.value?(o(),U(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",_s,z(w.value>0?w.value:"赞"),1)],8,rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",ps,[t(p,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:H(r,["stop"])},[t(p,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),U(a(fe),{key:0})),g.value?(o(),U(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,ds)):u("",!0),a(v).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:I}," 回复 ")):u("",!0)])])])])}}});const vs=ie(ms,[["__scopeId","data-v-187a4ed3"]]),hs={class:"reply-compose-wrap"},fs={class:"reply-switch"},gs={class:"time-item"},ys={class:"actions"},ks={key:0,class:"action-item"},ws={class:"upvote-count"},bs=["onClick"],$s={class:"upvote-count"},Cs={key:2,class:"action-item"},xs=["onClick"],Is={key:0,class:"reply-input-wrap"},Ps=ee({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const v=E,m=le(),g=c(),w=c(!1),S=c(""),r=c(!1),I=+"300",R=c(v.comment.is_thumbs_up==ve.YES),f=c(v.comment.is_thumbs_down==ve.YES),C=c(v.comment.thumbs_up_count),O=()=>{Ge({tweet_id:v.comment.post_id,comment_id:v.comment.id}).then(b=>{R.value=!R.value,R.value?(C.value++,f.value=!1):C.value--}).catch(b=>{console.log(b)})},p=()=>{Qe({tweet_id:v.comment.post_id,comment_id:v.comment.id}).then(b=>{f.value=!f.value,f.value&&R.value&&(C.value--,R.value=!1)}).catch(b=>{console.log(b)})},x=b=>{w.value=b,b?setTimeout(()=>{var M;(M=g.value)==null||M.focus()},10):(r.value=!1,S.value="",l("reset"))},D=()=>{r.value=!0,Xe({comment_id:v.comment.id,at_user_id:v.atUserid,content:S.value}).then(b=>{x(!1),window.$message.success("评论成功"),l("reload")}).catch(b=>{r.value=!1})};return q({switchReply:x}),(b,M)=>{const s=K,y=xt,B=ue,N=It;return o(),_("div",hs,[d("div",fs,[d("span",gs,z(a(me)(b.comment.created_on)),1),d("div",ys,[a(m).state.userLogined?u("",!0):(o(),_("div",ks,[t(s,{size:"medium"},{default:n(()=>[t(a(he))]),_:1}),d("span",ws,z(C.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:H(O,["stop"])},[t(s,{size:"medium"},{default:n(()=>[R.value?u("",!0):(o(),U(a(he),{key:0})),R.value?(o(),U(a(Se),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",$s,z(C.value>0?C.value:"赞"),1)],8,bs)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",Cs,[t(s,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:H(p,["stop"])},[t(s,{size:"medium"},{default:n(()=>[f.value?u("",!0):(o(),U(a(fe),{key:0})),f.value?(o(),U(a(Le),{key:1,class:"show"})):u("",!0)]),_:1})],8,xs)):u("",!0),a(m).state.userLogined&&!w.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:M[0]||(M[0]=V=>x(!0))}," 回复 ")):u("",!0),a(m).state.userLogined&&w.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:M[1]||(M[1]=V=>x(!1))}," 取消 ")):u("",!0)])]),w.value?(o(),_("div",Is,[t(N,null,{default:n(()=>[t(y,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:v.atUsername?"@"+v.atUsername:"请输入回复内容..",maxlength:a(I),value:S.value,"onUpdate:value":M[2]||(M[2]=V=>S.value=V),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(B,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:D},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ts=ie(Ps,[["__scopeId","data-v-f9af7a93"]]),zs={class:"comment-item"},Rs={class:"nickname-wrap"},Us={class:"username-wrap"},Ss={class:"opt-wrap"},Ls={class:"timestamp"},Os=["innerHTML"],Ds={class:"reply-wrap"},Ms=ee({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(E,{emit:q}){const l=E,v=le(),m=Ee(),g=c(0),w=c(""),S=c(),r=ae(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(x=>{(+x.type==1||+x.type==2)&&p.texts.push(x),+x.type==3&&p.imgs.push(x)}),p}),I=(p,x)=>{let D=p.target;if(D.dataset.detail){const b=D.dataset.detail.split(":");b.length===2&&(v.commit("refresh"),b[0]==="tag"?window.$message.warning("评论内的无效话题"):m.push({name:"user",query:{s:b[1]}}))}},R=p=>{var x,D;g.value=p.user_id,w.value=((x=p.user)==null?void 0:x.username)||"",(D=S.value)==null||D.switchReply(!0)},f=()=>{q("reload")},C=()=>{g.value=0,w.value=""},O=()=>{Ze({id:r.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{f()},50)}).catch(p=>{})};return(p,x)=>{const D=ke,b=ye("router-link"),M=K,s=ue,y=Oe,B=Ae,N=Ts,V=vs,Y=De;return o(),_("div",zs,[t(Y,{"content-indented":""},Ve({avatar:n(()=>[t(D,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Rs,[t(b,{onClick:x[0]||(x[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:r.value.user.username}}},{default:n(()=>[T(z(r.value.user.nickname),1)]),_:1},8,["to"])]),d("span",Us," @"+z(r.value.user.username),1)]),"header-extra":n(()=>[d("div",Ss,[d("span",Ls,z(r.value.ip_loc),1),a(v).state.userInfo.is_admin||a(v).state.userInfo.id===r.value.user.id?(o(),U(y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:n(()=>[t(s,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(M,null,{default:n(()=>[t(a(Ue))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),U(B,{key:0,imgs:r.value.imgs},null,8,["imgs"])):u("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:r.value,"at-userid":g.value,"at-username":w.value,onReload:f,onReset:C},null,8,["comment","at-userid","at-username"]),d("div",Ds,[(o(!0),_(pe,null,de(r.value.replies,F=>(o(),U(V,{key:F.id,reply:F,"tweet-id":r.value.post_id,onFocusReply:R,onReload:f},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(pe,null,de(r.value.texts,F=>(o(),_("span",{key:F.id,class:"comment-text",onClick:x[1]||(x[1]=H(P=>I(P,r.value.id),["stop"])),innerHTML:a(we)(F.content).content},null,8,Os))),128))]),key:"0"}:void 0]),1024)])}}});const As=ie(Ms,[["__scopeId","data-v-36dac8c8"]]),Es=E=>(Te("data-v-d9073453"),E=E(),ze(),E),qs={key:0,class:"compose-wrap"},Ns={class:"compose-line"},Bs={class:"compose-user"},js={class:"compose-line compose-options"},Fs={class:"attachment"},Hs={class:"submit-wrap"},Vs={class:"attachment-list-wrap"},Ys={key:1,class:"compose-wrap"},Js=Es(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ks={key:0,class:"login-only-wrap"},Ws={key:1,class:"login-wrap"},Gs=ee({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,v=le(),m=c([]),g=c(!1),w=c(!1),S=c(!1),r=c(""),I=c(),R=c("public/image"),f=c([]),C=c([]),O=c("true".toLowerCase()==="true"),p=+"300",x="/v1/attachment",D=ae(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),b=Kt.debounce(h=>{et({k:h}).then(k=>{let $=[];k.suggest.map(e=>{$.push({label:e,value:e})}),m.value=$,w.value=!1}).catch(k=>{w.value=!1})},200),M=(h,k)=>{w.value||(w.value=!0,k==="@"&&b(h))},s=h=>{h.length>p?r.value=h.substring(0,p):r.value=h},y=h=>{R.value=h},B=h=>{for(let i=0;i30&&(h[i].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+e)}f.value=h},N=async h=>{var k,$;return R.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=h.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):R.value==="image"&&(($=h.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},V=({file:h,event:k})=>{var $;try{let e=JSON.parse(($=k.target)==null?void 0:$.response);e.code===0&&R.value==="public/image"&&C.value.push({id:h.id,content:e.data.content})}catch{window.$message.error("上传失败")}},Y=({file:h,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(A=>{i+=":"+A}),window.$message.error(i)}}catch{window.$message.error("上传失败")}},F=({file:h})=>{let k=C.value.findIndex($=>$.id===h.id);k>-1&&C.value.splice(k,1)},P=()=>{g.value=!0},L=()=>{var h;g.value=!1,(h=I.value)==null||h.clear(),f.value=[],r.value="",C.value=[]},te=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:h}=we(r.value);const k=[];let $=100;k.push({content:r.value,type:2,sort:$}),C.value.map(e=>{$++,k.push({content:e.content,type:3,sort:$})}),S.value=!0,tt({contents:k,post_id:l.postId,users:Array.from(new Set(h))}).then(e=>{window.$message.success("发布成功"),S.value=!1,q("post-success"),L()}).catch(e=>{S.value=!1})},W=h=>{v.commit("triggerAuth",!0),v.commit("triggerAuthKey",h)};return(h,k)=>{const $=ke,e=Pt,i=K,A=ue,se=Tt,G=zt,oe=Rt,ne=Ut,J=St;return o(),_("div",null,[a(v).state.userInfo.id>0?(o(),_("div",qs,[d("div",Ns,[d("div",Bs,[t($,{round:"",size:30,src:a(v).state.userInfo.avatar},null,8,["src"])]),t(e,{type:"textarea",size:"large",autosize:"",bordered:!1,options:m.value,prefix:["@"],loading:w.value,value:r.value,disabled:l.lock===1,"onUpdate:value":s,onSearch:M,onFocus:P,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),U(J,{key:0,ref_key:"uploadRef",ref:I,abstract:"","list-type":"image",multiple:!0,max:9,action:x,headers:{Authorization:D.value},data:{type:R.value},"file-list":f.value,onBeforeUpload:N,onFinish:V,onError:Y,onRemove:F,"onUpdate:fileList":B},{default:n(()=>[d("div",js,[d("div",Fs,[t(se,{abstract:""},{default:n(({handleClick:Z})=>[t(A,{disabled:f.value.length>0&&R.value==="public/video"||f.value.length===9,onClick:()=>{y("public/image"),Z()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(i,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(pt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(oe,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(G,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(p)*100},null,8,["percentage"])]),default:n(()=>[T(" "+z(r.value.length)+" / "+z(a(p)),1)]),_:1})]),d("div",Hs,[t(A,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:L},{default:n(()=>[T(" 取消 ")]),_:1}),t(A,{loading:S.value,onClick:te,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",Vs,[t(ne)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",Ys,[Js,O.value?u("",!0):(o(),_("div",Ks,[t(A,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=Z=>W("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),O.value?(o(),_("div",Ws,[t(A,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=Z=>W("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(A,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=Z=>W("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Qs=ie(Gs,[["__scopeId","data-v-d9073453"]]),Xs={class:"username-wrap"},Zs={class:"options"},eo={key:0},to=["innerHTML"],so={class:"timestamp"},oo={key:0},no={key:1},ao={class:"opts-wrap"},lo=["onClick"],io={class:"opt-item"},uo=["onClick"],co=["onClick"],ro=ee({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,v="true".toLowerCase()==="true",m=le(),g=Ee(),w=c(!1),S=c(!1),r=c(!1),I=c(!1),R=c(!1),f=c(!1),C=c(!1),O=c(!1),p=c(Q.PUBLIC),x=c(!1),D=c({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),b=e=>{D.value=e,x.value=!0},M=()=>{x.value=!1},s=ae({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}}),y=e=>()=>Ce(K,null,{default:()=>Ce(e)}),B=ae(()=>{var A;let e=[];if(!m.state.userInfo.is_admin&&m.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:y(kt)}),e;e.push({label:"删除",key:"delete",icon:y(wt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:y(bt)}):e.push({label:"解锁",key:"unlock",icon:y($t)}),m.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:y(xe)}):e.push({label:"取消置顶",key:"unstick",icon:y(xe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:y(Ie)}):e.push({label:"取消亮点",key:"unhighlight",icon:y(Ie)});let i;return s.value.visibility===Q.PUBLIC?i={label:"公开",key:"vpublic",icon:y(ce),children:[{label:"私密",key:"vprivate",icon:y(re)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:s.value.visibility===Q.PRIVATE?i={label:"私密",key:"vprivate",icon:y(re),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:v&&s.value.visibility===Q.FRIEND?i={label:"好友可见",key:"vfriend",icon:y(Pe),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"私密",key:"vprivate",icon:y(re)},{label:"关注可见",key:"vfollowing",icon:y(_e)}]}:i={label:"关注可见",key:"vfollowing",icon:y(_e),children:[{label:"公开",key:"vpublic",icon:y(ce)},{label:"私密",key:"vprivate",icon:y(re)}]},v&&s.value.visibility!==Q.FRIEND&&((A=i.children)==null||A.push({label:"好友可见",key:"vfriend",icon:y(Pe)})),e.push(i),e}),N=e=>{g.push({name:"post",query:{id:e}})},V=(e,i)=>{if(e.target.dataset.detail){const A=e.target.dataset.detail.split(":");if(A.length===2){m.commit("refresh"),A[0]==="tag"?g.push({name:"home",query:{q:A[1],t:"tag"}}):g.push({name:"user",query:{s:A[1]}});return}}N(i)},Y=e=>{switch(e){case"whisper":b(l.post.user);break;case"delete":r.value=!0;break;case"lock":case"unlock":I.value=!0;break;case"stick":case"unstick":R.value=!0;break;case"highlight":case"unhighlight":f.value=!0;break;case"vpublic":p.value=0,C.value=!0;break;case"vprivate":p.value=1,C.value=!0;break;case"vfriend":p.value=2,C.value=!0;break;case"vfollowing":p.value=3,C.value=!0;break}},F=()=>{nt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{m.commit("refresh")},50)}).catch(e=>{O.value=!1})},P=()=>{at({id:s.value.id}).then(e=>{q("reload"),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{O.value=!1})},L=()=>{lt({id:s.value.id}).then(e=>{q("reload"),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{O.value=!1})},te=()=>{it({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=>{O.value=!1})},W=()=>{ut({id:s.value.id,visibility:p.value}).then(e=>{q("reload"),window.$message.success("修改可见性成功")}).catch(e=>{O.value=!1})},h=()=>{ct({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=()=>{rt({id:s.value.id}).then(e=>{S.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)})},$=()=>{Gt(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Re(()=>{m.state.userInfo.id>0&&(st({id:s.value.id}).then(e=>{w.value=e.status}).catch(e=>{console.log(e)}),ot({id:s.value.id}).then(e=>{S.value=e.status}).catch(e=>{console.log(e)}))}),(e,i)=>{const A=ke,se=ye("router-link"),G=Lt,oe=ue,ne=Ot,J=Dt,Z=Wt,be=Ft,qe=Ae,Ne=Ht,Be=Vt,$e=Mt,je=Me,Fe=De;return o(),_("div",{class:"detail-item",onClick:i[7]||(i[7]=j=>N(s.value.id))},[t(Fe,null,{avatar:n(()=>[t(A,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(se,{onClick:i[0]||(i[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(z(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",Xs," @"+z(s.value.user.username),1),s.value.is_top?(o(),U(G,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(Q).PRIVATE?(o(),U(G,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(Q).FRIEND?(o(),U(G,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Zs,[t(ne,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:Y},{default:n(()=>[t(oe,{quaternary:"",circle:""},{icon:n(()=>[t(a(K),null,{default:n(()=>[t(a(dt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(J,{show:r.value,"onUpdate:show":i[1]||(i[1]=j=>r.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show"]),t(J,{show:I.value,"onUpdate:show":i[2]||(i[2]=j=>I.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:P},null,8,["show","content"]),t(J,{show:R.value,"onUpdate:show":i[3]||(i[3]=j=>R.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(J,{show:f.value,"onUpdate:show":i[4]||(i[4]=j=>f.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:te},null,8,["show","content"]),t(J,{show:C.value,"onUpdate:show":i[5]||(i[5]=j=>C.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:W},null,8,["show","content"]),t(Z,{show:x.value,user:D.value,onSuccess:M},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(Ne,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Be,{links:s.value.links},null,8,["links"]),d("div",so,[T(" 发布于 "+z(a(me)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",oo,[t($e,{vertical:""}),T(" "+z(s.value.ip_loc),1)])):u("",!0),!a(m).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",no,[t($e,{vertical:""}),T(" 最后回复 "+z(a(me)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",ao,[t(je,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:H(h,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[w.value?u("",!0):(o(),U(a(mt),{key:0})),w.value?(o(),U(a(vt),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+z(s.value.upvote_count),1)],8,lo),d("div",io,[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ht))]),_:1}),T(" "+z(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:H(k,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[S.value?u("",!0):(o(),U(a(ft),{key:0})),S.value?(o(),U(a(gt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+z(s.value.collection_count),1)],8,uo),d("div",{class:"opt-item hover",onClick:H($,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(yt))]),_:1}),T(" "+z(s.value.share_count),1)],8,co)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",eo,[(o(!0),_(pe,null,de(s.value.texts,j=>(o(),_("span",{key:j.id,class:"post-text",onClick:i[6]||(i[6]=H(He=>V(He,s.value.id),["stop"])),innerHTML:a(we)(j.content).content},null,8,to))),128))])):u("",!0)]),_:1})])}}});const _o=E=>(Te("data-v-a8d601f1"),E=E(),ze(),E),po={key:0,class:"detail-wrap"},mo={key:1,class:"empty-wrap"},vo={key:0,class:"comment-opts-wrap"},ho=_o(()=>d("span",{class:"comment-title-item"},"评论",-1)),fo={key:2},go={key:0,class:"skeleton-wrap"},yo={key:1},ko={key:0,class:"empty-wrap"},wo={key:0,class:"load-more-spinner"},bo={key:1,class:"load-more-spinner"},$o={key:2,class:"load-more-spinner"},Co={key:3,class:"load-more-spinner"},xo={key:4,class:"load-more-spinner"},Io={key:5,class:"load-more-spinner"},X=20,Po=ee({__name:"Post",setup(E){const q=Yt(),l=c({}),v=c(!1),m=c(!1),g=c([]),w=ae(()=>+q.query.id),S=c("default"),r=c(!0);let I={loading(){},loaded(){},complete(){},error(){}};const R=P=>{S.value=P,P==="default"&&(r.value=!0),Y(I)},f=()=>{l.value={id:0},v.value=!0,_t({id:w.value}).then(P=>{v.value=!1,l.value=P,Y(I)}).catch(P=>{v.value=!1})};let C=1;const O=c(!1),p=c([]),x=P=>{O.value||ge({id:l.value.id,style:"default",page:C,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(C===1?p.value=L.list:p.value.push(...L.list),g.value=p.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})};let D=1,b=c(!1);const M=c([]),s=P=>{b.value||ge({id:l.value.id,style:"hots",page:D,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(D===1?M.value=L.list:M.value.push(...L.list),g.value=M.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})};let y=1,B=c(!1);const N=c([]),V=P=>{B.value||ge({id:l.value.id,style:"newest",page:y,page_size:X}).then(L=>{P!==null&&(I=P),L.list.length0&&(y===1?N.value=L.list:N.value.push(...L.list),g.value=N.value),I.loaded(),m.value=!1}).catch(L=>{m.value=!1,I.error()})},Y=P=>{w.value<1||(g.value.length===0&&(m.value=!0),S.value==="default"?(g.value=p.value,x(P)):S.value==="hots"?(g.value=M.value,s(P)):(g.value=N.value,V(P)),m.value=!1)},F=()=>{C=1,O.value=!1,p.value=[],D=1,b.value=!1,M.value=[],y=1,B.value=!1,N.value=[],Y(I)};return Re(()=>{f()}),Ye(w,()=>{w.value>0&&q.name==="post"&&f()}),(P,L)=>{const te=Qt,W=ro,h=Et,k=qt,$=Nt,e=Bt,i=jt,A=Qs,se=Jt,G=As,oe=Me,ne=At;return o(),_("div",null,[t(te,{title:"泡泡详情",back:!0}),t(ne,{class:"main-content-wrap",bordered:""},{default:n(()=>[t($,null,{default:n(()=>[t(k,{show:v.value},{default:n(()=>[l.value.id>1?(o(),_("div",po,[t(W,{post:l.value,onReload:f},null,8,["post"])])):(o(),_("div",mo,[t(h,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",vo,[t(i,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":R},{prefix:n(()=>[ho]),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(),U($,{key:1},{default:n(()=>[t(A,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",fo,[m.value?(o(),_("div",go,[t(se,{num:5})])):(o(),_("div",yo,[g.value.length===0?(o(),_("div",ko,[t(h,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(pe,null,de(g.value,J=>(o(),U($,{key:J.id},{default:n(()=>[t(G,{comment:J,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=X?(o(),U(oe,{key:3,justify:"center"},{default:n(()=>[t(a(Xt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:Y},{spinner:n(()=>[r.value&&O.value?(o(),_("span",wo)):u("",!0),!r.value&&a(b)?(o(),_("span",bo)):u("",!0),!r.value&&a(B)?(o(),_("span",$o)):u("",!0),r.value&&!O.value?(o(),_("span",Co,"加载评论")):u("",!0),!r.value&&!a(b)?(o(),_("span",xo,"加载评论")):u("",!0),!r.value&&!a(B)?(o(),_("span",Io,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const un=ie(Po,[["__scopeId","data-v-a8d601f1"]]);export{un as default}; diff --git a/web/dist/assets/Post-0b1f6baf.css b/web/dist/assets/Post-8fdcb727.css similarity index 94% rename from web/dist/assets/Post-0b1f6baf.css rename to web/dist/assets/Post-8fdcb727.css index dc66b493..6ae9fdfa 100644 --- a/web/dist/assets/Post-0b1f6baf.css +++ b/web/dist/assets/Post-8fdcb727.css @@ -1 +1 @@ -.reply-item[data-v-187a4ed3]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-187a4ed3]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-187a4ed3]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-187a4ed3]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-187a4ed3]{display:block}.reply-item .base-wrap .content[data-v-187a4ed3]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-187a4ed3]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-187a4ed3]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-187a4ed3]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-187a4ed3]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-187a4ed3]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-187a4ed3]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-187a4ed3]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-187a4ed3]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-187a4ed3]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-36dac8c8]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-36dac8c8]{font-size:14px}.comment-item .username-wrap[data-v-36dac8c8]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-36dac8c8]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-36dac8c8]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-36dac8c8]{margin-left:4px}.comment-item .comment-text[data-v-36dac8c8]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-36dac8c8]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-36dac8c8]{margin-right:10px}.reply-wrap[data-v-36dac8c8]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-36dac8c8]:last-child{border-bottom:none}.dark .reply-wrap[data-v-36dac8c8]{background:#18181c}.dark .comment-item[data-v-36dac8c8]{background-color:#101014bf}.compose-wrap[data-v-d9073453]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-d9073453]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-d9073453]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-d9073453]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-d9073453]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-d9073453]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-d9073453]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-d9073453]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-d9073453]{margin:0 4px}.attachment[data-v-d9073453]{display:flex;align-items:center}.attachment .text-statistic[data-v-d9073453]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-d9073453]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-d9073453]{overflow:hidden}.dark .compose-mention[data-v-d9073453],.dark .compose-wrap[data-v-d9073453]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-121ae886]{min-height:100px}.comment-opts-wrap[data-v-121ae886]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-121ae886]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-121ae886]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-121ae886]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-121ae886],.dark .skeleton-wrap[data-v-121ae886]{background-color:#101014bf} +.reply-item[data-v-187a4ed3]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-187a4ed3]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-187a4ed3]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-187a4ed3]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-187a4ed3]{display:block}.reply-item .base-wrap .content[data-v-187a4ed3]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-187a4ed3]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-187a4ed3]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-187a4ed3]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-187a4ed3]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-187a4ed3]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-187a4ed3]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-187a4ed3]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-187a4ed3]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-187a4ed3]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-187a4ed3]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-187a4ed3]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-36dac8c8]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-36dac8c8]{font-size:14px}.comment-item .username-wrap[data-v-36dac8c8]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-36dac8c8]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-36dac8c8]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-36dac8c8]{margin-left:4px}.comment-item .comment-text[data-v-36dac8c8]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-36dac8c8]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-36dac8c8]{margin-right:10px}.reply-wrap[data-v-36dac8c8]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-36dac8c8]:last-child{border-bottom:none}.dark .reply-wrap[data-v-36dac8c8]{background:#18181c}.dark .comment-item[data-v-36dac8c8]{background-color:#101014bf}.compose-wrap[data-v-d9073453]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-d9073453]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-d9073453]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-d9073453]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-d9073453]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-d9073453]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-d9073453]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-d9073453]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-d9073453]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-d9073453]{margin:0 4px}.attachment[data-v-d9073453]{display:flex;align-items:center}.attachment .text-statistic[data-v-d9073453]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-d9073453]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-d9073453]{overflow:hidden}.dark .compose-mention[data-v-d9073453],.dark .compose-wrap[data-v-d9073453]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-a8d601f1]{min-height:100px}.comment-opts-wrap[data-v-a8d601f1]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-a8d601f1]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-a8d601f1]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-a8d601f1]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-a8d601f1],.dark .skeleton-wrap[data-v-a8d601f1]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-bdfe7ab1.js b/web/dist/assets/Profile-6e748e2f.js similarity index 95% rename from web/dist/assets/Profile-bdfe7ab1.js rename to web/dist/assets/Profile-6e748e2f.js index cd2a9ae9..6b216f3f 100644 --- a/web/dist/assets/Profile-bdfe7ab1.js +++ b/web/dist/assets/Profile-6e748e2f.js @@ -1 +1 @@ -import{_ as fe}from"./whisper-1cdd2a38.js";import{_ as he,a as ge}from"./post-item.vue_vue_type_style_index_0_lang-e778d128.js";import{_ as ke}from"./post-skeleton-f6905e5e.js";import{_ as ye}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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,F as ze,_ as qe}from"./index-121dfc2d.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Fe,I as Ne,k as Ve,G as De}from"./naive-ui-d8de3dda.js";import"./content-ebf88604.js";import"./@vicons-7a4ef312.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"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={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"),H=n(+T.query.p||1),R=n(1),A=n(1),G=n(1),Y=n(1),t=n(+T.query.p||1),h=n(20),r=n(0),J=n(0),K=n(0),O=n(0),Q=n(0),X=n(0),F=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,F.value=!0},te=()=>{F.value=!1},N=()=>{switch(p.value){case"post":V();break;case"comment":D();break;case"highlight":U();break;case"media":W();break;case"star":j();break}},V=()=>{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,J.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},D=()=>{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=H.value,r.value=J.value,V();break;case"comment":s.value=$.value,t.value=R.value,r.value=K.value,D();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=Y.value,r.value=X.value,j();break}},le=()=>{switch(p.value){case"post":H.value=t.value,V();break;case"comment":R.value=t.value,D();break;case"highlight":A.value=t.value,U();break;case"media":G.value=t.value,W();break;case"star":Y.value=t.value,j();break}},oe=()=>{t.value{N()}),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(()=>{N()},0);return}P.path!=="/post"&&a.path==="/profile"&&(t.value=+T.query.p||1,setTimeout(()=>{N()},0))}),(a,P)=>{const ne=ye,ue=Ce,ie=Le,ee=Ie("router-link"),M=Be,re=Fe,ce=ke,ve=Ne,z=he,k=De,q=ge,_e=fe,me=Se,pe=Ve,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",He,[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",Ye,[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",Je,[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:F.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}; +import{_ as fe}from"./whisper-7dcedd50.js";import{_ as he,a as ge}from"./post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js";import{_ as ke}from"./post-skeleton-4d2b103e.js";import{_ as ye}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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,F as ze,_ as qe}from"./index-4a465428.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Fe,I as Ne,k as Ve,G as De}from"./naive-ui-d8de3dda.js";import"./content-0e30acaf.js";import"./@vicons-7a4ef312.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"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={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"),H=n(+T.query.p||1),R=n(1),A=n(1),G=n(1),Y=n(1),t=n(+T.query.p||1),h=n(20),r=n(0),J=n(0),K=n(0),O=n(0),Q=n(0),X=n(0),F=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,F.value=!0},te=()=>{F.value=!1},N=()=>{switch(p.value){case"post":V();break;case"comment":D();break;case"highlight":U();break;case"media":W();break;case"star":j();break}},V=()=>{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,J.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},D=()=>{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=H.value,r.value=J.value,V();break;case"comment":s.value=$.value,t.value=R.value,r.value=K.value,D();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=Y.value,r.value=X.value,j();break}},le=()=>{switch(p.value){case"post":H.value=t.value,V();break;case"comment":R.value=t.value,D();break;case"highlight":A.value=t.value,U();break;case"media":G.value=t.value,W();break;case"star":Y.value=t.value,j();break}},oe=()=>{t.value{N()}),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(()=>{N()},0);return}P.path!=="/post"&&a.path==="/profile"&&(t.value=+T.query.p||1,setTimeout(()=>{N()},0))}),(a,P)=>{const ne=ye,ue=Ce,ie=Le,ee=Ie("router-link"),M=Be,re=Fe,ce=ke,ve=Ne,z=he,k=De,q=ge,_e=fe,me=Se,pe=Ve,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",He,[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",Ye,[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",Je,[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:F.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/Setting-eb815798.js b/web/dist/assets/Setting-bde8e499.js similarity index 98% rename from web/dist/assets/Setting-eb815798.js rename to web/dist/assets/Setting-bde8e499.js index 7dd9ede8..7028fcd1 100644 --- a/web/dist/assets/Setting-eb815798.js +++ b/web/dist/assets/Setting-bde8e499.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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 R,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{a0 as X,a1 as Se,a2 as Ue,a3 as Re,a4 as qe,a5 as Ae,a6 as Be,_ as Ne}from"./index-121dfc2d.js";import{Y as ze}from"./@vicons-7a4ef312.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-d8de3dda.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 j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ye={class:"base-line avatar"},Ge={class:"base-line"},He=j(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ze={class:"base-line"},Qe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=j(()=>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=j(()=>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),K=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),H=d(),J=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"&&Se({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.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=J.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(z.value=!0,Re({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=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.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=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{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&&U.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=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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")),O(),T()}),(n,e)=>{const v=we,f=xe,c=De,D=Fe,h=je,ge=Oe,F=Ke,Z=Te,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",Ye,[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(D,{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",Ge,[He,C.value?_("",!0):(r(),g("div",Je,R(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(" @"+R(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(R(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:Y,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:O},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:U.value,loading:P.value,onClick:ce},{default:s(()=>[p(R(I.value>0&&U.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(R(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:G,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:T},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:K.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(" 您已设置密码 "),S.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:H,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:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=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=>S.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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 R,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{a0 as X,a1 as Se,a2 as Ue,a3 as Re,a4 as qe,a5 as Ae,a6 as Be,_ as Ne}from"./index-4a465428.js";import{Y as ze}from"./@vicons-7a4ef312.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-d8de3dda.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 j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ye={class:"base-line avatar"},Ge={class:"base-line"},He=j(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ze={class:"base-line"},Qe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=j(()=>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=j(()=>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),K=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),H=d(),J=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"&&Se({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.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=J.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=Y.value)==null||e.validate(v=>{v||(z.value=!0,Re({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=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.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=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{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&&U.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=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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")),O(),T()}),(n,e)=>{const v=we,f=xe,c=De,D=Fe,h=je,ge=Oe,F=Ke,Z=Te,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",Ye,[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(D,{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",Ge,[He,C.value?_("",!0):(r(),g("div",Je,R(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(" @"+R(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(R(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:Y,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:O},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:U.value,loading:P.value,onClick:ce},{default:s(()=>[p(R(I.value>0&&U.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(R(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:G,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:T},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:K.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(" 您已设置密码 "),S.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:H,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:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=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=>S.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Topic-2c2b98aa.js b/web/dist/assets/Topic-a63673d1.js similarity index 97% rename from web/dist/assets/Topic-2c2b98aa.js rename to web/dist/assets/Topic-a63673d1.js index 0e728843..0e212094 100644 --- a/web/dist/assets/Topic-2c2b98aa.js +++ b/web/dist/assets/Topic-a63673d1.js @@ -1 +1 @@ -import{A as $,B as M,C as O,D as x,_ as z}from"./index-121dfc2d.js";import{x as D}from"./@vicons-7a4ef312.js";import{d as F,H as i,c as A,b as q,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 H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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=A(()=>{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":O({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":M({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 q(()=>{r.value=!1}),(e,o)=>{const w=U("router-link"),g=J,k=C,a=K,d=P,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(D))]),_: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=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,x({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 q(()=>{g()}),(a,d)=>{const v=te,p=X,L=C,V=Z,N=ie,S=ee,E=oe,I=W;return c(),_("div",null,[n(v,{title:"话题"}),n(I,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({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(L,{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(E,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Se=z(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Se as default}; +import{A as $,B as M,C as O,D as x,_ as z}from"./index-4a465428.js";import{x as D}from"./@vicons-7a4ef312.js";import{d as F,H as i,c as A,b as q,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 H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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=A(()=>{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":O({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":M({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 q(()=>{r.value=!1}),(e,o)=>{const w=U("router-link"),g=J,k=C,a=K,d=P,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(D))]),_: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=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,x({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 q(()=>{g()}),(a,d)=>{const v=te,p=X,L=C,V=Z,N=ie,S=ee,E=oe,I=W;return c(),_("div",null,[n(v,{title:"话题"}),n(I,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({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(L,{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(E,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Se=z(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Se as default}; diff --git a/web/dist/assets/User-606a2446.js b/web/dist/assets/User-9ecd5433.js similarity index 97% rename from web/dist/assets/User-606a2446.js rename to web/dist/assets/User-9ecd5433.js index 0d824a50..224c6cb8 100644 --- a/web/dist/assets/User-606a2446.js +++ b/web/dist/assets/User-9ecd5433.js @@ -1 +1 @@ -import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-e778d128.js";import{_ as Ne}from"./post-skeleton-f6905e5e.js";import{_ as Ve}from"./whisper-1cdd2a38.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.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,R as Ge,c as Ee,b as Je,E as Ke,r as Ye,f as u,Y as d,bf as k,y as ce,F as $,u as T,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{G as Ze,_ as me,H as ea,F as aa,e as V,I as sa,J as ta,K as la,L as na}from"./index-121dfc2d.js";import{R as oa,H as ua,S as ia,b as ra,e as fe,i as ca,T as _a,F as va,a as da,j as ve,o as pa,M as ma,O as fa,k as ha,f as ga,g as wa,I as ka,G as ya}from"./naive-ui-d8de3dda.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,p as $a,y as de,z as Ta,v as xa,D as za,G as Ua}from"./@vicons-7a4ef312.js";import"./content-ebf88604.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 Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=pe({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ue,{emit:O}){const y=ue,g=i(""),F=i(!1),c=()=>{O("success")},h=()=>{F.value=!0,Ze({user_id:y.user.id,greetings:g.value}).then(a=>{window.$message.success("发送成功"),F.value=!1,g.value="",c()}).catch(a=>{F.value=!1})};return(a,v)=>{const L=oa,A=ua,l=ia,I=ra,q=fe,C=ca;return s(),m(C,{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",Fa,[t(l,{"show-icon":!1},{default:r(()=>[U(" 发送添加朋友申请给: "),t(A,{style:{"max-width":"100%"}},{default:r(()=>[t(L,{type:"success"},{default:r(()=>[U(x(a.user.nickname)+"@"+x(a.user.username),1)]),_:1})]),_:1})]),_:1}),f("div",Ia,[t(I,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:g.value,"onUpdate:value":v[0]||(v[0]=M=>g.value=M),maxlength:"120","show-count":""},null,8,["value"])]),f("div",qa,[t(q,{strong:"",secondary:"",type:"primary",loading:F.value,onClick:h},{default:r(()=>[U(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=me(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Ba={class:"info-item"},Da={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ga={key:1},Ea={key:0,class:"empty-wrap"},Ja={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 O=_a(),y=Qe(),g=Xe(),F="true".toLowerCase()==="true",c=i(!1),h=i(!1),a=Ge({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),v=i(!1),L=i(!1),A=i(!1),l=i([]),I=i([]),q=i([]),C=i([]),M=i([]),B=i([]),S=i(g.query.s||""),n=i(+g.query.p||1),p=i("post"),G=i(+g.query.p||1),E=i(1),J=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=[],I.value=[],q.value=[],C.value=[],M.value=[],B.value=[],p.value="post",n.value=1,G.value=1,E.value=1,J.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),I.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),q.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),C.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),M.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=I.value,n.value=G.value,_.value=Q.value,j();break;case"comment":l.value=q.value,n.value=E.value,_.value=X.value,se();break;case"highlight":l.value=C.value,n.value=J.value,_.value=Z.value,te();break;case"media":l.value=M.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":G.value=n.value,j();break;case"comment":E.value=n.value,se();break;case"highlight":J.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=()=>{A.value=!0},Pe=()=>{L.value=!1},$e=()=>{A.value=!1},W=e=>()=>_e(ve,null,{default:()=>_e(e)}),Te=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(Ta)}):e.push({label:"关注",key:"follow",icon:W(xa)}),F&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:W(za)}):e.push({label:"添加朋友",key:"requesting",icon:W(Ua)})),e}),xe=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":Fe();break}},ze=()=>{O.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=()=>{O.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)})}})},Fe=()=>{O.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)})}})},Ie=()=>{n.value<_.value||_.value==0?(h.value=!1,n.value++,ke()):h.value=!0};return Je(()=>{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 qe=je,Ce=pa,oe=ma,ie=Ye("router-link"),Me=fe,Se=fa,We=Ve,re=ha,R=ga,Le=wa,Oe=Ne,Ae=ka,H=Re,P=ya,N=He,Be=va,De=da;return s(),u("div",null,[t(qe,{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(Ce,{size:72,src:a.avatar},null,8,["src"])]),f("div",La,[f("div",Oa,[f("strong",null,x(a.nickname),1),f("span",null," @"+x(a.username),1),F&&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",Aa,[f("span",Ba,"UID. "+x(a.id),1),f("span",Da,x(k(aa)(a.created_on))+" 加入",1)]),f("div",Ra,[f("span",Ha,[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(" 关注  "+x(a.follows),1)]),_:1},8,["to"])]),f("span",Na,[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(" 粉丝  "+x(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:Te.value,onSelect:xe},{default:r(()=>[t(Me,{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(Ma,{show:A.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(R,{name:"post",tab:"泡泡"}),t(R,{name:"comment",tab:"评论"}),t(R,{name:"highlight",tab:"亮点"}),t(R,{name:"media",tab:"图文"}),t(R,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),c.value&&l.value.length===0?(s(),u("div",ja,[t(Oe,{num:w.value},null,8,["num"])])):(s(),u("div",Ga,[l.value.length===0?(s(),u("div",Ea,[t(Ae,{size:"large",description:"暂无数据"})])):d("",!0),k(y).state.desktopModelShow?(s(),u("div",Ja,[p.value==="post"?(s(),u("div",Ka,[(s(!0),u($,null,T(I.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",Ya,[(s(!0),u($,null,T(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==="highlight"?(s(),u("div",Qa,[(s(!0),u($,null,T(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==="media"?(s(),u("div",Xa,[(s(!0),u($,null,T(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==="star"?(s(),u("div",Za,[(s(!0),u($,null,T(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)])):(s(),u("div",es,[p.value==="post"?(s(),u("div",as,[(s(!0),u($,null,T(I.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="comment"?(s(),u("div",ss,[(s(!0),u($,null,T(q.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="highlight"?(s(),u("div",ts,[(s(!0),u($,null,T(C.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="media"?(s(),u("div",ls,[(s(!0),u($,null,T(M.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="star"?(s(),u("div",ns,[(s(!0),u($,null,T(B.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{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=>Ie())},{spinner:r(()=>[f("div",os,[h.value?d("",!0):(s(),m(re,{key:0,size:14})),f("span",us,x(h.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Rs=me(is,[["__scopeId","data-v-ebc19734"]]);export{Rs as default}; +import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js";import{_ as Ne}from"./post-skeleton-4d2b103e.js";import{_ as Ve}from"./whisper-7dcedd50.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.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,R as Ge,c as Ee,b as Je,E as Ke,r as Ye,f as u,Y as d,bf as k,y as ce,F as $,u as T,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{G as Ze,_ as me,H as ea,F as aa,e as V,I as sa,J as ta,K as la,L as na}from"./index-4a465428.js";import{R as oa,H as ua,S as ia,b as ra,e as fe,i as ca,T as _a,F as va,a as da,j as ve,o as pa,M as ma,O as fa,k as ha,f as ga,g as wa,I as ka,G as ya}from"./naive-ui-d8de3dda.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,p as $a,y as de,z as Ta,v as xa,D as za,G as Ua}from"./@vicons-7a4ef312.js";import"./content-0e30acaf.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 Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=pe({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ue,{emit:O}){const y=ue,g=i(""),F=i(!1),c=()=>{O("success")},h=()=>{F.value=!0,Ze({user_id:y.user.id,greetings:g.value}).then(a=>{window.$message.success("发送成功"),F.value=!1,g.value="",c()}).catch(a=>{F.value=!1})};return(a,v)=>{const L=oa,A=ua,l=ia,I=ra,q=fe,C=ca;return s(),m(C,{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",Fa,[t(l,{"show-icon":!1},{default:r(()=>[U(" 发送添加朋友申请给: "),t(A,{style:{"max-width":"100%"}},{default:r(()=>[t(L,{type:"success"},{default:r(()=>[U(x(a.user.nickname)+"@"+x(a.user.username),1)]),_:1})]),_:1})]),_:1}),f("div",Ia,[t(I,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:g.value,"onUpdate:value":v[0]||(v[0]=M=>g.value=M),maxlength:"120","show-count":""},null,8,["value"])]),f("div",qa,[t(q,{strong:"",secondary:"",type:"primary",loading:F.value,onClick:h},{default:r(()=>[U(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=me(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Ba={class:"info-item"},Da={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ga={key:1},Ea={key:0,class:"empty-wrap"},Ja={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 O=_a(),y=Qe(),g=Xe(),F="true".toLowerCase()==="true",c=i(!1),h=i(!1),a=Ge({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),v=i(!1),L=i(!1),A=i(!1),l=i([]),I=i([]),q=i([]),C=i([]),M=i([]),B=i([]),S=i(g.query.s||""),n=i(+g.query.p||1),p=i("post"),G=i(+g.query.p||1),E=i(1),J=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=[],I.value=[],q.value=[],C.value=[],M.value=[],B.value=[],p.value="post",n.value=1,G.value=1,E.value=1,J.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),I.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),q.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),C.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),M.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=I.value,n.value=G.value,_.value=Q.value,j();break;case"comment":l.value=q.value,n.value=E.value,_.value=X.value,se();break;case"highlight":l.value=C.value,n.value=J.value,_.value=Z.value,te();break;case"media":l.value=M.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":G.value=n.value,j();break;case"comment":E.value=n.value,se();break;case"highlight":J.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=()=>{A.value=!0},Pe=()=>{L.value=!1},$e=()=>{A.value=!1},W=e=>()=>_e(ve,null,{default:()=>_e(e)}),Te=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(Ta)}):e.push({label:"关注",key:"follow",icon:W(xa)}),F&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:W(za)}):e.push({label:"添加朋友",key:"requesting",icon:W(Ua)})),e}),xe=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":Fe();break}},ze=()=>{O.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=()=>{O.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)})}})},Fe=()=>{O.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)})}})},Ie=()=>{n.value<_.value||_.value==0?(h.value=!1,n.value++,ke()):h.value=!0};return Je(()=>{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 qe=je,Ce=pa,oe=ma,ie=Ye("router-link"),Me=fe,Se=fa,We=Ve,re=ha,R=ga,Le=wa,Oe=Ne,Ae=ka,H=Re,P=ya,N=He,Be=va,De=da;return s(),u("div",null,[t(qe,{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(Ce,{size:72,src:a.avatar},null,8,["src"])]),f("div",La,[f("div",Oa,[f("strong",null,x(a.nickname),1),f("span",null," @"+x(a.username),1),F&&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",Aa,[f("span",Ba,"UID. "+x(a.id),1),f("span",Da,x(k(aa)(a.created_on))+" 加入",1)]),f("div",Ra,[f("span",Ha,[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(" 关注  "+x(a.follows),1)]),_:1},8,["to"])]),f("span",Na,[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(" 粉丝  "+x(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:Te.value,onSelect:xe},{default:r(()=>[t(Me,{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(Ma,{show:A.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(R,{name:"post",tab:"泡泡"}),t(R,{name:"comment",tab:"评论"}),t(R,{name:"highlight",tab:"亮点"}),t(R,{name:"media",tab:"图文"}),t(R,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),c.value&&l.value.length===0?(s(),u("div",ja,[t(Oe,{num:w.value},null,8,["num"])])):(s(),u("div",Ga,[l.value.length===0?(s(),u("div",Ea,[t(Ae,{size:"large",description:"暂无数据"})])):d("",!0),k(y).state.desktopModelShow?(s(),u("div",Ja,[p.value==="post"?(s(),u("div",Ka,[(s(!0),u($,null,T(I.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",Ya,[(s(!0),u($,null,T(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==="highlight"?(s(),u("div",Qa,[(s(!0),u($,null,T(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==="media"?(s(),u("div",Xa,[(s(!0),u($,null,T(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==="star"?(s(),u("div",Za,[(s(!0),u($,null,T(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)])):(s(),u("div",es,[p.value==="post"?(s(),u("div",as,[(s(!0),u($,null,T(I.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="comment"?(s(),u("div",ss,[(s(!0),u($,null,T(q.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="highlight"?(s(),u("div",ts,[(s(!0),u($,null,T(C.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="media"?(s(),u("div",ls,[(s(!0),u($,null,T(M.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="star"?(s(),u("div",ns,[(s(!0),u($,null,T(B.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{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=>Ie())},{spinner:r(()=>[f("div",os,[h.value?d("",!0):(s(),m(re,{key:0,size:14})),f("span",us,x(h.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Rs=me(is,[["__scopeId","data-v-ebc19734"]]);export{Rs as default}; diff --git a/web/dist/assets/Wallet-cd5136fb.js b/web/dist/assets/Wallet-22a3cef6.js similarity index 95% rename from web/dist/assets/Wallet-cd5136fb.js rename to web/dist/assets/Wallet-22a3cef6.js index 061fc6c4..31397827 100644 --- a/web/dist/assets/Wallet-cd5136fb.js +++ b/web/dist/assets/Wallet-22a3cef6.js @@ -1 +1 @@ -import{_ as G}from"./post-skeleton-f6905e5e.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-03282050.js";import{d as K,H as c,b as J,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{X as _e,Y as re,Z as ue,$ as pe,E as de,_ as me}from"./index-121dfc2d.js";import{X as ge}from"./@vicons-7a4ef312.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.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),Re={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},Ee={key:0,class:"empty-wrap"},Fe={class:"bill-line"},Oe={key:0,class:"amount-options"},Pe={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},We=B(()=>n("canvas",{id:"qrcode-container"},null,-1)),De={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=K({__name:"Wallet",setup(m){const i=le(),E=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+E.query.p||1),C=c(20),I=c(0),F=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{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})},O=s=>{x.value=s,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},P=()=>{g.value=!0},T=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="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},W=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=H,d=fe,D=ye,f=we,$=ke,L=be,U=G,V=xe,M=Ae,Y=ve,j=Ce,Q=Ie,X=Se,Z=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":O,"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",Re,[n("div",$e,[e(D,{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:P},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:W},{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",Ee,[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",Fe,[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(Z,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(X,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Oe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(F.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",Pe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Te,[We,n("div",De," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",Le,[e(Q,{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 G}from"./post-skeleton-4d2b103e.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{d as K,H as c,b as J,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{X as _e,Y as re,Z as ue,$ as pe,E as de,_ as me}from"./index-4a465428.js";import{X as ge}from"./@vicons-7a4ef312.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.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),Re={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},Ee={key:0,class:"empty-wrap"},Fe={class:"bill-line"},Oe={key:0,class:"amount-options"},Pe={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},We=B(()=>n("canvas",{id:"qrcode-container"},null,-1)),De={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=K({__name:"Wallet",setup(m){const i=le(),E=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+E.query.p||1),C=c(20),I=c(0),F=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{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})},O=s=>{x.value=s,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},P=()=>{g.value=!0},T=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="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},W=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=H,d=fe,D=ye,f=we,$=ke,L=be,U=G,V=xe,M=Ae,Y=ve,j=Ce,Q=Ie,X=Se,Z=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":O,"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",Re,[n("div",$e,[e(D,{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:P},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:W},{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",Ee,[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",Fe,[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(Z,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(X,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Oe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(F.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",Pe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Te,[We,n("div",De," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",Le,[e(Q,{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-ebf88604.js b/web/dist/assets/content-0e30acaf.js similarity index 98% rename from web/dist/assets/content-ebf88604.js rename to web/dist/assets/content-0e30acaf.js index 0825953d..ddf025e7 100644 --- a/web/dist/assets/content-ebf88604.js +++ b/web/dist/assets/content-0e30acaf.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{R as V,U as T}from"./@vicons-7a4ef312.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-d8de3dda.js";import{_ as D,S as R,T as M}from"./index-121dfc2d.js";import{e as O}from"./paopao-video-player-2fe58954.js";const P={class:"link-wrap"},S={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",P,[(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",S,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,I(n.content),1)],8,q)])]))),128))])}}});const ot=D(W,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=B;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(O),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,_=A,f=B,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),R({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{M({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{R as V,U as T}from"./@vicons-7a4ef312.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-d8de3dda.js";import{_ as D,S as R,T as M}from"./index-4a465428.js";import{e as O}from"./paopao-video-player-2fe58954.js";const P={class:"link-wrap"},S={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",P,[(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",S,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,I(n.content),1)],8,q)])]))),128))])}}});const ot=D(W,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=B;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(O),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,_=A,f=B,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),R({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{M({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-121dfc2d.js b/web/dist/assets/index-4a465428.js similarity index 90% rename from web/dist/assets/index-121dfc2d.js rename to web/dist/assets/index-4a465428.js index 9479ed88..db8e3743 100644 --- a/web/dist/assets/index-121dfc2d.js +++ b/web/dist/assets/index-4a465428.js @@ -1 +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-d8de3dda.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-7a4ef312.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-fc24bae7.js"),["assets/Home-fc24bae7.js","assets/whisper-1cdd2a38.js","assets/naive-ui-d8de3dda.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-e778d128.js","assets/content-ebf88604.js","assets/@vicons-7a4ef312.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-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-b58ba6dd.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-c15711ff.js"),["assets/Post-c15711ff.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-ebf88604.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-1cdd2a38.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-03282050.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-0b1f6baf.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-2c2b98aa.js"),["assets/Topic-2c2b98aa.js","assets/@vicons-7a4ef312.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.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-03282050.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-21a92532.js"),["assets/Anouncement-21a92532.js","assets/post-skeleton-f6905e5e.js","assets/naive-ui-d8de3dda.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-03282050.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.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-bdfe7ab1.js"),["assets/Profile-bdfe7ab1.js","assets/whisper-1cdd2a38.js","assets/naive-ui-d8de3dda.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-e778d128.js","assets/content-ebf88604.js","assets/@vicons-7a4ef312.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-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-606a2446.js"),["assets/User-606a2446.js","assets/post-item.vue_vue_type_style_index_0_lang-e778d128.js","assets/content-ebf88604.js","assets/@vue-a481fc63.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/whisper-1cdd2a38.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-5c4e999b.js"),["assets/Messages-5c4e999b.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-1cdd2a38.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-b826e3a0.js"),["assets/Collection-b826e3a0.js","assets/whisper-1cdd2a38.js","assets/naive-ui-d8de3dda.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-e778d128.js","assets/content-ebf88604.js","assets/@vicons-7a4ef312.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-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-ed0b9b43.js"),["assets/Contacts-ed0b9b43.js","assets/whisper-1cdd2a38.js","assets/naive-ui-d8de3dda.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-7a4ef312.js","assets/post-skeleton-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-53d3b5dc.js"),["assets/Following-53d3b5dc.js","assets/whisper-1cdd2a38.js","assets/naive-ui-d8de3dda.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-7a4ef312.js","assets/post-skeleton-f6905e5e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.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-cd5136fb.js"),["assets/Wallet-cd5136fb.js","assets/post-skeleton-f6905e5e.js","assets/naive-ui-d8de3dda.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-03282050.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.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-eb815798.js"),["assets/Setting-eb815798.js","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-7c70356e.js"),["assets/404-7c70356e.js","assets/main-nav.vue_vue_type_style_index_0_lang-03282050.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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/reply",data:e}),Co=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),$o=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),So=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Do=e=>o({method:"post",url:"/v1/captcha",data:e}),xo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),qo=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),No=e=>o({method:"post",url:"/v1/friend/add",data:e}),Ko=e=>o({method:"post",url:"/v1/user/follow",data:e}),Fo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Vo=e=>o({method:"get",url:"/v1/user/follows",params:e}),zo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ho=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Wo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Yo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=e=>o({method:"post",url:"/v1/user/activate",data:e}),jo=e=>o({method:"post",url:"/v1/user/password",data:e}),Go=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Qo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Zo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Jo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Xo=e=>o({method:"get",url:"/v1/user/collections",params:e}),es=e=>o({method:"get",url:"/v1/user/profile",params:e}),ts=e=>o({method:"get",url:"/v1/user/posts",params:e}),os=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ss=e=>o({method:"post",url:"/v1/user/recharge",data:e}),ns=e=>o({method:"get",url:"/v1/user/recharge",params:e}),rs=e=>o({method:"get",url:"/v1/suggest/users",params:e}),as=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),ls=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),us=e=>o({method:"get",url:"/v1/attachment",params:e}),is=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(),cs=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()},ds=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()},ms=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 $,$o as A,So as B,Mo as C,mt as D,_t as E,ms as F,qo as G,es as H,Wo as I,Fo as J,Ko as K,is as L,No as M,Ho as N,Jo as O,Zo as P,Xo as Q,ds as R,ls as S,us as T,Vo as U,zo as V,xo as W,G as X,os as Y,ss as Z,we as _,as as a,Uo as a0,Qo as a1,jo as a2,Yo as a3,Bo as a4,Go as a5,Do as a6,xt as a7,fo as b,vo as c,io as d,ts as e,cs as f,rs as g,Ao as h,Co as i,Oo as j,Lo as k,Ro as l,Io as m,Eo as n,mo as o,_o as p,wo as q,yo as r,bo as s,To as t,ko as u,Po as v,po as w,ho as x,co as y,go as z}; +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-d8de3dda.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-7a4ef312.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-0ca93a27.js"),["assets/Home-0ca93a27.js","assets/whisper-7dcedd50.js","assets/naive-ui-d8de3dda.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-a5e9cab2.js","assets/content-0e30acaf.js","assets/@vicons-7a4ef312.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-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-b58ba6dd.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-8403b241.js"),["assets/Post-8403b241.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-0e30acaf.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-7dcedd50.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-2982e04a.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-8fdcb727.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-a63673d1.js"),["assets/Topic-a63673d1.js","assets/@vicons-7a4ef312.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.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-2982e04a.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-2531033c.js"),["assets/Anouncement-2531033c.js","assets/post-skeleton-4d2b103e.js","assets/naive-ui-d8de3dda.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-2982e04a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.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-6e748e2f.js"),["assets/Profile-6e748e2f.js","assets/whisper-7dcedd50.js","assets/naive-ui-d8de3dda.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-a5e9cab2.js","assets/content-0e30acaf.js","assets/@vicons-7a4ef312.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-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-9ecd5433.js"),["assets/User-9ecd5433.js","assets/post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js","assets/content-0e30acaf.js","assets/@vue-a481fc63.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/whisper-7dcedd50.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-8ba7b532.js"),["assets/Messages-8ba7b532.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-7dcedd50.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-6b9226c9.js"),["assets/Collection-6b9226c9.js","assets/whisper-7dcedd50.js","assets/naive-ui-d8de3dda.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-a5e9cab2.js","assets/content-0e30acaf.js","assets/@vicons-7a4ef312.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-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-cf96d2d4.js"),["assets/Contacts-cf96d2d4.js","assets/whisper-7dcedd50.js","assets/naive-ui-d8de3dda.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-7a4ef312.js","assets/post-skeleton-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-3b99fb7a.js"),["assets/Following-3b99fb7a.js","assets/whisper-7dcedd50.js","assets/naive-ui-d8de3dda.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-7a4ef312.js","assets/post-skeleton-4d2b103e.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.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-22a3cef6.js"),["assets/Wallet-22a3cef6.js","assets/post-skeleton-4d2b103e.js","assets/naive-ui-d8de3dda.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-2982e04a.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-7a4ef312.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-bde8e499.js"),["assets/Setting-bde8e499.js","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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-e41e3193.js"),["assets/404-e41e3193.js","assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-7a4ef312.js","assets/naive-ui-d8de3dda.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/reply",data:e}),Co=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),$o=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),So=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Do=e=>o({method:"post",url:"/v1/captcha",data:e}),xo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),qo=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),No=e=>o({method:"post",url:"/v1/friend/add",data:e}),Ko=e=>o({method:"post",url:"/v1/user/follow",data:e}),Fo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Vo=e=>o({method:"get",url:"/v1/user/follows",params:e}),zo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ho=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Wo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Yo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=e=>o({method:"post",url:"/v1/user/activate",data:e}),jo=e=>o({method:"post",url:"/v1/user/password",data:e}),Go=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Qo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Zo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Jo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Xo=e=>o({method:"get",url:"/v1/user/collections",params:e}),es=e=>o({method:"get",url:"/v1/user/profile",params:e}),ts=e=>o({method:"get",url:"/v1/user/posts",params:e}),os=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ss=e=>o({method:"post",url:"/v1/user/recharge",data:e}),ns=e=>o({method:"get",url:"/v1/user/recharge",params:e}),rs=e=>o({method:"get",url:"/v1/suggest/users",params:e}),as=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),ls=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),us=e=>o({method:"get",url:"/v1/attachment",params:e}),is=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(),cs=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()},ds=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()},ms=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 $,$o as A,So as B,Mo as C,mt as D,_t as E,ms as F,qo as G,es as H,Wo as I,Fo as J,Ko as K,is as L,No as M,Ho as N,Jo as O,Zo as P,Xo as Q,ds as R,ls as S,us as T,Vo as U,zo as V,xo as W,G as X,os as Y,ss as Z,we as _,as as a,Uo as a0,Qo as a1,jo as a2,Yo as a3,Bo as a4,Go as a5,Do as a6,xt as a7,fo as b,vo as c,io as d,ts as e,cs as f,rs as g,Ao as h,Co as i,Oo as j,Lo as k,Ro as l,Io as m,Eo as n,mo as o,_o as p,wo as q,yo as r,bo as s,To as t,ko as u,Po as v,po as w,ho as x,co as y,go as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-03282050.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-03282050.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.js index 4f9f824c..28c342e4 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-03282050.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-2982e04a.js @@ -1 +1 @@ -import{a7 as A}from"./index-121dfc2d.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{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-7a4ef312.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-d8de3dda.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 Z}from"./@vue-a481fc63.js";const G={key:0},J={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(Z,null,[a(o).state.drawerModelShow?(n(),f("div",G,[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",J,[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{a7 as A}from"./index-4a465428.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{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-7a4ef312.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-d8de3dda.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 Z}from"./@vue-a481fc63.js";const G={key:0},J={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(Z,null,[a(o).state.drawerModelShow?(n(),f("div",G,[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",J,[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-e778d128.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-e778d128.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js index e07dbd72..4b9e5948 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-e778d128.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js @@ -1 +1 @@ -import{p as R,a as V,_ as E,b as Y,c as G}from"./content-ebf88604.js";import{d as J,c as x,r as K,e as a,f,k as n,al as Q,w as o,j as i,F as U,u as W,y as m,bf as l,A as r,x as p,q as u,Y as c,h as C}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{R as ee,w as te,x as se}from"./index-121dfc2d.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as ne,j as ae,l as le,m as ie,p as ue,o as ce}from"./@vicons-7a4ef312.js";import{j as v,o as re,M as pe,e as _e,O as me,a as ve,L as de}from"./naive-ui-d8de3dda.js";const he={class:"post-item"},ge={class:"nickname-wrap"},ke={class:"username-wrap"},ye={class:"timestamp-mobile"},fe={class:"item-header-extra"},we=["innerHTML"],be=["onClick"],xe=["onClick"],Ne=J({__name:"mobile-post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=V,H=E,B=Y,I=G,N=ve,A=de;return a(),f("div",he,[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",ge,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",ke," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ye,p(l(ee)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":o(()=>[i("div",fe,[n(D,{placement:"bottom-end",trigger:"click",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,be),i("div",{class:"opt-item",onClick:s[3]||(s[3]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,xe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[i("div",{onClick:s[2]||(s[2]=h=>k(e.value.id))},[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(R)(h.content).content},null,8,we))),128))])]),key:"0"}:void 0]),1024)])}}});const Ce={class:"nickname-wrap"},$e={class:"username-wrap"},ze={class:"item-header-extra"},Te={class:"timestamp"},qe=["innerHTML"],Pe=["onClick"],Le=["onClick"],Ae=J({__name:"post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=V,H=E,B=Y,I=G,N=ve,A=de;return a(),f("div",{class:"post-item",onClick:s[3]||(s[3]=h=>k(e.value.id))},[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",Ce,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",$e," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":o(()=>[i("div",ze,[i("span",Te,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(ee)(e.value.created_on)),1),n(D,{placement:"bottom-end",trigger:"hover",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Pe),i("div",{class:"opt-item hover",onClick:s[2]||(s[2]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Le)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text hover",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(R)(h.content).content},null,8,qe))),128))]),key:"0"}:void 0]),1024)])}}});export{Ae as _,Ne as a}; +import{p as R,a as V,_ as E,b as Y,c as G}from"./content-0e30acaf.js";import{d as J,c as x,r as K,e as a,f,k as n,al as Q,w as o,j as i,F as U,u as W,y as m,bf as l,A as r,x as p,q as u,Y as c,h as C}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{R as ee,w as te,x as se}from"./index-4a465428.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as ne,j as ae,l as le,m as ie,p as ue,o as ce}from"./@vicons-7a4ef312.js";import{j as v,o as re,M as pe,e as _e,O as me,a as ve,L as de}from"./naive-ui-d8de3dda.js";const he={class:"post-item"},ge={class:"nickname-wrap"},ke={class:"username-wrap"},ye={class:"timestamp-mobile"},fe={class:"item-header-extra"},we=["innerHTML"],be=["onClick"],xe=["onClick"],Ne=J({__name:"mobile-post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=V,H=E,B=Y,I=G,N=ve,A=de;return a(),f("div",he,[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",ge,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",ke," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ye,p(l(ee)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":o(()=>[i("div",fe,[n(D,{placement:"bottom-end",trigger:"click",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,be),i("div",{class:"opt-item",onClick:s[3]||(s[3]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,xe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[i("div",{onClick:s[2]||(s[2]=h=>k(e.value.id))},[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(R)(h.content).content},null,8,we))),128))])]),key:"0"}:void 0]),1024)])}}});const Ce={class:"nickname-wrap"},$e={class:"username-wrap"},ze={class:"item-header-extra"},Te={class:"timestamp"},qe=["innerHTML"],Pe=["onClick"],Le=["onClick"],Ae=J({__name:"post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=V,H=E,B=Y,I=G,N=ve,A=de;return a(),f("div",{class:"post-item",onClick:s[3]||(s[3]=h=>k(e.value.id))},[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",Ce,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",$e," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":o(()=>[i("div",ze,[i("span",Te,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(ee)(e.value.created_on)),1),n(D,{placement:"bottom-end",trigger:"hover",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Pe),i("div",{class:"opt-item hover",onClick:s[2]||(s[2]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Le)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text hover",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(R)(h.content).content},null,8,qe))),128))]),key:"0"}:void 0]),1024)])}}});export{Ae as _,Ne as a}; diff --git a/web/dist/assets/post-skeleton-f6905e5e.js b/web/dist/assets/post-skeleton-4d2b103e.js similarity index 88% rename from web/dist/assets/post-skeleton-f6905e5e.js rename to web/dist/assets/post-skeleton-4d2b103e.js index 3b04246b..cadb4053 100644 --- a/web/dist/assets/post-skeleton-f6905e5e.js +++ b/web/dist/assets/post-skeleton-4d2b103e.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-d8de3dda.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-121dfc2d.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-d8de3dda.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-4a465428.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-1cdd2a38.js b/web/dist/assets/whisper-7dcedd50.js similarity index 95% rename from web/dist/assets/whisper-1cdd2a38.js rename to web/dist/assets/whisper-7dcedd50.js index 26ee928e..4b07c8b6 100644 --- a/web/dist/assets/whisper-1cdd2a38.js +++ b/web/dist/assets/whisper-7dcedd50.js @@ -1 +1 @@ -import{W as b,_ as k}from"./index-121dfc2d.js";import{R as B,H as C,S as N,b as R,e as U,i as V}from"./naive-ui-d8de3dda.js";import{d as W,H as p,e as $,q as z,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const H={class:"whisper-wrap"},S={class:"whisper-line"},j={class:"whisper-line send-wrap"},q=W({__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=R,g=U,y=V;return $(),z(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",H,[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",S,[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",j,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const M=k(q,[["__scopeId","data-v-0cbfe47c"]]);export{M as _}; +import{W as b,_ as k}from"./index-4a465428.js";import{R as B,H as C,S as N,b as R,e as U,i as V}from"./naive-ui-d8de3dda.js";import{d as W,H as p,e as $,q as z,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const H={class:"whisper-wrap"},S={class:"whisper-line"},j={class:"whisper-line send-wrap"},q=W({__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=R,g=U,y=V;return $(),z(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",H,[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",S,[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",j,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const M=k(q,[["__scopeId","data-v-0cbfe47c"]]);export{M as _}; diff --git a/web/dist/index.html b/web/dist/index.html index 60a67163..c69639b1 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/types/NetParams.d.ts b/web/src/types/NetParams.d.ts index 029d346e..d2587f6d 100644 --- a/web/src/types/NetParams.d.ts +++ b/web/src/types/NetParams.d.ts @@ -199,7 +199,7 @@ declare module NetParams { interface PostGetPostComments { id: number; - sort_strategy: "default" | "hots" | "newest"; + style: "default" | "hots" | "newest"; page?: number; page_size?: number; } diff --git a/web/src/views/Post.vue b/web/src/views/Post.vue index f829da96..e7216b71 100644 --- a/web/src/views/Post.vue +++ b/web/src/views/Post.vue @@ -126,7 +126,7 @@ const loadDefaultComments = ($state: any) => { } getPostComments({ id: post.value.id as number, - sort_strategy: 'default', + style: 'default', page: defaultCommmentsPage, page_size: pageSize, }) @@ -165,7 +165,7 @@ const loadHotsComments = ($state: any) => { } getPostComments({ id: post.value.id as number, - sort_strategy: 'hots', + style: 'hots', page: hotsCommmentsPage, page_size: pageSize, }) @@ -204,7 +204,7 @@ const loadNewestComments = ($state: any) => { } getPostComments({ id: post.value.id as number, - sort_strategy: 'newest', + style: 'newest', page: newestCommmentsPage, page_size: pageSize, })