From 88d06cc4548ee7cb4ce267475caca6d2cf9da10c Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sun, 7 May 2023 10:13:11 +0800 Subject: [PATCH 01/15] update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 56917231..eba606fd 100644 --- a/README.md +++ b/README.md @@ -554,6 +554,7 @@ x/sqlx |[`r/paopao-ce-plus`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus)|paopao-ce-plus 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus/internal/dao/sakila) 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据逻辑层的ORM框架,专注于为MySQL/PostgreSQL/Sqlite3使用更优化的查询语句以提升数据检索效率。建议熟悉[sqlx](https://github.com/jmoiron/sqlx)的开发人员可以基于此版本来做 二次开发。| |[`r/paopao-ce-pro`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro)|paopao-ce-pro 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro/internal/dao/slonik) 使用[sqlc](https://github.com/kyleconroy/sqlc)作为sql语句生成器自动生成ORM代码,专门针对特定数据库MySQL/PostgreSQL进行查询优化,熟悉[sqlc](https://github.com/kyleconroy/sqlc)的开发人员可以基于此版本来做 二次开发。(另:分支目前只使用[pgx-v5](https://github.com/jackc/pgx)适配了PostgreSQL数据库,后续或许会适配MySQL/TiDB数据库。)| |[`r/paopao-ce-xtra`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-xtra)|paopao-ce-xtra 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 是r/paopao-ce、r/paopao-ce-plus、r/paopao-ce-pro的合集| +|[`r/paopao-ce-mini`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-mini)|paopao-ce-mini 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支是paopao-ce最小可用版本,专注于个人部署、一键傻瓜式最简部署| **代码分支演进图** ![](docs/proposal/.assets/000-01.png) From 67b36b776444d88431445ecaab623367a496b7f2 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 8 May 2023 15:03:46 +0800 Subject: [PATCH 02/15] frontend: split post-item display in desktop and mobile env --- .../{404-00d7402f.js => 404-59f4b7a6.js} | 2 +- ...nt-89915a48.js => Anouncement-7e7cb6ce.js} | 2 +- web/dist/assets/Collection-2dd501b0.js | 1 - web/dist/assets/Collection-b97b3cf7.css | 1 + web/dist/assets/Collection-d6ff62e7.js | 1 + web/dist/assets/Collection-e1365ea0.css | 1 - ...tacts-212adf88.js => Contacts-1eed118e.js} | 2 +- web/dist/assets/Home-37cbe774.js | 1 - .../{Home-47eb20e2.css => Home-c075a37e.css} | 2 +- web/dist/assets/Home-d4930ea8.js | 1 + ...sages-268fd9db.js => Messages-ef7b1288.js} | 2 +- .../{Post-e74fef3c.js => Post-31658e5a.js} | 2 +- web/dist/assets/Profile-5d71a5c2.css | 1 - web/dist/assets/Profile-85fb2629.js | 1 + web/dist/assets/Profile-87e8712d.css | 1 + web/dist/assets/Profile-ada56cf6.js | 1 - ...etting-e97b467a.js => Setting-73765ab9.js} | 2 +- .../{Topic-ea29dcd9.js => Topic-faac43f3.js} | 2 +- web/dist/assets/User-4f525d0f.css | 1 - web/dist/assets/User-645b4d7e.js | 1 - web/dist/assets/User-9ff86a18.js | 1 + web/dist/assets/User-dfc90f68.css | 1 + ...{Wallet-595cd027.js => Wallet-88809b56.js} | 2 +- ...ontent-3f1d28f2.js => content-62bae3e8.js} | 2 +- .../{index-71354138.js => index-fbd1aa45.js} | 2 +- ...e_vue_type_style_index_0_lang-31ba5408.js} | 2 +- ...em-37a52e00.css => post-item-593ff254.css} | 2 +- ...ue_vue_type_style_index_0_lang-09a3d19d.js | 1 - ...ue_vue_type_style_index_0_lang-84c4f6fd.js | 1 + ...-fdd699ea.js => post-skeleton-38ecc5be.js} | 2 +- web/dist/index.html | 2 +- web/src/components/mobile-post-item.vue | 309 ++++++++++++++++++ web/src/components/post-item.vue | 71 +--- web/src/views/Collection.vue | 16 +- web/src/views/Home.vue | 14 +- web/src/views/Profile.vue | 13 +- web/src/views/User.vue | 13 +- 37 files changed, 378 insertions(+), 104 deletions(-) rename web/dist/assets/{404-00d7402f.js => 404-59f4b7a6.js} (84%) rename web/dist/assets/{Anouncement-89915a48.js => Anouncement-7e7cb6ce.js} (91%) delete mode 100644 web/dist/assets/Collection-2dd501b0.js create mode 100644 web/dist/assets/Collection-b97b3cf7.css create mode 100644 web/dist/assets/Collection-d6ff62e7.js delete mode 100644 web/dist/assets/Collection-e1365ea0.css rename web/dist/assets/{Contacts-212adf88.js => Contacts-1eed118e.js} (93%) delete mode 100644 web/dist/assets/Home-37cbe774.js rename web/dist/assets/{Home-47eb20e2.css => Home-c075a37e.css} (84%) create mode 100644 web/dist/assets/Home-d4930ea8.js rename web/dist/assets/{Messages-268fd9db.js => Messages-ef7b1288.js} (97%) rename web/dist/assets/{Post-e74fef3c.js => Post-31658e5a.js} (99%) delete mode 100644 web/dist/assets/Profile-5d71a5c2.css create mode 100644 web/dist/assets/Profile-85fb2629.js create mode 100644 web/dist/assets/Profile-87e8712d.css delete mode 100644 web/dist/assets/Profile-ada56cf6.js rename web/dist/assets/{Setting-e97b467a.js => Setting-73765ab9.js} (97%) rename web/dist/assets/{Topic-ea29dcd9.js => Topic-faac43f3.js} (97%) delete mode 100644 web/dist/assets/User-4f525d0f.css delete mode 100644 web/dist/assets/User-645b4d7e.js create mode 100644 web/dist/assets/User-9ff86a18.js create mode 100644 web/dist/assets/User-dfc90f68.css rename web/dist/assets/{Wallet-595cd027.js => Wallet-88809b56.js} (96%) rename web/dist/assets/{content-3f1d28f2.js => content-62bae3e8.js} (99%) rename web/dist/assets/{index-71354138.js => index-fbd1aa45.js} (89%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-5097b22a.js => main-nav.vue_vue_type_style_index_0_lang-31ba5408.js} (96%) rename web/dist/assets/{post-item-37a52e00.css => post-item-593ff254.css} (70%) delete mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js create mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js rename web/dist/assets/{post-skeleton-fdd699ea.js => post-skeleton-38ecc5be.js} (88%) create mode 100644 web/src/components/mobile-post-item.vue diff --git a/web/dist/assets/404-00d7402f.js b/web/dist/assets/404-59f4b7a6.js similarity index 84% rename from web/dist/assets/404-00d7402f.js rename to web/dist/assets/404-59f4b7a6.js index 37baf9fc..69d2dbe4 100644 --- a/web/dist/assets/404-00d7402f.js +++ b/web/dist/assets/404-59f4b7a6.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-71354138.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as a}from"./vue-router-88cc84d1.js";import{F as i,e as c,a2 as u}from"./naive-ui-2035804c.js";import{d as l,c as d,L as t,$ as o,o as f,e as x}from"./@vue-ca177dbe.js";import{_ as g}from"./index-fbd1aa45.js";import"./vuex-d28e9067.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/Anouncement-89915a48.js b/web/dist/assets/Anouncement-7e7cb6ce.js similarity index 91% rename from web/dist/assets/Anouncement-89915a48.js rename to web/dist/assets/Anouncement-7e7cb6ce.js index 4a4ae2fe..cbc6ff37 100644 --- a/web/dist/assets/Anouncement-89915a48.js +++ b/web/dist/assets/Anouncement-7e7cb6ce.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-fdd699ea.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-71354138.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=$,x=F,w=j,B=q,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",E,[a(k,{page:i.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?(e(),o("div",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; +import{_ as F}from"./post-skeleton-38ecc5be.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as z}from"./vuex-d28e9067.js";import{b as A}from"./vue-router-88cc84d1.js";import{a as R}from"./formatTime-000dbebb.js";import{d as S,r as n,j as V,c as o,L as a,$ as p,o as e,Y as u,O as l,F as I,a2 as L,K as M,a as s,M as _,a4 as O}from"./@vue-ca177dbe.js";import{F as P,G as $,I as j,H as q}from"./naive-ui-2035804c.js";import{_ as D}from"./index-fbd1aa45.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./@vicons-6d35273b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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";/* empty css */const E={key:0,class:"pagination-wrap"},G={key:0,class:"skeleton-wrap"},H={key:1},K={key:0,class:"empty-wrap"},T={class:"bill-line"},U=S({__name:"Anouncement",setup(Y){const d=z(),g=A(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return V(()=>{}),(m,J)=>{const y=N,k=$,x=F,w=j,B=q,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",E,[a(k,{page:i.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?(e(),o("div",G,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",H,[r.value.length===0?(e(),o("div",K,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=D(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-2dd501b0.js b/web/dist/assets/Collection-2dd501b0.js deleted file mode 100644 index fcb04f11..00000000 --- a/web/dist/assets/Collection-2dd501b0.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as z}from"./post-item.vue_vue_type_style_index_0_lang-09a3d19d.js";import{_ as B}from"./post-skeleton-fdd699ea.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as P}from"./vuex-d28e9067.js";import{b as R,u as $}from"./vue-router-88cc84d1.js";import{K as b,_ as I}from"./index-71354138.js";import{d as K,r as a,j as L,c as e,L as n,$ as m,Y as M,O as u,o as t,F as N,a2 as S,K as V}from"./@vue-ca177dbe.js";import{F as j,G as q,I as E,H as G}from"./naive-ui-2035804c.js";import"./content-3f1d28f2.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 H={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={key:0,class:"pagination-wrap"},Y=K({__name:"Collection",setup(A){const d=P(),g=R();$();const s=a(!1),p=a([]),_=a(+g.query.p||1),i=a(20),r=a(0),l=()=>{s.value=!0,b({page:_.value,page_size:i.value}).then(o=>{s.value=!1,p.value=o.list,r.value=Math.ceil(o.pager.total_rows/i.value),window.scrollTo(0,0)}).catch(o=>{s.value=!1})},v=o=>{_.value=o,l()};return L(()=>{l()}),(o,D)=>{const f=F,h=B,k=E,y=z,w=G,C=j,x=q;return t(),e("div",null,[n(f,{title:"收藏"}),n(C,{class:"main-content-wrap",bordered:""},{default:m(()=>[s.value?(t(),e("div",H,[n(h,{num:i.value},null,8,["num"])])):(t(),e("div",O,[p.value.length===0?(t(),e("div",T,[n(k,{size:"large",description:"暂无数据"})])):u("",!0),(t(!0),e(N,null,S(p.value,c=>(t(),V(w,{key:c.id},{default:m(()=>[n(y,{post:c},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),r.value>0?(t(),e("div",U,[n(x,{page:_.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):u("",!0)])}}});const Bt=I(Y,[["__scopeId","data-v-1e709369"]]);export{Bt as default}; diff --git a/web/dist/assets/Collection-b97b3cf7.css b/web/dist/assets/Collection-b97b3cf7.css new file mode 100644 index 00000000..82f9e2e5 --- /dev/null +++ b/web/dist/assets/Collection-b97b3cf7.css @@ -0,0 +1 @@ +.pagination-wrap[data-v-a5302c9b]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-a5302c9b],.dark .empty-wrap[data-v-a5302c9b],.dark .skeleton-wrap[data-v-a5302c9b]{background-color:#101014bf} diff --git a/web/dist/assets/Collection-d6ff62e7.js b/web/dist/assets/Collection-d6ff62e7.js new file mode 100644 index 00000000..719ab3d6 --- /dev/null +++ b/web/dist/assets/Collection-d6ff62e7.js @@ -0,0 +1 @@ +import{_ as M,a as P}from"./post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js";import{_ as S}from"./post-skeleton-38ecc5be.js";import{_ as I}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as K}from"./vuex-d28e9067.js";import{b as L}from"./vue-router-88cc84d1.js";import{K as N,_ as R}from"./index-fbd1aa45.js";import{d as V,r as a,j,c as o,L as e,$ as c,Y as g,O as v,o as t,F as f,a2 as h,K as k}from"./@vue-ca177dbe.js";import{F as q,G as E,I as G,H}from"./naive-ui-2035804c.js";import"./content-62bae3e8.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 O={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},Y={key:1},A={key:2},D={key:0,class:"pagination-wrap"},J=V({__name:"Collection",setup(Q){const m=K(),y=L(),_=a(!1),i=a([]),p=a(+y.query.p||1),l=a(20),r=a(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return j(()=>{u()}),(n,W)=>{const C=I,b=S,x=G,$=M,d=H,z=P,B=q,F=E;return t(),o("div",null,[e(C,{title:"收藏"}),e(B,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",Y,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e($,{post:s},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",A,[(t(!0),o(f,null,h(i.value,s=>(t(),k(d,{key:s.id},{default:c(()=>[e(z,{post:s},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",D,[e(F,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Ft=R(J,[["__scopeId","data-v-a5302c9b"]]);export{Ft as default}; diff --git a/web/dist/assets/Collection-e1365ea0.css b/web/dist/assets/Collection-e1365ea0.css deleted file mode 100644 index db797d3f..00000000 --- a/web/dist/assets/Collection-e1365ea0.css +++ /dev/null @@ -1 +0,0 @@ -.pagination-wrap[data-v-1e709369]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-1e709369],.dark .empty-wrap[data-v-1e709369],.dark .skeleton-wrap[data-v-1e709369]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts-212adf88.js b/web/dist/assets/Contacts-1eed118e.js similarity index 93% rename from web/dist/assets/Contacts-212adf88.js rename to web/dist/assets/Contacts-1eed118e.js index e76d60a2..12fc835d 100644 --- a/web/dist/assets/Contacts-212adf88.js +++ b/web/dist/assets/Contacts-1eed118e.js @@ -1 +1 @@ -import{u as M,b as P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-71354138.js";import{_ as G}from"./post-skeleton-fdd699ea.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./@vicons-6d35273b.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; +import{u as M,b as P}from"./vue-router-88cc84d1.js";import{d as b,o as t,c as n,a,L as s,M as v,r as i,j as R,$ as h,Y as S,O as y,F as k,a2 as U,K as V}from"./@vue-ca177dbe.js";import{o as q,F as D,G as L,I as T,H as j}from"./naive-ui-2035804c.js";import{_ as C,N as E}from"./index-fbd1aa45.js";import{_ as G}from"./post-skeleton-38ecc5be.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as K}from"./vuex-d28e9067.js";import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./@vicons-6d35273b.js";/* empty css */const O={class:"avatar"},Y={class:"base-info"},A={class:"username"},J={class:"uid"},Q=b({__name:"contact-item",props:{contact:null},setup(c){const p=M(),m=e=>{p.push({name:"user",query:{username:e}})};return(e,o)=>{const _=q;return t(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=l=>m(c.contact.username))},[a("div",O,[s(_,{size:"large",src:c.contact.avatar},null,8,["src"])]),a("div",Y,[a("div",A,[a("strong",null,v(c.contact.nickname),1),a("span",null," @"+v(c.contact.username),1)]),a("div",J,"UID. "+v(c.contact.user_id),1)])])}}});const W=C(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=b({__name:"Contacts",setup(c){const p=K(),m=P(),e=i(!1),o=i([]),_=i(+m.query.p||1),l=i(20),d=i(0),$=r=>{_.value=r,g()};R(()=>{g()});const g=(r=!1)=>{o.value.length===0&&(e.value=!0),E({page:_.value,page_size:l.value}).then(u=>{e.value=!1,o.value=u.list,d.value=Math.ceil(u.pager.total_rows/l.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(u=>{e.value=!1})};return(r,u)=>{const w=H,x=G,I=T,z=W,B=j,N=D,F=L;return t(),n(k,null,[a("div",null,[s(w,{title:"好友"}),s(N,{class:"main-content-wrap",bordered:""},{default:h(()=>[e.value?(t(),n("div",X,[s(x,{num:l.value},null,8,["num"])])):(t(),n("div",Z,[o.value.length===0?(t(),n("div",tt,[s(I,{size:"large",description:"暂无数据"})])):y("",!0),(t(!0),n(k,null,U(o.value,f=>(t(),V(B,{key:f.user_id},{default:h(()=>[s(z,{contact:f},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(t(),n("div",et,[s(F,{page:_.value,"onUpdate:page":$,"page-slot":S(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)],64)}}});const It=C(ot,[["__scopeId","data-v-3b2bf978"]]);export{It as default}; diff --git a/web/dist/assets/Home-37cbe774.js b/web/dist/assets/Home-37cbe774.js deleted file mode 100644 index fa19a0a9..00000000 --- a/web/dist/assets/Home-37cbe774.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as $e}from"./post-item.vue_vue_type_style_index_0_lang-09a3d19d.js";import{_ as qe}from"./post-skeleton-fdd699ea.js";import{d as Q,r as l,j as X,o as _,c as y,Y as T,a as q,L as t,$ as s,K as N,O as $,a0 as G,e as E,M as J,F as Y,a2 as W,n as xe,w as Ie}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{l as Z}from"./lodash-94eb5868.js";import{g as ze,a as Ue,c as Re,b as Ae,_ as Ee}from"./index-71354138.js";import{p as Le}from"./content-3f1d28f2.js";import{V as z,P as S}from"./IEnum-a180d93e.js";import{I as Pe,V as Se,A as Ne,d as Ve,E as Fe}from"./@vicons-6d35273b.js";import{o as Be,v as Oe,j as Me,e as De,w as je,x as He,y as Ke,z as Ge,A as Je,B as Ze,C as Qe,a as Xe,D as Ye,E as We,F as et,G as tt,H as at,I as ot}from"./naive-ui-2035804c.js";import{_ as nt}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{b as st,u as lt}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./nonesir-video-db921567.js";const it=V=>{const x=new FileReader,i=p=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(p),I=()=>{const p=new Uint8Array(x.result).subarray(0,4);let m="";for(let c=0;c{x.onloadend=()=>{const c=V.type;p(c===""||c==="application/octet-stream"?I():i(c))},x.readAsArrayBuffer(V.slice(0,4))})},rt={key:0,class:"compose-wrap"},ut={class:"compose-line"},ct={class:"compose-user"},pt={class:"compose-line compose-options"},_t={class:"attachment"},dt={class:"submit-wrap"},mt={class:"attachment-list-wrap"},vt={key:0,class:"attachment-price-wrap"},gt=q("span",null," 附件价格¥",-1),ft={key:0,class:"eye-wrap"},yt={key:1,class:"link-wrap"},ht={key:1,class:"compose-wrap"},wt=q("div",{class:"login-wrap"},[q("span",{class:"login-banner"}," 登录后,精彩更多")],-1),bt={key:0,class:"login-only-wrap"},kt={key:1,class:"login-wrap"},Ct=Q({__name:"compose",emits:["post-success"],setup(V,{emit:x}){const i=ee(),I=l([]),p=l(!1),m=l(!1),c=l(!1),w=l(!1),b=l(""),U=l([]),A=l(),L=l(0),g=l("public/image"),r=l([]),h=l([]),k=l([]),f=l([]),C=l(z.FRIEND),R=l(z.FRIEND),O=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],P=+"300",F=l("true".toLowerCase()==="true"),M=l("true".toLowerCase()==="true"),B=l("true".toLowerCase()==="true"),te=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",K=l(),ne=()=>{c.value=!c.value,c.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&c.value&&(c.value=!1)},le=Z.debounce(a=>{ze({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,p.value=!1}).catch(e=>{p.value=!1})},200),ie=Z.debounce(a=>{Ue({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,p.value=!1}).catch(e=>{p.value=!1})},200),re=(a,e)=>{p.value||(p.value=!0,e==="@"?le(a):ie(a))},ue=a=>{a.length>P||(b.value=a)},D=a=>{g.value=a},ce=a=>{r.value=a},pe=async a=>{var e,n,o,u,v;return g.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):g.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):g.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):g.value==="public/video"&&((u=a.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):g.value==="attachment"&&!await it(a.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):g.value==="attachment"&&((v=a.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(g.value==="public/image"&&h.value.push({id:a.id,content:o.data.content}),g.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),g.value==="attachment"&&f.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let u=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(v=>{u+=":"+v}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=h.value.findIndex(n=>n.id===a.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=f.value.findIndex(n=>n.id===a.id),e>-1&&f.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Le(b.value);const n=[];let o=100;n.push({content:b.value,type:S.TEXT,sort:o}),h.value.map(u=>{o++,n.push({content:u.content,type:S.IMAGEURL,sort:o})}),k.value.map(u=>{o++,n.push({content:u.content,type:S.VIDEOURL,sort:o})}),f.value.map(u=>{o++,n.push({content:u.content,type:S.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(u=>{o++,n.push({content:u,type:S.LINKURL,sort:o})}),m.value=!0,Re({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+L.value*100,visibility:C.value}).then(u=>{var v;window.$message.success("发布成功"),m.value=!1,x("post-success",u),c.value=!1,w.value=!1,(v=A.value)==null||v.clear(),r.value=[],b.value="",U.value=[],h.value=[],k.value=[],f.value=[],C.value=R.value}).catch(u=>{m.value=!1})},j=a=>{i.commit("triggerAuth",!0),i.commit("triggerAuthKey",a)};return X(()=>{"friend".toLowerCase()==="friend"?R.value=z.FRIEND:"friend".toLowerCase()==="public"?R.value=z.PUBLIC:R.value=z.PRIVATE,C.value=R.value,K.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Be,o=Oe,u=Me,v=De,H=je,ge=He,fe=Ke,ye=Ge,he=Je,we=Ze,be=Qe,ke=Xe,Ce=Ye,Te=We;return _(),y("div",null,[T(i).state.userInfo.id>0?(_(),y("div",rt,[q("div",ut,[q("div",ct,[t(n,{round:"",size:30,src:T(i).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:p.value,value:b.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:A,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:K.value},data:{type:g.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[q("div",pt,[q("div",_t,[t(H,{abstract:""},{default:s(({handleClick:d})=>[t(v,{disabled:r.value.length>0&&g.value==="public/video"||r.value.length===9,onClick:()=>{D("public/image"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t(T(Pe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),M.value?(_(),N(H,{key:0,abstract:""},{default:s(({handleClick:d})=>[t(v,{disabled:r.value.length>0&&g.value!=="public/video"||r.value.length===9,onClick:()=>{D("public/video"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t(T(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):$("",!0),B.value?(_(),N(H,{key:1,abstract:""},{default:s(({handleClick:d})=>[t(v,{disabled:r.value.length>0&&g.value==="public/video"||r.value.length===9,onClick:()=>{D("attachment"),d()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t(T(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):$("",!0),t(v,{quaternary:"",circle:"",type:"primary",onClick:G(ne,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t(T(Ve))]),_:1})]),_:1},8,["onClick"]),ae.value?(_(),N(v,{key:2,quaternary:"",circle:"",type:"primary",onClick:G(se,["stop"])},{icon:s(()=>[t(u,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t(T(Fe))]),_:1})]),_:1},8,["onClick"])):$("",!0)]),q("div",dt,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/T(P)*100},null,8,["percentage"])]),default:s(()=>[E(" "+J(b.value.length)+" / "+J(T(P)),1)]),_:1}),t(v,{loading:m.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[E(" 发布 ")]),_:1},8,["loading"])])]),q("div",mt,[t(ye),f.value.length>0?(_(),y("div",vt,[te.value?(_(),N(he,{key:0,value:L.value,"onUpdate:value":e[0]||(e[0]=d=>L.value=d),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[gt]),_:1},8,["value"])):$("",!0)])):$("",!0)])]),_:1},8,["headers","data"]),w.value?(_(),y("div",ft,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=d=>C.value=d),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(_(),y(Y,null,W(O,d=>t(be,{key:d.value,value:d.value,label:d.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):$("",!0),c.value?(_(),y("div",yt,[t(Te,{value:U.value,"onUpdate:value":e[2]||(e[2]=d=>U.value=d),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[E(" 创建链接 ")]),_:1},8,["value"])])):$("",!0)])):(_(),y("div",ht,[wt,F.value?$("",!0):(_(),y("div",bt,[t(v,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=d=>j("signin"))},{default:s(()=>[E(" 登录 ")]),_:1})])),F.value?(_(),y("div",kt,[t(v,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=d=>j("signin"))},{default:s(()=>[E(" 登录 ")]),_:1}),t(v,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=d=>j("signup"))},{default:s(()=>[E(" 注册 ")]),_:1})])):$("",!0)]))])}}});const Tt={key:0,class:"skeleton-wrap"},$t={key:1},qt={key:0,class:"empty-wrap"},xt={key:0,class:"pagination-wrap"},It=Q({__name:"Home",setup(V){const x=ee(),i=st(),I=lt(),p=l(!1),m=l([]),c=l(+i.query.p||1),w=l(20),b=l(0),U=xe(()=>{let r="泡泡广场";return i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?r="#"+decodeURIComponent(i.query.q):r="搜索: "+decodeURIComponent(i.query.q)),r}),A=()=>{p.value=!0,Ae({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,page:c.value,page_size:w.value}).then(r=>{p.value=!1,m.value=r.list,b.value=Math.ceil(r.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(r=>{p.value=!1})},L=r=>{if(c.value!=1){I.push({name:"post",query:{id:r.id}});return}let h=[],k=m.value.length;k==w.value&&k--;for(var f=0;f{I.push({name:"home",query:{...i.query,p:r}})};return X(()=>{A()}),Ie(()=>({path:i.path,query:i.query,refresh:x.state.refresh}),(r,h)=>{if(r.refresh!==h.refresh){c.value=+i.query.p||1,setTimeout(()=>{A()},0);return}h.path!=="/post"&&r.path==="/"&&(c.value=+i.query.p||1,setTimeout(()=>{A()},0))}),(r,h)=>{const k=nt,f=Ct,C=at,R=qe,O=ot,P=$e,F=et,M=tt;return _(),y("div",null,[t(k,{title:T(U)},null,8,["title"]),t(F,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(f,{onPostSuccess:L})]),_:1}),p.value?(_(),y("div",Tt,[t(R,{num:w.value},null,8,["num"])])):(_(),y("div",$t,[m.value.length===0?(_(),y("div",qt,[t(O,{size:"large",description:"暂无数据"})])):$("",!0),(_(!0),y(Y,null,W(m.value,B=>(_(),N(C,{key:B.id},{default:s(()=>[t(P,{post:B},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),b.value>0?(_(),y("div",xt,[t(M,{page:c.value,"onUpdate:page":g,"page-slot":T(x).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):$("",!0)])}}});const ia=Ee(It,[["__scopeId","data-v-936146f2"]]);export{ia as default}; diff --git a/web/dist/assets/Home-47eb20e2.css b/web/dist/assets/Home-c075a37e.css similarity index 84% rename from web/dist/assets/Home-47eb20e2.css rename to web/dist/assets/Home-c075a37e.css index edc19687..92bf390d 100644 --- a/web/dist/assets/Home-47eb20e2.css +++ b/web/dist/assets/Home-c075a37e.css @@ -1 +1 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.pagination-wrap[data-v-936146f2]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-936146f2],.dark .pagination-wrap[data-v-936146f2],.dark .empty-wrap[data-v-936146f2],.dark .skeleton-wrap[data-v-936146f2]{background-color:#101014bf} +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.pagination-wrap[data-v-f42b0645]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-f42b0645],.dark .pagination-wrap[data-v-f42b0645],.dark .empty-wrap[data-v-f42b0645],.dark .skeleton-wrap[data-v-f42b0645]{background-color:#101014bf} diff --git a/web/dist/assets/Home-d4930ea8.js b/web/dist/assets/Home-d4930ea8.js new file mode 100644 index 00000000..b2987abd --- /dev/null +++ b/web/dist/assets/Home-d4930ea8.js @@ -0,0 +1 @@ +import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js";import{_ as xe}from"./post-skeleton-38ecc5be.js";import{d as W,r as l,j as ee,o as u,c as v,Y as $,a as x,L as t,$ as s,K as P,O as T,a0 as Q,e as L,M as X,F as G,a2 as J,n as Ie,w as ze}from"./@vue-ca177dbe.js";import{u as te}from"./vuex-d28e9067.js";import{l as Y}from"./lodash-94eb5868.js";import{g as Ue,a as Re,c as Ae,b as Ee,_ as Le}from"./index-fbd1aa45.js";import{p as Pe}from"./content-62bae3e8.js";import{V as z,P as V}from"./IEnum-a180d93e.js";import{I as Se,V as Ne,A as Ve,d as Fe,E as Be}from"./@vicons-6d35273b.js";import{o as Me,v as Oe,j as De,e as je,w as He,x as Ke,y as Ge,z as Je,A as Ze,B as Qe,C as Xe,a as Ye,D as We,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-2035804c.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{b as lt,u as it}from"./vue-router-88cc84d1.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./nonesir-video-db921567.js";const rt=F=>{const q=new FileReader,i=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),I=()=>{const _=new Uint8Array(q.result).subarray(0,4);let d="";for(let p=0;p<_.length;p++)d+=_[p].toString(16);switch(d){case"504b0304":case"504b0506":case"504b0708":return i("application/zip");case"504b030414":return i("application/x-zip-compressed");case"504b0508":return i("application/x-zip");case"504b5370":return i("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():i(p))},q.readAsArrayBuffer(F.slice(0,4))})},ut={key:0,class:"compose-wrap"},ct={class:"compose-line"},pt={class:"compose-user"},_t={class:"compose-line compose-options"},dt={class:"attachment"},mt={class:"submit-wrap"},vt={class:"attachment-list-wrap"},gt={key:0,class:"attachment-price-wrap"},ft=x("span",null," 附件价格¥",-1),yt={key:0,class:"eye-wrap"},ht={key:1,class:"link-wrap"},wt={key:1,class:"compose-wrap"},bt=x("div",{class:"login-wrap"},[x("span",{class:"login-banner"}," 登录后,精彩更多")],-1),kt={key:0,class:"login-only-wrap"},Ct={key:1,class:"login-wrap"},$t=W({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const i=te(),I=l([]),_=l(!1),d=l(!1),p=l(!1),w=l(!1),b=l(""),U=l([]),E=l(),S=l(0),f=l("public/image"),r=l([]),h=l([]),k=l([]),y=l([]),C=l(z.FRIEND),R=l(z.FRIEND),M=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],N=+"300",B=l("true".toLowerCase()==="true"),O=l("true".toLowerCase()==="true"),D=l("true".toLowerCase()==="true"),A=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),oe="/v1/attachment",Z=l(),ne=()=>{p.value=!p.value,p.value&&w.value&&(w.value=!1)},se=()=>{w.value=!w.value,w.value&&p.value&&(p.value=!1)},le=Y.debounce(a=>{Ue({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),ie=Y.debounce(a=>{Re({k:a}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),re=(a,e)=>{_.value||(_.value=!0,e==="@"?le(a):ie(a))},ue=a=>{a.length>N||(b.value=a)},j=a=>{f.value=a},ce=a=>{r.value=a},pe=async a=>{var e,n,o,c,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=a.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=a.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=a.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((c=a.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(a.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=a.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(f.value==="public/image"&&h.value.push({id:a.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:a.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:a.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:a,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let c=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{c+=":"+g}),window.$message.error(c)}}catch{window.$message.error("上传失败")}},me=({file:a})=>{let e=h.value.findIndex(n=>n.id===a.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===a.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===a.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(b.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:a,users:e}=Pe(b.value);const n=[];let o=100;n.push({content:b.value,type:V.TEXT,sort:o}),h.value.map(c=>{o++,n.push({content:c.content,type:V.IMAGEURL,sort:o})}),k.value.map(c=>{o++,n.push({content:c.content,type:V.VIDEOURL,sort:o})}),y.value.map(c=>{o++,n.push({content:c.content,type:V.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(c=>{o++,n.push({content:c,type:V.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(a)),users:Array.from(new Set(e)),attachment_price:+S.value*100,visibility:C.value}).then(c=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",c),p.value=!1,w.value=!1,(g=E.value)==null||g.clear(),r.value=[],b.value="",U.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(c=>{d.value=!1})},H=a=>{i.commit("triggerAuth",!0),i.commit("triggerAuthKey",a)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=z.FRIEND:"friend".toLowerCase()==="public"?R.value=z.PUBLIC:R.value=z.PRIVATE,C.value=R.value,Z.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(a,e)=>{const n=Me,o=Oe,c=De,g=je,K=He,ge=Ke,fe=Ge,ye=Je,he=Ze,we=Qe,be=Xe,ke=Ye,Ce=We,$e=et;return u(),v("div",null,[$(i).state.userInfo.id>0?(u(),v("div",ut,[x("div",ct,[x("div",pt,[t(n,{round:"",size:30,src:$(i).state.userInfo.avatar},null,8,["src"])]),t(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:b.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),t(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:Z.value},data:{type:f.value},onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[t(K,{abstract:""},{default:s(({handleClick:m})=>[t(g,{disabled:r.value.length>0&&f.value==="public/video"||r.value.length===9,onClick:()=>{j("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(c,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(u(),P(K,{key:0,abstract:""},{default:s(({handleClick:m})=>[t(g,{disabled:r.value.length>0&&f.value!=="public/video"||r.value.length===9,onClick:()=>{j("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(c,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),D.value?(u(),P(K,{key:1,abstract:""},{default:s(({handleClick:m})=>[t(g,{disabled:r.value.length>0&&f.value==="public/video"||r.value.length===9,onClick:()=>{j("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[t(c,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),t(g,{quaternary:"",circle:"",type:"primary",onClick:Q(ne,["stop"])},{icon:s(()=>[t(c,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(u(),P(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Q(se,["stop"])},{icon:s(()=>[t(c,{size:"20",color:"var(--primary-color)"},{default:s(()=>[t($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[t(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[t(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:b.value.length/$(N)*100},null,8,["percentage"])]),default:s(()=>[L(" "+X(b.value.length)+" / "+X($(N)),1)]),_:1}),t(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[t(ye),y.value.length>0?(u(),v("div",gt,[A.value?(u(),P(he,{key:0,value:S.value,"onUpdate:value":e[0]||(e[0]=m=>S.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data"]),w.value?(u(),v("div",yt,[t(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[t(ke,null,{default:s(()=>[(u(),v(G,null,J(M,m=>t(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(u(),v("div",ht,[t($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=m=>U.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(u(),v("div",wt,[bt,B.value?T("",!0):(u(),v("div",kt,[t(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1})])),B.value?(u(),v("div",Ct,[t(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1}),t(g,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=m=>H("signup"))},{default:s(()=>[L(" 注册 ")]),_:1})])):T("",!0)]))])}}});const Tt={key:0,class:"skeleton-wrap"},qt={key:1},xt={key:0,class:"empty-wrap"},It={key:1},zt={key:2},Ut={key:0,class:"pagination-wrap"},Rt=W({__name:"Home",setup(F){const q=te(),i=lt(),I=it(),_=l(!1),d=l([]),p=l(+i.query.p||1),w=l(20),b=l(0),U=Ie(()=>{let r="泡泡广场";return i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?r="#"+decodeURIComponent(i.query.q):r="搜索: "+decodeURIComponent(i.query.q)),r}),E=()=>{_.value=!0,Ee({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,page:p.value,page_size:w.value}).then(r=>{_.value=!1,d.value=r.list,b.value=Math.ceil(r.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(r=>{_.value=!1})},S=r=>{if(p.value!=1){I.push({name:"post",query:{id:r.id}});return}let h=[],k=d.value.length;k==w.value&&k--;for(var y=0;y{I.push({name:"home",query:{...i.query,p:r}})};return ee(()=>{E()}),ze(()=>({path:i.path,query:i.query,refresh:q.state.refresh}),(r,h)=>{if(r.refresh!==h.refresh){p.value=+i.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&r.path==="/"&&(p.value=+i.query.p||1,setTimeout(()=>{E()},0))}),(r,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,N=Te,B=qe,O=tt,D=at;return u(),v("div",null,[t(k,{title:$(U)},null,8,["title"]),t(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[t(C,null,{default:s(()=>[t(y,{onPostSuccess:S})]),_:1}),_.value?(u(),v("div",Tt,[t(R,{num:w.value},null,8,["num"])])):(u(),v("div",qt,[d.value.length===0?(u(),v("div",xt,[t(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(u(),v("div",It,[(u(!0),v(G,null,J(d.value,A=>(u(),P(C,{key:A.id},{default:s(()=>[t(N,{post:A},null,8,["post"])]),_:2},1024))),128))])):(u(),v("div",zt,[(u(!0),v(G,null,J(d.value,A=>(u(),P(C,{key:A.id},{default:s(()=>[t(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),b.value>0?(u(),v("div",Ut,[t(D,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":b.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Le(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; diff --git a/web/dist/assets/Messages-268fd9db.js b/web/dist/assets/Messages-ef7b1288.js similarity index 97% rename from web/dist/assets/Messages-268fd9db.js rename to web/dist/assets/Messages-ef7b1288.js index 36698fb6..ca635103 100644 --- a/web/dist/assets/Messages-268fd9db.js +++ b/web/dist/assets/Messages-ef7b1288.js @@ -1 +1 @@ -import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-71354138.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-6d35273b.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),H({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(J))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(O,null,N(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(O,null,N(s.value,S=>(a(),z(R,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; +import{d as b,a1 as V,o as a,c as o,L as n,$ as i,a as k,a0 as $,e as u,M as g,K as z,O as l,Y as p,a4 as A,a2 as N,F as O,r as y,j as D}from"./@vue-ca177dbe.js";import{u as L,b as G}from"./vue-router-88cc84d1.js";import{G as H,H as P,I as T,_ as F,J as U}from"./index-fbd1aa45.js";import{a as E}from"./formatTime-000dbebb.js";import{q as J,r as K,s as q,t as Y}from"./@vicons-6d35273b.js";import{o as Q,l as W,j as X,S as Z,L as ee,U as se,F as te,G as ne,I as ae,H as oe}from"./naive-ui-2035804c.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as le}from"./vuex-d28e9067.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./moment-b7869f98.js";const re={class:"sender-wrap"},ce={key:0,class:"nickname"},_e={class:"username"},ue={key:1,class:"nickname"},de={class:"timestamp"},me={class:"timestamp-txt"},pe={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke=b({__name:"message-item",props:{message:null},setup(e){const h="https://assets.paopao.info/public/avatar/default/admin.png",w=L(),r=s=>{c(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?w.push({name:"post",query:{id:s.post_id}}):window.$message.error("该动态已被删除"))},d=s=>{c(s),H({user_id:s.sender_user_id}).then(t=>{s.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},v=s=>{c(s),P({user_id:s.sender_user_id}).then(t=>{s.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},c=s=>{s.is_read===0&&T({id:s.id}).then(t=>{s.is_read=1}).catch(t=>{console.log(t)})};return(s,t)=>{const x=Q,_=V("router-link"),I=W,m=X,C=Z,M=ee;return a(),o("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:t[4]||(t[4]=f=>c(e.message))},[n(M,{"content-indented":""},{avatar:i(()=>[n(x,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:h},null,8,["src"])]),header:i(()=>[k("div",re,[e.message.sender_user.id>0?(a(),o("span",ce,[n(_,{onClick:t[0]||(t[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:i(()=>[u(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),k("span",_e," @"+g(e.message.sender_user.username),1)])):(a(),o("span",ue," 系统 "))])]),"header-extra":i(()=>[k("span",de,[e.message.is_read===0?(a(),z(I,{key:0,dot:"",processing:""})):l("",!0),k("span",me,g(p(E)(e.message.created_on)),1)])]),description:i(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:i(()=>[e.message.type!=4?(a(),o("div",pe,[u(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),o("span",{key:0,onClick:t[1]||(t[1]=$(f=>r(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(J))]),_:1}),u(" 查看详情 ")])):l("",!0)])):l("",!0),e.message.type===4?(a(),o("div",ge,g(e.message.content),1)):l("",!0),e.message.type===5?(a(),o("div",ve,[u(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),o("span",{key:0,onClick:t[2]||(t[2]=$(f=>d(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(K))]),_:1}),u(" 同意 ")])):l("",!0),e.message.reply_id===1?(a(),o("span",{key:1,onClick:t[3]||(t[3]=$(f=>v(e.message),["stop"])),class:"hash-link view-link"},[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 拒绝 ")])):l("",!0),e.message.reply_id===2?(a(),o("span",fe,[n(m,null,{default:i(()=>[n(p(Y))]),_:1}),u(" 已同意 ")])):l("",!0),e.message.reply_id===3?(a(),o("span",ye,[n(m,null,{default:i(()=>[n(p(q))]),_:1}),u(" 已拒绝 ")])):l("",!0)])):l("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const he=F(ke,[["__scopeId","data-v-4a0e27fa"]]),we={class:"content"},$e=b({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(h,w)=>{const r=se;return a(!0),o(O,null,N(new Array(e.num),d=>(a(),o("div",{class:"skeleton-item",key:d},[k("div",we,[n(r,{text:"",repeat:2}),n(r,{text:"",style:{width:"60%"}})])]))),128)}}});const xe=F($e,[["__scopeId","data-v-01d2e871"]]),Ce={key:0,class:"skeleton-wrap"},Me={key:1},be={key:0,class:"empty-wrap"},Fe={key:0,class:"pagination-wrap"},Ie=b({__name:"Messages",setup(e){const h=G(),w=le(),r=y(!1),d=y(+h.query.p||1),v=y(10),c=y(0),s=y([]),t=()=>{r.value=!0,U({page:d.value,page_size:v.value}).then(_=>{r.value=!1,s.value=_.list,c.value=Math.ceil(_.pager.total_rows/v.value)}).catch(_=>{r.value=!1})},x=_=>{d.value=_,t()};return D(()=>{t()}),(_,I)=>{const m=ie,C=xe,M=ae,f=he,R=oe,j=te,B=ne;return a(),o("div",null,[n(m,{title:"消息"}),n(j,{class:"main-content-wrap messages-wrap",bordered:""},{default:i(()=>[r.value?(a(),o("div",Ce,[n(C,{num:v.value},null,8,["num"])])):(a(),o("div",Me,[s.value.length===0?(a(),o("div",be,[n(M,{size:"large",description:"暂无数据"})])):l("",!0),(a(!0),o(O,null,N(s.value,S=>(a(),z(R,{key:S.id},{default:i(()=>[n(f,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),c.value>0?(a(),o("div",Fe,[n(B,{page:d.value,"onUpdate:page":x,"page-slot":p(w).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)])}}});const Ze=F(Ie,[["__scopeId","data-v-4e7b1342"]]);export{Ze as default}; diff --git a/web/dist/assets/Post-e74fef3c.js b/web/dist/assets/Post-31658e5a.js similarity index 99% rename from web/dist/assets/Post-e74fef3c.js rename to web/dist/assets/Post-31658e5a.js index 26b223ce..85fcb5f5 100644 --- a/web/dist/assets/Post-e74fef3c.js +++ b/web/dist/assets/Post-31658e5a.js @@ -1 +1 @@ -import{d as Q,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as I,M as T,K as z,O as i,Y as e,a0 as j,n as ae,a6 as Ue,F as le,a2 as ie,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{f as ce}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as te,f as Ae,h as De,i as Me,j as Oe,g as qe,k as Be,l as Ee,m as Ne,n as je,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-71354138.js";import{Y as ue,V as Z}from"./IEnum-a180d93e.js";import{T as ke,e as re,f as we,g as _e,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-6d35273b.js";import{j as se,e as oe,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-3f1d28f2.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-fdd699ea.js";import{l as It}from"./lodash-94eb5868.js";import{a as Tt}from"./copy-to-clipboard-1dd3075d.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./nonesir-video-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},At={class:"timestamp"},Dt={class:"base-wrap"},Mt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Nt=["onClick"],jt={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=Q({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(A,{emit:O}){const l=A,r=ee(),g=u(l.reply.is_thumbs_up==ue.YES),y=u(l.reply.is_thumbs_down==ue.YES),w=u(l.reply.thumbs_up_count),S=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{g.value=!g.value,g.value?(w.value++,y.value=!1):w.value--}).catch(k=>{console.log(k)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{y.value=!y.value,y.value&&g.value&&(w.value--,g.value=!1)}).catch(k=>{console.log(k)})},C=()=>{O("focusReply",l.reply)},f=()=>{Le({id:l.reply.id}).then(k=>{window.$message.success("删除成功"),setTimeout(()=>{O("reload")},50)}).catch(k=>{console.log(k)})};return(k,U)=>{const s=de("router-link"),h=se,b=oe,$=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[I(T(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,T(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),z(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[I(T(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",At,[I(T(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),z($,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:f},{trigger:a(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(h,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",Dt,[d("div",Mt,T(l.reply.content),1),d("div",Ot,[d("span",qt,T(e(ce)(l.reply.created_on)),1),d("div",Bt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:U[0]||(U[0]=j(()=>{},["stop"]))},[t(h,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Et,T(w.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(S,["stop"])},[t(h,{size:"medium"},{default:a(()=>[g.value?i("",!0):(n(),z(e(re),{key:0})),g.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",jt,T(w.value),1)],8,Nt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(h,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(h,{size:"medium"},{default:a(()=>[y.value?i("",!0):(n(),z(e(_e),{key:0})),y.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:C}," 回复 ")):i("",!0)])])])])}}});const Yt=te(Ft,[["__scopeId","data-v-783f5693"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=Q({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:O,emit:l}){const r=A,g=ee(),y=u(),w=u(!1),S=u(""),_=u(!1),C=u(r.comment.is_thumbs_up==ue.YES),f=u(r.comment.is_thumbs_down==ue.YES),k=u(r.comment.thumbs_up_count),U=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{C.value=!C.value,C.value?(k.value++,f.value=!1):k.value--}).catch($=>{console.log($)})},s=()=>{De({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{f.value=!f.value,f.value&&C.value&&(k.value--,C.value=!1)}).catch($=>{console.log($)})},h=$=>{w.value=$,$?setTimeout(()=>{var x;(x=y.value)==null||x.focus()},10):(_.value=!1,S.value="",l("reset"))},b=()=>{_.value=!0,Me({comment_id:r.comment.id,at_user_id:r.atUserid,content:S.value}).then($=>{h(!1),window.$message.success("评论成功"),l("reload")}).catch($=>{_.value=!1})};return O({switchReply:h}),($,x)=>{const M=se,q=ot,Y=oe,E=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,T(e(ce)(A.comment.created_on)),1),d("div",Qt,[e(g).state.userLogined?i("",!0):(n(),c("div",Wt,[t(M,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Xt,T(k.value),1)])),e(g).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(M,{size:"medium"},{default:a(()=>[C.value?i("",!0):(n(),z(e(re),{key:0})),C.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,T(k.value),1)],8,Zt)):i("",!0),e(g).state.userLogined?i("",!0):(n(),c("div",ts,[t(M,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(g).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(s,["stop"])},[t(M,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),z(e(_e),{key:0})),f.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(g).state.userLogined&&!w.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:x[0]||(x[0]=N=>h(!0))}," 回复 ")):i("",!0),e(g).state.userLogined&&w.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:x[1]||(x[1]=N=>h(!1))}," 取消 ")):i("",!0)])]),w.value?(n(),c("div",os,[t(E,null,{default:a(()=>[t(q,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:"100",value:S.value,"onUpdate:value":x[2]||(x[2]=N=>S.value=N),"show-count":"",clearable:""},null,8,["placeholder","value"]),t(Y,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:b},{default:a(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=te(ns,[["__scopeId","data-v-0f1721e2"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=Q({__name:"comment-item",props:{comment:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(0),w=u(""),S=u(),_=ae(()=>{let h=Object.assign({texts:[],imgs:[]},l.comment);return h.contents.map(b=>{(+b.type==1||+b.type==2)&&h.texts.push(b),+b.type==3&&h.imgs.push(b)}),h}),C=(h,b)=>{let $=h.target;if($.dataset.detail){const x=$.dataset.detail.split(":");x.length===2&&(r.commit("refresh"),x[0]==="tag"?window.$message.warning("评论内的无效话题"):g.push({name:"user",query:{username:x[1]}}))}},f=h=>{var b,$;y.value=h.user_id,w.value=((b=h.user)==null?void 0:b.username)||"",($=S.value)==null||$.switchReply(!0)},k=()=>{O("reload")},U=()=>{y.value=0,w.value=""},s=()=>{Oe({id:_.value.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{k()},50)}).catch(h=>{})};return(h,b)=>{const $=ve,x=de("router-link"),M=se,q=oe,Y=$e,E=Ie,N=as,L=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t($,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(x,{onClick:b[0]||(b[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[I(T(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+T(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,T(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),z(Y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(M,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),z(E,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:e(_),"at-userid":y.value,"at-username":w.value,onReload:k,onReset:U},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(le,null,ie(e(_).replies,o=>(n(),z(L,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:f,onReload:k},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(le,null,ie(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:b[1]||(b[1]=j(p=>C(p,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=te(ds,[["__scopeId","data-v-f206d4d8"]]),vs=A=>(ge("data-v-ca3e6071"),A=A(),ye(),A),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=Q({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:O}){const l=A,r=ee(),g=u([]),y=u(!1),w=u(!1),S=u(!1),_=u(""),C=u(),f=u("public/image"),k=u([]),U=u([]),s=u("true".toLowerCase()==="true"),h="/v1/attachment",b=u(),$=It.debounce(m=>{qe({k:m}).then(v=>{let P=[];v.suggest.map(R=>{P.push({label:R,value:R})}),g.value=P,w.value=!1}).catch(v=>{w.value=!1})},200),x=(m,v)=>{w.value||(w.value=!0,v==="@"&&$(m))},M=m=>{m.length>200||(_.value=m)},q=m=>{f.value=m},Y=m=>{k.value=m},E=async m=>{var v,P;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((v=m.file.file)==null?void 0:v.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((P=m.file.file)==null?void 0:P.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},N=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);R.code===0&&f.value==="public/image"&&U.value.push({id:m.id,content:R.data.content})}catch{window.$message.error("上传失败")}},L=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);if(R.code!==0){let H=R.msg||"上传失败";R.details&&R.details.length>0&&R.details.map(B=>{H+=":"+B}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},D=({file:m})=>{let v=U.value.findIndex(P=>P.id===m.id);v>-1&&U.value.splice(v,1)},o=()=>{y.value=!0},p=()=>{var m;y.value=!1,(m=C.value)==null||m.clear(),k.value=[],_.value="",U.value=[]},V=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=fe(_.value);const v=[];let P=100;v.push({content:_.value,type:2,sort:P}),U.value.map(R=>{P++,v.push({content:R.content,type:3,sort:P})}),S.value=!0,Be({contents:v,post_id:l.postId,users:Array.from(new Set(m))}).then(R=>{window.$message.success("发布成功"),S.value=!1,O("post-success"),p()}).catch(R=>{S.value=!1})},K=m=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",m)};return me(()=>{b.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,v)=>{const P=ve,R=at,H=se,B=oe,W=lt,X=it,J=ct,ne=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t(P,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(R,{type:"textarea",size:"large",autosize:"",bordered:!1,options:g.value,prefix:["@"],loading:w.value,value:_.value,disabled:l.lock===1,"onUpdate:value":M,onSearch:x,onFocus:o,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),z(pe,{key:0,ref_key:"uploadRef",ref:C,abstract:"","list-type":"image",multiple:!0,max:9,action:h,headers:{Authorization:b.value},data:{type:f.value},onBeforeUpload:E,onFinish:N,onError:L,onRemove:D,"onUpdate:fileList":Y},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:G})=>[t(B,{disabled:k.value.length>0&&f.value==="public/video"||k.value.length===9,onClick:()=>{q("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(J,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(X,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/200*100},null,8,["percentage"])]),default:a(()=>[I(" "+T(_.value.length)+" / 200 ",1)]),_:1})]),d("div",ws,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:p},{default:a(()=>[I(" 取消 ")]),_:1}),t(B,{loading:S.value,onClick:V,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(ne)])]),_:1},8,["headers","data"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=G=>K("signup"))},{default:a(()=>[I(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=te(Ts,[["__scopeId","data-v-ca3e6071"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},As={key:0},Ds={key:1},Ms={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Ns=Q({__name:"post-detail",props:{post:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(!1),w=u(!1),S=u(!1),_=u(!1),C=u(!1),f=u(!1),k=u(!1),U=u(Z.PUBLIC),s=ae({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(p=>{(+p.type==1||+p.type==2)&&o.texts.push(p),+p.type==3&&o.imgs.push(p),+p.type==4&&o.videos.push(p),+p.type==6&&o.links.push(p),+p.type==7&&o.attachments.push(p),+p.type==8&&o.charge_attachments.push(p)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),h=ae(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===Z.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===Z.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),b=o=>{g.push({name:"post",query:{id:o}})},$=(o,p)=>{if(o.target.dataset.detail){const V=o.target.dataset.detail.split(":");if(V.length===2){r.commit("refresh"),V[0]==="tag"?g.push({name:"home",query:{q:V[1],t:"tag"}}):g.push({name:"user",query:{username:V[1]}});return}}b(p)},x=o=>{switch(o){case"delete":S.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":C.value=!0;break;case"vpublic":U.value=0,f.value=!0;break;case"vprivate":U.value=1,f.value=!0;break;case"vfriend":U.value=2,f.value=!0;break}},M=()=>{je({id:s.value.id}).then(o=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{k.value=!1})},q=()=>{Ve({id:s.value.id}).then(o=>{O("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{k.value=!1})},Y=()=>{He({id:s.value.id}).then(o=>{O("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{k.value=!1})},E=()=>{Fe({id:s.value.id,visibility:U.value}).then(o=>{O("reload"),window.$message.success("修改可见性成功")}).catch(o=>{k.value=!1})},N=()=>{Ye({id:s.value.id}).then(o=>{y.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},L=()=>{Ke({id:s.value.id}).then(o=>{w.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(Ee({id:s.value.id}).then(o=>{y.value=o.status}).catch(o=>{console.log(o)}),Ne({id:s.value.id}).then(o=>{w.value=o.status}).catch(o=>{console.log(o)}))}),(o,p)=>{const V=ve,K=de("router-link"),m=_t,v=se,P=oe,R=pt,H=dt,B=wt,W=Ie,X=bt,J=$t,ne=mt,pe=xe,G=Ce;return n(),c("div",{class:"detail-item",onClick:p[6]||(p[6]=F=>b(e(s).id))},[t(G,null,{avatar:a(()=>[t(V,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(K,{onClick:p[0]||(p[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[I(T(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+T(e(s).user.username),1),e(s).is_top?(n(),z(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[I(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(Z).PRIVATE?(n(),z(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[I(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(Z).FRIEND?(n(),z(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[I(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t(R,{placement:"bottom-end",trigger:"click",size:"small",options:e(h),onSelect:x},{default:a(()=>[t(P,{quaternary:"",circle:""},{icon:a(()=>[t(v,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(H,{show:S.value,"onUpdate:show":p[1]||(p[1]=F=>S.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:M},null,8,["show"]),t(H,{show:_.value,"onUpdate:show":p[2]||(p[2]=F=>_.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:q},null,8,["show","content"]),t(H,{show:C.value,"onUpdate:show":p[3]||(p[3]=F=>C.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(H,{show:f.value,"onUpdate:show":p[4]||(p[4]=F=>f.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(U.value==0?"公开":U.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:a(()=>[t(B,{attachments:e(s).attachments},null,8,["attachments"]),t(B,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(W,{imgs:e(s).imgs},null,8,["imgs"]),t(X,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[I(" 发布于 "+T(e(ce)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",As,[t(ne,{vertical:""}),I(" "+T(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",Ds,[t(ne,{vertical:""}),I(" 最后回复 "+T(e(ce)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ms,[t(pe,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:j(N,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[y.value?i("",!0):(n(),z(e(We),{key:0})),y.value?(n(),z(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),I(" "+T(e(s).upvote_count),1)],8,Os),d("div",qs,[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),I(" "+T(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:j(L,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[w.value?i("",!0):(n(),z(e(et),{key:0})),w.value?(n(),z(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),I(" "+T(e(s).collection_count),1)],8,Bs),d("div",{class:"opt-item hover",onClick:j(D,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),I(" "+T(e(s).share_count),1)],8,Es)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(le,null,ie(e(s).texts,F=>(n(),c("span",{key:F.id,class:"post-text",onClick:p[5]||(p[5]=j(ze=>$(ze,e(s).id),["stop"])),innerHTML:e(fe)(F.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const js=A=>(ge("data-v-0d01659f"),A=A(),ye(),A),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=js(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=Q({__name:"Post",setup(A){const O=Ct(),l=u({}),r=u(!1),g=u(!1),y=u([]),w=ae(()=>+O.query.id),S=u("default"),_=u(!0),C=20;let f={loading(){},loaded(){},complete(){},error(){}};const k=L=>{S.value=L,L==="default"&&(_.value=!0),E(f)},U=()=>{l.value={id:0},r.value=!0,Je({id:w.value}).then(L=>{r.value=!1,l.value=L,E(f)}).catch(L=>{r.value=!1})};let s=1;const h=u(!1),b=u([]),$=L=>{h.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(s===1?b.value=D.list:b.value.push(...D.list),y.value=b.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})};let x=1,M=u(!1);const q=u([]),Y=L=>{M.value||he({id:l.value.id,sort_strategy:"newest",page:x,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(x===1?q.value=D.list:q.value.push(...D.list),y.value=q.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})},E=L=>{w.value<1||(y.value.length===0&&(g.value=!0),S.value==="default"?(y.value=b.value,$(L)):(y.value=q.value,Y(L)),g.value=!1)},N=()=>{s=1,h.value=!1,b.value=[],x=1,M.value=!1,q.value=[],E(f)};return me(()=>{U()}),Pe(w,()=>{w.value>0&&O.name==="post"&&U()}),(L,D)=>{const o=zt,p=Ns,V=ft,K=ht,m=gt,v=yt,P=kt,R=zs,H=xt,B=ms,W=xe,X=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(X,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(m,null,{default:a(()=>[t(K,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(p,{post:l.value,onReload:U},null,8,["post"])])):(n(),c("div",Hs,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(P,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":k},{prefix:a(()=>[Ys]),default:a(()=>[t(v,{name:"default",tab:"默认"}),t(v,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),z(m,{key:1},{default:a(()=>[t(R,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:N},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[g.value?(n(),c("div",Js,[t(H,{num:5})])):(n(),c("div",Gs,[y.value.length===0?(n(),c("div",Qs,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(le,null,ie(y.value,J=>(n(),z(m,{key:J.id},{default:a(()=>[t(B,{comment:J,onReload:N},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=C?(n(),z(W,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:E},{spinner:a(()=>[_.value&&h.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(M)?(n(),c("span",Xs)):i("",!0),_.value&&!h.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(M)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Do=te(to,[["__scopeId","data-v-0d01659f"]]);export{Do as default}; +import{d as Q,r as u,a1 as de,o as n,c,a as d,L as t,$ as a,e as I,M as T,K as z,O as i,Y as e,a0 as j,n as ae,a6 as Ue,F as le,a2 as ie,j as me,U as ge,V as ye,w as Pe}from"./@vue-ca177dbe.js";import{u as ee}from"./vuex-d28e9067.js";import{f as ce}from"./formatTime-000dbebb.js";import{t as Re,d as Se,e as Le,_ as te,f as Ae,h as De,i as Me,j as Oe,g as qe,k as Be,l as Ee,m as Ne,n as je,o as Ve,s as He,v as Fe,p as Ye,q as Ke,r as Je,u as he}from"./index-fbd1aa45.js";import{Y as ue,V as Z}from"./IEnum-a180d93e.js";import{T as ke,e as re,f as we,g as _e,h as be,I as Ge,i as Qe,j as We,k as Xe,l as Ze,m as et,n as tt,o as st}from"./@vicons-6d35273b.js";import{j as se,e as oe,J as $e,b as ot,K as nt,o as ve,L as Ce,v as at,w as lt,x as it,y as ct,z as ut,B as rt,M as _t,O as pt,i as dt,P as mt,a as xe,F as vt,I as ft,k as ht,H as gt,f as yt,g as kt}from"./naive-ui-2035804c.js";import{p as fe,_ as Ie,a as wt,b as bt,c as $t}from"./content-62bae3e8.js";import{u as Te,b as Ct}from"./vue-router-88cc84d1.js";import{_ as xt}from"./post-skeleton-38ecc5be.js";import{l as It}from"./lodash-94eb5868.js";import{a as Tt}from"./copy-to-clipboard-1dd3075d.js";import{_ as zt}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{K as Ut}from"./v3-infinite-loading-fcb59c38.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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"./nonesir-video-db921567.js";import"./toggle-selection-93f4ad84.js";const Pt={class:"reply-item"},Rt={class:"header-wrap"},St={class:"username"},Lt={class:"reply-name"},At={class:"timestamp"},Dt={class:"base-wrap"},Mt={class:"content"},Ot={class:"reply-switch"},qt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Nt=["onClick"],jt={class:"upvote-count"},Vt={key:2,class:"action-item"},Ht=["onClick"],Ft=Q({__name:"reply-item",props:{tweetId:null,reply:null},emits:["focusReply","reload"],setup(A,{emit:O}){const l=A,r=ee(),g=u(l.reply.is_thumbs_up==ue.YES),y=u(l.reply.is_thumbs_down==ue.YES),w=u(l.reply.thumbs_up_count),S=()=>{Re({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{g.value=!g.value,g.value?(w.value++,y.value=!1):w.value--}).catch(k=>{console.log(k)})},_=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(k=>{y.value=!y.value,y.value&&g.value&&(w.value--,g.value=!1)}).catch(k=>{console.log(k)})},C=()=>{O("focusReply",l.reply)},f=()=>{Le({id:l.reply.id}).then(k=>{window.$message.success("删除成功"),setTimeout(()=>{O("reload")},50)}).catch(k=>{console.log(k)})};return(k,U)=>{const s=de("router-link"),h=se,b=oe,$=$e;return n(),c("div",Pt,[d("div",Rt,[d("div",St,[t(s,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:a(()=>[I(T(l.reply.user.username),1)]),_:1},8,["to"]),d("span",Lt,T(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(n(),z(s,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:a(()=>[I(T(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",At,[I(T(l.reply.ip_loc)+" ",1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===l.reply.user.id?(n(),z($,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:f},{trigger:a(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(h,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),d("div",Dt,[d("div",Mt,T(l.reply.content),1),d("div",Ot,[d("span",qt,T(e(ce)(l.reply.created_on)),1),d("div",Bt,[e(r).state.userLogined?i("",!0):(n(),c("div",{key:0,class:"action-item",onClick:U[0]||(U[0]=j(()=>{},["stop"]))},[t(h,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Et,T(w.value),1)])),e(r).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(S,["stop"])},[t(h,{size:"medium"},{default:a(()=>[g.value?i("",!0):(n(),z(e(re),{key:0})),g.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",jt,T(w.value),1)],8,Nt)):i("",!0),e(r).state.userLogined?i("",!0):(n(),c("div",Vt,[t(h,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(r).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(h,{size:"medium"},{default:a(()=>[y.value?i("",!0):(n(),z(e(_e),{key:0})),y.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,Ht)):i("",!0),e(r).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:C}," 回复 ")):i("",!0)])])])])}}});const Yt=te(Ft,[["__scopeId","data-v-783f5693"]]),Kt={class:"reply-compose-wrap"},Jt={class:"reply-switch"},Gt={class:"time-item"},Qt={class:"actions"},Wt={key:0,class:"action-item"},Xt={class:"upvote-count"},Zt=["onClick"],es={class:"upvote-count"},ts={key:2,class:"action-item"},ss=["onClick"],os={key:0,class:"reply-input-wrap"},ns=Q({__name:"compose-reply",props:{comment:null,atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:O,emit:l}){const r=A,g=ee(),y=u(),w=u(!1),S=u(""),_=u(!1),C=u(r.comment.is_thumbs_up==ue.YES),f=u(r.comment.is_thumbs_down==ue.YES),k=u(r.comment.thumbs_up_count),U=()=>{Ae({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{C.value=!C.value,C.value?(k.value++,f.value=!1):k.value--}).catch($=>{console.log($)})},s=()=>{De({tweet_id:r.comment.post_id,comment_id:r.comment.id}).then($=>{f.value=!f.value,f.value&&C.value&&(k.value--,C.value=!1)}).catch($=>{console.log($)})},h=$=>{w.value=$,$?setTimeout(()=>{var x;(x=y.value)==null||x.focus()},10):(_.value=!1,S.value="",l("reset"))},b=()=>{_.value=!0,Me({comment_id:r.comment.id,at_user_id:r.atUserid,content:S.value}).then($=>{h(!1),window.$message.success("评论成功"),l("reload")}).catch($=>{_.value=!1})};return O({switchReply:h}),($,x)=>{const M=se,q=ot,Y=oe,E=nt;return n(),c("div",Kt,[d("div",Jt,[d("span",Gt,T(e(ce)(A.comment.created_on)),1),d("div",Qt,[e(g).state.userLogined?i("",!0):(n(),c("div",Wt,[t(M,{size:"medium"},{default:a(()=>[t(e(re))]),_:1}),d("span",Xt,T(k.value),1)])),e(g).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(M,{size:"medium"},{default:a(()=>[C.value?i("",!0):(n(),z(e(re),{key:0})),C.value?(n(),z(e(we),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",es,T(k.value),1)],8,Zt)):i("",!0),e(g).state.userLogined?i("",!0):(n(),c("div",ts,[t(M,{size:"medium"},{default:a(()=>[t(e(_e))]),_:1})])),e(g).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(s,["stop"])},[t(M,{size:"medium"},{default:a(()=>[f.value?i("",!0):(n(),z(e(_e),{key:0})),f.value?(n(),z(e(be),{key:1,class:"show"})):i("",!0)]),_:1})],8,ss)):i("",!0),e(g).state.userLogined&&!w.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:x[0]||(x[0]=N=>h(!0))}," 回复 ")):i("",!0),e(g).state.userLogined&&w.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:x[1]||(x[1]=N=>h(!1))}," 取消 ")):i("",!0)])]),w.value?(n(),c("div",os,[t(E,null,{default:a(()=>[t(q,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:r.atUsername?"@"+r.atUsername:"请输入回复内容..",maxlength:"100",value:S.value,"onUpdate:value":x[2]||(x[2]=N=>S.value=N),"show-count":"",clearable:""},null,8,["placeholder","value"]),t(Y,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:b},{default:a(()=>[I(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const as=te(ns,[["__scopeId","data-v-0f1721e2"]]),ls={class:"comment-item"},is={class:"nickname-wrap"},cs={class:"username-wrap"},us={class:"opt-wrap"},rs={class:"timestamp"},_s=["innerHTML"],ps={class:"reply-wrap"},ds=Q({__name:"comment-item",props:{comment:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(0),w=u(""),S=u(),_=ae(()=>{let h=Object.assign({texts:[],imgs:[]},l.comment);return h.contents.map(b=>{(+b.type==1||+b.type==2)&&h.texts.push(b),+b.type==3&&h.imgs.push(b)}),h}),C=(h,b)=>{let $=h.target;if($.dataset.detail){const x=$.dataset.detail.split(":");x.length===2&&(r.commit("refresh"),x[0]==="tag"?window.$message.warning("评论内的无效话题"):g.push({name:"user",query:{username:x[1]}}))}},f=h=>{var b,$;y.value=h.user_id,w.value=((b=h.user)==null?void 0:b.username)||"",($=S.value)==null||$.switchReply(!0)},k=()=>{O("reload")},U=()=>{y.value=0,w.value=""},s=()=>{Oe({id:_.value.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{k()},50)}).catch(h=>{})};return(h,b)=>{const $=ve,x=de("router-link"),M=se,q=oe,Y=$e,E=Ie,N=as,L=Yt,D=Ce;return n(),c("div",ls,[t(D,{"content-indented":""},Ue({avatar:a(()=>[t($,{round:"",size:30,src:e(_).user.avatar},null,8,["src"])]),header:a(()=>[d("span",is,[t(x,{onClick:b[0]||(b[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(_).user.username}}},{default:a(()=>[I(T(e(_).user.nickname),1)]),_:1},8,["to"])]),d("span",cs," @"+T(e(_).user.username),1)]),"header-extra":a(()=>[d("div",us,[d("span",rs,T(e(_).ip_loc),1),e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(_).user.id?(n(),z(Y,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:s},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(M,null,{default:a(()=>[t(e(ke))]),_:1})]),_:1})]),default:a(()=>[I(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:a(()=>[e(_).imgs.length>0?(n(),z(E,{key:0,imgs:e(_).imgs},null,8,["imgs"])):i("",!0),t(N,{ref_key:"replyComposeRef",ref:S,comment:e(_),"at-userid":y.value,"at-username":w.value,onReload:k,onReset:U},null,8,["comment","at-userid","at-username"]),d("div",ps,[(n(!0),c(le,null,ie(e(_).replies,o=>(n(),z(L,{key:o.id,reply:o,"tweet-id":e(_).post_id,onFocusReply:f,onReload:k},null,8,["reply","tweet-id"]))),128))])]),_:2},[e(_).texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(le,null,ie(e(_).texts,o=>(n(),c("span",{key:o.id,class:"comment-text",onClick:b[1]||(b[1]=j(p=>C(p,e(_).id),["stop"])),innerHTML:e(fe)(o.content).content},null,8,_s))),128))]),key:"0"}:void 0]),1024)])}}});const ms=te(ds,[["__scopeId","data-v-f206d4d8"]]),vs=A=>(ge("data-v-ca3e6071"),A=A(),ye(),A),fs={key:0,class:"compose-wrap"},hs={class:"compose-line"},gs={class:"compose-user"},ys={class:"compose-line compose-options"},ks={class:"attachment"},ws={class:"submit-wrap"},bs={class:"attachment-list-wrap"},$s={key:1,class:"compose-wrap"},Cs=vs(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),xs={key:0,class:"login-only-wrap"},Is={key:1,class:"login-wrap"},Ts=Q({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:O}){const l=A,r=ee(),g=u([]),y=u(!1),w=u(!1),S=u(!1),_=u(""),C=u(),f=u("public/image"),k=u([]),U=u([]),s=u("true".toLowerCase()==="true"),h="/v1/attachment",b=u(),$=It.debounce(m=>{qe({k:m}).then(v=>{let P=[];v.suggest.map(R=>{P.push({label:R,value:R})}),g.value=P,w.value=!1}).catch(v=>{w.value=!1})},200),x=(m,v)=>{w.value||(w.value=!0,v==="@"&&$(m))},M=m=>{m.length>200||(_.value=m)},q=m=>{f.value=m},Y=m=>{k.value=m},E=async m=>{var v,P;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((v=m.file.file)==null?void 0:v.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((P=m.file.file)==null?void 0:P.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},N=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);R.code===0&&f.value==="public/image"&&U.value.push({id:m.id,content:R.data.content})}catch{window.$message.error("上传失败")}},L=({file:m,event:v})=>{var P;try{let R=JSON.parse((P=v.target)==null?void 0:P.response);if(R.code!==0){let H=R.msg||"上传失败";R.details&&R.details.length>0&&R.details.map(B=>{H+=":"+B}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},D=({file:m})=>{let v=U.value.findIndex(P=>P.id===m.id);v>-1&&U.value.splice(v,1)},o=()=>{y.value=!0},p=()=>{var m;y.value=!1,(m=C.value)==null||m.clear(),k.value=[],_.value="",U.value=[]},V=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=fe(_.value);const v=[];let P=100;v.push({content:_.value,type:2,sort:P}),U.value.map(R=>{P++,v.push({content:R.content,type:3,sort:P})}),S.value=!0,Be({contents:v,post_id:l.postId,users:Array.from(new Set(m))}).then(R=>{window.$message.success("发布成功"),S.value=!1,O("post-success"),p()}).catch(R=>{S.value=!1})},K=m=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",m)};return me(()=>{b.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,v)=>{const P=ve,R=at,H=se,B=oe,W=lt,X=it,J=ct,ne=ut,pe=rt;return n(),c("div",null,[e(r).state.userInfo.id>0?(n(),c("div",fs,[d("div",hs,[d("div",gs,[t(P,{round:"",size:30,src:e(r).state.userInfo.avatar},null,8,["src"])]),t(R,{type:"textarea",size:"large",autosize:"",bordered:!1,options:g.value,prefix:["@"],loading:w.value,value:_.value,disabled:l.lock===1,"onUpdate:value":M,onSearch:x,onFocus:o,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),z(pe,{key:0,ref_key:"uploadRef",ref:C,abstract:"","list-type":"image",multiple:!0,max:9,action:h,headers:{Authorization:b.value},data:{type:f.value},onBeforeUpload:E,onFinish:N,onError:L,onRemove:D,"onUpdate:fileList":Y},{default:a(()=>[d("div",ys,[d("div",ks,[t(W,{abstract:""},{default:a(({handleClick:G})=>[t(B,{disabled:k.value.length>0&&f.value==="public/video"||k.value.length===9,onClick:()=>{q("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(e(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(J,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(X,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/200*100},null,8,["percentage"])]),default:a(()=>[I(" "+T(_.value.length)+" / 200 ",1)]),_:1})]),d("div",ws,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:p},{default:a(()=>[I(" 取消 ")]),_:1}),t(B,{loading:S.value,onClick:V,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[I(" 发布 ")]),_:1},8,["loading"])])]),d("div",bs,[t(ne)])]),_:1},8,["headers","data"])):i("",!0)])):(n(),c("div",$s,[Cs,s.value?i("",!0):(n(),c("div",xs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1})])),s.value?(n(),c("div",Is,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=G=>K("signin"))},{default:a(()=>[I(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=G=>K("signup"))},{default:a(()=>[I(" 注册 ")]),_:1})])):i("",!0)]))])}}});const zs=te(Ts,[["__scopeId","data-v-ca3e6071"]]),Us={class:"username-wrap"},Ps={key:0,class:"options"},Rs={key:0},Ss=["innerHTML"],Ls={class:"timestamp"},As={key:0},Ds={key:1},Ms={class:"opts-wrap"},Os=["onClick"],qs={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Ns=Q({__name:"post-detail",props:{post:null},emits:["reload"],setup(A,{emit:O}){const l=A,r=ee(),g=Te(),y=u(!1),w=u(!1),S=u(!1),_=u(!1),C=u(!1),f=u(!1),k=u(!1),U=u(Z.PUBLIC),s=ae({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return o.contents.map(p=>{(+p.type==1||+p.type==2)&&o.texts.push(p),+p.type==3&&o.imgs.push(p),+p.type==4&&o.videos.push(p),+p.type==6&&o.links.push(p),+p.type==7&&o.attachments.push(p),+p.type==8&&o.charge_attachments.push(p)}),o},set:o=>{l.post.upvote_count=o.upvote_count,l.post.comment_count=o.comment_count,l.post.collection_count=o.collection_count}}),h=ae(()=>{let o=[{label:"删除",key:"delete"}];return s.value.is_lock===0?o.push({label:"锁定",key:"lock"}):o.push({label:"解锁",key:"unlock"}),r.state.userInfo.is_admin&&(s.value.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"})),s.value.visibility===Z.PUBLIC?o.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):s.value.visibility===Z.PRIVATE?o.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):o.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),o}),b=o=>{g.push({name:"post",query:{id:o}})},$=(o,p)=>{if(o.target.dataset.detail){const V=o.target.dataset.detail.split(":");if(V.length===2){r.commit("refresh"),V[0]==="tag"?g.push({name:"home",query:{q:V[1],t:"tag"}}):g.push({name:"user",query:{username:V[1]}});return}}b(p)},x=o=>{switch(o){case"delete":S.value=!0;break;case"lock":case"unlock":_.value=!0;break;case"stick":case"unstick":C.value=!0;break;case"vpublic":U.value=0,f.value=!0;break;case"vprivate":U.value=1,f.value=!0;break;case"vfriend":U.value=2,f.value=!0;break}},M=()=>{je({id:s.value.id}).then(o=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{r.commit("refresh")},50)}).catch(o=>{k.value=!1})},q=()=>{Ve({id:s.value.id}).then(o=>{O("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{k.value=!1})},Y=()=>{He({id:s.value.id}).then(o=>{O("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{k.value=!1})},E=()=>{Fe({id:s.value.id,visibility:U.value}).then(o=>{O("reload"),window.$message.success("修改可见性成功")}).catch(o=>{k.value=!1})},N=()=>{Ye({id:s.value.id}).then(o=>{y.value=o.status,o.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(o=>{console.log(o)})},L=()=>{Ke({id:s.value.id}).then(o=>{w.value=o.status,o.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(o=>{console.log(o)})},D=()=>{Tt(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板")};return me(()=>{r.state.userInfo.id>0&&(Ee({id:s.value.id}).then(o=>{y.value=o.status}).catch(o=>{console.log(o)}),Ne({id:s.value.id}).then(o=>{w.value=o.status}).catch(o=>{console.log(o)}))}),(o,p)=>{const V=ve,K=de("router-link"),m=_t,v=se,P=oe,R=pt,H=dt,B=wt,W=Ie,X=bt,J=$t,ne=mt,pe=xe,G=Ce;return n(),c("div",{class:"detail-item",onClick:p[6]||(p[6]=F=>b(e(s).id))},[t(G,null,{avatar:a(()=>[t(V,{round:"",size:30,src:e(s).user.avatar},null,8,["src"])]),header:a(()=>[t(K,{onClick:p[0]||(p[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(s).user.username}}},{default:a(()=>[I(T(e(s).user.nickname),1)]),_:1},8,["to"]),d("span",Us," @"+T(e(s).user.username),1),e(s).is_top?(n(),z(m,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[I(" 置顶 ")]),_:1})):i("",!0),e(s).visibility==e(Z).PRIVATE?(n(),z(m,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[I(" 私密 ")]),_:1})):i("",!0),e(s).visibility==e(Z).FRIEND?(n(),z(m,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[I(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":a(()=>[e(r).state.userInfo.is_admin||e(r).state.userInfo.id===e(s).user.id?(n(),c("div",Ps,[t(R,{placement:"bottom-end",trigger:"click",size:"small",options:e(h),onSelect:x},{default:a(()=>[t(P,{quaternary:"",circle:""},{icon:a(()=>[t(v,null,{default:a(()=>[t(e(Qe))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(H,{show:S.value,"onUpdate:show":p[1]||(p[1]=F=>S.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:M},null,8,["show"]),t(H,{show:_.value,"onUpdate:show":p[2]||(p[2]=F=>_.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:q},null,8,["show","content"]),t(H,{show:C.value,"onUpdate:show":p[3]||(p[3]=F=>C.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e(s).is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Y},null,8,["show","content"]),t(H,{show:f.value,"onUpdate:show":p[4]||(p[4]=F=>f.value=F),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(U.value==0?"公开":U.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:E},null,8,["show","content"])]),footer:a(()=>[t(B,{attachments:e(s).attachments},null,8,["attachments"]),t(B,{attachments:e(s).charge_attachments,price:e(s).attachment_price},null,8,["attachments","price"]),t(W,{imgs:e(s).imgs},null,8,["imgs"]),t(X,{videos:e(s).videos,full:!0},null,8,["videos"]),t(J,{links:e(s).links},null,8,["links"]),d("div",Ls,[I(" 发布于 "+T(e(ce)(e(s).created_on))+" ",1),e(s).ip_loc?(n(),c("span",As,[t(ne,{vertical:""}),I(" "+T(e(s).ip_loc),1)])):i("",!0),!e(r).state.collapsedLeft&&e(s).created_on!=e(s).latest_replied_on?(n(),c("span",Ds,[t(ne,{vertical:""}),I(" 最后回复 "+T(e(ce)(e(s).latest_replied_on)),1)])):i("",!0)])]),action:a(()=>[d("div",Ms,[t(pe,{justify:"space-between"},{default:a(()=>[d("div",{class:"opt-item hover",onClick:j(N,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[y.value?i("",!0):(n(),z(e(We),{key:0})),y.value?(n(),z(e(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),I(" "+T(e(s).upvote_count),1)],8,Os),d("div",qs,[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(Ze))]),_:1}),I(" "+T(e(s).comment_count),1)]),d("div",{class:"opt-item hover",onClick:j(L,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[w.value?i("",!0):(n(),z(e(et),{key:0})),w.value?(n(),z(e(tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),I(" "+T(e(s).collection_count),1)],8,Bs),d("div",{class:"opt-item hover",onClick:j(D,["stop"])},[t(v,{size:"20",class:"opt-item-icon"},{default:a(()=>[t(e(st))]),_:1}),I(" "+T(e(s).share_count),1)],8,Es)]),_:1})])]),default:a(()=>[e(s).texts.length>0?(n(),c("div",Rs,[(n(!0),c(le,null,ie(e(s).texts,F=>(n(),c("span",{key:F.id,class:"post-text",onClick:p[5]||(p[5]=j(ze=>$(ze,e(s).id),["stop"])),innerHTML:e(fe)(F.content).content},null,8,Ss))),128))])):i("",!0)]),_:1})])}}});const js=A=>(ge("data-v-0d01659f"),A=A(),ye(),A),Vs={key:0,class:"detail-wrap"},Hs={key:1,class:"empty-wrap"},Fs={key:0,class:"comment-opts-wrap"},Ys=js(()=>d("span",{class:"comment-title-item"},"评论",-1)),Ks={key:2},Js={key:0,class:"skeleton-wrap"},Gs={key:1},Qs={key:0,class:"empty-wrap"},Ws={key:0,class:"load-more-spinner"},Xs={key:1,class:"load-more-spinner"},Zs={key:2,class:"load-more-spinner"},eo={key:3,class:"load-more-spinner"},to=Q({__name:"Post",setup(A){const O=Ct(),l=u({}),r=u(!1),g=u(!1),y=u([]),w=ae(()=>+O.query.id),S=u("default"),_=u(!0),C=20;let f={loading(){},loaded(){},complete(){},error(){}};const k=L=>{S.value=L,L==="default"&&(_.value=!0),E(f)},U=()=>{l.value={id:0},r.value=!0,Je({id:w.value}).then(L=>{r.value=!1,l.value=L,E(f)}).catch(L=>{r.value=!1})};let s=1;const h=u(!1),b=u([]),$=L=>{h.value||he({id:l.value.id,sort_strategy:"default",page:s,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(s===1?b.value=D.list:b.value.push(...D.list),y.value=b.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})};let x=1,M=u(!1);const q=u([]),Y=L=>{M.value||he({id:l.value.id,sort_strategy:"newest",page:x,page_size:C}).then(D=>{L!==null&&(f=L),D.list.length0&&(x===1?q.value=D.list:q.value.push(...D.list),y.value=q.value),f.loaded(),g.value=!1}).catch(D=>{g.value=!1,f.error()})},E=L=>{w.value<1||(y.value.length===0&&(g.value=!0),S.value==="default"?(y.value=b.value,$(L)):(y.value=q.value,Y(L)),g.value=!1)},N=()=>{s=1,h.value=!1,b.value=[],x=1,M.value=!1,q.value=[],E(f)};return me(()=>{U()}),Pe(w,()=>{w.value>0&&O.name==="post"&&U()}),(L,D)=>{const o=zt,p=Ns,V=ft,K=ht,m=gt,v=yt,P=kt,R=zs,H=xt,B=ms,W=xe,X=vt;return n(),c("div",null,[t(o,{title:"泡泡详情",back:!0}),t(X,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(m,null,{default:a(()=>[t(K,{show:r.value},{default:a(()=>[l.value.id>1?(n(),c("div",Vs,[t(p,{post:l.value,onReload:U},null,8,["post"])])):(n(),c("div",Hs,[t(V,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(n(),c("div",Fs,[t(P,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":k},{prefix:a(()=>[Ys]),default:a(()=>[t(v,{name:"default",tab:"默认"}),t(v,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(n(),z(m,{key:1},{default:a(()=>[t(R,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:N},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(n(),c("div",Ks,[g.value?(n(),c("div",Js,[t(H,{num:5})])):(n(),c("div",Gs,[y.value.length===0?(n(),c("div",Qs,[t(V,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(n(!0),c(le,null,ie(y.value,J=>(n(),z(m,{key:J.id},{default:a(()=>[t(B,{comment:J,onReload:N},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=C?(n(),z(W,{key:3,justify:"center"},{default:a(()=>[t(e(Ut),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:E},{spinner:a(()=>[_.value&&h.value?(n(),c("span",Ws)):i("",!0),!_.value&&e(M)?(n(),c("span",Xs)):i("",!0),_.value&&!h.value?(n(),c("span",Zs,"加载评论")):i("",!0),!_.value&&!e(M)?(n(),c("span",eo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Do=te(to,[["__scopeId","data-v-0d01659f"]]);export{Do as default}; diff --git a/web/dist/assets/Profile-5d71a5c2.css b/web/dist/assets/Profile-5d71a5c2.css deleted file mode 100644 index 9dea5053..00000000 --- a/web/dist/assets/Profile-5d71a5c2.css +++ /dev/null @@ -1 +0,0 @@ -.profile-baseinfo[data-v-1d87d974]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-1d87d974]{width:55px}.profile-baseinfo .base-info[data-v-1d87d974]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-1d87d974]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-1d87d974]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-1d87d974]{padding:0 16px}.pagination-wrap[data-v-1d87d974]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-1d87d974]{background-color:#18181c}.dark .profile-wrap[data-v-1d87d974],.dark .pagination-wrap[data-v-1d87d974]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-85fb2629.js b/web/dist/assets/Profile-85fb2629.js new file mode 100644 index 00000000..bdd0342d --- /dev/null +++ b/web/dist/assets/Profile-85fb2629.js @@ -0,0 +1 @@ +import{_ as U,a as V}from"./post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js";import{_ as D}from"./post-skeleton-38ecc5be.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as R}from"./vuex-d28e9067.js";import{b as j}from"./vue-router-88cc84d1.js";import{A as q,_ as A}from"./index-fbd1aa45.js";import{d as E,r,j as G,c as e,L as o,Y as n,K as f,$ as c,O as v,o as t,a,M as g,F as y,a2 as w}from"./@vue-ca177dbe.js";import{F as H,G as K,o as O,f as T,g as Y,I as J,H as Q}from"./naive-ui-2035804c.js";import"./content-62bae3e8.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 W={class:"profile-baseinfo"},X={class:"avatar"},Z={class:"base-info"},tt={class:"username"},et={class:"uid"},ot={key:0,class:"skeleton-wrap"},st={key:1},nt={key:0,class:"empty-wrap"},at={key:1},_t={key:2},it={key:1,class:"pagination-wrap"},rt=E({__name:"Profile",setup(pt){const s=R(),b=j(),p=r(!1),l=r([]),u=r(+b.query.p||1),m=r(20),d=r(0),h=()=>{p.value=!0,q({username:s.state.userInfo.username,page:u.value,page_size:m.value}).then(_=>{p.value=!1,l.value=_.list,d.value=Math.ceil(_.pager.total_rows/m.value),window.scrollTo(0,0)}).catch(_=>{p.value=!1})},I=_=>{u.value=_,h()};return G(()=>{h()}),(_,lt)=>{const P=L,x=O,$=T,z=Y,B=D,M=J,S=U,k=Q,C=V,F=H,N=K;return t(),e("div",null,[o(P,{title:"主页"}),n(s).state.userInfo.id>0?(t(),f(F,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[a("div",W,[a("div",X,[o(x,{size:"large",src:n(s).state.userInfo.avatar},null,8,["src"])]),a("div",Z,[a("div",tt,[a("strong",null,g(n(s).state.userInfo.nickname),1),a("span",null," @"+g(n(s).state.userInfo.username),1)]),a("div",et,"UID. "+g(n(s).state.userInfo.id),1)])]),o(z,{class:"profile-tabs-wrap",animated:""},{default:c(()=>[o($,{name:"post",tab:"泡泡"})]),_:1}),p.value?(t(),e("div",ot,[o(B,{num:m.value},null,8,["num"])])):(t(),e("div",st,[l.value.length===0?(t(),e("div",nt,[o(M,{size:"large",description:"暂无数据"})])):v("",!0),n(s).state.desktopModelShow?(t(),e("div",at,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(S,{post:i},null,8,["post"])]),_:2},1024))),128))])):(t(),e("div",_t,[(t(!0),e(y,null,w(l.value,i=>(t(),f(k,{key:i.id},{default:c(()=>[o(C,{post:i},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):v("",!0),d.value>0?(t(),e("div",it,[o(N,{page:u.value,"onUpdate:page":I,"page-slot":n(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const At=A(rt,[["__scopeId","data-v-1f072d05"]]);export{At as default}; diff --git a/web/dist/assets/Profile-87e8712d.css b/web/dist/assets/Profile-87e8712d.css new file mode 100644 index 00000000..4b69aaf1 --- /dev/null +++ b/web/dist/assets/Profile-87e8712d.css @@ -0,0 +1 @@ +.profile-baseinfo[data-v-1f072d05]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-1f072d05]{width:55px}.profile-baseinfo .base-info[data-v-1f072d05]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-1f072d05]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-1f072d05]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-1f072d05]{padding:0 16px}.pagination-wrap[data-v-1f072d05]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-1f072d05]{background-color:#18181c}.dark .profile-wrap[data-v-1f072d05],.dark .pagination-wrap[data-v-1f072d05]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-ada56cf6.js b/web/dist/assets/Profile-ada56cf6.js deleted file mode 100644 index 6f9cc990..00000000 --- a/web/dist/assets/Profile-ada56cf6.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as M}from"./post-item.vue_vue_type_style_index_0_lang-09a3d19d.js";import{_ as N}from"./post-skeleton-fdd699ea.js";import{_ as S}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as U}from"./vuex-d28e9067.js";import{b as V}from"./vue-router-88cc84d1.js";import{A as D,_ as L}from"./index-71354138.js";import{d as R,r,j,c as a,L as t,Y as _,K as h,$ as u,O as d,o as e,a as s,M as f,F as q,a2 as A}from"./@vue-ca177dbe.js";import{F as E,G,o as H,f as K,g as O,I as T,H as Y}from"./naive-ui-2035804c.js";import"./content-3f1d28f2.js";import"./@vicons-6d35273b.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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={class:"profile-baseinfo"},Q={class:"avatar"},W={class:"base-info"},X={class:"username"},Z={class:"uid"},tt={key:0,class:"skeleton-wrap"},et={key:1},ot={key:0,class:"empty-wrap"},st={key:1,class:"pagination-wrap"},nt=R({__name:"Profile",setup(at){const o=U(),k=V(),i=r(!1),p=r([]),l=r(+k.query.p||1),c=r(20),m=r(0),g=()=>{i.value=!0,D({username:o.state.userInfo.username,page:l.value,page_size:c.value}).then(n=>{i.value=!1,p.value=n.list,m.value=Math.ceil(n.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(n=>{i.value=!1})},y=n=>{l.value=n,g()};return j(()=>{g()}),(n,_t)=>{const w=S,I=H,b=K,P=O,x=N,z=T,B=M,$=Y,C=E,F=G;return e(),a("div",null,[t(w,{title:"主页"}),_(o).state.userInfo.id>0?(e(),h(C,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:u(()=>[s("div",J,[s("div",Q,[t(I,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),s("div",W,[s("div",X,[s("strong",null,f(_(o).state.userInfo.nickname),1),s("span",null," @"+f(_(o).state.userInfo.username),1)]),s("div",Z,"UID. "+f(_(o).state.userInfo.id),1)])]),t(P,{class:"profile-tabs-wrap",animated:""},{default:u(()=>[t(b,{name:"post",tab:"泡泡"})]),_:1}),i.value?(e(),a("div",tt,[t(x,{num:c.value},null,8,["num"])])):(e(),a("div",et,[p.value.length===0?(e(),a("div",ot,[t(z,{size:"large",description:"暂无数据"})])):d("",!0),(e(!0),a(q,null,A(p.value,v=>(e(),h($,{key:v.id},{default:u(()=>[t(B,{post:v},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0),m.value>0?(e(),a("div",st,[t(F,{page:l.value,"onUpdate:page":y,"page-slot":_(o).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):d("",!0)])}}});const Lt=L(nt,[["__scopeId","data-v-1d87d974"]]);export{Lt as default}; diff --git a/web/dist/assets/Setting-e97b467a.js b/web/dist/assets/Setting-73765ab9.js similarity index 97% rename from web/dist/assets/Setting-e97b467a.js rename to web/dist/assets/Setting-73765ab9.js index 396cfc43..055e9945 100644 --- a/web/dist/assets/Setting-e97b467a.js +++ b/web/dist/assets/Setting-73765ab9.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-71354138.js";import{x as Ke}from"./@vicons-6d35273b.js";import{h as Ne,o as xe,e as De,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>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=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={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(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=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 z.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):z.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&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}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=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,U.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||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.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=>{K.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||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.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=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),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")),T(),j()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=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:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Xe,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:ce,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(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,c(" @"+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",Ze,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(H,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),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(B(()=>{},["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:T},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(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_: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,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(H,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),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(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["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(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:X,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(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{d as ye,r as d,D as Q,j as ke,c as g,L as t,$ as s,K as b,O as _,o as r,a as m,Y as u,e as c,M as R,z as be,v as Ce,P as q,a0 as B,U as Ie,V as $e}from"./@vue-ca177dbe.js";import{u as Pe}from"./vuex-d28e9067.js";import{S as Z,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as ze}from"./index-fbd1aa45.js";import{x as Ke}from"./@vicons-6d35273b.js";import{h as Ne,o as xe,e as De,B as Fe,b as Ve,j as Te,S as je,$ as Oe,K as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-2035804c.js";import"./vue-router-88cc84d1.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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 V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Ye={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Xe={key:0},He={class:"base-line"},Qe=V(()=>m("span",{class:"base-label"},"用户名",-1)),Ze={key:0},et={key:1},tt=V(()=>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=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={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(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),K=d(!1),N=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),Y=d(),G=d(),J=d(),X=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 z.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):z.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&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}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=X.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,U.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||(K.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{K.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=>{K.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||(N.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{N.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=>{N.value=!1,f.code===20012&&j()}))})},T=()=>{Z().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Z().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),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")),T(),j()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=Ve,ge=Te,F=Ne,H=je,w=Oe,he=Ee,O=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:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Xe,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:ce,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(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ke))]),_:1})]),_:1})):_("",!0)]),m("div",He,[Qe,c(" @"+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",Ze,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(H,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),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(B(()=>{},["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:T},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(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_: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,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(H,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),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(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["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(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:X,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(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Topic-ea29dcd9.js b/web/dist/assets/Topic-faac43f3.js similarity index 97% rename from web/dist/assets/Topic-ea29dcd9.js rename to web/dist/assets/Topic-faac43f3.js index 14929fa5..5973dc22 100644 --- a/web/dist/assets/Topic-ea29dcd9.js +++ b/web/dist/assets/Topic-faac43f3.js @@ -1 +1 @@ -import{w as x,x as S,y as z,z as I,_ as j}from"./index-71354138.js";import{p as E}from"./@vicons-6d35273b.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":z({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=U("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(E))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,I({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; +import{w as x,x as S,y as z,z as I,_ as j}from"./index-fbd1aa45.js";import{p as E}from"./@vicons-6d35273b.js";import{d as F,r as _,n as $,j as q,a1 as U,o as l,c as u,L as n,$ as a,K as T,e as A,M as w,O as m,Y as r,w as D,a6 as K,F as Y,a2 as G}from"./@vue-ca177dbe.js";import{o as H,M as L,j as J,e as P,O as Q,L as R,F as W,f as X,g as Z,a as tt,k as et}from"./naive-ui-2035804c.js";import{_ as ot}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as nt}from"./vuex-d28e9067.js";import"./vue-router-88cc84d1.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 st={key:0,class:"tag-item"},at={key:0,class:"tag-quote"},ct={key:1,class:"tag-quote tag-follow"},lt={key:0,class:"options"},it=F({__name:"tag-item",props:{tag:null,showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(s){const e=s,g=_(!1),d=$(()=>{let o=[];return e.tag.is_following===0?o.push({label:"关注",key:"follow"}):(e.tag.is_top===0?o.push({label:"置顶",key:"stick"}):o.push({label:"取消置顶",key:"unstick"}),o.push({label:"取消关注",key:"unfollow"})),o}),i=o=>{switch(o){case"follow":z({topic_id:e.tag.id}).then(t=>{e.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":S({topic_id:e.tag.id}).then(t=>{e.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":x({topic_id:e.tag.id}).then(t=>{e.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return q(()=>{g.value=!1}),(o,t)=>{const k=U("router-link"),f=H,v=L,c=J,h=P,y=Q,p=R;return!s.checkFollowing||s.checkFollowing&&s.tag.is_following===1?(l(),u("div",st,[n(p,null,{header:a(()=>[(l(),T(v,{type:"success",size:"large",round:"",key:s.tag.id},{avatar:a(()=>[n(f,{src:s.tag.user.avatar},null,8,["src"])]),default:a(()=>[n(k,{class:"hash-link",to:{name:"home",query:{q:s.tag.tag,t:"tag"}}},{default:a(()=>[A(" #"+w(s.tag.tag),1)]),_:1},8,["to"]),s.showAction?m("",!0):(l(),u("span",at,"("+w(s.tag.quote_num)+")",1)),s.showAction?(l(),u("span",ct,"("+w(s.tag.quote_num)+")",1)):m("",!0)]),_:1}))]),"header-extra":a(()=>[s.showAction?(l(),u("div",lt,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:r(d),onSelect:i},{default:a(()=>[n(h,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(c,null,{default:a(()=>[n(r(E))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)]),_:1})])):m("",!0)}}});const _t=F({__name:"Topic",setup(s){const e=nt(),g=_([]),d=_("hot"),i=_(!1),o=_(!1),t=_(!1);D(o,()=>{o.value||(window.$message.success("保存成功"),e.commit("refreshTopicFollow"))});const k=$({get:()=>{let c="编辑";return o.value&&(c="保存"),c},set:c=>{}}),f=()=>{i.value=!0,I({type:d.value,num:50}).then(c=>{g.value=c.topics,i.value=!1}).catch(c=>{console.log(c),i.value=!1})},v=c=>{d.value=c,c=="follow"?t.value=!0:t.value=!1,f()};return q(()=>{f()}),(c,h)=>{const y=ot,p=X,B=L,C=Z,V=it,M=tt,N=et,O=W;return l(),u("div",null,[n(y,{title:"话题"}),n(O,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(C,{type:"line",animated:"","onUpdate:value":v},K({default:a(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),r(e).state.userLogined?(l(),T(p,{key:0,name:"follow",tab:"关注"})):m("",!0)]),_:2},[r(e).state.userLogined?{name:"suffix",fn:a(()=>[n(B,{checked:o.value,"onUpdate:checked":h[0]||(h[0]=b=>o.value=b),checkable:""},{default:a(()=>[A(w(r(k)),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:a(()=>[n(M,null,{default:a(()=>[(l(!0),u(Y,null,G(g.value,b=>(l(),T(V,{tag:b,showAction:r(e).state.userLogined&&o.value,checkFollowing:t.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Vt=j(_t,[["__scopeId","data-v-15794a53"]]);export{Vt as default}; diff --git a/web/dist/assets/User-4f525d0f.css b/web/dist/assets/User-4f525d0f.css deleted file mode 100644 index 1af8b2d6..00000000 --- a/web/dist/assets/User-4f525d0f.css +++ /dev/null @@ -1 +0,0 @@ -.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-46a0183a]{padding:0 16px}.profile-baseinfo[data-v-46a0183a]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-46a0183a]{width:55px}.profile-baseinfo .base-info[data-v-46a0183a]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-46a0183a]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-46a0183a]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-46a0183a]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-46a0183a]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-46a0183a]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-46a0183a]{background-color:#18181c}.dark .profile-wrap[data-v-46a0183a],.dark .pagination-wrap[data-v-46a0183a]{background-color:#101014bf} diff --git a/web/dist/assets/User-645b4d7e.js b/web/dist/assets/User-645b4d7e.js deleted file mode 100644 index fab128cb..00000000 --- a/web/dist/assets/User-645b4d7e.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as _e}from"./post-item.vue_vue_type_style_index_0_lang-09a3d19d.js";import{_ as re}from"./post-skeleton-fdd699ea.js";import{B as ue,_ as I,C as pe,D as de,A as me,E as he,F as ve}from"./index-71354138.js";import{Q as B,R as P,S as R,b as T,e as S,i as A,u as fe,T as ge,F as we,G as ye,o as ke,M as be,j as xe,O as $e,k as Ue,f as Fe,g as ze,I as Ie,H as Se}from"./naive-ui-2035804c.js";import{d as q,r as c,o as i,K as z,$ as t,a as _,L as n,e as h,M as $,D as qe,n as We,w as Ce,j as Me,c as m,Y as x,O as F,F as Be,a2 as Pe}from"./@vue-ca177dbe.js";import{_ as Re}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{u as Te}from"./vuex-d28e9067.js";import{b as Ae}from"./vue-router-88cc84d1.js";import{i as De}from"./@vicons-6d35273b.js";import"./content-3f1d28f2.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 Ne={class:"whisper-wrap"},Ve={class:"whisper-line"},Le={class:"whisper-line send-wrap"},Oe=q({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,ue({user_id:u.user.id,content:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ne,[n(g,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ve,[n(w,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Le,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const je=I(Oe,[["__scopeId","data-v-0cbfe47c"]]),Ee={class:"whisper-wrap"},He={class:"whisper-line"},Ge={class:"whisper-line send-wrap"},Ke=q({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(r,{emit:U}){const u=r,a=c(""),o=c(!1),e=()=>{U("success")},l=()=>{o.value=!0,pe({user_id:u.user.id,greetings:a.value}).then(p=>{window.$message.success("发送成功"),o.value=!1,a.value="",e()}).catch(p=>{o.value=!1})};return(p,d)=>{const v=B,f=P,g=R,w=T,y=S,k=A;return i(),z(k,{show:r.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ee,[n(g,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:t(()=>[n(v,{type:"success"},{default:t(()=>[h($(r.user.nickname)+"@"+$(r.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",He,[n(w,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=b=>a.value=b),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ge,[n(y,{strong:"",secondary:"",type:"primary",loading:o.value,onClick:l},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=I(Ke,[["__scopeId","data-v-60be56a2"]]),Ye={key:0,class:"profile-baseinfo"},Je={class:"avatar"},Xe={class:"base-info"},Ze={class:"username"},es={class:"uid"},ss={key:0,class:"user-opts"},ns={key:0,class:"skeleton-wrap"},ts={key:1},as={key:0,class:"empty-wrap"},os={key:0,class:"pagination-wrap"},ls=q({__name:"User",setup(r){fe();const U=ge(),u=Te(),a=Ae(),o=c(!1),e=qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),l=c(!1),p=c(!1),d=c(!1),v=c([]),f=c(a.query.username||""),g=c(+a.query.p||1),w=c(20),y=c(0),k=()=>{o.value=!0,me({username:f.value,page:g.value,page_size:w.value}).then(s=>{o.value=!1,v.value=s.list,y.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{o.value=!1})},b=()=>{l.value=!0,de({username:f.value}).then(s=>{l.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,k()}).catch(s=>{l.value=!1,console.log(s)})},D=s=>{g.value=s,k()},N=()=>{p.value=!0},V=()=>{d.value=!0},L=()=>{p.value=!1},O=()=>{d.value=!1},j=We(()=>{let s=[{label:"私信",key:"whisper"}];return u.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),E=s=>{switch(s){case"whisper":N();break;case"delete":H();break;case"requesting":V();break;case"banned":case"deblocking":G();break}},H=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,he({user_id:e.id}).then(s=>{l.value=!1,e.is_friend=!1,k()}).catch(s=>{l.value=!1,console.log(s)})}})},G=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{l.value=!0,ve({id:e.id,status:e.status===1?2:1}).then(s=>{l.value=!1,b()}).catch(s=>{l.value=!1,console.log(s)})}})};return Ce(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(f.value=a.query.username||"",b())}),Me(()=>{b()}),(s,W)=>{const K=Re,Q=ke,C=be,Y=xe,J=S,X=$e,Z=je,ee=Ue,se=Fe,ne=ze,te=re,ae=Ie,oe=_e,le=Se,ie=we,ce=ye;return i(),m("div",null,[n(K,{title:"用户详情"}),n(ie,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(ee,{show:l.value},{default:t(()=>[e.id>0?(i(),m("div",Ye,[_("div",Je,[n(Q,{size:"large",src:e.avatar},null,8,["src"])]),_("div",Xe,[_("div",Ze,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username&&e.is_friend?(i(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):F("",!0),e.is_admin?(i(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):F("",!0)]),_("div",es,"UID. "+$(e.id),1)]),x(u).state.userInfo.id>0&&x(u).state.userInfo.username!=e.username?(i(),m("div",ss,[n(X,{placement:"bottom-end",trigger:"click",size:"small",options:x(j),onSelect:E},{default:t(()=>[n(J,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(x(De))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(Z,{show:p.value,user:e,onSuccess:L},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ne,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(se,{name:"post",tab:"泡泡"})]),_:1}),o.value?(i(),m("div",ns,[n(te,{num:w.value},null,8,["num"])])):(i(),m("div",ts,[v.value.length===0?(i(),m("div",as,[n(ae,{size:"large",description:"暂无数据"})])):F("",!0),(i(!0),m(Be,null,Pe(v.value,M=>(i(),z(le,{key:M.id},{default:t(()=>[n(oe,{post:M},null,8,["post"])]),_:2},1024))),128))]))]),_:1}),y.value>0?(i(),m("div",os,[n(ce,{page:g.value,"onUpdate:page":D,"page-slot":x(u).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Ts=I(ls,[["__scopeId","data-v-46a0183a"]]);export{Ts as default}; diff --git a/web/dist/assets/User-9ff86a18.js b/web/dist/assets/User-9ff86a18.js new file mode 100644 index 00000000..94d19eb3 --- /dev/null +++ b/web/dist/assets/User-9ff86a18.js @@ -0,0 +1 @@ +import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js";import{_ as me}from"./post-skeleton-38ecc5be.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-fbd1aa45.js";import{Q as T,R as A,S as D,b as N,e as q,i as V,u as ke,T as be,F as xe,G as $e,o as Ue,M as Fe,j as ze,O as Ie,k as Se,f as qe,g as Me,I as We,H as Ce}from"./naive-ui-2035804c.js";import{d as M,r as c,o,K as z,$ as t,a as _,L as n,e as f,M as $,D as Be,n as Pe,w as Re,j as Te,c as u,Y as v,O as F,F as P,a2 as R}from"./@vue-ca177dbe.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{u as De}from"./vuex-d28e9067.js";import{b as Ne}from"./vue-router-88cc84d1.js";import{i as Ve}from"./@vicons-6d35273b.js";import"./content-62bae3e8.js";import"./nonesir-video-db921567.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"whisper-wrap"},Oe={class:"whisper-line"},je={class:"whisper-line send-wrap"},Ee=M({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,he({user_id:r.user.id,content:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Le,[n(w,{"show-icon":!1},{default:t(()=>[f(" 即将发送私信给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Oe,[n(y,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"200","show-count":""},null,8,["value"])]),_("div",je,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const He=S(Ee,[["__scopeId","data-v-0cbfe47c"]]),Ge={class:"whisper-wrap"},Ke={class:"whisper-line"},Qe={class:"whisper-line send-wrap"},Ye=M({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(p,{emit:U}){const r=p,a=c(""),l=c(!1),e=()=>{U("success")},i=()=>{l.value=!0,ve({user_id:r.user.id,greetings:a.value}).then(d=>{window.$message.success("发送成功"),l.value=!1,a.value="",e()}).catch(d=>{l.value=!1})};return(d,m)=>{const h=T,g=A,w=D,y=N,k=q,b=V;return o(),z(b,{show:p.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[_("div",Ge,[n(w,{"show-icon":!1},{default:t(()=>[f(" 发送添加朋友申请给: "),n(g,{style:{"max-width":"100%"}},{default:t(()=>[n(h,{type:"success"},{default:t(()=>[f($(p.user.nickname)+"@"+$(p.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ke,[n(y,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":m[0]||(m[0]=x=>a.value=x),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Qe,[n(k,{strong:"",secondary:"",type:"primary",loading:l.value,onClick:i},{default:t(()=>[f(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Je=S(Ye,[["__scopeId","data-v-60be56a2"]]),Xe={key:0,class:"profile-baseinfo"},Ze={class:"avatar"},es={class:"base-info"},ss={class:"username"},ns={class:"uid"},ts={key:0,class:"user-opts"},os={key:0,class:"skeleton-wrap"},as={key:1},ls={key:0,class:"empty-wrap"},is={key:1},cs={key:2},_s={key:0,class:"pagination-wrap"},rs=M({__name:"User",setup(p){ke();const U=be(),r=De(),a=Ne(),l=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),i=c(!1),d=c(!1),m=c(!1),h=c([]),g=c(a.query.username||""),w=c(+a.query.p||1),y=c(20),k=c(0),b=()=>{l.value=!0,ge({username:g.value,page:w.value,page_size:y.value}).then(s=>{l.value=!1,h.value=s.list,k.value=Math.ceil(s.pager.total_rows/y.value),window.scrollTo(0,0)}).catch(s=>{l.value=!1})},x=()=>{i.value=!0,fe({username:g.value}).then(s=>{i.value=!1,e.id=s.id,e.avatar=s.avatar,e.username=s.username,e.nickname=s.nickname,e.is_admin=s.is_admin,e.is_friend=s.is_friend,e.status=s.status,b()}).catch(s=>{i.value=!1,console.log(s)})},L=s=>{w.value=s,b()},O=()=>{d.value=!0},j=()=>{m.value=!0},E=()=>{d.value=!1},H=()=>{m.value=!1},G=Pe(()=>{let s=[{label:"私信",key:"whisper"}];return r.state.userInfo.is_admin&&(e.status===1?s.push({label:"禁言",key:"banned"}):s.push({label:"解封",key:"deblocking"})),e.is_friend?s.push({label:"删除好友",key:"delete"}):s.push({label:"添加朋友",key:"requesting"}),s}),K=s=>{switch(s){case"whisper":O();break;case"delete":Q();break;case"requesting":j();break;case"banned":case"deblocking":Y();break}},Q=()=>{U.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,we({user_id:e.id}).then(s=>{i.value=!1,e.is_friend=!1,b()}).catch(s=>{i.value=!1,console.log(s)})}})},Y=()=>{U.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{i.value=!1,x()}).catch(s=>{i.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(g.value=a.query.username||"",x())}),Te(()=>{x()}),(s,W)=>{const J=Ae,X=Ue,C=Fe,Z=ze,ee=q,se=Ie,ne=He,te=Se,oe=qe,ae=Me,le=me,ie=We,ce=pe,B=Ce,_e=de,re=xe,ue=$e;return o(),u("div",null,[n(J,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:i.value},{default:t(()=>[e.id>0?(o(),u("div",Xe,[_("div",Ze,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),_("div",es,[_("div",ss,[_("strong",null,$(e.nickname),1),_("span",null," @"+$(e.username),1),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username&&e.is_friend?(o(),z(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[f(" 好友 ")]),_:1})):F("",!0),e.is_admin?(o(),z(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[f(" 管理员 ")]),_:1})):F("",!0)]),_("div",ns,"UID. "+$(e.id),1)]),v(r).state.userInfo.id>0&&v(r).state.userInfo.username!=e.username?(o(),u("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:v(G),onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Z,null,{default:t(()=>[n(v(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):F("",!0)])):F("",!0),n(ne,{show:d.value,user:e,onSuccess:E},null,8,["show","user"]),n(Je,{show:m.value,user:e,onSuccess:H},null,8,["show","user"])]),_:1},8,["show"]),n(ae,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(oe,{name:"post",tab:"泡泡"})]),_:1}),l.value?(o(),u("div",os,[n(le,{num:y.value},null,8,["num"])])):(o(),u("div",as,[h.value.length===0?(o(),u("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):F("",!0),v(r).state.desktopModelShow?(o(),u("div",is,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(ce,{post:I},null,8,["post"])]),_:2},1024))),128))])):(o(),u("div",cs,[(o(!0),u(P,null,R(h.value,I=>(o(),z(B,{key:I.id},{default:t(()=>[n(_e,{post:I},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),k.value>0?(o(),u("div",_s,[n(ue,{page:w.value,"onUpdate:page":L,"page-slot":v(r).state.collapsedRight?5:8,"page-count":k.value},null,8,["page","page-slot","page-count"])])):F("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default}; diff --git a/web/dist/assets/User-dfc90f68.css b/web/dist/assets/User-dfc90f68.css new file mode 100644 index 00000000..fe6ac273 --- /dev/null +++ b/web/dist/assets/User-dfc90f68.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-31cfec9c]{padding:0 16px}.profile-baseinfo[data-v-31cfec9c]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-31cfec9c]{width:55px}.profile-baseinfo .base-info[data-v-31cfec9c]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-31cfec9c]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-31cfec9c]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-31cfec9c]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-31cfec9c]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-31cfec9c]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-31cfec9c]{background-color:#18181c}.dark .profile-wrap[data-v-31cfec9c],.dark .pagination-wrap[data-v-31cfec9c]{background-color:#101014bf} diff --git a/web/dist/assets/Wallet-595cd027.js b/web/dist/assets/Wallet-88809b56.js similarity index 96% rename from web/dist/assets/Wallet-595cd027.js rename to web/dist/assets/Wallet-88809b56.js index eea6d586..4b54c7c0 100644 --- a/web/dist/assets/Wallet-595cd027.js +++ b/web/dist/assets/Wallet-88809b56.js @@ -1 +1 @@ -import{_ as H}from"./post-skeleton-fdd699ea.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-5097b22a.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-71354138.js";import{a as de}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-6d35273b.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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"./moment-b7869f98.js";const O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},L=()=>{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(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as H}from"./post-skeleton-38ecc5be.js";import{_ as Z}from"./main-nav.vue_vue_type_style_index_0_lang-31ba5408.js";import{d as J,r as c,j as X,c as _,L as e,$ as o,o as n,Y as y,O as w,a,e as k,F as $,a2 as N,z as ee,v as te,M as r,K as q,a4 as oe,a0 as ae,U as ne,V as se}from"./@vue-ca177dbe.js";import{u as le}from"./vuex-d28e9067.js";import{b as ce}from"./vue-router-88cc84d1.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as me}from"./index-fbd1aa45.js";import{a as de}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-6d35273b.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as xe,j as Ce,l as Ie,h as Se,H as Re}from"./naive-ui-2035804c.js";import"./vooks-2c48c2b5.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./@css-render-480a363d.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"./moment-b7869f98.js";const O=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},$e={class:"balance-opts"},Ne={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Oe={key:1},Pe={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Te={class:"qrcode-wrap"},Ue=O(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},We={class:"pay-sub-tips"},Ee=O(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Me=J({__name:"Wallet",setup(d){const i=le(),P=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+P.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},L=()=>{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(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Z,m=fe,V=ye,f=we,z=ke,W=be,E=H,M=xe,D=Re,j=ve,K=Ce,Q=Ie,Y=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Ne,[e(W,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),a("div",$e,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",Oe,[b.value.length===0?(n(),_("div",Pe,[e(M,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_($,null,N(b.value,t=>(n(),q(D,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_($,null,N(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(De=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:T},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Te,[Ue,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",We,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=me(Me,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-3f1d28f2.js b/web/dist/assets/content-62bae3e8.js similarity index 99% rename from web/dist/assets/content-3f1d28f2.js rename to web/dist/assets/content-62bae3e8.js index 79fd4105..0a4aa2d4 100644 --- a/web/dist/assets/content-3f1d28f2.js +++ b/web/dist/assets/content-62bae3e8.js @@ -1 +1 @@ -import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as j,M as $,a0 as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-ca177dbe.js";import{u as D,v as L}from"./@vicons-6d35273b.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-71354138.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",S,$(n.content),1)],8,K)]))),128))])}}});const nt=A(W,[["__scopeId","data-v-6c4d1eb6"]]),X={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},st=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=M,d=N,f=V,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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"},q=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(G=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(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 rt=A(q,[["__scopeId","data-v-22563084"]]),lt=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{st as _,rt as a,ot as b,nt as c,lt as p}; +import{d as h,o as e,c as r,F as a,a2 as m,L as s,$ as o,Y as c,a as j,M as $,a0 as k,K as _,O as g,r as C,e as B,s as b}from"./@vue-ca177dbe.js";import{u as D,v as L}from"./@vicons-6d35273b.js";import{j as I,V as N,W as V,m as M,X as z,e as F,i as O}from"./naive-ui-2035804c.js";import{_ as A,L as T,M as U}from"./index-fbd1aa45.js";import{N as P}from"./nonesir-video-db921567.js";const R={class:"link-wrap"},K=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),j("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[j("span",S,$(n.content),1)],8,K)]))),128))])}}});const nt=A(W,[["__scopeId","data-v-6c4d1eb6"]]),X={key:0},ot=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:y.full?1:5},{default:o(()=>[s(x,{span:y.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),_(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},st=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=M,d=N,f=V,w=z;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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(),_(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"},q=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=C(!1),u=C(""),x=C(0),n=d=>{p.value=!0,x.value=d.id,u.value="这是一个免费附件,您可以直接下载?",d.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,f)=>{const w=I,t=F,i=O;return e(),r("div",Z,[(e(!0),r(a,null,m(y.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(G=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(L))]),_:1})]),default:o(()=>[B(" "+$(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 rt=A(q,[["__scopeId","data-v-22563084"]]),lt=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{st as _,rt as a,ot as b,nt as c,lt as p}; diff --git a/web/dist/assets/index-71354138.js b/web/dist/assets/index-fbd1aa45.js similarity index 89% rename from web/dist/assets/index-71354138.js rename to web/dist/assets/index-fbd1aa45.js index b30c6817..bcc2d22c 100644 --- a/web/dist/assets/index-71354138.js +++ b/web/dist/assets/index-fbd1aa45.js @@ -1 +1 @@ -import{d as z,r as R,D as Y,j,o as v,K as N,$ as a,a as k,L as o,c as T,e as S,P as q,a0 as D,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ce,c as Oe,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as F,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-6d35273b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const _ of n.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const _=n.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!_||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":Ge,_||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),_)return new Promise((b,h)=>{g.addEventListener("load",b),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-37cbe774.js"),["assets/Home-37cbe774.js","assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js","assets/content-3f1d28f2.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Home-47eb20e2.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-e74fef3c.js"),["assets/Post-e74fef3c.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-3f1d28f2.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-d4d1dd23.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-ea29dcd9.js"),["assets/Topic-ea29dcd9.js","assets/@vicons-6d35273b.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-5097b22a.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-89915a48.js"),["assets/Anouncement-89915a48.js","assets/post-skeleton-fdd699ea.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-5097b22a.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-ada56cf6.js"),["assets/Profile-ada56cf6.js","assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js","assets/content-3f1d28f2.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Profile-5d71a5c2.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-645b4d7e.js"),["assets/User-645b4d7e.js","assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js","assets/content-3f1d28f2.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/User-4f525d0f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-268fd9db.js"),["assets/Messages-268fd9db.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-5097b22a.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-2dd501b0.js"),["assets/Collection-2dd501b0.js","assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js","assets/content-3f1d28f2.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-37a52e00.css","assets/post-skeleton-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Collection-e1365ea0.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-212adf88.js"),["assets/Contacts-212adf88.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-fdd699ea.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/vuex-d28e9067.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-595cd027.js"),["assets/Wallet-595cd027.js","assets/post-skeleton-fdd699ea.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-5097b22a.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/qrcode-bd5089a5.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-e97b467a.js"),["assets/Setting-e97b467a.js","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-00d7402f.js"),["assets/404-00d7402f.js","assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=ke({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:""}},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:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;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(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return G(e)}const ne=e=>s({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>s({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),i=R(!1),c=R(),n=Y({username:"",password:""}),_=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(L=>{L||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=_.value)==null||u.validate(L=>{L||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?W(h).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(h,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,E=ie,x=Te,$=Re,K=de,V=Ce;return v(),N(V,{show:m(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>m(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[o(K,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(O,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N($,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(x,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(x,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:_,model:d,rules:U},{default:a(()=>[o(w,{label:"用户名",path:"username"},{default:a(()=>[o(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"重复密码",path:"repassword"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=e=>s({method:"get",url:"/v1/post/star",params:e}),eo=e=>s({method:"post",url:"/v1/post/star",data:e}),to=e=>s({method:"get",url:"/v1/post/collection",params:e}),oo=e=>s({method:"post",url:"/v1/post/collection",data:e}),so=e=>s({method:"get",url:"/v1/post/comments",params:e}),no=e=>s({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>s({method:"post",url:"/v1/post",data:e}),ao=e=>s({method:"delete",url:"/v1/post",data:e}),lo=e=>s({method:"post",url:"/v1/post/lock",data:e}),uo=e=>s({method:"post",url:"/v1/post/stick",data:e}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),_=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",L=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,i.value=!1}).catch(y=>{i.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{_.push({name:"home",query:{q:c.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,E)=>{(y.refreshTopicFollow!==E.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,E)=>{const x=F,$=ce,K=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o($,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:q(D(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(w)?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+I(m(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:m(g),target:"_blank",class:"hash-link"},I(m(U)),9,it),k("a",{href:m(h),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Lo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Oo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),_=R(),d=R("true".toLowerCase()==="true"),U=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?_.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),_.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},U)):_.value&&clearInterval(_.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,h=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,i.push({name:r})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=$e(),(r,w)=>{const y=Se,E=Me,x=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:m(g),"render-label":b,"render-icon":h,value:n.value,"onUpdate:value":u},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{class:"user-avatar",round:"",size:34,src:m(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(m(t).state.userInfo.nickname),1),o($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(m(F),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(m(F),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,_=ae("router-view"),d=mt,U=st,g=De,b=Ne,h=xe,u=Ke;return v(),N(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=m(l))==null?void 0:L.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(_,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[i.$route.meta.keepAlive?(v(),N(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),N(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(h)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; +import{d as z,r as R,D as Y,j,o as v,K as N,$ as a,a as k,L as o,c as T,e as S,P as q,a0 as D,O as M,Y as m,n as Q,w as H,a1 as ae,F as J,a2 as X,M as I,s as P,a3 as he,Q as Z,a4 as ge,a5 as fe}from"./@vue-ca177dbe.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-88cc84d1.js";import{c as ke,u as B}from"./vuex-d28e9067.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ce,c as Oe,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ce,j as F,k as Ee,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as De,s as Ne,t as xe}from"./naive-ui-2035804c.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-6d35273b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-973e5707.js";import"./evtd-b614532e.js";import"./@css-render-480a363d.js";import"./vooks-2c48c2b5.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 c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const _ of n.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const Ge="modulepreload",Ye=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ye(n),n in se)return;se[n]=!0;const _=n.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!_||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":Ge,_||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),_)return new Promise((b,h)=>{g.addEventListener("load",b),g.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-d4930ea8.js"),["assets/Home-d4930ea8.js","assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js","assets/content-62bae3e8.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Home-c075a37e.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-31658e5a.js"),["assets/Post-31658e5a.js","assets/@vue-ca177dbe.js","assets/vuex-d28e9067.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-62bae3e8.js","assets/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vue-router-88cc84d1.js","assets/post-skeleton-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-fcb59c38.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-d4d1dd23.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-faac43f3.js"),["assets/Topic-faac43f3.js","assets/@vicons-6d35273b.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-31ba5408.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-7e7cb6ce.js"),["assets/Anouncement-7e7cb6ce.js","assets/post-skeleton-38ecc5be.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-31ba5408.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-85fb2629.js"),["assets/Profile-85fb2629.js","assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js","assets/content-62bae3e8.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Profile-87e8712d.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-9ff86a18.js"),["assets/User-9ff86a18.js","assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js","assets/content-62bae3e8.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/User-dfc90f68.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-ef7b1288.js"),["assets/Messages-ef7b1288.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-31ba5408.js","assets/vuex-d28e9067.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-d6ff62e7.js"),["assets/Collection-d6ff62e7.js","assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js","assets/content-62bae3e8.js","assets/@vue-ca177dbe.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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/nonesir-video-db921567.js","assets/content-cc55174b.css","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-1eed118e.js"),["assets/Contacts-1eed118e.js","assets/vue-router-88cc84d1.js","assets/@vue-ca177dbe.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-38ecc5be.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/vuex-d28e9067.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-88809b56.js"),["assets/Wallet-88809b56.js","assets/post-skeleton-38ecc5be.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/@vue-ca177dbe.js","assets/vueuc-973e5707.js","assets/evtd-b614532e.js","assets/@css-render-480a363d.js","assets/vooks-2c48c2b5.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-31ba5408.js","assets/vuex-d28e9067.js","assets/vue-router-88cc84d1.js","assets/@vicons-6d35273b.js","assets/main-nav-3ef9bae6.css","assets/qrcode-bd5089a5.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-73765ab9.js"),["assets/Setting-73765ab9.js","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-59f4b7a6.js"),["assets/404-59f4b7a6.js","assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js","assets/vuex-d28e9067.js","assets/@vue-ca177dbe.js","assets/vue-router-88cc84d1.js","assets/vooks-2c48c2b5.js","assets/evtd-b614532e.js","assets/@vicons-6d35273b.js","assets/naive-ui-2035804c.js","assets/seemly-76b7b838.js","assets/vueuc-973e5707.js","assets/@css-render-480a363d.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-3ef9bae6.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Je});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Xe=ke({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:""}},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:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;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(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function s(e){return G(e)}const ne=e=>s({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>s({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>s({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),i=R(!1),c=R(),n=Y({username:"",password:""}),_=R(),d=Y({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(L=>{L||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=_.value)==null||u.validate(L=>{L||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?W(h).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(h,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,E=ie,x=Te,$=Re,K=de,V=Ce;return v(),N(V,{show:m(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>m(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[o(K,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[o(O,{justify:"center"},{default:a(()=>[o(p,null,{default:a(()=>[o(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),N($,{key:1,"default-value":m(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(x,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[o(w,{label:"账户",path:"username"},{default:a(()=>[o(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(D(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(x,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:_,model:d,rules:U},{default:a(()=>[o(w,{label:"用户名",path:"username"},{default:a(()=>[o(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),o(w,{label:"密码",path:"password"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),o(w,{label:"重复密码",path:"repassword"},{default:a(()=>[o(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:q(D(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Jt=e=>s({method:"get",url:"/v1/posts",params:e}),nt=e=>s({method:"get",url:"/v1/tags",params:e}),Xt=e=>s({method:"get",url:"/v1/post",params:e}),Zt=e=>s({method:"get",url:"/v1/post/star",params:e}),eo=e=>s({method:"post",url:"/v1/post/star",data:e}),to=e=>s({method:"get",url:"/v1/post/collection",params:e}),oo=e=>s({method:"post",url:"/v1/post/collection",data:e}),so=e=>s({method:"get",url:"/v1/post/comments",params:e}),no=e=>s({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>s({method:"post",url:"/v1/post",data:e}),ao=e=>s({method:"delete",url:"/v1/post",data:e}),lo=e=>s({method:"post",url:"/v1/post/lock",data:e}),uo=e=>s({method:"post",url:"/v1/post/stick",data:e}),co=e=>s({method:"post",url:"/v1/post/visibility",data:e}),io=e=>s({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),po=e=>s({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),mo=e=>s({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),_o=e=>s({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),ho=e=>s({method:"post",url:"/v1/post/comment",data:e}),go=e=>s({method:"delete",url:"/v1/post/comment",data:e}),fo=e=>s({method:"post",url:"/v1/post/comment/reply",data:e}),vo=e=>s({method:"delete",url:"/v1/post/comment/reply",data:e}),wo=e=>s({method:"post",url:"/v1/topic/stick",data:e}),yo=e=>s({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>s({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),_=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",L=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,i.value=!1}).catch(y=>{i.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{_.push({name:"home",query:{q:c.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,E)=>{(y.refreshTopicFollow!==E.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,E)=>{const x=F,$=ce,K=ae("router-link"),V=Ee,f=de,_e=ue;return m(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[o($,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:q(D(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:m(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),m(w)?(v(),N(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(l.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:i.value},{default:a(()=>[(v(!0),T(J,null,X(t.value,C=>(v(),T("div",{class:"hot-tag-item",key:C.id},[o(K,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+I(m(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:m(g),target:"_blank",class:"hash-link"},I(m(U)),9,it),k("a",{href:m(h),target:"_blank",class:"hash-link"},I(m(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),bo=(e={})=>s({method:"get",url:"/v1/captcha",params:e}),Po=e=>s({method:"post",url:"/v1/captcha",data:e}),Lo=e=>s({method:"post",url:"/v1/user/whisper",data:e}),Oo=e=>s({method:"post",url:"/v1/friend/requesting",data:e}),Ao=e=>s({method:"post",url:"/v1/friend/add",data:e}),To=e=>s({method:"post",url:"/v1/friend/reject",data:e}),Ro=e=>s({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>s({method:"post",url:"/v1/user/phone",data:e}),Eo=e=>s({method:"post",url:"/v1/user/activate",data:e}),$o=e=>s({method:"post",url:"/v1/user/password",data:e}),Io=e=>s({method:"post",url:"/v1/user/nickname",data:e}),So=e=>s({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>s({method:"get",url:"/v1/user/msgcount/unread",params:e}),Mo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Uo=e=>s({method:"post",url:"/v1/user/message/read",data:e}),Ko=e=>s({method:"get",url:"/v1/user/collections",params:e}),qo=e=>s({method:"get",url:"/v1/user/profile",params:e}),Do=e=>s({method:"get",url:"/v1/user/posts",params:e}),No=e=>s({method:"get",url:"/v1/user/wallet/bills",params:e}),xo=e=>s({method:"post",url:"/v1/user/recharge",data:e}),Fo=e=>s({method:"get",url:"/v1/user/recharge",params:e}),Vo=e=>s({method:"get",url:"/v1/suggest/users",params:e}),zo=e=>s({method:"get",url:"/v1/suggest/tags",params:e}),Bo=e=>s({method:"get",url:"/v1/attachment/precheck",params:e}),Wo=e=>s({method:"get",url:"/v1/attachment",params:e}),Ho=e=>s({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),_=R(),d=R("true".toLowerCase()==="true"),U=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?_.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),_.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},U)):_.value&&clearInterval(_.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,h=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,i.push({name:r})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=$e(),(r,w)=>{const y=Se,E=Me,x=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:m(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:m(g),"render-label":b,"render-icon":h,value:n.value,"onUpdate:value":u},null,8,["options","value"]),m(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{class:"user-avatar",round:"",size:34,src:m(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(m(t).state.userInfo.nickname),1),o($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(m(F),null,{default:a(()=>[o(m(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(m(t).state.userInfo.username),1)]),k("div",bt,[o($,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(m(F),{size:24},{default:a(()=>[o(m(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Lt,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o($,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Ct={class:"content-wrap"},Et=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,_=ae("router-view"),d=mt,U=st,g=De,b=Ne,h=xe,u=Ke;return v(),N(u,{theme:m(l)},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=m(l))==null?void 0:L.name)==="dark",mobile:!m(t).state.desktopModelShow}])},[k("div",Tt,[m(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):M("",!0),k("div",Ct,[o(_,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),N(he,null,[i.$route.meta.keepAlive?(v(),N(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),N(Z(p),{key:0}))]),_:1})]),o(d)]),o(U)],2)]}),_:1})]),_:1}),o(h)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{Do as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Uo as I,Mo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,No as P,xo as Q,Fo as R,bo as S,So as T,$o as U,Co as V,Eo as W,Io as X,Po as Y,At as Z,me as _,zo as a,Jt as b,ro as c,_o as d,vo as e,io as f,Vo as g,po as h,fo as i,go as j,ho as k,Zt as l,to as m,ao as n,lo as o,eo as p,oo as q,Xt as r,uo as s,mo as t,so as u,co as v,wo as w,ko as x,yo as y,nt as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js index 9e2a9847..a8470557 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-5097b22a.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-31ba5408.js @@ -1 +1 @@ -import{Z as B}from"./index-71354138.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,y as D,z as N,F as P}from"./@vicons-6d35273b.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as K}from"./@vue-ca177dbe.js";const Y={key:0},Z={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[$("div",Z,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),q(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; +import{Z as B}from"./index-fbd1aa45.js";import{u as E}from"./vuex-d28e9067.js";import{u as S}from"./vue-router-88cc84d1.js";import{j as A}from"./vooks-2c48c2b5.js";import{D as C,y as D,z as N,F as P}from"./@vicons-6d35273b.js";import{a3 as x,a4 as R,j as I,e as V,a5 as j,h as F}from"./naive-ui-2035804c.js";import{d as H,r as f,j as L,o as a,c as g,Y as o,L as e,$ as t,O as c,a as $,K as _,e as q,M as U,F as K}from"./@vue-ca177dbe.js";const Y={key:0},Z={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(r){const i=r,n=E(),m=S(),l=f(!1),k=f("left"),u=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return L(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(d,p)=>{const y=B,b=x,O=R,s=I,h=V,M=j,T=F;return a(),g(K,null,[o(n).state.drawerModelShow?(a(),g("div",Y,[e(O,{show:l.value,"onUpdate:show":p[0]||(p[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[$("div",Z,[o(n).state.drawerModelShow&&!r.back?(a(),_(h,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),r.back?(a(),_(h,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(s,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),q(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(s,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(s,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/post-item-37a52e00.css b/web/dist/assets/post-item-593ff254.css similarity index 70% rename from web/dist/assets/post-item-37a52e00.css rename to web/dist/assets/post-item-593ff254.css index 9d3ec44e..a4e275ef 100644 --- a/web/dist/assets/post-item-37a52e00.css +++ b/web/dist/assets/post-item-593ff254.css @@ -1 +1 @@ -.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .timestamp-mobile{margin-top:2px;opacity:.75;font-size:11px}.post-item .item-header-extra{display:flex;align-items:center;opacity:.75}.post-item .item-header-extra .timestamp{font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item{background-color:#101014bf}.dark .post-item:hover{background:#18181c} +.post-item .timestamp-mobile{margin-top:2px;opacity:.75;font-size:11px}.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .item-header-extra{display:flex;align-items:center;opacity:.75}.post-item .item-header-extra .timestamp{font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item{background-color:#101014bf}.dark .post-item:hover{background:#18181c} diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js deleted file mode 100644 index c3e1fee8..00000000 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-09a3d19d.js +++ /dev/null @@ -1 +0,0 @@ -import{p as D,a as F,_ as P,b as I,c as R}from"./content-3f1d28f2.js";import{d as A,n as x,a1 as E,o as a,c as u,L as i,a6 as K,Y as t,$ as n,a as l,F as Y,a2 as G,a0 as v,e as _,M as c,K as p,O as r}from"./@vue-ca177dbe.js";import{u as J}from"./vuex-d28e9067.js";import{b as Q,u as U}from"./vue-router-88cc84d1.js";import{b}from"./formatTime-000dbebb.js";import{a as W}from"./copy-to-clipboard-1dd3075d.js";import{i as X,j as Z,l as tt,m as et}from"./@vicons-6d35273b.js";import{o as st,M as ot,j as nt,e as at,O as it,a as rt,L as ct}from"./naive-ui-2035804c.js";const pt={class:"post-item"},lt={class:"nickname-wrap"},_t={class:"username-wrap"},mt={key:3},ut={class:"timestamp-mobile"},dt={class:"item-header-extra"},ht={key:0,class:"timestamp"},gt=["innerHTML"],kt={class:"opt-item"},ft={class:"opt-item"},Mt=A({__name:"post-item",props:{post:null},setup(C){const $=C;Q();const k=U(),d=J(),z=x(()=>[{label:"复制链接",key:"copyTweetLink"}]),M=o=>{switch(o){case"copyTweetLink":W(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板");break}},e=x(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},$.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o}),f=o=>{k.push({name:"post",query:{id:o}})},T=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){d.commit("refresh"),m[0]==="tag"?k.push({name:"home",query:{q:m[1],t:"tag"}}):k.push({name:"user",query:{username:m[1]}});return}}f(s)};return(o,s)=>{const m=st,L=E("router-link"),y=ot,h=nt,O=at,S=it,w=F,q=P,B=I,N=R,j=rt,H=ct;return a(),u("div",pt,[i(H,{"content-indented":""},K({avatar:n(()=>[i(m,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[l("span",lt,[i(L,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[_(c(t(e).user.nickname),1)]),_:1},8,["to"])]),l("span",_t," @"+c(t(e).user.username),1),t(e).is_top?(a(),p(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),t(e).visibility==1?(a(),p(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),t(e).visibility==2?(a(),p(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0),t(d).state.desktopModelShow?r("",!0):(a(),u("div",mt,[l("span",ut,c(t(b)(t(e).created_on))+" "+c(t(e).ip_loc),1)]))]),"header-extra":n(()=>[l("div",dt,[t(d).state.desktopModelShow?(a(),u("span",ht,c(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+c(t(b)(t(e).created_on)),1)):r("",!0),t(d).state.desktopModelShow?r("",!0):(a(),p(S,{key:1,placement:"bottom-end",trigger:"click",size:"small",options:t(z),onSelect:M},{default:n(()=>[i(O,{quaternary:"",circle:""},{icon:n(()=>[i(h,null,{default:n(()=>[i(t(X))]),_:1})]),_:1})]),_:1},8,["options"]))])]),footer:n(()=>[t(e).attachments.length>0?(a(),p(w,{key:0,attachments:t(e).attachments},null,8,["attachments"])):r("",!0),t(e).charge_attachments.length>0?(a(),p(w,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):r("",!0),t(e).imgs.length>0?(a(),p(q,{key:2,imgs:t(e).imgs},null,8,["imgs"])):r("",!0),t(e).videos.length>0?(a(),p(B,{key:3,videos:t(e).videos},null,8,["videos"])):r("",!0),t(e).links.length>0?(a(),p(N,{key:4,links:t(e).links},null,8,["links"])):r("",!0)]),action:n(()=>[i(j,{justify:"space-between"},{default:n(()=>[l("div",kt,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(Z))]),_:1}),_(" "+c(t(e).upvote_count),1)]),l("div",{class:"opt-item",onClick:s[3]||(s[3]=v(g=>f(t(e).id),["stop"]))},[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(tt))]),_:1}),_(" "+c(t(e).comment_count),1)]),l("div",ft,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(et))]),_:1}),_(" "+c(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[l("div",{onClick:s[2]||(s[2]=g=>f(t(e).id))},[(a(!0),u(Y,null,G(t(e).texts,g=>(a(),u("span",{key:g.id,class:"post-text",onClick:s[1]||(s[1]=v(V=>T(V,t(e).id),["stop"])),innerHTML:t(D)(g.content).content},null,8,gt))),128))])]),key:"0"}:void 0]),1024)])}}});export{Mt as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js new file mode 100644 index 00000000..22eac453 --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-84c4f6fd.js @@ -0,0 +1 @@ +import{p as B,a as N,_ as P,b as D,c as S}from"./content-62bae3e8.js";import{d as V,n as H,a1 as F,o as r,c as f,L as l,a6 as I,Y as t,$ as n,a as p,F as A,a2 as E,a0 as v,e as u,M as d,K as _,O as m}from"./@vue-ca177dbe.js";import{u as K}from"./vuex-d28e9067.js";import{u as R}from"./vue-router-88cc84d1.js";import{b as Y}from"./formatTime-000dbebb.js";import{a as ot}from"./copy-to-clipboard-1dd3075d.js";import{i as at,j as G,l as J,m as Q}from"./@vicons-6d35273b.js";import{o as U,M as W,j as X,e as it,O as lt,a as Z,L as tt}from"./naive-ui-2035804c.js";const rt={class:"post-item"},ct={class:"nickname-wrap"},pt={class:"username-wrap"},_t={class:"timestamp-mobile"},mt={class:"item-header-extra"},ut=["innerHTML"],dt={class:"opt-item"},ht={class:"opt-item"},Ot=V({__name:"mobile-post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>[{label:"复制链接",key:"copyTweetLink"}]),x=async i=>{switch(i){case"copyTweetLink":ot(`${window.location.origin}/#/post?id=${s.value.id}`),window.$message.success("链接已复制到剪贴板");break}},s=H(()=>{let i=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return i.contents.map(a=>{(+a.type==1||+a.type==2)&&i.texts.push(a),+a.type==3&&i.imgs.push(a),+a.type==4&&i.videos.push(a),+a.type==6&&i.links.push(a),+a.type==7&&i.attachments.push(a),+a.type==8&&i.charge_attachments.push(a)}),i}),c=i=>{g.push({name:"post",query:{id:i}})},o=(i,a)=>{if(i.target.dataset.detail){const h=i.target.dataset.detail.split(":");if(h.length===2){L.commit("refresh"),h[0]==="tag"?g.push({name:"home",query:{q:h[1],t:"tag"}}):g.push({name:"user",query:{username:h[1]}});return}}c(a)};return(i,a)=>{const h=U,b=F("router-link"),w=W,y=X,M=it,$=lt,z=N,O=P,k=D,j=S,et=Z,st=tt;return r(),f("div",rt,[l(st,{"content-indented":""},I({avatar:n(()=>[l(h,{round:"",size:30,src:t(s).user.avatar},null,8,["src"])]),header:n(()=>[p("span",ct,[l(b,{onClick:a[0]||(a[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(s).user.username}}},{default:n(()=>[u(d(t(s).user.nickname),1)]),_:1},8,["to"])]),p("span",pt," @"+d(t(s).user.username),1),t(s).is_top?(r(),_(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(s).visibility==1?(r(),_(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(s).visibility==2?(r(),_(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0),p("div",null,[p("span",_t,d(t(Y)(t(s).created_on))+" "+d(t(s).ip_loc),1)])]),"header-extra":n(()=>[p("div",mt,[l($,{placement:"bottom-end",trigger:"click",size:"small",options:t(e),onSelect:x},{default:n(()=>[l(M,{quaternary:"",circle:""},{icon:n(()=>[l(y,null,{default:n(()=>[l(t(at))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[t(s).attachments.length>0?(r(),_(z,{key:0,attachments:t(s).attachments},null,8,["attachments"])):m("",!0),t(s).charge_attachments.length>0?(r(),_(z,{key:1,attachments:t(s).charge_attachments,price:t(s).attachment_price},null,8,["attachments","price"])):m("",!0),t(s).imgs.length>0?(r(),_(O,{key:2,imgs:t(s).imgs},null,8,["imgs"])):m("",!0),t(s).videos.length>0?(r(),_(k,{key:3,videos:t(s).videos},null,8,["videos"])):m("",!0),t(s).links.length>0?(r(),_(j,{key:4,links:t(s).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(et,{justify:"space-between"},{default:n(()=>[p("div",dt,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(s).upvote_count),1)]),p("div",{class:"opt-item",onClick:a[3]||(a[3]=v(C=>c(t(s).id),["stop"]))},[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(s).comment_count),1)]),p("div",ht,[l(y,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(s).collection_count),1)])]),_:1})]),_:2},[t(s).texts.length>0?{name:"description",fn:n(()=>[p("div",{onClick:a[2]||(a[2]=C=>c(t(s).id))},[(r(!0),f(A,null,E(t(s).texts,C=>(r(),f("span",{key:C.id,class:"post-text",onClick:a[1]||(a[1]=v(nt=>o(nt,t(s).id),["stop"])),innerHTML:t(B)(C.content).content},null,8,ut))),128))])]),key:"0"}:void 0]),1024)])}}});const gt={class:"nickname-wrap"},yt={class:"username-wrap"},kt={class:"item-header-extra"},ft={class:"timestamp"},vt=["innerHTML"],xt={class:"opt-item"},wt={class:"opt-item"},jt=V({__name:"post-item",props:{post:null},setup(q){const T=q,g=R(),L=K(),e=H(()=>{let c=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return c.contents.map(o=>{(+o.type==1||+o.type==2)&&c.texts.push(o),+o.type==3&&c.imgs.push(o),+o.type==4&&c.videos.push(o),+o.type==6&&c.links.push(o),+o.type==7&&c.attachments.push(o),+o.type==8&&c.charge_attachments.push(o)}),c}),x=c=>{g.push({name:"post",query:{id:c}})},s=(c,o)=>{if(c.target.dataset.detail){const i=c.target.dataset.detail.split(":");if(i.length===2){L.commit("refresh"),i[0]==="tag"?g.push({name:"home",query:{q:i[1],t:"tag"}}):g.push({name:"user",query:{username:i[1]}});return}}x(o)};return(c,o)=>{const i=U,a=F("router-link"),h=W,b=N,w=P,y=D,M=S,$=X,z=Z,O=tt;return r(),f("div",{class:"post-item",onClick:o[3]||(o[3]=k=>x(t(e).id))},[l(O,{"content-indented":""},I({avatar:n(()=>[l(i,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[p("span",gt,[l(a,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[u(d(t(e).user.nickname),1)]),_:1},8,["to"])]),p("span",yt," @"+d(t(e).user.username),1),t(e).is_top?(r(),_(h,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[u(" 置顶 ")]),_:1})):m("",!0),t(e).visibility==1?(r(),_(h,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[u(" 私密 ")]),_:1})):m("",!0),t(e).visibility==2?(r(),_(h,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[u(" 好友可见 ")]),_:1})):m("",!0)]),"header-extra":n(()=>[p("div",kt,[p("span",ft,d(t(e).ip_loc?t(e).ip_loc+" · ":t(e).ip_loc)+" "+d(t(Y)(t(e).created_on)),1)])]),footer:n(()=>[t(e).attachments.length>0?(r(),_(b,{key:0,attachments:t(e).attachments},null,8,["attachments"])):m("",!0),t(e).charge_attachments.length>0?(r(),_(b,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):m("",!0),t(e).imgs.length>0?(r(),_(w,{key:2,imgs:t(e).imgs},null,8,["imgs"])):m("",!0),t(e).videos.length>0?(r(),_(y,{key:3,videos:t(e).videos},null,8,["videos"])):m("",!0),t(e).links.length>0?(r(),_(M,{key:4,links:t(e).links},null,8,["links"])):m("",!0)]),action:n(()=>[l(z,{justify:"space-between"},{default:n(()=>[p("div",xt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(G))]),_:1}),u(" "+d(t(e).upvote_count),1)]),p("div",{class:"opt-item",onClick:o[2]||(o[2]=v(k=>x(t(e).id),["stop"]))},[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(J))]),_:1}),u(" "+d(t(e).comment_count),1)]),p("div",wt,[l($,{size:"18",class:"opt-item-icon"},{default:n(()=>[l(t(Q))]),_:1}),u(" "+d(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(r(!0),f(A,null,E(t(e).texts,k=>(r(),f("span",{key:k.id,class:"post-text",onClick:o[1]||(o[1]=v(j=>s(j,t(e).id),["stop"])),innerHTML:t(B)(k.content).content},null,8,vt))),128))]),key:"0"}:void 0]),1024)])}}});export{jt as _,Ot as a}; diff --git a/web/dist/assets/post-skeleton-fdd699ea.js b/web/dist/assets/post-skeleton-38ecc5be.js similarity index 88% rename from web/dist/assets/post-skeleton-fdd699ea.js rename to web/dist/assets/post-skeleton-38ecc5be.js index 51058cae..9bd2ac44 100644 --- a/web/dist/assets/post-skeleton-fdd699ea.js +++ b/web/dist/assets/post-skeleton-38ecc5be.js @@ -1 +1 @@ -import{U as c}from"./naive-ui-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-71354138.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as c}from"./naive-ui-2035804c.js";import{d as r,o as s,c as n,a2 as l,a as o,L as t,F as p}from"./@vue-ca177dbe.js";import{_ as i}from"./index-fbd1aa45.js";const m={class:"user"},d={class:"content"},u=r({__name:"post-skeleton",props:{num:{default:1}},setup(_){return(f,k)=>{const e=c;return s(!0),n(p,null,l(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/index.html b/web/dist/index.html index 2b595655..5ea097f0 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/mobile-post-item.vue b/web/src/components/mobile-post-item.vue new file mode 100644 index 00000000..ba683a5b --- /dev/null +++ b/web/src/components/mobile-post-item.vue @@ -0,0 +1,309 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/post-item.vue b/web/src/components/post-item.vue index 1900ed3c..b3a47dfe 100644 --- a/web/src/components/post-item.vue +++ b/web/src/components/post-item.vue @@ -1,5 +1,5 @@