From 5f7955798658cb023f4a47f4bb0cc18ed04ce599 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Thu, 6 Jul 2023 16:03:19 +0800 Subject: [PATCH] re-build web frontend --- web/dist/assets/{404-3f4651e7.js => 404-7b417834.js} | 2 +- .../assets/{Anouncement-f2146181.js => Anouncement-555d6b96.js} | 2 +- .../assets/{Collection-f0c6a1aa.js => Collection-004c869e.js} | 2 +- web/dist/assets/{Contacts-ba6816c8.js => Contacts-b5d93513.js} | 2 +- web/dist/assets/Home-20128b51.js | 1 - web/dist/assets/Home-99db4d92.js | 1 + web/dist/assets/{Messages-8bfe7f3b.js => Messages-d5995867.js} | 2 +- web/dist/assets/Post-1ec9984a.js | 1 - web/dist/assets/Post-42da50a2.js | 1 + web/dist/assets/{Profile-536bb0b1.js => Profile-8f57060d.js} | 2 +- web/dist/assets/Setting-275ddb43.js | 1 + web/dist/assets/Setting-bb44f792.js | 1 - web/dist/assets/{Topic-09053135.js => Topic-467e0970.js} | 2 +- web/dist/assets/{User-e96c5cea.js => User-4141fab5.js} | 2 +- web/dist/assets/{Wallet-6f8e141c.js => Wallet-992dfbd0.js} | 2 +- web/dist/assets/{content-1ad34d0c.js => content-d4af862e.js} | 2 +- web/dist/assets/index-5fa3c6e0.js | 1 - web/dist/assets/index-ff680598.js | 1 + ....js => main-nav.vue_vue_type_style_index_0_lang-832b7340.js} | 2 +- ...js => post-item.vue_vue_type_style_index_0_lang-7c874df8.js} | 2 +- .../{post-skeleton-49f18127.js => post-skeleton-af959eab.js} | 2 +- web/dist/index.html | 2 +- 22 files changed, 18 insertions(+), 18 deletions(-) rename web/dist/assets/{404-3f4651e7.js => 404-7b417834.js} (84%) rename web/dist/assets/{Anouncement-f2146181.js => Anouncement-555d6b96.js} (91%) rename web/dist/assets/{Collection-f0c6a1aa.js => Collection-004c869e.js} (90%) rename web/dist/assets/{Contacts-ba6816c8.js => Contacts-b5d93513.js} (93%) delete mode 100644 web/dist/assets/Home-20128b51.js create mode 100644 web/dist/assets/Home-99db4d92.js rename web/dist/assets/{Messages-8bfe7f3b.js => Messages-d5995867.js} (97%) delete mode 100644 web/dist/assets/Post-1ec9984a.js create mode 100644 web/dist/assets/Post-42da50a2.js rename web/dist/assets/{Profile-536bb0b1.js => Profile-8f57060d.js} (91%) create mode 100644 web/dist/assets/Setting-275ddb43.js delete mode 100644 web/dist/assets/Setting-bb44f792.js rename web/dist/assets/{Topic-09053135.js => Topic-467e0970.js} (97%) rename web/dist/assets/{User-e96c5cea.js => User-4141fab5.js} (96%) rename web/dist/assets/{Wallet-6f8e141c.js => Wallet-992dfbd0.js} (96%) rename web/dist/assets/{content-1ad34d0c.js => content-d4af862e.js} (99%) delete mode 100644 web/dist/assets/index-5fa3c6e0.js create mode 100644 web/dist/assets/index-ff680598.js rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js => main-nav.vue_vue_type_style_index_0_lang-832b7340.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-bc760886.js => post-item.vue_vue_type_style_index_0_lang-7c874df8.js} (98%) rename web/dist/assets/{post-skeleton-49f18127.js => post-skeleton-af959eab.js} (88%) diff --git a/web/dist/assets/404-3f4651e7.js b/web/dist/assets/404-7b417834.js similarity index 84% rename from web/dist/assets/404-3f4651e7.js rename to web/dist/assets/404-7b417834.js index 49a74f42..0d16fe19 100644 --- a/web/dist/assets/404-3f4651e7.js +++ b/web/dist/assets/404-7b417834.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as a}from"./vue-router-29e6667f.js";import{F as i,e as c,a2 as u}from"./naive-ui-d02aa0d7.js";import{d as l,c as d,U as t,a0 as o,o as f,e as x}from"./@vue-d002002f.js";import{_ as g}from"./index-5fa3c6e0.js";import"./vuex-4d2f7b35.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./@vicons-4022100b.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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 L=g(v,[["__scopeId","data-v-e62daa85"]]);export{L as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as a}from"./vue-router-29e6667f.js";import{F as i,e as c,a2 as u}from"./naive-ui-d02aa0d7.js";import{d as l,c as d,U as t,a0 as o,o as f,e as x}from"./@vue-d002002f.js";import{_ as g}from"./index-ff680598.js";import"./vuex-4d2f7b35.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./@vicons-4022100b.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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 L=g(v,[["__scopeId","data-v-e62daa85"]]);export{L as default}; diff --git a/web/dist/assets/Anouncement-f2146181.js b/web/dist/assets/Anouncement-555d6b96.js similarity index 91% rename from web/dist/assets/Anouncement-f2146181.js rename to web/dist/assets/Anouncement-555d6b96.js index 3af2ec5e..415980b3 100644 --- a/web/dist/assets/Anouncement-f2146181.js +++ b/web/dist/assets/Anouncement-555d6b96.js @@ -1 +1 @@ -import{_ as C}from"./post-skeleton-49f18127.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as z}from"./vuex-4d2f7b35.js";import{b as A}from"./vue-router-29e6667f.js";import{a as P}from"./formatTime-000dbebb.js";import{d as R,r as n,j as S,c as o,U as a,a0 as p,o as e,Z as u,N as l,F as V,a3 as I,P as L,a as s,L as _,K as U}from"./@vue-d002002f.js";import{F as j,G as q,I as D,H as E}from"./naive-ui-d02aa0d7.js";import{_ as G}from"./index-5fa3c6e0.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./@vicons-4022100b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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 H={key:0,class:"pagination-wrap"},K={key:0,class:"skeleton-wrap"},M={key:1},O={key:0,class:"empty-wrap"},T={class:"bill-line"},Z=R({__name:"Anouncement",setup($){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 S(()=>{}),(m,J)=>{const y=F,k=q,x=C,w=D,N=E,B=j;return e(),o("div",null,[a(y,{title:"公告"}),a(B,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",H,[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",K,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",M,[r.value.length===0?(e(),o("div",O,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(V,null,I(r.value,t=>(e(),L(N,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:U({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(P)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=G(Z,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; +import{_ as C}from"./post-skeleton-af959eab.js";import{_ as F}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as z}from"./vuex-4d2f7b35.js";import{b as A}from"./vue-router-29e6667f.js";import{a as P}from"./formatTime-000dbebb.js";import{d as R,r as n,j as S,c as o,U as a,a0 as p,o as e,Z as u,N as l,F as V,a3 as I,P as L,a as s,L as _,K as U}from"./@vue-d002002f.js";import{F as j,G as q,I as D,H as E}from"./naive-ui-d02aa0d7.js";import{_ as G}from"./index-ff680598.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./@vicons-4022100b.js";import"./moment-b7869f98.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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 H={key:0,class:"pagination-wrap"},K={key:0,class:"skeleton-wrap"},M={key:1},O={key:0,class:"empty-wrap"},T={class:"bill-line"},Z=R({__name:"Anouncement",setup($){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 S(()=>{}),(m,J)=>{const y=F,k=q,x=C,w=D,N=E,B=j;return e(),o("div",null,[a(y,{title:"公告"}),a(B,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",H,[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",K,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",M,[r.value.length===0?(e(),o("div",O,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(V,null,I(r.value,t=>(e(),L(N,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:U({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(P)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=G(Z,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-f0c6a1aa.js b/web/dist/assets/Collection-004c869e.js similarity index 90% rename from web/dist/assets/Collection-f0c6a1aa.js rename to web/dist/assets/Collection-004c869e.js index 12ad5769..d9ff8619 100644 --- a/web/dist/assets/Collection-f0c6a1aa.js +++ b/web/dist/assets/Collection-004c869e.js @@ -1 +1 @@ -import{_ as M,a as N}from"./post-item.vue_vue_type_style_index_0_lang-bc760886.js";import{_ as S}from"./post-skeleton-49f18127.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as I}from"./vuex-4d2f7b35.js";import{b as R}from"./vue-router-29e6667f.js";import{K as U,_ as V}from"./index-5fa3c6e0.js";import{d as j,r as s,j as q,c as o,U as e,a0 as c,Z as g,N as v,o as t,F as f,a3 as h,P as k}from"./@vue-d002002f.js";import{F as E,G,I as H,H as K}from"./naive-ui-d02aa0d7.js";import"./content-1ad34d0c.js";import"./@vicons-4022100b.js";import"./paopao-video-player-d47e9bf6.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"skeleton-wrap"},T={key:1},Z={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},O=j({__name:"Collection",setup(Q){const m=I(),y=R(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,U({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 q(()=>{u()}),(n,W)=>{const C=$,b=S,x=H,P=M,d=K,z=N,B=E,F=G;return t(),o("div",null,[e(C,{title:"收藏"}),e(B,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",L,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",Z,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(P,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[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=V(O,[["__scopeId","data-v-a5302c9b"]]);export{Ft as default}; +import{_ as M,a as N}from"./post-item.vue_vue_type_style_index_0_lang-7c874df8.js";import{_ as S}from"./post-skeleton-af959eab.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as I}from"./vuex-4d2f7b35.js";import{b as R}from"./vue-router-29e6667f.js";import{K as U,_ as V}from"./index-ff680598.js";import{d as j,r as s,j as q,c as o,U as e,a0 as c,Z as g,N as v,o as t,F as f,a3 as h,P as k}from"./@vue-d002002f.js";import{F as E,G,I as H,H as K}from"./naive-ui-d02aa0d7.js";import"./content-d4af862e.js";import"./@vicons-4022100b.js";import"./paopao-video-player-d47e9bf6.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"skeleton-wrap"},T={key:1},Z={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},O=j({__name:"Collection",setup(Q){const m=I(),y=R(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,U({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 q(()=>{u()}),(n,W)=>{const C=$,b=S,x=H,P=M,d=K,z=N,B=E,F=G;return t(),o("div",null,[e(C,{title:"收藏"}),e(B,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",L,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",Z,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(P,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[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=V(O,[["__scopeId","data-v-a5302c9b"]]);export{Ft as default}; diff --git a/web/dist/assets/Contacts-ba6816c8.js b/web/dist/assets/Contacts-b5d93513.js similarity index 93% rename from web/dist/assets/Contacts-ba6816c8.js rename to web/dist/assets/Contacts-b5d93513.js index 8073b2db..091efadc 100644 --- a/web/dist/assets/Contacts-ba6816c8.js +++ b/web/dist/assets/Contacts-b5d93513.js @@ -1 +1 @@ -import{u as F,b as R}from"./vue-router-29e6667f.js";import{d as k,o as e,c as n,a as s,U as a,L as d,r as c,j as S,a0 as f,Z as V,N as h,F as y,a3 as q,P as x}from"./@vue-d002002f.js";import{o as D,F as L,G as M,I as T,H as j}from"./naive-ui-d02aa0d7.js";import{_ as b,N as E}from"./index-5fa3c6e0.js";import{_ as G}from"./post-skeleton-49f18127.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as Z}from"./vuex-4d2f7b35.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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-4022100b.js";/* empty css */const A={class:"avatar"},J={class:"base-info"},K={class:"username"},O={class:"uid"},Q=k({__name:"contact-item",props:{contact:{}},setup(C){const l=F(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=D;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",A,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",J,[s("div",K,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",O,"UID. "+d(t.contact.user_id),1)])])}}});const W=b(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Y={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=Z(),u=R(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};S(()=>{v()});const v=(i=!1)=>{o.value.length===0&&(t.value=!0),E({page:_.value,page_size:r.value}).then(p=>{t.value=!1,o.value=p.list,m.value=Math.ceil(p.pager.total_rows/r.value),i&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(i,p)=>{const $=H,I=G,N=T,z=W,B=j,P=L,U=M;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(P,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",X,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Y,[o.value.length===0?(e(),n("div",tt,[a(N,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,q(o.value,g=>(e(),x(B,{key:g.user_id},{default:f(()=>[a(z,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(U,{page:_.value,"onUpdate:page":w,"page-slot":V(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const Nt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{Nt as default}; +import{u as F,b as R}from"./vue-router-29e6667f.js";import{d as k,o as e,c as n,a as s,U as a,L as d,r as c,j as S,a0 as f,Z as V,N as h,F as y,a3 as q,P as x}from"./@vue-d002002f.js";import{o as D,F as L,G as M,I as T,H as j}from"./naive-ui-d02aa0d7.js";import{_ as b,N as E}from"./index-ff680598.js";import{_ as G}from"./post-skeleton-af959eab.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as Z}from"./vuex-4d2f7b35.js";import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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-4022100b.js";/* empty css */const A={class:"avatar"},J={class:"base-info"},K={class:"username"},O={class:"uid"},Q=k({__name:"contact-item",props:{contact:{}},setup(C){const l=F(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=D;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",A,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",J,[s("div",K,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",O,"UID. "+d(t.contact.user_id),1)])])}}});const W=b(Q,[["__scopeId","data-v-08ee9b2e"]]),X={key:0,class:"skeleton-wrap"},Y={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=Z(),u=R(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};S(()=>{v()});const v=(i=!1)=>{o.value.length===0&&(t.value=!0),E({page:_.value,page_size:r.value}).then(p=>{t.value=!1,o.value=p.list,m.value=Math.ceil(p.pager.total_rows/r.value),i&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(i,p)=>{const $=H,I=G,N=T,z=W,B=j,P=L,U=M;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(P,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",X,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Y,[o.value.length===0?(e(),n("div",tt,[a(N,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,q(o.value,g=>(e(),x(B,{key:g.user_id},{default:f(()=>[a(z,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(U,{page:_.value,"onUpdate:page":w,"page-slot":V(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const Nt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{Nt as default}; diff --git a/web/dist/assets/Home-20128b51.js b/web/dist/assets/Home-20128b51.js deleted file mode 100644 index 3d81c18f..00000000 --- a/web/dist/assets/Home-20128b51.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-bc760886.js";import{_ as xe}from"./post-skeleton-49f18127.js";import{d as Y,r as i,j as ee,o as c,c as v,Z as $,a as x,U as a,a0 as s,P as S,N as T,a1 as Q,e as L,L as X,F as K,a3 as Z,n as Ie,w as Ue}from"./@vue-d002002f.js";import{u as te}from"./vuex-4d2f7b35.js";import{l as W}from"./lodash-94eb5868.js";import{g as ze,a as Re,c as Ae,b as Ee,_ as Pe}from"./index-5fa3c6e0.js";import{p as Le}from"./content-1ad34d0c.js";import{V as U,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-4022100b.js";import{o as Me,v as Oe,j as je,e as De,w as He,x as Ge,y as Ke,z as Ze,A as Je,B as Qe,C as Xe,a as We,D as Ye,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-d02aa0d7.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{b as lt,u as it}from"./vue-router-29e6667f.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-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-d47e9bf6.js";const rt=F=>{const q=new FileReader,r=_=>["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 r("application/zip");case"504b030414":return r("application/x-zip-compressed");case"504b0508":return r("application/x-zip");case"504b5370":return r("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():r(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=Y({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const r=te(),I=i([]),_=i(!1),d=i(!1),p=i(!1),b=i(!1),w=i(""),z=i([]),E=i(),N=i(0),f=i("public/image"),u=i([]),h=i([]),k=i([]),y=i([]),C=i(U.FRIEND),R=i(U.FRIEND),M=[{value:U.PUBLIC,label:"公开"},{value:U.PRIVATE,label:"私密"},{value:U.FRIEND,label:"好友可见"}],P=+"400",B=i("true".toLowerCase()==="true"),O=i("true".toLowerCase()==="true"),j=i("true".toLowerCase()==="true"),A=i("false".toLowerCase()==="true"),ae=i("true".toLowerCase()==="true"),oe="https://iibiubiu.com/v1/attachment",J=i(),ne=()=>{p.value=!p.value,p.value&&b.value&&(b.value=!1)},se=()=>{b.value=!b.value,b.value&&p.value&&(p.value=!1)},le=W.debounce(t=>{ze({k:t}).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=W.debounce(t=>{Re({k:t}).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=(t,e)=>{_.value||(_.value=!0,e==="@"?le(t):ie(t))},ue=t=>{t.length>P?w.value=t.substring(0,P):w.value=t},D=t=>{f.value=t},ce=t=>{for(let l=0;l30&&(t[l].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}u.value=t},pe=async t=>{var e,n,o,l,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((l=t.file.file)==null?void 0:l.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=t.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:t,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:t.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:t.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let l=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{l+=":"+g}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},me=({file:t})=>{let e=h.value.findIndex(n=>n.id===t.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Le(w.value);const n=[];let o=100;n.push({content:w.value,type:V.TEXT,sort:o}),h.value.map(l=>{o++,n.push({content:l.content,type:V.IMAGEURL,sort:o})}),k.value.map(l=>{o++,n.push({content:l.content,type:V.VIDEOURL,sort:o})}),y.value.map(l=>{o++,n.push({content:l.content,type:V.ATTACHMENT,sort:o})}),z.value.length>0&&z.value.map(l=>{o++,n.push({content:l,type:V.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+N.value*100,visibility:C.value}).then(l=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",l),p.value=!1,b.value=!1,(g=E.value)==null||g.clear(),u.value=[],w.value="",z.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(l=>{d.value=!1})},H=t=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",t)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=U.FRIEND:"friend".toLowerCase()==="public"?R.value=U.PUBLIC:R.value=U.PRIVATE,C.value=R.value,J.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Me,o=Oe,l=je,g=De,G=He,ge=Ge,fe=Ke,ye=Ze,he=Je,we=Qe,be=Xe,ke=We,Ce=Ye,$e=et;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",ut,[x("div",ct,[x("div",pt,[a(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:J.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[a(G,{abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(c(),S(G,{key:0,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{D("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),j.value?(c(),S(G,{key:1,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),a(g,{quaternary:"",circle:"",type:"primary",onClick:Q(ne,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),S(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Q(se,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[a(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[L(" "+X(w.value.length)+" / "+X($(P)),1)]),_:1}),a(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[a(ye),y.value.length>0?(c(),v("div",gt,[A.value?(c(),S(he,{key:0,value:N.value,"onUpdate:value":e[0]||(e[0]=m=>N.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data","file-list"]),b.value?(c(),v("div",yt,[a(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[a(ke,null,{default:s(()=>[(c(),v(K,null,Z(M,m=>a(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(c(),v("div",ht,[a($e,{value:z.value,"onUpdate:value":e[2]||(e[2]=m=>z.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(c(),v("div",wt,[bt,B.value?T("",!0):(c(),v("div",kt,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1})])),B.value?(c(),v("div",Ct,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1}),a(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},Ut={key:2},zt={key:0,class:"pagination-wrap"},Rt=Y({__name:"Home",setup(F){const q=te(),r=lt(),I=it(),_=i(!1),d=i([]),p=i(+r.query.p||1),b=i(20),w=i(0),z=Ie(()=>{let u="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?u="#"+decodeURIComponent(r.query.q):u="搜索: "+decodeURIComponent(r.query.q)),u}),E=()=>{_.value=!0,Ee({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:p.value,page_size:b.value}).then(u=>{_.value=!1,d.value=u.list,w.value=Math.ceil(u.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(u=>{_.value=!1})},N=u=>{if(p.value!=1){I.push({name:"post",query:{id:u.id}});return}let h=[],k=d.value.length;k==b.value&&k--;for(var y=0;y{I.push({name:"home",query:{...r.query,p:u}})};return ee(()=>{E()}),Ue(()=>({path:r.path,query:r.query,refresh:q.state.refresh}),(u,h)=>{if(u.refresh!==h.refresh){p.value=+r.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&u.path==="/"&&(p.value=+r.query.p||1,setTimeout(()=>{E()},0))}),(u,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,P=Te,B=qe,O=tt,j=at;return c(),v("div",null,[a(k,{title:z.value},null,8,["title"]),a(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[a(C,null,{default:s(()=>[a(y,{onPostSuccess:N})]),_:1}),_.value?(c(),v("div",Tt,[a(R,{num:b.value},null,8,["num"])])):(c(),v("div",qt,[d.value.length===0?(c(),v("div",xt,[a(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(c(),v("div",It,[(c(!0),v(K,null,Z(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(P,{post:A},null,8,["post"])]),_:2},1024))),128))])):(c(),v("div",Ut,[(c(!0),v(K,null,Z(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(c(),v("div",zt,[a(j,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Pe(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; diff --git a/web/dist/assets/Home-99db4d92.js b/web/dist/assets/Home-99db4d92.js new file mode 100644 index 00000000..36637031 --- /dev/null +++ b/web/dist/assets/Home-99db4d92.js @@ -0,0 +1 @@ +import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-7c874df8.js";import{_ as xe}from"./post-skeleton-af959eab.js";import{d as Y,r as i,j as ee,o as c,c as v,Z as $,a as x,U as a,a0 as s,P as S,N as T,a1 as Q,e as L,L as X,F as K,a3 as Z,n as Ie,w as Ue}from"./@vue-d002002f.js";import{u as te}from"./vuex-4d2f7b35.js";import{l as W}from"./lodash-94eb5868.js";import{g as ze,a as Re,c as Ae,b as Ee,_ as Pe}from"./index-ff680598.js";import{p as Le}from"./content-d4af862e.js";import{V as U,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-4022100b.js";import{o as Me,v as Oe,j as je,e as De,w as He,x as Ge,y as Ke,z as Ze,A as Je,B as Qe,C as Xe,a as We,D as Ye,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-d02aa0d7.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{b as lt,u as it}from"./vue-router-29e6667f.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-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-d47e9bf6.js";const rt=F=>{const q=new FileReader,r=_=>["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 r("application/zip");case"504b030414":return r("application/x-zip-compressed");case"504b0508":return r("application/x-zip");case"504b5370":return r("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():r(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=Y({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const r=te(),I=i([]),_=i(!1),d=i(!1),p=i(!1),b=i(!1),w=i(""),z=i([]),E=i(),N=i(0),f=i("public/image"),u=i([]),h=i([]),k=i([]),y=i([]),C=i(U.FRIEND),R=i(U.FRIEND),M=[{value:U.PUBLIC,label:"公开"},{value:U.PRIVATE,label:"私密"},{value:U.FRIEND,label:"好友可见"}],P=+"400",B=i("true".toLowerCase()==="true"),O=i("true".toLowerCase()==="true"),j=i("true".toLowerCase()==="true"),A=i("false".toLowerCase()==="true"),ae=i("true".toLowerCase()==="true"),oe="/v1/attachment",J=i(),ne=()=>{p.value=!p.value,p.value&&b.value&&(b.value=!1)},se=()=>{b.value=!b.value,b.value&&p.value&&(p.value=!1)},le=W.debounce(t=>{ze({k:t}).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=W.debounce(t=>{Re({k:t}).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=(t,e)=>{_.value||(_.value=!0,e==="@"?le(t):ie(t))},ue=t=>{t.length>P?w.value=t.substring(0,P):w.value=t},D=t=>{f.value=t},ce=t=>{for(let l=0;l30&&(t[l].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}u.value=t},pe=async t=>{var e,n,o,l,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((l=t.file.file)==null?void 0:l.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=t.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:t,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:t.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:t.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let l=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{l+=":"+g}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},me=({file:t})=>{let e=h.value.findIndex(n=>n.id===t.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Le(w.value);const n=[];let o=100;n.push({content:w.value,type:V.TEXT,sort:o}),h.value.map(l=>{o++,n.push({content:l.content,type:V.IMAGEURL,sort:o})}),k.value.map(l=>{o++,n.push({content:l.content,type:V.VIDEOURL,sort:o})}),y.value.map(l=>{o++,n.push({content:l.content,type:V.ATTACHMENT,sort:o})}),z.value.length>0&&z.value.map(l=>{o++,n.push({content:l,type:V.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+N.value*100,visibility:C.value}).then(l=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",l),p.value=!1,b.value=!1,(g=E.value)==null||g.clear(),u.value=[],w.value="",z.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(l=>{d.value=!1})},H=t=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",t)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=U.FRIEND:"friend".toLowerCase()==="public"?R.value=U.PUBLIC:R.value=U.PRIVATE,C.value=R.value,J.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Me,o=Oe,l=je,g=De,G=He,ge=Ge,fe=Ke,ye=Ze,he=Je,we=Qe,be=Xe,ke=We,Ce=Ye,$e=et;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",ut,[x("div",ct,[x("div",pt,[a(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:J.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[a(G,{abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(c(),S(G,{key:0,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{D("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),j.value?(c(),S(G,{key:1,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),a(g,{quaternary:"",circle:"",type:"primary",onClick:Q(ne,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),S(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Q(se,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[a(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[L(" "+X(w.value.length)+" / "+X($(P)),1)]),_:1}),a(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[a(ye),y.value.length>0?(c(),v("div",gt,[A.value?(c(),S(he,{key:0,value:N.value,"onUpdate:value":e[0]||(e[0]=m=>N.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data","file-list"]),b.value?(c(),v("div",yt,[a(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[a(ke,null,{default:s(()=>[(c(),v(K,null,Z(M,m=>a(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(c(),v("div",ht,[a($e,{value:z.value,"onUpdate:value":e[2]||(e[2]=m=>z.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(c(),v("div",wt,[bt,B.value?T("",!0):(c(),v("div",kt,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1})])),B.value?(c(),v("div",Ct,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[L(" 登录 ")]),_:1}),a(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},Ut={key:2},zt={key:0,class:"pagination-wrap"},Rt=Y({__name:"Home",setup(F){const q=te(),r=lt(),I=it(),_=i(!1),d=i([]),p=i(+r.query.p||1),b=i(20),w=i(0),z=Ie(()=>{let u="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?u="#"+decodeURIComponent(r.query.q):u="搜索: "+decodeURIComponent(r.query.q)),u}),E=()=>{_.value=!0,Ee({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:p.value,page_size:b.value}).then(u=>{_.value=!1,d.value=u.list,w.value=Math.ceil(u.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(u=>{_.value=!1})},N=u=>{if(p.value!=1){I.push({name:"post",query:{id:u.id}});return}let h=[],k=d.value.length;k==b.value&&k--;for(var y=0;y{I.push({name:"home",query:{...r.query,p:u}})};return ee(()=>{E()}),Ue(()=>({path:r.path,query:r.query,refresh:q.state.refresh}),(u,h)=>{if(u.refresh!==h.refresh){p.value=+r.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&u.path==="/"&&(p.value=+r.query.p||1,setTimeout(()=>{E()},0))}),(u,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,P=Te,B=qe,O=tt,j=at;return c(),v("div",null,[a(k,{title:z.value},null,8,["title"]),a(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[a(C,null,{default:s(()=>[a(y,{onPostSuccess:N})]),_:1}),_.value?(c(),v("div",Tt,[a(R,{num:b.value},null,8,["num"])])):(c(),v("div",qt,[d.value.length===0?(c(),v("div",xt,[a(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(c(),v("div",It,[(c(!0),v(K,null,Z(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(P,{post:A},null,8,["post"])]),_:2},1024))),128))])):(c(),v("div",Ut,[(c(!0),v(K,null,Z(d.value,A=>(c(),S(C,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(c(),v("div",zt,[a(j,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Pe(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; diff --git a/web/dist/assets/Messages-8bfe7f3b.js b/web/dist/assets/Messages-d5995867.js similarity index 97% rename from web/dist/assets/Messages-8bfe7f3b.js rename to web/dist/assets/Messages-d5995867.js index 4949fdfe..ebcc4ede 100644 --- a/web/dist/assets/Messages-8bfe7f3b.js +++ b/web/dist/assets/Messages-d5995867.js @@ -1 +1 @@ -import{d as b,a2 as A,o as t,c as a,U as n,a0 as o,a as y,a1 as w,e as p,L as m,P as q,N as r,Z as c,K as D,a3 as z,F as R,r as f,j as P}from"./@vue-d002002f.js";import{u as U,b as G}from"./vue-router-29e6667f.js";import{G as H,H as L,I as T,_ as F,J as E}from"./index-5fa3c6e0.js";import{a as J}from"./formatTime-000dbebb.js";import{q as K,r as Z,s as S,t as Q}from"./@vicons-4022100b.js";import{o as W,l as X,j as Y,S as x,M as ee,U as se,F as ne,G as te,I as ae,H as oe}from"./naive-ui-d02aa0d7.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as ie}from"./vuex-4d2f7b35.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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 _e={class:"sender-wrap"},le={key:0,class:"nickname"},pe={class:"username"},ue={key:1,class:"nickname"},ce={class:"timestamp"},de={class:"timestamp-txt"},me={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="https://assets.paopao.info/public/avatar/default/admin.png",he=b({__name:"message-item",props:{message:{}},setup(I){const g=U(),k=e=>{_(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},i=e=>{_(e),H({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},u=e=>{_(e),L({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},_=e=>{e.is_read===0&&T({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const h=W,$=A("router-link"),l=X,d=Y,C=x,M=ee;return t(),a("div",{class:D(["message-item",{unread:e.message.is_read===0}]),onClick:s[4]||(s[4]=v=>_(e.message))},[n(M,{"content-indented":""},{avatar:o(()=>[n(h,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:ke},null,8,["src"])]),header:o(()=>[y("div",_e,[e.message.sender_user.id>0?(t(),a("span",le,[n($,{onClick:s[0]||(s[0]=w(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:o(()=>[p(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),y("span",pe," @"+m(e.message.sender_user.username),1)])):(t(),a("span",ue," 系统 "))])]),"header-extra":o(()=>[y("span",ce,[e.message.is_read===0?(t(),q(l,{key:0,dot:"",processing:""})):r("",!0),y("span",de,m(c(J)(e.message.created_on)),1)])]),description:o(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:o(()=>[e.message.type!=4?(t(),a("div",me,[p(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),a("span",{key:0,onClick:s[1]||(s[1]=w(v=>k(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(K))]),_:1}),p(" 查看详情 ")])):r("",!0)])):r("",!0),e.message.type===4?(t(),a("div",ge,m(e.message.content),1)):r("",!0),e.message.type===5?(t(),a("div",ve,[p(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),a("span",{key:0,onClick:s[2]||(s[2]=w(v=>i(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(Z))]),_:1}),p(" 同意 ")])):r("",!0),e.message.reply_id===1?(t(),a("span",{key:1,onClick:s[3]||(s[3]=w(v=>u(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 拒绝 ")])):r("",!0),e.message.reply_id===2?(t(),a("span",fe,[n(d,null,{default:o(()=>[n(c(Q))]),_:1}),p(" 已同意 ")])):r("",!0),e.message.reply_id===3?(t(),a("span",ye,[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 已拒绝 ")])):r("",!0)])):r("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const we=F(he,[["__scopeId","data-v-4a0e27fa"]]),$e={class:"content"},Ce=b({__name:"message-skeleton",props:{num:{default:1}},setup(I){return(g,k)=>{const i=se;return t(!0),a(R,null,z(new Array(g.num),u=>(t(),a("div",{class:"skeleton-item",key:u},[y("div",$e,[n(i,{text:"",repeat:2}),n(i,{text:"",style:{width:"60%"}})])]))),128)}}});const Me=F(Ce,[["__scopeId","data-v-01d2e871"]]),be={key:0,class:"skeleton-wrap"},Fe={key:1},Ie={key:0,class:"empty-wrap"},Ne={key:0,class:"pagination-wrap"},Se=b({__name:"Messages",setup(I){const g=G(),k=ie(),i=f(!1),u=f(+g.query.p||1),_=f(10),e=f(0),s=f([]),h=()=>{i.value=!0,E({page:u.value,page_size:_.value}).then(l=>{i.value=!1,s.value=l.list,e.value=Math.ceil(l.pager.total_rows/_.value)}).catch(l=>{i.value=!1})},$=l=>{u.value=l,h()};return P(()=>{h()}),(l,d)=>{const C=re,M=Me,v=ae,j=we,B=oe,O=ne,V=te;return t(),a("div",null,[n(C,{title:"消息"}),n(O,{class:"main-content-wrap messages-wrap",bordered:""},{default:o(()=>[i.value?(t(),a("div",be,[n(M,{num:_.value},null,8,["num"])])):(t(),a("div",Fe,[s.value.length===0?(t(),a("div",Ie,[n(v,{size:"large",description:"暂无数据"})])):r("",!0),(t(!0),a(R,null,z(s.value,N=>(t(),q(B,{key:N.id},{default:o(()=>[n(j,{message:N},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),e.value>0?(t(),a("div",Ne,[n(V,{page:u.value,"onUpdate:page":$,"page-slot":c(k).state.collapsedRight?5:8,"page-count":e.value},null,8,["page","page-slot","page-count"])])):r("",!0)])}}});const es=F(Se,[["__scopeId","data-v-4e7b1342"]]);export{es as default}; +import{d as b,a2 as A,o as t,c as a,U as n,a0 as o,a as y,a1 as w,e as p,L as m,P as q,N as r,Z as c,K as D,a3 as z,F as R,r as f,j as P}from"./@vue-d002002f.js";import{u as U,b as G}from"./vue-router-29e6667f.js";import{G as H,H as L,I as T,_ as F,J as E}from"./index-ff680598.js";import{a as J}from"./formatTime-000dbebb.js";import{q as K,r as Z,s as S,t as Q}from"./@vicons-4022100b.js";import{o as W,l as X,j as Y,S as x,M as ee,U as se,F as ne,G as te,I as ae,H as oe}from"./naive-ui-d02aa0d7.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as ie}from"./vuex-4d2f7b35.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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 _e={class:"sender-wrap"},le={key:0,class:"nickname"},pe={class:"username"},ue={key:1,class:"nickname"},ce={class:"timestamp"},de={class:"timestamp-txt"},me={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="https://assets.paopao.info/public/avatar/default/admin.png",he=b({__name:"message-item",props:{message:{}},setup(I){const g=U(),k=e=>{_(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},i=e=>{_(e),H({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},u=e=>{_(e),L({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},_=e=>{e.is_read===0&&T({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const h=W,$=A("router-link"),l=X,d=Y,C=x,M=ee;return t(),a("div",{class:D(["message-item",{unread:e.message.is_read===0}]),onClick:s[4]||(s[4]=v=>_(e.message))},[n(M,{"content-indented":""},{avatar:o(()=>[n(h,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:ke},null,8,["src"])]),header:o(()=>[y("div",_e,[e.message.sender_user.id>0?(t(),a("span",le,[n($,{onClick:s[0]||(s[0]=w(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:o(()=>[p(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),y("span",pe," @"+m(e.message.sender_user.username),1)])):(t(),a("span",ue," 系统 "))])]),"header-extra":o(()=>[y("span",ce,[e.message.is_read===0?(t(),q(l,{key:0,dot:"",processing:""})):r("",!0),y("span",de,m(c(J)(e.message.created_on)),1)])]),description:o(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:o(()=>[e.message.type!=4?(t(),a("div",me,[p(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),a("span",{key:0,onClick:s[1]||(s[1]=w(v=>k(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(K))]),_:1}),p(" 查看详情 ")])):r("",!0)])):r("",!0),e.message.type===4?(t(),a("div",ge,m(e.message.content),1)):r("",!0),e.message.type===5?(t(),a("div",ve,[p(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),a("span",{key:0,onClick:s[2]||(s[2]=w(v=>i(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(Z))]),_:1}),p(" 同意 ")])):r("",!0),e.message.reply_id===1?(t(),a("span",{key:1,onClick:s[3]||(s[3]=w(v=>u(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 拒绝 ")])):r("",!0),e.message.reply_id===2?(t(),a("span",fe,[n(d,null,{default:o(()=>[n(c(Q))]),_:1}),p(" 已同意 ")])):r("",!0),e.message.reply_id===3?(t(),a("span",ye,[n(d,null,{default:o(()=>[n(c(S))]),_:1}),p(" 已拒绝 ")])):r("",!0)])):r("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const we=F(he,[["__scopeId","data-v-4a0e27fa"]]),$e={class:"content"},Ce=b({__name:"message-skeleton",props:{num:{default:1}},setup(I){return(g,k)=>{const i=se;return t(!0),a(R,null,z(new Array(g.num),u=>(t(),a("div",{class:"skeleton-item",key:u},[y("div",$e,[n(i,{text:"",repeat:2}),n(i,{text:"",style:{width:"60%"}})])]))),128)}}});const Me=F(Ce,[["__scopeId","data-v-01d2e871"]]),be={key:0,class:"skeleton-wrap"},Fe={key:1},Ie={key:0,class:"empty-wrap"},Ne={key:0,class:"pagination-wrap"},Se=b({__name:"Messages",setup(I){const g=G(),k=ie(),i=f(!1),u=f(+g.query.p||1),_=f(10),e=f(0),s=f([]),h=()=>{i.value=!0,E({page:u.value,page_size:_.value}).then(l=>{i.value=!1,s.value=l.list,e.value=Math.ceil(l.pager.total_rows/_.value)}).catch(l=>{i.value=!1})},$=l=>{u.value=l,h()};return P(()=>{h()}),(l,d)=>{const C=re,M=Me,v=ae,j=we,B=oe,O=ne,V=te;return t(),a("div",null,[n(C,{title:"消息"}),n(O,{class:"main-content-wrap messages-wrap",bordered:""},{default:o(()=>[i.value?(t(),a("div",be,[n(M,{num:_.value},null,8,["num"])])):(t(),a("div",Fe,[s.value.length===0?(t(),a("div",Ie,[n(v,{size:"large",description:"暂无数据"})])):r("",!0),(t(!0),a(R,null,z(s.value,N=>(t(),q(B,{key:N.id},{default:o(()=>[n(j,{message:N},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),e.value>0?(t(),a("div",Ne,[n(V,{page:u.value,"onUpdate:page":$,"page-slot":c(k).state.collapsedRight?5:8,"page-count":e.value},null,8,["page","page-slot","page-count"])])):r("",!0)])}}});const es=F(Se,[["__scopeId","data-v-4e7b1342"]]);export{es as default}; diff --git a/web/dist/assets/Post-1ec9984a.js b/web/dist/assets/Post-1ec9984a.js deleted file mode 100644 index caa42aa1..00000000 --- a/web/dist/assets/Post-1ec9984a.js +++ /dev/null @@ -1 +0,0 @@ -import{d as G,r,a2 as me,o,c as u,a as m,U as e,a0 as n,e as T,L as z,P as U,N as i,Z as a,a1 as V,n as ne,a6 as Pe,F as ae,a3 as le,j as ve,V as ye,W as ke,w as Re}from"./@vue-d002002f.js";import{u as X}from"./vuex-4d2f7b35.js";import{f as ie}from"./formatTime-000dbebb.js";import{t as Se,d as Le,e as Ae,_ as ee,f as De,h as Me,i as qe,j as Ne,g as Oe,k as je,l as Be,m as Ee,n as Ve,o as He,s as Fe,v as Ye,p as Ke,q as Je,r as Qe,u as ge}from"./index-5fa3c6e0.js";import{Y as ue,V as W}from"./IEnum-a180d93e.js";import{T as we,e as ce,f as be,g as re,h as $e,I as Ge,i as We,j as Ze,k as Xe,l as et,m as tt,n as st,o as ot}from"./@vicons-4022100b.js";import{j as te,e as se,J as Ce,K as nt,b as at,L as lt,o as fe,M as xe,v as it,w as ut,x as ct,y as rt,z as _t,B as pt,O as dt,P as mt,i as vt,Q as ft,a as Ie,F as ht,I as gt,k as yt,H as kt,f as wt,g as bt}from"./naive-ui-d02aa0d7.js";import{p as he,_ as Te,a as $t,b as Ct,c as xt}from"./content-1ad34d0c.js";import{u as ze,b as It}from"./vue-router-29e6667f.js";import{_ as Tt}from"./post-skeleton-49f18127.js";import{l as zt}from"./lodash-94eb5868.js";import{a as Ut}from"./copy-to-clipboard-1dd3075d.js";import{_ as Pt}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{K as Rt}from"./v3-infinite-loading-58f64a4e.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-d47e9bf6.js";import"./toggle-selection-93f4ad84.js";const St={class:"reply-item"},Lt={class:"header-wrap"},At={class:"username"},Dt={class:"reply-name"},Mt={class:"timestamp"},qt={class:"base-wrap"},Nt={class:"content"},Ot={class:"reply-switch"},jt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Vt=["onClick"],Ht={class:"upvote-count"},Ft={key:2,class:"action-item"},Yt=["onClick"],Kt=G({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(M,{emit:N}){const l=M,_=X(),h=r(l.reply.is_thumbs_up==ue.YES),y=r(l.reply.is_thumbs_down==ue.YES),k=r(l.reply.thumbs_up_count),L=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{h.value=!h.value,h.value?(k.value++,y.value=!1):k.value--}).catch(v=>{console.log(v)})},c=()=>{Le({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{y.value=!y.value,y.value&&h.value&&(k.value--,h.value=!1)}).catch(v=>{console.log(v)})},R=()=>{N("focusReply",l.reply)},I=()=>{Ae({id:l.reply.id}).then(v=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(v=>{console.log(v)})};return(v,b)=>{const t=me("router-link"),f=te,$=se,A=Ce,w=nt;return o(),u("div",St,[m("div",Lt,[m("div",At,[e(t,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:n(()=>[T(z(l.reply.user.username),1)]),_:1},8,["to"]),m("span",Dt,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),U(t,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:n(()=>[T(z(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),m("div",Mt,[T(z(l.reply.ip_loc)+" ",1),a(_).state.userInfo.is_admin||a(_).state.userInfo.id===l.reply.user.id?(o(),U(A,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:I},{trigger:n(()=>[e($,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[e(f,null,{default:n(()=>[e(a(we))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):i("",!0)])]),m("div",qt,[m("div",Nt,[e(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(z(l.reply.content),1)]),_:1})]),m("div",Ot,[m("span",jt,z(a(ie)(l.reply.created_on)),1),m("div",Bt,[a(_).state.userLogined?i("",!0):(o(),u("div",{key:0,class:"action-item",onClick:b[0]||(b[0]=V(()=>{},["stop"]))},[e(f,{size:"medium"},{default:n(()=>[e(a(ce))]),_:1}),m("span",Et,z(k.value),1)])),a(_).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:V(L,["stop"])},[e(f,{size:"medium"},{default:n(()=>[h.value?i("",!0):(o(),U(a(ce),{key:0})),h.value?(o(),U(a(be),{key:1,class:"show"})):i("",!0)]),_:1}),m("span",Ht,z(k.value>0?k.value:"赞"),1)],8,Vt)):i("",!0),a(_).state.userLogined?i("",!0):(o(),u("div",Ft,[e(f,{size:"medium"},{default:n(()=>[e(a(re))]),_:1})])),a(_).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:V(c,["stop"])},[e(f,{size:"medium"},{default:n(()=>[y.value?i("",!0):(o(),U(a(re),{key:0})),y.value?(o(),U(a($e),{key:1,class:"show"})):i("",!0)]),_:1})],8,Yt)):i("",!0),a(_).state.userLogined?(o(),u("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):i("",!0)])])])])}}});const Jt=ee(Kt,[["__scopeId","data-v-0fa8b923"]]),Qt={class:"reply-compose-wrap"},Gt={class:"reply-switch"},Wt={class:"time-item"},Zt={class:"actions"},Xt={key:0,class:"action-item"},es={class:"upvote-count"},ts=["onClick"],ss={class:"upvote-count"},os={key:2,class:"action-item"},ns=["onClick"],as={key:0,class:"reply-input-wrap"},ls=G({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(M,{expose:N,emit:l}){const _=M,h=X(),y=r(),k=r(!1),L=r(""),c=r(!1),R=+"300",I=r(_.comment.is_thumbs_up==ue.YES),v=r(_.comment.is_thumbs_down==ue.YES),b=r(_.comment.thumbs_up_count),t=()=>{De({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(w=>{I.value=!I.value,I.value?(b.value++,v.value=!1):b.value--}).catch(w=>{console.log(w)})},f=()=>{Me({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(w=>{v.value=!v.value,v.value&&I.value&&(b.value--,I.value=!1)}).catch(w=>{console.log(w)})},$=w=>{k.value=w,w?setTimeout(()=>{var D;(D=y.value)==null||D.focus()},10):(c.value=!1,L.value="",l("reset"))},A=()=>{c.value=!0,qe({comment_id:_.comment.id,at_user_id:_.atUserid,content:L.value}).then(w=>{$(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{c.value=!1})};return N({switchReply:$}),(w,D)=>{const j=te,B=at,F=se,P=lt;return o(),u("div",Qt,[m("div",Gt,[m("span",Wt,z(a(ie)(w.comment.created_on)),1),m("div",Zt,[a(h).state.userLogined?i("",!0):(o(),u("div",Xt,[e(j,{size:"medium"},{default:n(()=>[e(a(ce))]),_:1}),m("span",es,z(b.value),1)])),a(h).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:V(t,["stop"])},[e(j,{size:"medium"},{default:n(()=>[I.value?i("",!0):(o(),U(a(ce),{key:0})),I.value?(o(),U(a(be),{key:1,class:"show"})):i("",!0)]),_:1}),m("span",ss,z(b.value>0?b.value:"赞"),1)],8,ts)):i("",!0),a(h).state.userLogined?i("",!0):(o(),u("div",os,[e(j,{size:"medium"},{default:n(()=>[e(a(re))]),_:1})])),a(h).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:V(f,["stop"])},[e(j,{size:"medium"},{default:n(()=>[v.value?i("",!0):(o(),U(a(re),{key:0})),v.value?(o(),U(a($e),{key:1,class:"show"})):i("",!0)]),_:1})],8,ns)):i("",!0),a(h).state.userLogined&&!k.value?(o(),u("span",{key:4,class:"show reply-btn",onClick:D[0]||(D[0]=S=>$(!0))}," 回复 ")):i("",!0),a(h).state.userLogined&&k.value?(o(),u("span",{key:5,class:"hide reply-btn",onClick:D[1]||(D[1]=S=>$(!1))}," 取消 ")):i("",!0)])]),k.value?(o(),u("div",as,[e(P,null,{default:n(()=>[e(B,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:_.atUsername?"@"+_.atUsername:"请输入回复内容..",maxlength:a(R),value:L.value,"onUpdate:value":D[2]||(D[2]=S=>L.value=S),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),e(F,{type:"primary",size:"small",ghost:"",loading:c.value,onClick:A},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const is=ee(ls,[["__scopeId","data-v-f9af7a93"]]),us={class:"comment-item"},cs={class:"nickname-wrap"},rs={class:"username-wrap"},_s={class:"opt-wrap"},ps={class:"timestamp"},ds=["innerHTML"],ms={class:"reply-wrap"},vs=G({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(M,{emit:N}){const l=M,_=X(),h=ze(),y=r(0),k=r(""),L=r(),c=ne(()=>{let f=Object.assign({texts:[],imgs:[]},l.comment);return f.contents.map($=>{(+$.type==1||+$.type==2)&&f.texts.push($),+$.type==3&&f.imgs.push($)}),f}),R=(f,$)=>{let A=f.target;if(A.dataset.detail){const w=A.dataset.detail.split(":");w.length===2&&(_.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):h.push({name:"user",query:{username:w[1]}}))}},I=f=>{var $,A;y.value=f.user_id,k.value=(($=f.user)==null?void 0:$.username)||"",(A=L.value)==null||A.switchReply(!0)},v=()=>{N("reload")},b=()=>{y.value=0,k.value=""},t=()=>{Ne({id:c.value.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{v()},50)}).catch(f=>{})};return(f,$)=>{const A=fe,w=me("router-link"),D=te,j=se,B=Ce,F=Te,P=is,S=Jt,K=xe;return o(),u("div",us,[e(K,{"content-indented":""},Pe({avatar:n(()=>[e(A,{round:"",size:30,src:c.value.user.avatar},null,8,["src"])]),header:n(()=>[m("span",cs,[e(w,{onClick:$[0]||($[0]=V(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:c.value.user.username}}},{default:n(()=>[T(z(c.value.user.nickname),1)]),_:1},8,["to"])]),m("span",rs," @"+z(c.value.user.username),1)]),"header-extra":n(()=>[m("div",_s,[m("span",ps,z(c.value.ip_loc),1),a(_).state.userInfo.is_admin||a(_).state.userInfo.id===c.value.user.id?(o(),U(B,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:t},{trigger:n(()=>[e(j,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[e(D,null,{default:n(()=>[e(a(we))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:n(()=>[c.value.imgs.length>0?(o(),U(F,{key:0,imgs:c.value.imgs},null,8,["imgs"])):i("",!0),e(P,{ref_key:"replyComposeRef",ref:L,comment:c.value,"at-userid":y.value,"at-username":k.value,onReload:v,onReset:b},null,8,["comment","at-userid","at-username"]),m("div",ms,[(o(!0),u(ae,null,le(c.value.replies,s=>(o(),U(S,{key:s.id,reply:s,"tweet-id":c.value.post_id,onFocusReply:I,onReload:v},null,8,["reply","tweet-id"]))),128))])]),_:2},[c.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),u(ae,null,le(c.value.texts,s=>(o(),u("span",{key:s.id,class:"comment-text",onClick:$[1]||($[1]=V(d=>R(d,c.value.id),["stop"])),innerHTML:a(he)(s.content).content},null,8,ds))),128))]),key:"0"}:void 0]),1024)])}}});const fs=ee(vs,[["__scopeId","data-v-e5cb084f"]]),hs=M=>(ye("data-v-634e6bfd"),M=M(),ke(),M),gs={key:0,class:"compose-wrap"},ys={class:"compose-line"},ks={class:"compose-user"},ws={class:"compose-line compose-options"},bs={class:"attachment"},$s={class:"submit-wrap"},Cs={class:"attachment-list-wrap"},xs={key:1,class:"compose-wrap"},Is=hs(()=>m("div",{class:"login-wrap"},[m("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ts={key:0,class:"login-only-wrap"},zs={key:1,class:"login-wrap"},Us=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(M,{emit:N}){const l=M,_=X(),h=r([]),y=r(!1),k=r(!1),L=r(!1),c=r(""),R=r(),I=r("public/image"),v=r([]),b=r([]),t=r("true".toLowerCase()==="true"),f=+"300",$="https://iibiubiu.com/v1/attachment",A=r(),w=zt.debounce(p=>{Oe({k:p}).then(g=>{let C=[];g.suggest.map(x=>{C.push({label:x,value:x})}),h.value=C,k.value=!1}).catch(g=>{k.value=!1})},200),D=(p,g)=>{k.value||(k.value=!0,g==="@"&&w(p))},j=p=>{p.length>f?c.value=p.substring(0,f):c.value=p},B=p=>{I.value=p},F=p=>{for(let O=0;O30&&(p[O].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+x)}v.value=p},P=async p=>{var g,C;return I.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((g=p.file.file)==null?void 0:g.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):I.value==="image"&&((C=p.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},S=({file:p,event:g})=>{var C;try{let x=JSON.parse((C=g.target)==null?void 0:C.response);x.code===0&&I.value==="public/image"&&b.value.push({id:p.id,content:x.data.content})}catch{window.$message.error("上传失败")}},K=({file:p,event:g})=>{var C;try{let x=JSON.parse((C=g.target)==null?void 0:C.response);if(x.code!==0){let O=x.msg||"上传失败";x.details&&x.details.length>0&&x.details.map(E=>{O+=":"+E}),window.$message.error(O)}}catch{window.$message.error("上传失败")}},s=({file:p})=>{let g=b.value.findIndex(C=>C.id===p.id);g>-1&&b.value.splice(g,1)},d=()=>{y.value=!0},H=()=>{var p;y.value=!1,(p=R.value)==null||p.clear(),v.value=[],c.value="",b.value=[]},J=()=>{if(c.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:p}=he(c.value);const g=[];let C=100;g.push({content:c.value,type:2,sort:C}),b.value.map(x=>{C++,g.push({content:x.content,type:3,sort:C})}),L.value=!0,je({contents:g,post_id:l.postId,users:Array.from(new Set(p))}).then(x=>{window.$message.success("发布成功"),L.value=!1,N("post-success"),H()}).catch(x=>{L.value=!1})},Y=p=>{_.commit("triggerAuth",!0),_.commit("triggerAuthKey",p)};return ve(()=>{A.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(p,g)=>{const C=fe,x=it,O=te,E=se,Q=ut,_e=ct,oe=rt,pe=_t,de=pt;return o(),u("div",null,[a(_).state.userInfo.id>0?(o(),u("div",gs,[m("div",ys,[m("div",ks,[e(C,{round:"",size:30,src:a(_).state.userInfo.avatar},null,8,["src"])]),e(x,{type:"textarea",size:"large",autosize:"",bordered:!1,options:h.value,prefix:["@"],loading:k.value,value:c.value,disabled:l.lock===1,"onUpdate:value":j,onSearch:D,onFocus:d,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(o(),U(de,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:$,headers:{Authorization:A.value},data:{type:I.value},"file-list":v.value,onBeforeUpload:P,onFinish:S,onError:K,onRemove:s,"onUpdate:fileList":F},{default:n(()=>[m("div",ws,[m("div",bs,[e(Q,{abstract:""},{default:n(({handleClick:q})=>[e(E,{disabled:v.value.length>0&&I.value==="public/video"||v.value.length===9,onClick:()=>{B("public/image"),q()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[e(O,{size:"20",color:"var(--primary-color)"},{default:n(()=>[e(a(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),e(oe,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[e(_e,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:c.value.length/a(f)*100},null,8,["percentage"])]),default:n(()=>[T(" "+z(c.value.length)+" / "+z(a(f)),1)]),_:1})]),m("div",$s,[e(E,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:H},{default:n(()=>[T(" 取消 ")]),_:1}),e(E,{loading:L.value,onClick:J,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),m("div",Cs,[e(pe)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(o(),u("div",xs,[Is,t.value?i("",!0):(o(),u("div",Ts,[e(E,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=q=>Y("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),t.value?(o(),u("div",zs,[e(E,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=q=>Y("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),e(E,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=q=>Y("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):i("",!0)]))])}}});const Ps=ee(Us,[["__scopeId","data-v-634e6bfd"]]),Rs={class:"username-wrap"},Ss={key:0,class:"options"},Ls={key:0},As=["innerHTML"],Ds={class:"timestamp"},Ms={key:0},qs={key:1},Ns={class:"opts-wrap"},Os=["onClick"],js={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Vs=G({__name:"post-detail",props:{post:{}},emits:["reload"],setup(M,{emit:N}){const l=M,_=X(),h=ze(),y=r(!1),k=r(!1),L=r(!1),c=r(!1),R=r(!1),I=r(!1),v=r(!1),b=r(W.PUBLIC),t=ne({get:()=>{let s=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return s.contents.map(d=>{(+d.type==1||+d.type==2)&&s.texts.push(d),+d.type==3&&s.imgs.push(d),+d.type==4&&s.videos.push(d),+d.type==6&&s.links.push(d),+d.type==7&&s.attachments.push(d),+d.type==8&&s.charge_attachments.push(d)}),s},set:s=>{l.post.upvote_count=s.upvote_count,l.post.comment_count=s.comment_count,l.post.collection_count=s.collection_count}}),f=ne(()=>{let s=[{label:"删除",key:"delete"}];return t.value.is_lock===0?s.push({label:"锁定",key:"lock"}):s.push({label:"解锁",key:"unlock"}),_.state.userInfo.is_admin&&(t.value.is_top===0?s.push({label:"置顶",key:"stick"}):s.push({label:"取消置顶",key:"unstick"})),t.value.visibility===W.PUBLIC?s.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):t.value.visibility===W.PRIVATE?s.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):s.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),s}),$=s=>{h.push({name:"post",query:{id:s}})},A=(s,d)=>{if(s.target.dataset.detail){const H=s.target.dataset.detail.split(":");if(H.length===2){_.commit("refresh"),H[0]==="tag"?h.push({name:"home",query:{q:H[1],t:"tag"}}):h.push({name:"user",query:{username:H[1]}});return}}$(d)},w=s=>{switch(s){case"delete":L.value=!0;break;case"lock":case"unlock":c.value=!0;break;case"stick":case"unstick":R.value=!0;break;case"vpublic":b.value=0,I.value=!0;break;case"vprivate":b.value=1,I.value=!0;break;case"vfriend":b.value=2,I.value=!0;break}},D=()=>{Ve({id:t.value.id}).then(s=>{window.$message.success("删除成功"),h.replace("/"),setTimeout(()=>{_.commit("refresh")},50)}).catch(s=>{v.value=!1})},j=()=>{He({id:t.value.id}).then(s=>{N("reload"),s.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(s=>{v.value=!1})},B=()=>{Fe({id:t.value.id}).then(s=>{N("reload"),s.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(s=>{v.value=!1})},F=()=>{Ye({id:t.value.id,visibility:b.value}).then(s=>{N("reload"),window.$message.success("修改可见性成功")}).catch(s=>{v.value=!1})},P=()=>{Ke({id:t.value.id}).then(s=>{y.value=s.status,s.status?t.value={...t.value,upvote_count:t.value.upvote_count+1}:t.value={...t.value,upvote_count:t.value.upvote_count-1}}).catch(s=>{console.log(s)})},S=()=>{Je({id:t.value.id}).then(s=>{k.value=s.status,s.status?t.value={...t.value,collection_count:t.value.collection_count+1}:t.value={...t.value,collection_count:t.value.collection_count-1}}).catch(s=>{console.log(s)})},K=()=>{Ut(`${window.location.origin}/#/post?id=${t.value.id}`),window.$message.success("链接已复制到剪贴板")};return ve(()=>{_.state.userInfo.id>0&&(Be({id:t.value.id}).then(s=>{y.value=s.status}).catch(s=>{console.log(s)}),Ee({id:t.value.id}).then(s=>{k.value=s.status}).catch(s=>{console.log(s)}))}),(s,d)=>{const H=fe,J=me("router-link"),Y=dt,p=te,g=se,C=mt,x=vt,O=$t,E=Te,Q=Ct,_e=xt,oe=ft,pe=Ie,de=xe;return o(),u("div",{class:"detail-item",onClick:d[6]||(d[6]=q=>$(t.value.id))},[e(de,null,{avatar:n(()=>[e(H,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:n(()=>[e(J,{onClick:d[0]||(d[0]=V(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t.value.user.username}}},{default:n(()=>[T(z(t.value.user.nickname),1)]),_:1},8,["to"]),m("span",Rs," @"+z(t.value.user.username),1),t.value.is_top?(o(),U(Y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):i("",!0),t.value.visibility==a(W).PRIVATE?(o(),U(Y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):i("",!0),t.value.visibility==a(W).FRIEND?(o(),U(Y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[a(_).state.userInfo.is_admin||a(_).state.userInfo.id===t.value.user.id?(o(),u("div",Ss,[e(C,{placement:"bottom-end",trigger:"click",size:"small",options:f.value,onSelect:w},{default:n(()=>[e(g,{quaternary:"",circle:""},{icon:n(()=>[e(p,null,{default:n(()=>[e(a(We))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),e(x,{show:L.value,"onUpdate:show":d[1]||(d[1]=q=>L.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:D},null,8,["show"]),e(x,{show:c.value,"onUpdate:show":d[2]||(d[2]=q=>c.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(t.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show","content"]),e(x,{show:R.value,"onUpdate:show":d[3]||(d[3]=q=>R.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(t.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show","content"]),e(x,{show:I.value,"onUpdate:show":d[4]||(d[4]=q=>I.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(b.value==0?"公开":b.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show","content"])]),footer:n(()=>[e(O,{attachments:t.value.attachments},null,8,["attachments"]),e(O,{attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"]),e(E,{imgs:t.value.imgs},null,8,["imgs"]),e(Q,{videos:t.value.videos,full:!0},null,8,["videos"]),e(_e,{links:t.value.links},null,8,["links"]),m("div",Ds,[T(" 发布于 "+z(a(ie)(t.value.created_on))+" ",1),t.value.ip_loc?(o(),u("span",Ms,[e(oe,{vertical:""}),T(" "+z(t.value.ip_loc),1)])):i("",!0),!a(_).state.collapsedLeft&&t.value.created_on!=t.value.latest_replied_on?(o(),u("span",qs,[e(oe,{vertical:""}),T(" 最后回复 "+z(a(ie)(t.value.latest_replied_on)),1)])):i("",!0)])]),action:n(()=>[m("div",Ns,[e(pe,{justify:"space-between"},{default:n(()=>[m("div",{class:"opt-item hover",onClick:V(P,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[y.value?i("",!0):(o(),U(a(Ze),{key:0})),y.value?(o(),U(a(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),T(" "+z(t.value.upvote_count),1)],8,Os),m("div",js,[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[e(a(et))]),_:1}),T(" "+z(t.value.comment_count),1)]),m("div",{class:"opt-item hover",onClick:V(S,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?i("",!0):(o(),U(a(tt),{key:0})),k.value?(o(),U(a(st),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),T(" "+z(t.value.collection_count),1)],8,Bs),m("div",{class:"opt-item hover",onClick:V(K,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[e(a(ot))]),_:1}),T(" "+z(t.value.share_count),1)],8,Es)]),_:1})])]),default:n(()=>[t.value.texts.length>0?(o(),u("div",Ls,[(o(!0),u(ae,null,le(t.value.texts,q=>(o(),u("span",{key:q.id,class:"post-text",onClick:d[5]||(d[5]=V(Ue=>A(Ue,t.value.id),["stop"])),innerHTML:a(he)(q.content).content},null,8,As))),128))])):i("",!0)]),_:1})])}}});const Hs=M=>(ye("data-v-0d01659f"),M=M(),ke(),M),Fs={key:0,class:"detail-wrap"},Ys={key:1,class:"empty-wrap"},Ks={key:0,class:"comment-opts-wrap"},Js=Hs(()=>m("span",{class:"comment-title-item"},"评论",-1)),Qs={key:2},Gs={key:0,class:"skeleton-wrap"},Ws={key:1},Zs={key:0,class:"empty-wrap"},Xs={key:0,class:"load-more-spinner"},eo={key:1,class:"load-more-spinner"},to={key:2,class:"load-more-spinner"},so={key:3,class:"load-more-spinner"},Z=20,oo=G({__name:"Post",setup(M){const N=It(),l=r({}),_=r(!1),h=r(!1),y=r([]),k=ne(()=>+N.query.id),L=r("default"),c=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const I=P=>{L.value=P,P==="default"&&(c.value=!0),B(R)},v=()=>{l.value={id:0},_.value=!0,Qe({id:k.value}).then(P=>{_.value=!1,l.value=P,B(R)}).catch(P=>{_.value=!1})};let b=1;const t=r(!1),f=r([]),$=P=>{t.value||ge({id:l.value.id,sort_strategy:"default",page:b,page_size:Z}).then(S=>{P!==null&&(R=P),S.list.length0&&(b===1?f.value=S.list:f.value.push(...S.list),y.value=f.value),R.loaded(),h.value=!1}).catch(S=>{h.value=!1,R.error()})};let A=1,w=r(!1);const D=r([]),j=P=>{w.value||ge({id:l.value.id,sort_strategy:"newest",page:A,page_size:Z}).then(S=>{P!==null&&(R=P),S.list.length0&&(A===1?D.value=S.list:D.value.push(...S.list),y.value=D.value),R.loaded(),h.value=!1}).catch(S=>{h.value=!1,R.error()})},B=P=>{k.value<1||(y.value.length===0&&(h.value=!0),L.value==="default"?(y.value=f.value,$(P)):(y.value=D.value,j(P)),h.value=!1)},F=()=>{b=1,t.value=!1,f.value=[],A=1,w.value=!1,D.value=[],B(R)};return ve(()=>{v()}),Re(k,()=>{k.value>0&&N.name==="post"&&v()}),(P,S)=>{const K=Pt,s=Vs,d=gt,H=yt,J=kt,Y=wt,p=bt,g=Ps,C=Tt,x=fs,O=Ie,E=ht;return o(),u("div",null,[e(K,{title:"泡泡详情",back:!0}),e(E,{class:"main-content-wrap",bordered:""},{default:n(()=>[e(J,null,{default:n(()=>[e(H,{show:_.value},{default:n(()=>[l.value.id>1?(o(),u("div",Fs,[e(s,{post:l.value,onReload:v},null,8,["post"])])):(o(),u("div",Ys,[e(d,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),u("div",Ks,[e(p,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":I},{prefix:n(()=>[Js]),default:n(()=>[e(Y,{name:"default",tab:"默认"}),e(Y,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(o(),U(J,{key:1},{default:n(()=>[e(g,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(o(),u("div",Qs,[h.value?(o(),u("div",Gs,[e(C,{num:5})])):(o(),u("div",Ws,[y.value.length===0?(o(),u("div",Zs,[e(d,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(o(!0),u(ae,null,le(y.value,Q=>(o(),U(J,{key:Q.id},{default:n(()=>[e(x,{comment:Q,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=Z?(o(),U(O,{key:3,justify:"center"},{default:n(()=>[e(a(Rt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:n(()=>[c.value&&t.value?(o(),u("span",Xs)):i("",!0),!c.value&&a(w)?(o(),u("span",eo)):i("",!0),c.value&&!t.value?(o(),u("span",to,"加载评论")):i("",!0),!c.value&&!a(w)?(o(),u("span",so,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const qo=ee(oo,[["__scopeId","data-v-0d01659f"]]);export{qo as default}; diff --git a/web/dist/assets/Post-42da50a2.js b/web/dist/assets/Post-42da50a2.js new file mode 100644 index 00000000..5a94e9ea --- /dev/null +++ b/web/dist/assets/Post-42da50a2.js @@ -0,0 +1 @@ +import{d as G,r,a2 as me,o,c as u,a as m,U as e,a0 as n,e as T,L as z,P as U,N as i,Z as a,a1 as V,n as ne,a6 as Pe,F as ae,a3 as le,j as ve,V as ye,W as ke,w as Re}from"./@vue-d002002f.js";import{u as X}from"./vuex-4d2f7b35.js";import{f as ie}from"./formatTime-000dbebb.js";import{t as Se,d as Le,e as Ae,_ as ee,f as De,h as Me,i as qe,j as Ne,g as Oe,k as je,l as Be,m as Ee,n as Ve,o as He,s as Fe,v as Ye,p as Ke,q as Je,r as Qe,u as ge}from"./index-ff680598.js";import{Y as ue,V as W}from"./IEnum-a180d93e.js";import{T as we,e as ce,f as be,g as re,h as $e,I as Ge,i as We,j as Ze,k as Xe,l as et,m as tt,n as st,o as ot}from"./@vicons-4022100b.js";import{j as te,e as se,J as Ce,K as nt,b as at,L as lt,o as fe,M as xe,v as it,w as ut,x as ct,y as rt,z as _t,B as pt,O as dt,P as mt,i as vt,Q as ft,a as Ie,F as ht,I as gt,k as yt,H as kt,f as wt,g as bt}from"./naive-ui-d02aa0d7.js";import{p as he,_ as Te,a as $t,b as Ct,c as xt}from"./content-d4af862e.js";import{u as ze,b as It}from"./vue-router-29e6667f.js";import{_ as Tt}from"./post-skeleton-af959eab.js";import{l as zt}from"./lodash-94eb5868.js";import{a as Ut}from"./copy-to-clipboard-1dd3075d.js";import{_ as Pt}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{K as Rt}from"./v3-infinite-loading-58f64a4e.js";import"./moment-b7869f98.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-d47e9bf6.js";import"./toggle-selection-93f4ad84.js";const St={class:"reply-item"},Lt={class:"header-wrap"},At={class:"username"},Dt={class:"reply-name"},Mt={class:"timestamp"},qt={class:"base-wrap"},Nt={class:"content"},Ot={class:"reply-switch"},jt={class:"time-item"},Bt={class:"actions"},Et={class:"upvote-count"},Vt=["onClick"],Ht={class:"upvote-count"},Ft={key:2,class:"action-item"},Yt=["onClick"],Kt=G({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(M,{emit:N}){const l=M,_=X(),h=r(l.reply.is_thumbs_up==ue.YES),y=r(l.reply.is_thumbs_down==ue.YES),k=r(l.reply.thumbs_up_count),L=()=>{Se({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{h.value=!h.value,h.value?(k.value++,y.value=!1):k.value--}).catch(v=>{console.log(v)})},c=()=>{Le({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(v=>{y.value=!y.value,y.value&&h.value&&(k.value--,h.value=!1)}).catch(v=>{console.log(v)})},R=()=>{N("focusReply",l.reply)},I=()=>{Ae({id:l.reply.id}).then(v=>{window.$message.success("删除成功"),setTimeout(()=>{N("reload")},50)}).catch(v=>{console.log(v)})};return(v,b)=>{const t=me("router-link"),f=te,$=se,A=Ce,w=nt;return o(),u("div",St,[m("div",Lt,[m("div",At,[e(t,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:n(()=>[T(z(l.reply.user.username),1)]),_:1},8,["to"]),m("span",Dt,z(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),U(t,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:n(()=>[T(z(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),m("div",Mt,[T(z(l.reply.ip_loc)+" ",1),a(_).state.userInfo.is_admin||a(_).state.userInfo.id===l.reply.user.id?(o(),U(A,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:I},{trigger:n(()=>[e($,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[e(f,null,{default:n(()=>[e(a(we))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):i("",!0)])]),m("div",qt,[m("div",Nt,[e(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(z(l.reply.content),1)]),_:1})]),m("div",Ot,[m("span",jt,z(a(ie)(l.reply.created_on)),1),m("div",Bt,[a(_).state.userLogined?i("",!0):(o(),u("div",{key:0,class:"action-item",onClick:b[0]||(b[0]=V(()=>{},["stop"]))},[e(f,{size:"medium"},{default:n(()=>[e(a(ce))]),_:1}),m("span",Et,z(k.value),1)])),a(_).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:V(L,["stop"])},[e(f,{size:"medium"},{default:n(()=>[h.value?i("",!0):(o(),U(a(ce),{key:0})),h.value?(o(),U(a(be),{key:1,class:"show"})):i("",!0)]),_:1}),m("span",Ht,z(k.value>0?k.value:"赞"),1)],8,Vt)):i("",!0),a(_).state.userLogined?i("",!0):(o(),u("div",Ft,[e(f,{size:"medium"},{default:n(()=>[e(a(re))]),_:1})])),a(_).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:V(c,["stop"])},[e(f,{size:"medium"},{default:n(()=>[y.value?i("",!0):(o(),U(a(re),{key:0})),y.value?(o(),U(a($e),{key:1,class:"show"})):i("",!0)]),_:1})],8,Yt)):i("",!0),a(_).state.userLogined?(o(),u("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):i("",!0)])])])])}}});const Jt=ee(Kt,[["__scopeId","data-v-0fa8b923"]]),Qt={class:"reply-compose-wrap"},Gt={class:"reply-switch"},Wt={class:"time-item"},Zt={class:"actions"},Xt={key:0,class:"action-item"},es={class:"upvote-count"},ts=["onClick"],ss={class:"upvote-count"},os={key:2,class:"action-item"},ns=["onClick"],as={key:0,class:"reply-input-wrap"},ls=G({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(M,{expose:N,emit:l}){const _=M,h=X(),y=r(),k=r(!1),L=r(""),c=r(!1),R=+"300",I=r(_.comment.is_thumbs_up==ue.YES),v=r(_.comment.is_thumbs_down==ue.YES),b=r(_.comment.thumbs_up_count),t=()=>{De({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(w=>{I.value=!I.value,I.value?(b.value++,v.value=!1):b.value--}).catch(w=>{console.log(w)})},f=()=>{Me({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(w=>{v.value=!v.value,v.value&&I.value&&(b.value--,I.value=!1)}).catch(w=>{console.log(w)})},$=w=>{k.value=w,w?setTimeout(()=>{var D;(D=y.value)==null||D.focus()},10):(c.value=!1,L.value="",l("reset"))},A=()=>{c.value=!0,qe({comment_id:_.comment.id,at_user_id:_.atUserid,content:L.value}).then(w=>{$(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{c.value=!1})};return N({switchReply:$}),(w,D)=>{const j=te,B=at,F=se,P=lt;return o(),u("div",Qt,[m("div",Gt,[m("span",Wt,z(a(ie)(w.comment.created_on)),1),m("div",Zt,[a(h).state.userLogined?i("",!0):(o(),u("div",Xt,[e(j,{size:"medium"},{default:n(()=>[e(a(ce))]),_:1}),m("span",es,z(b.value),1)])),a(h).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:V(t,["stop"])},[e(j,{size:"medium"},{default:n(()=>[I.value?i("",!0):(o(),U(a(ce),{key:0})),I.value?(o(),U(a(be),{key:1,class:"show"})):i("",!0)]),_:1}),m("span",ss,z(b.value>0?b.value:"赞"),1)],8,ts)):i("",!0),a(h).state.userLogined?i("",!0):(o(),u("div",os,[e(j,{size:"medium"},{default:n(()=>[e(a(re))]),_:1})])),a(h).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:V(f,["stop"])},[e(j,{size:"medium"},{default:n(()=>[v.value?i("",!0):(o(),U(a(re),{key:0})),v.value?(o(),U(a($e),{key:1,class:"show"})):i("",!0)]),_:1})],8,ns)):i("",!0),a(h).state.userLogined&&!k.value?(o(),u("span",{key:4,class:"show reply-btn",onClick:D[0]||(D[0]=S=>$(!0))}," 回复 ")):i("",!0),a(h).state.userLogined&&k.value?(o(),u("span",{key:5,class:"hide reply-btn",onClick:D[1]||(D[1]=S=>$(!1))}," 取消 ")):i("",!0)])]),k.value?(o(),u("div",as,[e(P,null,{default:n(()=>[e(B,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:_.atUsername?"@"+_.atUsername:"请输入回复内容..",maxlength:a(R),value:L.value,"onUpdate:value":D[2]||(D[2]=S=>L.value=S),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),e(F,{type:"primary",size:"small",ghost:"",loading:c.value,onClick:A},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const is=ee(ls,[["__scopeId","data-v-f9af7a93"]]),us={class:"comment-item"},cs={class:"nickname-wrap"},rs={class:"username-wrap"},_s={class:"opt-wrap"},ps={class:"timestamp"},ds=["innerHTML"],ms={class:"reply-wrap"},vs=G({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(M,{emit:N}){const l=M,_=X(),h=ze(),y=r(0),k=r(""),L=r(),c=ne(()=>{let f=Object.assign({texts:[],imgs:[]},l.comment);return f.contents.map($=>{(+$.type==1||+$.type==2)&&f.texts.push($),+$.type==3&&f.imgs.push($)}),f}),R=(f,$)=>{let A=f.target;if(A.dataset.detail){const w=A.dataset.detail.split(":");w.length===2&&(_.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):h.push({name:"user",query:{username:w[1]}}))}},I=f=>{var $,A;y.value=f.user_id,k.value=(($=f.user)==null?void 0:$.username)||"",(A=L.value)==null||A.switchReply(!0)},v=()=>{N("reload")},b=()=>{y.value=0,k.value=""},t=()=>{Ne({id:c.value.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{v()},50)}).catch(f=>{})};return(f,$)=>{const A=fe,w=me("router-link"),D=te,j=se,B=Ce,F=Te,P=is,S=Jt,K=xe;return o(),u("div",us,[e(K,{"content-indented":""},Pe({avatar:n(()=>[e(A,{round:"",size:30,src:c.value.user.avatar},null,8,["src"])]),header:n(()=>[m("span",cs,[e(w,{onClick:$[0]||($[0]=V(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:c.value.user.username}}},{default:n(()=>[T(z(c.value.user.nickname),1)]),_:1},8,["to"])]),m("span",rs," @"+z(c.value.user.username),1)]),"header-extra":n(()=>[m("div",_s,[m("span",ps,z(c.value.ip_loc),1),a(_).state.userInfo.is_admin||a(_).state.userInfo.id===c.value.user.id?(o(),U(B,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:t},{trigger:n(()=>[e(j,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[e(D,null,{default:n(()=>[e(a(we))]),_:1})]),_:1})]),default:n(()=>[T(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:n(()=>[c.value.imgs.length>0?(o(),U(F,{key:0,imgs:c.value.imgs},null,8,["imgs"])):i("",!0),e(P,{ref_key:"replyComposeRef",ref:L,comment:c.value,"at-userid":y.value,"at-username":k.value,onReload:v,onReset:b},null,8,["comment","at-userid","at-username"]),m("div",ms,[(o(!0),u(ae,null,le(c.value.replies,s=>(o(),U(S,{key:s.id,reply:s,"tweet-id":c.value.post_id,onFocusReply:I,onReload:v},null,8,["reply","tweet-id"]))),128))])]),_:2},[c.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),u(ae,null,le(c.value.texts,s=>(o(),u("span",{key:s.id,class:"comment-text",onClick:$[1]||($[1]=V(d=>R(d,c.value.id),["stop"])),innerHTML:a(he)(s.content).content},null,8,ds))),128))]),key:"0"}:void 0]),1024)])}}});const fs=ee(vs,[["__scopeId","data-v-e5cb084f"]]),hs=M=>(ye("data-v-634e6bfd"),M=M(),ke(),M),gs={key:0,class:"compose-wrap"},ys={class:"compose-line"},ks={class:"compose-user"},ws={class:"compose-line compose-options"},bs={class:"attachment"},$s={class:"submit-wrap"},Cs={class:"attachment-list-wrap"},xs={key:1,class:"compose-wrap"},Is=hs(()=>m("div",{class:"login-wrap"},[m("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Ts={key:0,class:"login-only-wrap"},zs={key:1,class:"login-wrap"},Us=G({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(M,{emit:N}){const l=M,_=X(),h=r([]),y=r(!1),k=r(!1),L=r(!1),c=r(""),R=r(),I=r("public/image"),v=r([]),b=r([]),t=r("true".toLowerCase()==="true"),f=+"300",$="/v1/attachment",A=r(),w=zt.debounce(p=>{Oe({k:p}).then(g=>{let C=[];g.suggest.map(x=>{C.push({label:x,value:x})}),h.value=C,k.value=!1}).catch(g=>{k.value=!1})},200),D=(p,g)=>{k.value||(k.value=!0,g==="@"&&w(p))},j=p=>{p.length>f?c.value=p.substring(0,f):c.value=p},B=p=>{I.value=p},F=p=>{for(let O=0;O30&&(p[O].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+x)}v.value=p},P=async p=>{var g,C;return I.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((g=p.file.file)==null?void 0:g.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):I.value==="image"&&((C=p.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},S=({file:p,event:g})=>{var C;try{let x=JSON.parse((C=g.target)==null?void 0:C.response);x.code===0&&I.value==="public/image"&&b.value.push({id:p.id,content:x.data.content})}catch{window.$message.error("上传失败")}},K=({file:p,event:g})=>{var C;try{let x=JSON.parse((C=g.target)==null?void 0:C.response);if(x.code!==0){let O=x.msg||"上传失败";x.details&&x.details.length>0&&x.details.map(E=>{O+=":"+E}),window.$message.error(O)}}catch{window.$message.error("上传失败")}},s=({file:p})=>{let g=b.value.findIndex(C=>C.id===p.id);g>-1&&b.value.splice(g,1)},d=()=>{y.value=!0},H=()=>{var p;y.value=!1,(p=R.value)==null||p.clear(),v.value=[],c.value="",b.value=[]},J=()=>{if(c.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:p}=he(c.value);const g=[];let C=100;g.push({content:c.value,type:2,sort:C}),b.value.map(x=>{C++,g.push({content:x.content,type:3,sort:C})}),L.value=!0,je({contents:g,post_id:l.postId,users:Array.from(new Set(p))}).then(x=>{window.$message.success("发布成功"),L.value=!1,N("post-success"),H()}).catch(x=>{L.value=!1})},Y=p=>{_.commit("triggerAuth",!0),_.commit("triggerAuthKey",p)};return ve(()=>{A.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(p,g)=>{const C=fe,x=it,O=te,E=se,Q=ut,_e=ct,oe=rt,pe=_t,de=pt;return o(),u("div",null,[a(_).state.userInfo.id>0?(o(),u("div",gs,[m("div",ys,[m("div",ks,[e(C,{round:"",size:30,src:a(_).state.userInfo.avatar},null,8,["src"])]),e(x,{type:"textarea",size:"large",autosize:"",bordered:!1,options:h.value,prefix:["@"],loading:k.value,value:c.value,disabled:l.lock===1,"onUpdate:value":j,onSearch:D,onFocus:d,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(o(),U(de,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:$,headers:{Authorization:A.value},data:{type:I.value},"file-list":v.value,onBeforeUpload:P,onFinish:S,onError:K,onRemove:s,"onUpdate:fileList":F},{default:n(()=>[m("div",ws,[m("div",bs,[e(Q,{abstract:""},{default:n(({handleClick:q})=>[e(E,{disabled:v.value.length>0&&I.value==="public/video"||v.value.length===9,onClick:()=>{B("public/image"),q()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[e(O,{size:"20",color:"var(--primary-color)"},{default:n(()=>[e(a(Ge))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),e(oe,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[e(_e,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:c.value.length/a(f)*100},null,8,["percentage"])]),default:n(()=>[T(" "+z(c.value.length)+" / "+z(a(f)),1)]),_:1})]),m("div",$s,[e(E,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:H},{default:n(()=>[T(" 取消 ")]),_:1}),e(E,{loading:L.value,onClick:J,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),m("div",Cs,[e(pe)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(o(),u("div",xs,[Is,t.value?i("",!0):(o(),u("div",Ts,[e(E,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=q=>Y("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),t.value?(o(),u("div",zs,[e(E,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=q=>Y("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),e(E,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=q=>Y("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):i("",!0)]))])}}});const Ps=ee(Us,[["__scopeId","data-v-634e6bfd"]]),Rs={class:"username-wrap"},Ss={key:0,class:"options"},Ls={key:0},As=["innerHTML"],Ds={class:"timestamp"},Ms={key:0},qs={key:1},Ns={class:"opts-wrap"},Os=["onClick"],js={class:"opt-item"},Bs=["onClick"],Es=["onClick"],Vs=G({__name:"post-detail",props:{post:{}},emits:["reload"],setup(M,{emit:N}){const l=M,_=X(),h=ze(),y=r(!1),k=r(!1),L=r(!1),c=r(!1),R=r(!1),I=r(!1),v=r(!1),b=r(W.PUBLIC),t=ne({get:()=>{let s=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return s.contents.map(d=>{(+d.type==1||+d.type==2)&&s.texts.push(d),+d.type==3&&s.imgs.push(d),+d.type==4&&s.videos.push(d),+d.type==6&&s.links.push(d),+d.type==7&&s.attachments.push(d),+d.type==8&&s.charge_attachments.push(d)}),s},set:s=>{l.post.upvote_count=s.upvote_count,l.post.comment_count=s.comment_count,l.post.collection_count=s.collection_count}}),f=ne(()=>{let s=[{label:"删除",key:"delete"}];return t.value.is_lock===0?s.push({label:"锁定",key:"lock"}):s.push({label:"解锁",key:"unlock"}),_.state.userInfo.is_admin&&(t.value.is_top===0?s.push({label:"置顶",key:"stick"}):s.push({label:"取消置顶",key:"unstick"})),t.value.visibility===W.PUBLIC?s.push({label:"公开",key:"vpublic",children:[{label:"私密",key:"vprivate"},{label:"好友可见",key:"vfriend"}]}):t.value.visibility===W.PRIVATE?s.push({label:"私密",key:"vprivate",children:[{label:"公开",key:"vpublic"},{label:"好友可见",key:"vfriend"}]}):s.push({label:"好友可见",key:"vfriend",children:[{label:"公开",key:"vpublic"},{label:"私密",key:"vprivate"}]}),s}),$=s=>{h.push({name:"post",query:{id:s}})},A=(s,d)=>{if(s.target.dataset.detail){const H=s.target.dataset.detail.split(":");if(H.length===2){_.commit("refresh"),H[0]==="tag"?h.push({name:"home",query:{q:H[1],t:"tag"}}):h.push({name:"user",query:{username:H[1]}});return}}$(d)},w=s=>{switch(s){case"delete":L.value=!0;break;case"lock":case"unlock":c.value=!0;break;case"stick":case"unstick":R.value=!0;break;case"vpublic":b.value=0,I.value=!0;break;case"vprivate":b.value=1,I.value=!0;break;case"vfriend":b.value=2,I.value=!0;break}},D=()=>{Ve({id:t.value.id}).then(s=>{window.$message.success("删除成功"),h.replace("/"),setTimeout(()=>{_.commit("refresh")},50)}).catch(s=>{v.value=!1})},j=()=>{He({id:t.value.id}).then(s=>{N("reload"),s.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(s=>{v.value=!1})},B=()=>{Fe({id:t.value.id}).then(s=>{N("reload"),s.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(s=>{v.value=!1})},F=()=>{Ye({id:t.value.id,visibility:b.value}).then(s=>{N("reload"),window.$message.success("修改可见性成功")}).catch(s=>{v.value=!1})},P=()=>{Ke({id:t.value.id}).then(s=>{y.value=s.status,s.status?t.value={...t.value,upvote_count:t.value.upvote_count+1}:t.value={...t.value,upvote_count:t.value.upvote_count-1}}).catch(s=>{console.log(s)})},S=()=>{Je({id:t.value.id}).then(s=>{k.value=s.status,s.status?t.value={...t.value,collection_count:t.value.collection_count+1}:t.value={...t.value,collection_count:t.value.collection_count-1}}).catch(s=>{console.log(s)})},K=()=>{Ut(`${window.location.origin}/#/post?id=${t.value.id}`),window.$message.success("链接已复制到剪贴板")};return ve(()=>{_.state.userInfo.id>0&&(Be({id:t.value.id}).then(s=>{y.value=s.status}).catch(s=>{console.log(s)}),Ee({id:t.value.id}).then(s=>{k.value=s.status}).catch(s=>{console.log(s)}))}),(s,d)=>{const H=fe,J=me("router-link"),Y=dt,p=te,g=se,C=mt,x=vt,O=$t,E=Te,Q=Ct,_e=xt,oe=ft,pe=Ie,de=xe;return o(),u("div",{class:"detail-item",onClick:d[6]||(d[6]=q=>$(t.value.id))},[e(de,null,{avatar:n(()=>[e(H,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:n(()=>[e(J,{onClick:d[0]||(d[0]=V(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t.value.user.username}}},{default:n(()=>[T(z(t.value.user.nickname),1)]),_:1},8,["to"]),m("span",Rs," @"+z(t.value.user.username),1),t.value.is_top?(o(),U(Y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):i("",!0),t.value.visibility==a(W).PRIVATE?(o(),U(Y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):i("",!0),t.value.visibility==a(W).FRIEND?(o(),U(Y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[a(_).state.userInfo.is_admin||a(_).state.userInfo.id===t.value.user.id?(o(),u("div",Ss,[e(C,{placement:"bottom-end",trigger:"click",size:"small",options:f.value,onSelect:w},{default:n(()=>[e(g,{quaternary:"",circle:""},{icon:n(()=>[e(p,null,{default:n(()=>[e(a(We))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),e(x,{show:L.value,"onUpdate:show":d[1]||(d[1]=q=>L.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:D},null,8,["show"]),e(x,{show:c.value,"onUpdate:show":d[2]||(d[2]=q=>c.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(t.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:j},null,8,["show","content"]),e(x,{show:R.value,"onUpdate:show":d[3]||(d[3]=q=>R.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(t.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show","content"]),e(x,{show:I.value,"onUpdate:show":d[4]||(d[4]=q=>I.value=q),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(b.value==0?"公开":b.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show","content"])]),footer:n(()=>[e(O,{attachments:t.value.attachments},null,8,["attachments"]),e(O,{attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"]),e(E,{imgs:t.value.imgs},null,8,["imgs"]),e(Q,{videos:t.value.videos,full:!0},null,8,["videos"]),e(_e,{links:t.value.links},null,8,["links"]),m("div",Ds,[T(" 发布于 "+z(a(ie)(t.value.created_on))+" ",1),t.value.ip_loc?(o(),u("span",Ms,[e(oe,{vertical:""}),T(" "+z(t.value.ip_loc),1)])):i("",!0),!a(_).state.collapsedLeft&&t.value.created_on!=t.value.latest_replied_on?(o(),u("span",qs,[e(oe,{vertical:""}),T(" 最后回复 "+z(a(ie)(t.value.latest_replied_on)),1)])):i("",!0)])]),action:n(()=>[m("div",Ns,[e(pe,{justify:"space-between"},{default:n(()=>[m("div",{class:"opt-item hover",onClick:V(P,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[y.value?i("",!0):(o(),U(a(Ze),{key:0})),y.value?(o(),U(a(Xe),{key:1,color:"red"})):i("",!0)]),_:1}),T(" "+z(t.value.upvote_count),1)],8,Os),m("div",js,[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[e(a(et))]),_:1}),T(" "+z(t.value.comment_count),1)]),m("div",{class:"opt-item hover",onClick:V(S,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?i("",!0):(o(),U(a(tt),{key:0})),k.value?(o(),U(a(st),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),T(" "+z(t.value.collection_count),1)],8,Bs),m("div",{class:"opt-item hover",onClick:V(K,["stop"])},[e(p,{size:"20",class:"opt-item-icon"},{default:n(()=>[e(a(ot))]),_:1}),T(" "+z(t.value.share_count),1)],8,Es)]),_:1})])]),default:n(()=>[t.value.texts.length>0?(o(),u("div",Ls,[(o(!0),u(ae,null,le(t.value.texts,q=>(o(),u("span",{key:q.id,class:"post-text",onClick:d[5]||(d[5]=V(Ue=>A(Ue,t.value.id),["stop"])),innerHTML:a(he)(q.content).content},null,8,As))),128))])):i("",!0)]),_:1})])}}});const Hs=M=>(ye("data-v-0d01659f"),M=M(),ke(),M),Fs={key:0,class:"detail-wrap"},Ys={key:1,class:"empty-wrap"},Ks={key:0,class:"comment-opts-wrap"},Js=Hs(()=>m("span",{class:"comment-title-item"},"评论",-1)),Qs={key:2},Gs={key:0,class:"skeleton-wrap"},Ws={key:1},Zs={key:0,class:"empty-wrap"},Xs={key:0,class:"load-more-spinner"},eo={key:1,class:"load-more-spinner"},to={key:2,class:"load-more-spinner"},so={key:3,class:"load-more-spinner"},Z=20,oo=G({__name:"Post",setup(M){const N=It(),l=r({}),_=r(!1),h=r(!1),y=r([]),k=ne(()=>+N.query.id),L=r("default"),c=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const I=P=>{L.value=P,P==="default"&&(c.value=!0),B(R)},v=()=>{l.value={id:0},_.value=!0,Qe({id:k.value}).then(P=>{_.value=!1,l.value=P,B(R)}).catch(P=>{_.value=!1})};let b=1;const t=r(!1),f=r([]),$=P=>{t.value||ge({id:l.value.id,sort_strategy:"default",page:b,page_size:Z}).then(S=>{P!==null&&(R=P),S.list.length0&&(b===1?f.value=S.list:f.value.push(...S.list),y.value=f.value),R.loaded(),h.value=!1}).catch(S=>{h.value=!1,R.error()})};let A=1,w=r(!1);const D=r([]),j=P=>{w.value||ge({id:l.value.id,sort_strategy:"newest",page:A,page_size:Z}).then(S=>{P!==null&&(R=P),S.list.length0&&(A===1?D.value=S.list:D.value.push(...S.list),y.value=D.value),R.loaded(),h.value=!1}).catch(S=>{h.value=!1,R.error()})},B=P=>{k.value<1||(y.value.length===0&&(h.value=!0),L.value==="default"?(y.value=f.value,$(P)):(y.value=D.value,j(P)),h.value=!1)},F=()=>{b=1,t.value=!1,f.value=[],A=1,w.value=!1,D.value=[],B(R)};return ve(()=>{v()}),Re(k,()=>{k.value>0&&N.name==="post"&&v()}),(P,S)=>{const K=Pt,s=Vs,d=gt,H=yt,J=kt,Y=wt,p=bt,g=Ps,C=Tt,x=fs,O=Ie,E=ht;return o(),u("div",null,[e(K,{title:"泡泡详情",back:!0}),e(E,{class:"main-content-wrap",bordered:""},{default:n(()=>[e(J,null,{default:n(()=>[e(H,{show:_.value},{default:n(()=>[l.value.id>1?(o(),u("div",Fs,[e(s,{post:l.value,onReload:v},null,8,["post"])])):(o(),u("div",Ys,[e(d,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),u("div",Ks,[e(p,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":I},{prefix:n(()=>[Js]),default:n(()=>[e(Y,{name:"default",tab:"默认"}),e(Y,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(o(),U(J,{key:1},{default:n(()=>[e(g,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:F},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(o(),u("div",Qs,[h.value?(o(),u("div",Gs,[e(C,{num:5})])):(o(),u("div",Ws,[y.value.length===0?(o(),u("div",Zs,[e(d,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(o(!0),u(ae,null,le(y.value,Q=>(o(),U(J,{key:Q.id},{default:n(()=>[e(x,{comment:Q,onReload:F},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=Z?(o(),U(O,{key:3,justify:"center"},{default:n(()=>[e(a(Rt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:n(()=>[c.value&&t.value?(o(),u("span",Xs)):i("",!0),!c.value&&a(w)?(o(),u("span",eo)):i("",!0),c.value&&!t.value?(o(),u("span",to,"加载评论")):i("",!0),!c.value&&!a(w)?(o(),u("span",so,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const qo=ee(oo,[["__scopeId","data-v-0d01659f"]]);export{qo as default}; diff --git a/web/dist/assets/Profile-536bb0b1.js b/web/dist/assets/Profile-8f57060d.js similarity index 91% rename from web/dist/assets/Profile-536bb0b1.js rename to web/dist/assets/Profile-8f57060d.js index b9a9ed0c..96ea1a67 100644 --- a/web/dist/assets/Profile-536bb0b1.js +++ b/web/dist/assets/Profile-8f57060d.js @@ -1 +1 @@ -import{_ as M,a as V}from"./post-item.vue_vue_type_style_index_0_lang-bc760886.js";import{_ as D}from"./post-skeleton-49f18127.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as R}from"./vuex-4d2f7b35.js";import{b as j}from"./vue-router-29e6667f.js";import{A as q,_ as A}from"./index-5fa3c6e0.js";import{d as E,r,j as G,c as e,U as o,Z as n,P as f,a0 as c,N as v,o as t,a,L as g,F as y,a3 as w}from"./@vue-d002002f.js";import{F as H,G as T,o as Z,f as J,g as K,I as O,H as Q}from"./naive-ui-d02aa0d7.js";import"./content-1ad34d0c.js";import"./@vicons-4022100b.js";import"./paopao-video-player-d47e9bf6.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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"},Y={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=Z,z=J,B=K,N=D,S=O,U=M,k=Q,$=V,C=H,F=T;return t(),e("div",null,[o(P,{title:"主页"}),n(s).state.userInfo.id>0?(t(),f(C,{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",Y,[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(B,{class:"profile-tabs-wrap",animated:""},{default:c(()=>[o(z,{name:"post",tab:"泡泡"})]),_:1}),p.value?(t(),e("div",ot,[o(N,{num:m.value},null,8,["num"])])):(t(),e("div",st,[l.value.length===0?(t(),e("div",nt,[o(S,{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(U,{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($,{post:i},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):v("",!0),d.value>0?(t(),e("div",it,[o(F,{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}; +import{_ as M,a as V}from"./post-item.vue_vue_type_style_index_0_lang-7c874df8.js";import{_ as D}from"./post-skeleton-af959eab.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as R}from"./vuex-4d2f7b35.js";import{b as j}from"./vue-router-29e6667f.js";import{A as q,_ as A}from"./index-ff680598.js";import{d as E,r,j as G,c as e,U as o,Z as n,P as f,a0 as c,N as v,o as t,a,L as g,F as y,a3 as w}from"./@vue-d002002f.js";import{F as H,G as T,o as Z,f as J,g as K,I as O,H as Q}from"./naive-ui-d02aa0d7.js";import"./content-d4af862e.js";import"./@vicons-4022100b.js";import"./paopao-video-player-d47e9bf6.js";import"./formatTime-000dbebb.js";import"./moment-b7869f98.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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"},Y={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=Z,z=J,B=K,N=D,S=O,U=M,k=Q,$=V,C=H,F=T;return t(),e("div",null,[o(P,{title:"主页"}),n(s).state.userInfo.id>0?(t(),f(C,{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",Y,[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(B,{class:"profile-tabs-wrap",animated:""},{default:c(()=>[o(z,{name:"post",tab:"泡泡"})]),_:1}),p.value?(t(),e("div",ot,[o(N,{num:m.value},null,8,["num"])])):(t(),e("div",st,[l.value.length===0?(t(),e("div",nt,[o(S,{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(U,{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($,{post:i},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):v("",!0),d.value>0?(t(),e("div",it,[o(F,{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/Setting-275ddb43.js b/web/dist/assets/Setting-275ddb43.js new file mode 100644 index 00000000..f1b7eb63 --- /dev/null +++ b/web/dist/assets/Setting-275ddb43.js @@ -0,0 +1 @@ +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{d as ye,r as d,D as H,j as ke,c as g,U as t,a0 as s,P as b,N as _,o as r,a as m,Z as u,e as c,L as R,z as be,v as Ce,O as q,a1 as B,V as Ie,W as $e}from"./@vue-d002002f.js";import{u as Pe}from"./vuex-4d2f7b35.js";import{S as Q,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as Ne}from"./index-ff680598.js";import{x as ze}from"./@vicons-4022100b.js";import{h as xe,o as De,e as Ke,B as Fe,b as Ve,j as Te,S as je,$ as Le,L as Oe,a0 as Ee,a1 as We,d as Me}from"./naive-ui-d02aa0d7.js";import"./vue-router-29e6667f.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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),Ge={class:"base-line avatar"},Je={class:"base-line"},Xe=V(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},He=V(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={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"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),W=d(),M=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),J=d(),X=d(),Y=d(),a=H({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=H({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var K;window.$message.success("头像更新成功"),(K=W.value)==null||K.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=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=X.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&j()}))})},T=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Q().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=M.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=De,p=Ke,K=Fe,h=Ve,ge=Te,F=xe,Z=je,w=Le,he=Oe,L=Ee,O=We,E=Me;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:W,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Je,[Xe,C.value?_("",!0):(r(),g("div",Ye,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,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(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[He,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",Qe,[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(Z,{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(E,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(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(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:z.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(Z,{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(E,{ref_key:"activateFormRef",ref:J,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(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:x.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(E,{ref_key:"formRef",ref:X,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:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Setting-bb44f792.js b/web/dist/assets/Setting-bb44f792.js deleted file mode 100644 index 8699c772..00000000 --- a/web/dist/assets/Setting-bb44f792.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{d as ye,r as d,D as H,j as ke,c as g,U as t,a0 as s,P as b,N as _,o as r,a as m,Z as u,e as c,L as R,z as be,v as Ce,O as q,a1 as B,V as Ie,W as $e}from"./@vue-d002002f.js";import{u as Pe}from"./vuex-4d2f7b35.js";import{S as Q,T as Ue,U as Se,V as Re,W as qe,X as Be,Y as Ae,_ as Ne}from"./index-5fa3c6e0.js";import{x as ze}from"./@vicons-4022100b.js";import{h as xe,o as De,e as Ke,B as Fe,b as Ve,j as Te,S as je,$ as Le,L as Oe,a0 as Ee,a1 as We,d as Me}from"./naive-ui-d02aa0d7.js";import"./vue-router-29e6667f.js";import"./vooks-77bdadbd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./@css-render-6b6cdab1.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),Ge={class:"base-line avatar"},Je={class:"base-line"},Xe=V(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},He=V(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={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="https://iibiubiu.com/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),W=d(),M=d(),C=d(!1),D=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),J=d(),X=d(),Y=d(),a=H({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=H({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var K;window.$message.success("头像更新成功"),(K=W.value)==null||K.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=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=X.value)==null||e.validate(v=>{v||(D.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&j()}))})},T=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{Q().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=M.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=De,p=Ke,K=Fe,h=Ve,ge=Te,F=xe,Z=je,w=Le,he=Oe,L=Ee,O=We,E=Me;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:W,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Je,[Xe,C.value?_("",!0):(r(),g("div",Ye,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,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(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[He,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",Qe,[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(Z,{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(E,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(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(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:z.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(Z,{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(E,{ref_key:"activateFormRef",ref:J,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(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:x.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(E,{ref_key:"formRef",ref:X,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:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(O,{gutter:[0,24]},{default:s(()=>[t(L,{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:D.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Topic-09053135.js b/web/dist/assets/Topic-467e0970.js similarity index 97% rename from web/dist/assets/Topic-09053135.js rename to web/dist/assets/Topic-467e0970.js index c209869c..f718b473 100644 --- a/web/dist/assets/Topic-09053135.js +++ b/web/dist/assets/Topic-467e0970.js @@ -1 +1 @@ -import{w as F,x as M,y as O,z as U,_ as j}from"./index-5fa3c6e0.js";import{p as E}from"./@vicons-4022100b.js";import{d as $,r as i,n as q,j as A,a2 as P,o as c,c as _,U as n,a0 as s,P as b,e as B,L as f,N as u,Z as h,w as x,a6 as D,F as Z,a3 as G}from"./@vue-d002002f.js";import{o as H,O as C,j as J,e as K,P as Q,M as R,F as W,f as X,g as Y,a as ee,k as oe}from"./naive-ui-d02aa0d7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as ne}from"./vuex-4d2f7b35.js";import"./vue-router-29e6667f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=$({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=P("router-link"),g=H,k=C,a=J,d=K,v=Q,p=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(E))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=$({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);x(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,U({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=X,L=C,N=Y,V=ie,S=ee,z=oe,I=W;return c(),_("div",null,[n(v,{title:"话题"}),n(I,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(N,{type:"line",animated:"","onUpdate:value":k},D({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Z,null,G(r.value,y=>(c(),b(V,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ve=j(_e,[["__scopeId","data-v-15794a53"]]);export{Ve as default}; +import{w as F,x as M,y as O,z as U,_ as j}from"./index-ff680598.js";import{p as E}from"./@vicons-4022100b.js";import{d as $,r as i,n as q,j as A,a2 as P,o as c,c as _,U as n,a0 as s,P as b,e as B,L as f,N as u,Z as h,w as x,a6 as D,F as Z,a3 as G}from"./@vue-d002002f.js";import{o as H,O as C,j as J,e as K,P as Q,M as R,F as W,f as X,g as Y,a as ee,k as oe}from"./naive-ui-d02aa0d7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as ne}from"./vuex-4d2f7b35.js";import"./vue-router-29e6667f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=$({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=P("router-link"),g=H,k=C,a=J,d=K,v=Q,p=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(E))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=$({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);x(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,U({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=X,L=C,N=Y,V=ie,S=ee,z=oe,I=W;return c(),_("div",null,[n(v,{title:"话题"}),n(I,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(N,{type:"line",animated:"","onUpdate:value":k},D({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Z,null,G(r.value,y=>(c(),b(V,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ve=j(_e,[["__scopeId","data-v-15794a53"]]);export{Ve as default}; diff --git a/web/dist/assets/User-e96c5cea.js b/web/dist/assets/User-4141fab5.js similarity index 96% rename from web/dist/assets/User-e96c5cea.js rename to web/dist/assets/User-4141fab5.js index 0338efbe..fe2a67a0 100644 --- a/web/dist/assets/User-e96c5cea.js +++ b/web/dist/assets/User-4141fab5.js @@ -1 +1 @@ -import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-bc760886.js";import{_ as me}from"./post-skeleton-49f18127.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-5fa3c6e0.js";import{R as T,K 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,O as Fe,j as ze,P as Ie,k as Se,f as qe,g as Pe,I as We,H as Ce}from"./naive-ui-d02aa0d7.js";import{d as P,r as c,o,P as F,a0 as t,a as r,U as n,e as h,L as x,D as Be,n as Me,w as Re,j as Te,c as p,Z as b,N as U,F as M,a3 as R}from"./@vue-d002002f.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{u as De}from"./vuex-4d2f7b35.js";import{b as Ne}from"./vue-router-29e6667f.js";import{i as Ve}from"./@vicons-4022100b.js";import"./content-1ad34d0c.js";import"./paopao-video-player-d47e9bf6.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-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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"},je={class:"whisper-line"},Ee={class:"whisper-line send-wrap"},He=P({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(I,{emit:$}){const u=I,a=c(""),i=c(!1),e=()=>{$("success")},_=()=>{i.value=!0,he({user_id:u.user.id,content:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Le,[n(f,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h(x(l.user.nickname)+"@"+x(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",je,[n(g,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"200","show-count":""},null,8,["value"])]),r("div",Ee,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Oe=S(He,[["__scopeId","data-v-0cbfe47c"]]),Ge={class:"whisper-wrap"},Ke={class:"whisper-line"},Ze={class:"whisper-line send-wrap"},Je=P({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(I,{emit:$}){const u=I,a=c(""),i=c(!1),e=()=>{$("success")},_=()=>{i.value=!0,ve({user_id:u.user.id,greetings:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Ge,[n(f,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h(x(l.user.nickname)+"@"+x(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",Ke,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"120","show-count":""},null,8,["value"])]),r("div",Ze,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=S(Je,[["__scopeId","data-v-60be56a2"]]),Xe={key:0,class:"profile-baseinfo"},Ye={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},_s={key:2},cs={key:0,class:"pagination-wrap"},rs=P({__name:"User",setup(I){ke();const $=be(),u=De(),a=Ne(),i=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),_=c(!1),l=c(!1),d=c(!1),m=c([]),v=c(a.query.username||""),f=c(+a.query.p||1),g=c(20),w=c(0),y=()=>{i.value=!0,ge({username:v.value,page:f.value,page_size:g.value}).then(s=>{i.value=!1,m.value=s.list,w.value=Math.ceil(s.pager.total_rows/g.value),window.scrollTo(0,0)}).catch(s=>{i.value=!1})},k=()=>{_.value=!0,fe({username:v.value}).then(s=>{_.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,y()}).catch(s=>{_.value=!1,console.log(s)})},L=s=>{f.value=s,y()},j=()=>{l.value=!0},E=()=>{d.value=!0},H=()=>{l.value=!1},O=()=>{d.value=!1},G=Me(()=>{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}),K=s=>{switch(s){case"whisper":j();break;case"delete":Z();break;case"requesting":E();break;case"banned":case"deblocking":J();break}},Z=()=>{$.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,we({user_id:e.id}).then(s=>{_.value=!1,e.is_friend=!1,y()}).catch(s=>{_.value=!1,console.log(s)})}})},J=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{_.value=!1,k()}).catch(s=>{_.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(v.value=a.query.username||"",k())}),Te(()=>{k()}),(s,W)=>{const Q=Ae,X=Ue,C=Fe,Y=ze,ee=q,se=Ie,ne=Oe,te=Se,oe=qe,ae=Pe,le=me,ie=We,_e=pe,B=Ce,ce=de,re=xe,ue=$e;return o(),p("div",null,[n(Q,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:_.value},{default:t(()=>[e.id>0?(o(),p("div",Xe,[r("div",Ye,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),r("div",es,[r("div",ss,[r("strong",null,x(e.nickname),1),r("span",null," @"+x(e.username),1),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username&&e.is_friend?(o(),F(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):U("",!0),e.is_admin?(o(),F(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):U("",!0)]),r("div",ns,"UID. "+x(e.id),1)]),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username?(o(),p("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:G.value,onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(b(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):U("",!0)])):U("",!0),n(ne,{show:l.value,user:e,onSuccess:H},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ae,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(oe,{name:"post",tab:"泡泡"})]),_:1}),i.value?(o(),p("div",os,[n(le,{num:g.value},null,8,["num"])])):(o(),p("div",as,[m.value.length===0?(o(),p("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):U("",!0),b(u).state.desktopModelShow?(o(),p("div",is,[(o(!0),p(M,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(_e,{post:z},null,8,["post"])]),_:2},1024))),128))])):(o(),p("div",_s,[(o(!0),p(M,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(ce,{post:z},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(o(),p("div",cs,[n(ue,{page:f.value,"onUpdate:page":L,"page-slot":b(u).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):U("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default}; +import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-7c874df8.js";import{_ as me}from"./post-skeleton-af959eab.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-ff680598.js";import{R as T,K 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,O as Fe,j as ze,P as Ie,k as Se,f as qe,g as Pe,I as We,H as Ce}from"./naive-ui-d02aa0d7.js";import{d as P,r as c,o,P as F,a0 as t,a as r,U as n,e as h,L as x,D as Be,n as Me,w as Re,j as Te,c as p,Z as b,N as U,F as M,a3 as R}from"./@vue-d002002f.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{u as De}from"./vuex-4d2f7b35.js";import{b as Ne}from"./vue-router-29e6667f.js";import{i as Ve}from"./@vicons-4022100b.js";import"./content-d4af862e.js";import"./paopao-video-player-d47e9bf6.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-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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"},je={class:"whisper-line"},Ee={class:"whisper-line send-wrap"},He=P({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(I,{emit:$}){const u=I,a=c(""),i=c(!1),e=()=>{$("success")},_=()=>{i.value=!0,he({user_id:u.user.id,content:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Le,[n(f,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h(x(l.user.nickname)+"@"+x(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",je,[n(g,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"200","show-count":""},null,8,["value"])]),r("div",Ee,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Oe=S(He,[["__scopeId","data-v-0cbfe47c"]]),Ge={class:"whisper-wrap"},Ke={class:"whisper-line"},Ze={class:"whisper-line send-wrap"},Je=P({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(I,{emit:$}){const u=I,a=c(""),i=c(!1),e=()=>{$("success")},_=()=>{i.value=!0,ve({user_id:u.user.id,greetings:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Ge,[n(f,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h(x(l.user.nickname)+"@"+x(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",Ke,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"120","show-count":""},null,8,["value"])]),r("div",Ze,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Qe=S(Je,[["__scopeId","data-v-60be56a2"]]),Xe={key:0,class:"profile-baseinfo"},Ye={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},_s={key:2},cs={key:0,class:"pagination-wrap"},rs=P({__name:"User",setup(I){ke();const $=be(),u=De(),a=Ne(),i=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),_=c(!1),l=c(!1),d=c(!1),m=c([]),v=c(a.query.username||""),f=c(+a.query.p||1),g=c(20),w=c(0),y=()=>{i.value=!0,ge({username:v.value,page:f.value,page_size:g.value}).then(s=>{i.value=!1,m.value=s.list,w.value=Math.ceil(s.pager.total_rows/g.value),window.scrollTo(0,0)}).catch(s=>{i.value=!1})},k=()=>{_.value=!0,fe({username:v.value}).then(s=>{_.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,y()}).catch(s=>{_.value=!1,console.log(s)})},L=s=>{f.value=s,y()},j=()=>{l.value=!0},E=()=>{d.value=!0},H=()=>{l.value=!1},O=()=>{d.value=!1},G=Me(()=>{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}),K=s=>{switch(s){case"whisper":j();break;case"delete":Z();break;case"requesting":E();break;case"banned":case"deblocking":J();break}},Z=()=>{$.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,we({user_id:e.id}).then(s=>{_.value=!1,e.is_friend=!1,y()}).catch(s=>{_.value=!1,console.log(s)})}})},J=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{_.value=!1,k()}).catch(s=>{_.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(v.value=a.query.username||"",k())}),Te(()=>{k()}),(s,W)=>{const Q=Ae,X=Ue,C=Fe,Y=ze,ee=q,se=Ie,ne=Oe,te=Se,oe=qe,ae=Pe,le=me,ie=We,_e=pe,B=Ce,ce=de,re=xe,ue=$e;return o(),p("div",null,[n(Q,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:_.value},{default:t(()=>[e.id>0?(o(),p("div",Xe,[r("div",Ye,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),r("div",es,[r("div",ss,[r("strong",null,x(e.nickname),1),r("span",null," @"+x(e.username),1),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username&&e.is_friend?(o(),F(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):U("",!0),e.is_admin?(o(),F(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):U("",!0)]),r("div",ns,"UID. "+x(e.id),1)]),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username?(o(),p("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:G.value,onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Y,null,{default:t(()=>[n(b(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):U("",!0)])):U("",!0),n(ne,{show:l.value,user:e,onSuccess:H},null,8,["show","user"]),n(Qe,{show:d.value,user:e,onSuccess:O},null,8,["show","user"])]),_:1},8,["show"]),n(ae,{class:"profile-tabs-wrap",animated:""},{default:t(()=>[n(oe,{name:"post",tab:"泡泡"})]),_:1}),i.value?(o(),p("div",os,[n(le,{num:g.value},null,8,["num"])])):(o(),p("div",as,[m.value.length===0?(o(),p("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):U("",!0),b(u).state.desktopModelShow?(o(),p("div",is,[(o(!0),p(M,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(_e,{post:z},null,8,["post"])]),_:2},1024))),128))])):(o(),p("div",_s,[(o(!0),p(M,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(ce,{post:z},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(o(),p("div",cs,[n(ue,{page:f.value,"onUpdate:page":L,"page-slot":b(u).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):U("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default}; diff --git a/web/dist/assets/Wallet-6f8e141c.js b/web/dist/assets/Wallet-992dfbd0.js similarity index 96% rename from web/dist/assets/Wallet-6f8e141c.js rename to web/dist/assets/Wallet-992dfbd0.js index 1f1dd697..c92e5093 100644 --- a/web/dist/assets/Wallet-6f8e141c.js +++ b/web/dist/assets/Wallet-992dfbd0.js @@ -1 +1 @@ -import{_ as H}from"./post-skeleton-49f18127.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js";import{d as J,r as c,j as X,c as _,U as e,a0 as o,o as n,Z as y,N as w,a,e as k,F as N,a3 as P,z as ee,v as te,L as r,P as $,K as oe,a1 as ae,V as ne,W as se}from"./@vue-d002002f.js";import{u as le}from"./vuex-4d2f7b35.js";import{b as ce}from"./vue-router-29e6667f.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as de}from"./index-5fa3c6e0.js";import{a as me}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-4022100b.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-d02aa0d7.js";import"./vooks-77bdadbd.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-0232e3b9.js";import"./@css-render-6b6cdab1.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 q=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},Pe={key:0,class:"pagination-wrap"},$e={key:0,class:"skeleton-wrap"},qe={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Oe={class:"qrcode-wrap"},Te=q(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ue={class:"pay-tips"},Ve={class:"pay-sub-tips"},Ee=q(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),De=J({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.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},O=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},T=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Y,d=fe,U=ye,f=we,z=ke,V=be,E=H,D=xe,M=Re,j=ve,K=Ce,Q=Ie,Z=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Pe,[e(V,{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(U,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[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:T},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",$e,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",qe,[b.value.length===0?(n(),_("div",We,[e(D,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,P(b.value,t=>(n(),$(M,{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(me)(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(Z,{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),_(N,null,P(B.value,t=>(n(),$(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:O},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Oe,[Te,a("div",Ue," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Ve,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(De,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as H}from"./post-skeleton-af959eab.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-832b7340.js";import{d as J,r as c,j as X,c as _,U as e,a0 as o,o as n,Z as y,N as w,a,e as k,F as N,a3 as P,z as ee,v as te,L as r,P as $,K as oe,a1 as ae,V as ne,W as se}from"./@vue-d002002f.js";import{u as le}from"./vuex-4d2f7b35.js";import{b as ce}from"./vue-router-29e6667f.js";import{b as ie}from"./qrcode-bd5089a5.js";import{O as _e,P as re,Q as ue,R as pe,_ as de}from"./index-ff680598.js";import{a as me}from"./formatTime-000dbebb.js";import{w as ge}from"./@vicons-4022100b.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-d02aa0d7.js";import"./vooks-77bdadbd.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-0232e3b9.js";import"./@css-render-6b6cdab1.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 q=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},Pe={key:0,class:"pagination-wrap"},$e={key:0,class:"skeleton-wrap"},qe={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Oe={class:"qrcode-wrap"},Te=q(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ue={class:"pay-tips"},Ve={class:"pay-sub-tips"},Ee=q(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),De=J({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.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},O=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},T=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const S=Y,d=fe,U=ye,f=we,z=ke,V=be,E=H,D=xe,M=Re,j=ve,K=Ce,Q=Ie,Z=Se,G=he;return n(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(n(),_("div",Pe,[e(V,{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(U,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[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:T},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",$e,[e(E,{num:C.value},null,8,["num"])])):(n(),_("div",qe,[b.value.length===0?(n(),_("div",We,[e(D,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,P(b.value,t=>(n(),$(M,{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(me)(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(Z,{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),_(N,null,P(B.value,t=>(n(),$(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:O},{icon:o(()=>[e(K,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Oe,[Te,a("div",Ue," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Ve,[e(Q,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(De,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-1ad34d0c.js b/web/dist/assets/content-d4af862e.js similarity index 99% rename from web/dist/assets/content-1ad34d0c.js rename to web/dist/assets/content-d4af862e.js index c54520b8..76136341 100644 --- a/web/dist/assets/content-1ad34d0c.js +++ b/web/dist/assets/content-d4af862e.js @@ -1 +1 @@ -import{d as h,o as e,c as r,F as a,a3 as m,U as s,a0 as o,Z as c,a as C,a1 as k,L as I,P as d,N as g,r as j,e as D,s as b}from"./@vue-d002002f.js";import{u as L,v as V}from"./@vicons-4022100b.js";import{j as $,V as N,W as A,m as U,X as z,e as F,i as M}from"./naive-ui-d02aa0d7.js";import{_ as B,L as P,M as T}from"./index-5fa3c6e0.js";import{e as O}from"./paopao-video-player-d47e9bf6.js";const R={class:"link-wrap"},Z={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(L))]),_:1}),C("div",Z,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,I(n.content),1)],8,S)])]))),128))])}}});const ot=B(X,[["__scopeId","data-v-36eef76b"]]),q={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=A;return l.videos.length>0?(e(),r("div",q,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(O),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),G={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,_=N,f=A,w=z;return e(),r("div",G,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const H={class:"attachment-wrap"},J=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{T({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=F,i=M;return e(),r("div",H,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(K=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(V))]),_:1})]),default:o(()=>[D(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; +import{d as h,o as e,c as r,F as a,a3 as m,U as s,a0 as o,Z as c,a as C,a1 as k,L as I,P as d,N as g,r as j,e as D,s as b}from"./@vue-d002002f.js";import{u as L,v as V}from"./@vicons-4022100b.js";import{j as $,V as N,W as A,m as U,X as z,e as F,i as M}from"./naive-ui-d02aa0d7.js";import{_ as B,L as P,M as T}from"./index-ff680598.js";import{e as O}from"./paopao-video-player-d47e9bf6.js";const R={class:"link-wrap"},Z={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(L))]),_:1}),C("div",Z,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,I(n.content),1)],8,S)])]))),128))])}}});const ot=B(X,[["__scopeId","data-v-36eef76b"]]),q={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=A;return l.videos.length>0?(e(),r("div",q,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(O),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),G={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=U,_=N,f=A,w=z;return e(),r("div",G,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const H={class:"attachment-wrap"},J=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{T({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=F,i=M;return e(),r("div",H,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(K=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(V))]),_:1})]),default:o(()=>[D(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/index-5fa3c6e0.js b/web/dist/assets/index-5fa3c6e0.js deleted file mode 100644 index 83e951b8..00000000 --- a/web/dist/assets/index-5fa3c6e0.js +++ /dev/null @@ -1 +0,0 @@ -import{d as z,r as R,D as Z,j,o as v,P as D,a0 as a,a as k,U as o,c as T,e as S,O as q,a1 as N,N as U,Z as h,n as Q,w as H,a2 as ae,F as J,a3 as X,L as $,s as P,a4 as he,Q as Y,K as ge,a5 as fe}from"./@vue-d002002f.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-29e6667f.js";import{c as ke,u as B}from"./vuex-4d2f7b35.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ie,c as Oe,d as Ae,e as ce,f as Te,g as Re,h as de,i as Ce,j as F,k as Ee,u as Ie,l as $e,m as Se,n as Ue,o as Me,p as Ke,q as qe,r as Ne,s as De,t as xe}from"./naive-ui-d02aa0d7.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-4022100b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function l(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=l(i);fetch(i.href,n)}})();const Ge="modulepreload",Ze=function(e){return"/"+e},se={},A=function(t,l,c){if(!l||l.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Ze(n),n in se)return;se[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":Ge,m||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),m)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-20128b51.js"),["assets/Home-20128b51.js","assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js","assets/content-1ad34d0c.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-49f18127.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.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-1ec9984a.js"),["assets/Post-1ec9984a.js","assets/@vue-d002002f.js","assets/vuex-4d2f7b35.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-1ad34d0c.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vue-router-29e6667f.js","assets/post-skeleton-49f18127.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-7d0e0feb.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-58f64a4e.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-00695942.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-09053135.js"),["assets/Topic-09053135.js","assets/@vicons-4022100b.js","assets/@vue-d002002f.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-f2146181.js"),["assets/Anouncement-f2146181.js","assets/post-skeleton-49f18127.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/@vue-d002002f.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.js","assets/@vicons-4022100b.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-536bb0b1.js"),["assets/Profile-536bb0b1.js","assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js","assets/content-1ad34d0c.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-49f18127.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.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-e96c5cea.js"),["assets/User-e96c5cea.js","assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js","assets/content-1ad34d0c.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-49f18127.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.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-8bfe7f3b.js"),["assets/Messages-8bfe7f3b.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-7d0e0feb.js","assets/vuex-4d2f7b35.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-f0c6a1aa.js"),["assets/Collection-f0c6a1aa.js","assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js","assets/content-1ad34d0c.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-49f18127.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.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-ba6816c8.js"),["assets/Contacts-ba6816c8.js","assets/vue-router-29e6667f.js","assets/@vue-d002002f.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-49f18127.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/@vicons-4022100b.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-6f8e141c.js"),["assets/Wallet-6f8e141c.js","assets/post-skeleton-49f18127.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/@vue-d002002f.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.js","assets/@vicons-4022100b.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-bb44f792.js"),["assets/Setting-bb44f792.js","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/vooks-77bdadbd.js","assets/evtd-b614532e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/@css-render-6b6cdab1.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-3f4651e7.js"),["assets/404-3f4651e7.js","assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js","assets/vuex-4d2f7b35.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/vooks-77bdadbd.js","assets/evtd-b614532e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/@css-render-6b6cdab1.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:"https://iibiubiu.com",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}),Ye=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(),c=R(!1),i=R(),n=Z({username:"",password:""}),m=R(),d=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(L=>{L||(c.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("登录成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(L=>{L||(c.value=!0,Ye({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("注册成功"),c.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{c.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const L=Pe,p=Le,O=ue,r=ie,w=Oe,y=Ae,E=ce,x=Te,I=Re,K=de,V=Ce;return v(),D(V,{show:h(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>h(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?U("",!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:i,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(N(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(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),D(I,{key:1,"default-value":h(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[o(x,{name:"signin",tab:"登录"},{default:a(()=>[o(y,{ref_key:"loginRef",ref:i,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(N(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(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),o(x,{name:"signup",tab:"注册"},{default:a(()=>[o(y,{ref_key:"registerRef",ref:m,model:d,rules:M},{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(N(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(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),o(E,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[c,i]of t)l[c]=i;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}),Yt=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}),io=e=>s({method:"post",url:"/v1/post/visibility",data:e}),co=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"},it={class:"copyright"},ct=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),c=R(!1),i=R(""),n=B(),m=le(),d="2023 paopao.info",M="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",L=+"12",p=()=>{c.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,c.value=!1}).catch(y=>{c.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{m.push({name:"home",query:{q:i.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,I=ie,K=ae("router-link"),V=Ee,f=de,_e=ue;return h(n).state.collapsedRight?U("",!0):(v(),T("div",rt,[k("div",at,[o(I,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":E[0]||(E[0]=C=>i.value=C),onKeyup:q(N(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:h(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),w.value?(v(),D(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:c.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(" #"+$(C.tag),1)]),_:2},1032,["to"]),k("div",lt,$(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),o(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[o(V,{show:c.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(" #"+$(C.tag),1)]),_:2},1032,["to"]),k("div",ut,$(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),o(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",it,"© "+$(h(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:h(g),target:"_blank",class:"hash-link"},$(h(M)),9,ct),k("a",{href:h(_),target:"_blank",class:"hash-link"},$(h(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}),Io=e=>s({method:"post",url:"/v1/user/password",data:e}),$o=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}),Uo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Mo=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}),No=e=>s({method:"get",url:"/v1/user/posts",params:e}),Do=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(),c=le(),i=R(!1),n=R(l.name||""),m=R(),d=R("true".toLowerCase()==="true"),M=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?m.value||(re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)}),m.value=setInterval(()=>{re().then(r=>{i.value=r.count>0}).catch(r=>{console.log(r)})},M)):m.value&&clearInterval(m.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,_=r=>r.key==="messages"?P($e,{dot:!0,show:i.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,c.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=Ie(),(r,w)=>{const y=Se,E=Ue,x=Me,I=ce;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:h(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:g.value,"render-label":b,"render-icon":_,value:n.value,"onUpdate:value":u},null,8,["options","value"]),h(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{class:"user-avatar",round:"",size:34,src:h(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,$(h(t).state.userInfo.nickname),1),o(I,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(h(F),null,{default:a(()=>[o(h(oe))]),_:1})]),_:1})]),k("div",kt,"@"+$(h(t).state.userInfo.username),1)]),k("div",bt,[o(I,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(h(F),{size:24},{default:a(()=>[o(h(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?U("",!0):(v(),T("div",Lt,[o(I,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o(I,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o(I,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):U("",!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(c,i)=>{const n=At,m=ae("router-view"),d=mt,M=st,g=Ne,b=De,_=xe,u=Ke;return v(),D(u,{theme:l.value},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=l.value)==null?void 0:L.name)==="dark",mobile:!h(t).state.desktopModelShow}])},[k("div",Tt,[h(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):U("",!0),k("div",Ct,[o(m,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),D(he,null,[c.$route.meta.keepAlive?(v(),D(Y(p),{key:0})):U("",!0)],1024)),c.$route.meta.keepAlive?U("",!0):(v(),D(Y(p),{key:0}))]),_:1})]),o(d)]),o(M)],2)]}),_:1})]),_:1}),o(_)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{No as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Mo as I,Uo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,Do as P,xo as Q,Fo as R,bo as S,So as T,Io as U,Co as V,Eo as W,$o 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,co as f,Vo as g,po as h,fo as i,go as j,ho as k,Yt 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,io as v,wo as w,ko as x,yo as y,nt as z}; diff --git a/web/dist/assets/index-ff680598.js b/web/dist/assets/index-ff680598.js new file mode 100644 index 00000000..651fd42c --- /dev/null +++ b/web/dist/assets/index-ff680598.js @@ -0,0 +1 @@ +import{d as z,r as R,D as Z,j,o as v,P as D,a0 as a,a as k,U as o,c as T,e as S,O as q,a1 as N,N as U,Z as h,n as Q,w as H,a2 as ae,F as J,a3 as X,L as $,s as P,a4 as he,Q as Y,K as ge,a5 as fe}from"./@vue-d002002f.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-29e6667f.js";import{c as ke,u as B}from"./vuex-4d2f7b35.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 Ie,l as $e,m as Se,n as Ue,o as Me,p as Ke,q as qe,r as Ne,s as De,t as xe}from"./naive-ui-d02aa0d7.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-4022100b.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-0232e3b9.js";import"./evtd-b614532e.js";import"./@css-render-6b6cdab1.js";import"./vooks-77bdadbd.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 m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).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",Ze=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=Ze(n),n in se)return;se[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const _=c[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":Ge,m||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),m)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t())},Je=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-99db4d92.js"),["assets/Home-99db4d92.js","assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js","assets/content-d4af862e.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-af959eab.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.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-42da50a2.js"),["assets/Post-42da50a2.js","assets/@vue-d002002f.js","assets/vuex-4d2f7b35.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/IEnum-a180d93e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-d4af862e.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vue-router-29e6667f.js","assets/post-skeleton-af959eab.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-832b7340.js","assets/main-nav-3ef9bae6.css","assets/v3-infinite-loading-58f64a4e.js","assets/v3-infinite-loading-7d241236.css","assets/axios-4a70c6fc.js","assets/Post-00695942.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-467e0970.js"),["assets/Topic-467e0970.js","assets/@vicons-4022100b.js","assets/@vue-d002002f.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-832b7340.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-555d6b96.js"),["assets/Anouncement-555d6b96.js","assets/post-skeleton-af959eab.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/@vue-d002002f.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-832b7340.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.js","assets/@vicons-4022100b.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-8f57060d.js"),["assets/Profile-8f57060d.js","assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js","assets/content-d4af862e.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-af959eab.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.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-4141fab5.js"),["assets/User-4141fab5.js","assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js","assets/content-d4af862e.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-af959eab.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.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-d5995867.js"),["assets/Messages-d5995867.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/formatTime-000dbebb.js","assets/moment-b7869f98.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-832b7340.js","assets/vuex-4d2f7b35.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-004c869e.js"),["assets/Collection-004c869e.js","assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js","assets/content-d4af862e.js","assets/@vue-d002002f.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-d47e9bf6.js","assets/content-2fda112b.css","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.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-af959eab.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.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-b5d93513.js"),["assets/Contacts-b5d93513.js","assets/vue-router-29e6667f.js","assets/@vue-d002002f.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-af959eab.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js","assets/vuex-4d2f7b35.js","assets/@vicons-4022100b.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-992dfbd0.js"),["assets/Wallet-992dfbd0.js","assets/post-skeleton-af959eab.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/@vue-d002002f.js","assets/vueuc-0232e3b9.js","assets/evtd-b614532e.js","assets/@css-render-6b6cdab1.js","assets/vooks-77bdadbd.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-832b7340.js","assets/vuex-4d2f7b35.js","assets/vue-router-29e6667f.js","assets/@vicons-4022100b.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-275ddb43.js"),["assets/Setting-275ddb43.js","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js","assets/vuex-4d2f7b35.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/vooks-77bdadbd.js","assets/evtd-b614532e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/@css-render-6b6cdab1.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-7b417834.js"),["assets/404-7b417834.js","assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js","assets/vuex-4d2f7b35.js","assets/@vue-d002002f.js","assets/vue-router-29e6667f.js","assets/vooks-77bdadbd.js","assets/evtd-b614532e.js","assets/@vicons-4022100b.js","assets/naive-ui-d02aa0d7.js","assets/seemly-76b7b838.js","assets/vueuc-0232e3b9.js","assets/@css-render-6b6cdab1.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}),Ye=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=Z({username:"",password:""}),m=R(),d=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.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=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(L=>{L||(i.value=!0,Ye({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 _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,E=ie,x=Te,I=Re,K=de,V=Ce;return v(),D(V,{show:h(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>h(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?U("",!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(N(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(N(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(),D(I,{key:1,"default-value":h(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(N(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(N(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:m,model:d,rules:M},{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(N(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(N(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"])):U("",!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}),Yt=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(),m=le(),d="2023 paopao.info",M="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="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=()=>{m.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,I=ce,K=ae("router-link"),V=Ee,f=de,_e=ue;return h(n).state.collapsedRight?U("",!0):(v(),T("div",rt,[k("div",at,[o(I,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":E[0]||(E[0]=C=>c.value=C),onKeyup:q(N(r,["prevent"]),["enter"])},{prefix:a(()=>[o(x,{component:h(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),w.value?(v(),D(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(" #"+$(C.tag),1)]),_:2},1032,["to"]),k("div",lt,$(O(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!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(" #"+$(C.tag),1)]),_:2},1032,["to"]),k("div",ut,$(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,"© "+$(h(d)),1),k("div",null,[o(_e,null,{default:a(()=>[k("a",{href:h(g),target:"_blank",class:"hash-link"},$(h(M)),9,it),k("a",{href:h(_),target:"_blank",class:"hash-link"},$(h(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}),Io=e=>s({method:"post",url:"/v1/user/password",data:e}),$o=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}),Uo=e=>s({method:"get",url:"/v1/user/messages",params:e}),Mo=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}),No=e=>s({method:"get",url:"/v1/user/posts",params:e}),Do=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||""),m=R(),d=R("true".toLowerCase()==="true"),M=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?m.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),m.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},M)):m.value&&clearInterval(m.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,_=r=>r.key==="messages"?P($e,{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=Ie(),(r,w)=>{const y=Se,E=Ue,x=Me,I=ie;return v(),T("div",ht,[k("div",gt,[o(y,{class:"logo-img",width:"36",src:h(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),o(E,{accordion:!0,"icon-size":24,options:g.value,"render-label":b,"render-icon":_,value:n.value,"onUpdate:value":u},null,8,["options","value"]),h(t).state.userInfo.id>0?(v(),T("div",ft,[o(x,{class:"user-avatar",round:"",size:34,src:h(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,$(h(t).state.userInfo.nickname),1),o(I,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[o(h(F),null,{default:a(()=>[o(h(oe))]),_:1})]),_:1})]),k("div",kt,"@"+$(h(t).state.userInfo.username),1)]),k("div",bt,[o(I,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[o(h(F),{size:24},{default:a(()=>[o(h(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?U("",!0):(v(),T("div",Lt,[o(I,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[o(I,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),o(I,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):U("",!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,m=ae("router-view"),d=mt,M=st,g=Ne,b=De,_=xe,u=Ke;return v(),D(u,{theme:l.value},{default:a(()=>[o(b,null,{default:a(()=>[o(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=l.value)==null?void 0:L.name)==="dark",mobile:!h(t).state.desktopModelShow}])},[k("div",Tt,[h(t).state.desktopModelShow?(v(),T("div",Rt,[o(n)])):U("",!0),k("div",Ct,[o(m,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),D(he,null,[i.$route.meta.keepAlive?(v(),D(Y(p),{key:0})):U("",!0)],1024)),i.$route.meta.keepAlive?U("",!0):(v(),D(Y(p),{key:0}))]),_:1})]),o(d)]),o(M)],2)]}),_:1})]),_:1}),o(_)]),_:1},8,["theme"])}}});fe(Et).use(pe).use(Xe).mount("#app");export{No as A,Lo as B,Oo as C,qo as D,Ro as E,Ho as F,Ao as G,To as H,Mo as I,Uo as J,Ko as K,Bo as L,Wo as M,no as N,W as O,Do as P,xo as Q,Fo as R,bo as S,So as T,Io as U,Co as V,Eo as W,$o 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,Yt 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-7d0e0feb.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js index abf1d29d..265f82aa 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-7d0e0feb.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-832b7340.js @@ -1 +1 @@ -import{Z as B}from"./index-5fa3c6e0.js";import{u as E}from"./vuex-4d2f7b35.js";import{u as N}from"./vue-router-29e6667f.js";import{j as P}from"./vooks-77bdadbd.js";import{D as S,y as A,z as C,F as D}from"./@vicons-4022100b.js";import{a3 as R,a4 as I,j as V,e as j,a5 as x,h as F}from"./naive-ui-d02aa0d7.js";import{d as H,r as h,j as L,o as a,c as f,Z as o,U as e,a0 as t,N as c,a as U,P as _,e as q,L as Z,F as $}from"./@vue-d002002f.js";const G={key:0},J={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=N(),l=h(!1),k=h("left"),u=s=>{s?(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(P()==="dark")}),(s,d)=>{const y=B,b=R,O=I,r=V,p=j,M=x,T=F;return a(),f($,null,[o(n).state.drawerModelShow?(a(),f("div",G,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[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(()=>[U("div",J,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(S))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(A))]),_:1})]),_:1})):c("",!0),q(" "+Z(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(r,{component:o(C)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; +import{Z as B}from"./index-ff680598.js";import{u as E}from"./vuex-4d2f7b35.js";import{u as N}from"./vue-router-29e6667f.js";import{j as P}from"./vooks-77bdadbd.js";import{D as S,y as A,z as C,F as D}from"./@vicons-4022100b.js";import{a3 as R,a4 as I,j as V,e as j,a5 as x,h as F}from"./naive-ui-d02aa0d7.js";import{d as H,r as h,j as L,o as a,c as f,Z as o,U as e,a0 as t,N as c,a as U,P as _,e as q,L as Z,F as $}from"./@vue-d002002f.js";const G={key:0},J={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=N(),l=h(!1),k=h("left"),u=s=>{s?(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(P()==="dark")}),(s,d)=>{const y=B,b=R,O=I,r=V,p=j,M=x,T=F;return a(),f($,null,[o(n).state.drawerModelShow?(a(),f("div",G,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[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(()=>[U("div",J,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(S))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(A))]),_:1})]),_:1})):c("",!0),q(" "+Z(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(r,{component:o(C)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js index 95292e3a..ce950c43 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-bc760886.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-7c874df8.js @@ -1 +1 @@ -import{p as H,a as N,_ as B,b as D,c as S}from"./content-1ad34d0c.js";import{d as V,n as j,a2 as F,o as l,c as k,U as i,a6 as I,a0 as s,a as r,F as A,a3 as E,a1 as f,Z as d,e as _,L as m,P as c,N as p}from"./@vue-d002002f.js";import{u as R}from"./vuex-4d2f7b35.js";import{u as U}from"./vue-router-29e6667f.js";import{b as Z}from"./formatTime-000dbebb.js";import{a as ne}from"./copy-to-clipboard-1dd3075d.js";import{i as oe,j as G,l as J,m as K}from"./@vicons-4022100b.js";import{o as Q,O as W,j as X,e as ie,P as le,a as Y,M as ee}from"./naive-ui-d02aa0d7.js";const ue={class:"post-item"},re={class:"nickname-wrap"},ce={class:"username-wrap"},pe={class:"timestamp-mobile"},_e={class:"item-header-extra"},me=["innerHTML"],de={class:"opt-item"},ve={class:"opt-item"},Oe=V({__name:"mobile-post-item",props:{post:{}},setup(q){const T=q,h=U(),L=R(),e=j(()=>[{label:"复制链接",key:"copyTweetLink"}]),x=async o=>{switch(o){case"copyTweetLink":ne(`${window.location.origin}/#/post?id=${t.value.id}`),window.$message.success("链接已复制到剪贴板");break}},t=j(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return o.contents.map(n=>{(+n.type==1||+n.type==2)&&o.texts.push(n),+n.type==3&&o.imgs.push(n),+n.type==4&&o.videos.push(n),+n.type==6&&o.links.push(n),+n.type==7&&o.attachments.push(n),+n.type==8&&o.charge_attachments.push(n)}),o}),u=o=>{h.push({name:"post",query:{id:o}})},a=(o,n)=>{if(o.target.dataset.detail){const v=o.target.dataset.detail.split(":");if(v.length===2){L.commit("refresh"),v[0]==="tag"?h.push({name:"home",query:{q:v[1],t:"tag"}}):h.push({name:"user",query:{username:v[1]}});return}}u(n)};return(o,n)=>{const v=Q,b=F("router-link"),w=W,g=X,M=ie,$=le,z=N,O=B,y=D,P=S,te=Y,se=ee;return l(),k("div",ue,[i(se,{"content-indented":""},I({avatar:s(()=>[i(v,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:s(()=>[r("span",re,[i(b,{onClick:n[0]||(n[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t.value.user.username}}},{default:s(()=>[_(m(t.value.user.nickname),1)]),_:1},8,["to"])]),r("span",ce," @"+m(t.value.user.username),1),t.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):p("",!0),t.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):p("",!0),t.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):p("",!0),r("div",null,[r("span",pe,m(d(Z)(t.value.created_on))+" "+m(t.value.ip_loc),1)])]),"header-extra":s(()=>[r("div",_e,[i($,{placement:"bottom-end",trigger:"click",size:"small",options:e.value,onSelect:x},{default:s(()=>[i(M,{quaternary:"",circle:""},{icon:s(()=>[i(g,null,{default:s(()=>[i(d(oe))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[t.value.attachments.length>0?(l(),c(z,{key:0,attachments:t.value.attachments},null,8,["attachments"])):p("",!0),t.value.charge_attachments.length>0?(l(),c(z,{key:1,attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"])):p("",!0),t.value.imgs.length>0?(l(),c(O,{key:2,imgs:t.value.imgs},null,8,["imgs"])):p("",!0),t.value.videos.length>0?(l(),c(y,{key:3,videos:t.value.videos},null,8,["videos"])):p("",!0),t.value.links.length>0?(l(),c(P,{key:4,links:t.value.links},null,8,["links"])):p("",!0)]),action:s(()=>[i(te,{justify:"space-between"},{default:s(()=>[r("div",de,[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(G))]),_:1}),_(" "+m(t.value.upvote_count),1)]),r("div",{class:"opt-item",onClick:n[3]||(n[3]=f(C=>u(t.value.id),["stop"]))},[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(J))]),_:1}),_(" "+m(t.value.comment_count),1)]),r("div",ve,[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(K))]),_:1}),_(" "+m(t.value.collection_count),1)])]),_:1})]),_:2},[t.value.texts.length>0?{name:"description",fn:s(()=>[r("div",{onClick:n[2]||(n[2]=C=>u(t.value.id))},[(l(!0),k(A,null,E(t.value.texts,C=>(l(),k("span",{key:C.id,class:"post-text",onClick:n[1]||(n[1]=f(ae=>a(ae,t.value.id),["stop"])),innerHTML:d(H)(C.content).content},null,8,me))),128))])]),key:"0"}:void 0]),1024)])}}});const he={class:"nickname-wrap"},ge={class:"username-wrap"},ye={class:"item-header-extra"},ke={class:"timestamp"},fe=["innerHTML"],xe={class:"opt-item"},we={class:"opt-item"},Pe=V({__name:"post-item",props:{post:{}},setup(q){const T=q,h=U(),L=R(),e=j(()=>{let u=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return u.contents.map(a=>{(+a.type==1||+a.type==2)&&u.texts.push(a),+a.type==3&&u.imgs.push(a),+a.type==4&&u.videos.push(a),+a.type==6&&u.links.push(a),+a.type==7&&u.attachments.push(a),+a.type==8&&u.charge_attachments.push(a)}),u}),x=u=>{h.push({name:"post",query:{id:u}})},t=(u,a)=>{if(u.target.dataset.detail){const o=u.target.dataset.detail.split(":");if(o.length===2){L.commit("refresh"),o[0]==="tag"?h.push({name:"home",query:{q:o[1],t:"tag"}}):h.push({name:"user",query:{username:o[1]}});return}}x(a)};return(u,a)=>{const o=Q,n=F("router-link"),v=W,b=N,w=B,g=D,M=S,$=X,z=Y,O=ee;return l(),k("div",{class:"post-item",onClick:a[3]||(a[3]=y=>x(e.value.id))},[i(O,{"content-indented":""},I({avatar:s(()=>[i(o,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[r("span",he,[i(n,{onClick:a[0]||(a[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.value.user.username}}},{default:s(()=>[_(m(e.value.user.nickname),1)]),_:1},8,["to"])]),r("span",ge," @"+m(e.value.user.username),1),e.value.is_top?(l(),c(v,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):p("",!0),e.value.visibility==1?(l(),c(v,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):p("",!0),e.value.visibility==2?(l(),c(v,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):p("",!0)]),"header-extra":s(()=>[r("div",ye,[r("span",ke,m(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+m(d(Z)(e.value.created_on)),1)])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):p("",!0),e.value.charge_attachments.length>0?(l(),c(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):p("",!0),e.value.imgs.length>0?(l(),c(w,{key:2,imgs:e.value.imgs},null,8,["imgs"])):p("",!0),e.value.videos.length>0?(l(),c(g,{key:3,videos:e.value.videos},null,8,["videos"])):p("",!0),e.value.links.length>0?(l(),c(M,{key:4,links:e.value.links},null,8,["links"])):p("",!0)]),action:s(()=>[i(z,{justify:"space-between"},{default:s(()=>[r("div",xe,[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(G))]),_:1}),_(" "+m(e.value.upvote_count),1)]),r("div",{class:"opt-item",onClick:a[2]||(a[2]=f(y=>x(e.value.id),["stop"]))},[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(J))]),_:1}),_(" "+m(e.value.comment_count),1)]),r("div",we,[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(K))]),_:1}),_(" "+m(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),k(A,null,E(e.value.texts,y=>(l(),k("span",{key:y.id,class:"post-text",onClick:a[1]||(a[1]=f(P=>t(P,e.value.id),["stop"])),innerHTML:d(H)(y.content).content},null,8,fe))),128))]),key:"0"}:void 0]),1024)])}}});export{Pe as _,Oe as a}; +import{p as H,a as N,_ as B,b as D,c as S}from"./content-d4af862e.js";import{d as V,n as j,a2 as F,o as l,c as k,U as i,a6 as I,a0 as s,a as r,F as A,a3 as E,a1 as f,Z as d,e as _,L as m,P as c,N as p}from"./@vue-d002002f.js";import{u as R}from"./vuex-4d2f7b35.js";import{u as U}from"./vue-router-29e6667f.js";import{b as Z}from"./formatTime-000dbebb.js";import{a as ne}from"./copy-to-clipboard-1dd3075d.js";import{i as oe,j as G,l as J,m as K}from"./@vicons-4022100b.js";import{o as Q,O as W,j as X,e as ie,P as le,a as Y,M as ee}from"./naive-ui-d02aa0d7.js";const ue={class:"post-item"},re={class:"nickname-wrap"},ce={class:"username-wrap"},pe={class:"timestamp-mobile"},_e={class:"item-header-extra"},me=["innerHTML"],de={class:"opt-item"},ve={class:"opt-item"},Oe=V({__name:"mobile-post-item",props:{post:{}},setup(q){const T=q,h=U(),L=R(),e=j(()=>[{label:"复制链接",key:"copyTweetLink"}]),x=async o=>{switch(o){case"copyTweetLink":ne(`${window.location.origin}/#/post?id=${t.value.id}`),window.$message.success("链接已复制到剪贴板");break}},t=j(()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return o.contents.map(n=>{(+n.type==1||+n.type==2)&&o.texts.push(n),+n.type==3&&o.imgs.push(n),+n.type==4&&o.videos.push(n),+n.type==6&&o.links.push(n),+n.type==7&&o.attachments.push(n),+n.type==8&&o.charge_attachments.push(n)}),o}),u=o=>{h.push({name:"post",query:{id:o}})},a=(o,n)=>{if(o.target.dataset.detail){const v=o.target.dataset.detail.split(":");if(v.length===2){L.commit("refresh"),v[0]==="tag"?h.push({name:"home",query:{q:v[1],t:"tag"}}):h.push({name:"user",query:{username:v[1]}});return}}u(n)};return(o,n)=>{const v=Q,b=F("router-link"),w=W,g=X,M=ie,$=le,z=N,O=B,y=D,P=S,te=Y,se=ee;return l(),k("div",ue,[i(se,{"content-indented":""},I({avatar:s(()=>[i(v,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:s(()=>[r("span",re,[i(b,{onClick:n[0]||(n[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t.value.user.username}}},{default:s(()=>[_(m(t.value.user.nickname),1)]),_:1},8,["to"])]),r("span",ce," @"+m(t.value.user.username),1),t.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):p("",!0),t.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):p("",!0),t.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):p("",!0),r("div",null,[r("span",pe,m(d(Z)(t.value.created_on))+" "+m(t.value.ip_loc),1)])]),"header-extra":s(()=>[r("div",_e,[i($,{placement:"bottom-end",trigger:"click",size:"small",options:e.value,onSelect:x},{default:s(()=>[i(M,{quaternary:"",circle:""},{icon:s(()=>[i(g,null,{default:s(()=>[i(d(oe))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[t.value.attachments.length>0?(l(),c(z,{key:0,attachments:t.value.attachments},null,8,["attachments"])):p("",!0),t.value.charge_attachments.length>0?(l(),c(z,{key:1,attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"])):p("",!0),t.value.imgs.length>0?(l(),c(O,{key:2,imgs:t.value.imgs},null,8,["imgs"])):p("",!0),t.value.videos.length>0?(l(),c(y,{key:3,videos:t.value.videos},null,8,["videos"])):p("",!0),t.value.links.length>0?(l(),c(P,{key:4,links:t.value.links},null,8,["links"])):p("",!0)]),action:s(()=>[i(te,{justify:"space-between"},{default:s(()=>[r("div",de,[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(G))]),_:1}),_(" "+m(t.value.upvote_count),1)]),r("div",{class:"opt-item",onClick:n[3]||(n[3]=f(C=>u(t.value.id),["stop"]))},[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(J))]),_:1}),_(" "+m(t.value.comment_count),1)]),r("div",ve,[i(g,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(K))]),_:1}),_(" "+m(t.value.collection_count),1)])]),_:1})]),_:2},[t.value.texts.length>0?{name:"description",fn:s(()=>[r("div",{onClick:n[2]||(n[2]=C=>u(t.value.id))},[(l(!0),k(A,null,E(t.value.texts,C=>(l(),k("span",{key:C.id,class:"post-text",onClick:n[1]||(n[1]=f(ae=>a(ae,t.value.id),["stop"])),innerHTML:d(H)(C.content).content},null,8,me))),128))])]),key:"0"}:void 0]),1024)])}}});const he={class:"nickname-wrap"},ge={class:"username-wrap"},ye={class:"item-header-extra"},ke={class:"timestamp"},fe=["innerHTML"],xe={class:"opt-item"},we={class:"opt-item"},Pe=V({__name:"post-item",props:{post:{}},setup(q){const T=q,h=U(),L=R(),e=j(()=>{let u=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},T.post);return u.contents.map(a=>{(+a.type==1||+a.type==2)&&u.texts.push(a),+a.type==3&&u.imgs.push(a),+a.type==4&&u.videos.push(a),+a.type==6&&u.links.push(a),+a.type==7&&u.attachments.push(a),+a.type==8&&u.charge_attachments.push(a)}),u}),x=u=>{h.push({name:"post",query:{id:u}})},t=(u,a)=>{if(u.target.dataset.detail){const o=u.target.dataset.detail.split(":");if(o.length===2){L.commit("refresh"),o[0]==="tag"?h.push({name:"home",query:{q:o[1],t:"tag"}}):h.push({name:"user",query:{username:o[1]}});return}}x(a)};return(u,a)=>{const o=Q,n=F("router-link"),v=W,b=N,w=B,g=D,M=S,$=X,z=Y,O=ee;return l(),k("div",{class:"post-item",onClick:a[3]||(a[3]=y=>x(e.value.id))},[i(O,{"content-indented":""},I({avatar:s(()=>[i(o,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[r("span",he,[i(n,{onClick:a[0]||(a[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.value.user.username}}},{default:s(()=>[_(m(e.value.user.nickname),1)]),_:1},8,["to"])]),r("span",ge," @"+m(e.value.user.username),1),e.value.is_top?(l(),c(v,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):p("",!0),e.value.visibility==1?(l(),c(v,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):p("",!0),e.value.visibility==2?(l(),c(v,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):p("",!0)]),"header-extra":s(()=>[r("div",ye,[r("span",ke,m(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+m(d(Z)(e.value.created_on)),1)])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):p("",!0),e.value.charge_attachments.length>0?(l(),c(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):p("",!0),e.value.imgs.length>0?(l(),c(w,{key:2,imgs:e.value.imgs},null,8,["imgs"])):p("",!0),e.value.videos.length>0?(l(),c(g,{key:3,videos:e.value.videos},null,8,["videos"])):p("",!0),e.value.links.length>0?(l(),c(M,{key:4,links:e.value.links},null,8,["links"])):p("",!0)]),action:s(()=>[i(z,{justify:"space-between"},{default:s(()=>[r("div",xe,[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(G))]),_:1}),_(" "+m(e.value.upvote_count),1)]),r("div",{class:"opt-item",onClick:a[2]||(a[2]=f(y=>x(e.value.id),["stop"]))},[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(J))]),_:1}),_(" "+m(e.value.comment_count),1)]),r("div",we,[i($,{size:"18",class:"opt-item-icon"},{default:s(()=>[i(d(K))]),_:1}),_(" "+m(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),k(A,null,E(e.value.texts,y=>(l(),k("span",{key:y.id,class:"post-text",onClick:a[1]||(a[1]=f(P=>t(P,e.value.id),["stop"])),innerHTML:d(H)(y.content).content},null,8,fe))),128))]),key:"0"}:void 0]),1024)])}}});export{Pe as _,Oe as a}; diff --git a/web/dist/assets/post-skeleton-49f18127.js b/web/dist/assets/post-skeleton-af959eab.js similarity index 88% rename from web/dist/assets/post-skeleton-49f18127.js rename to web/dist/assets/post-skeleton-af959eab.js index adda7283..828b9605 100644 --- a/web/dist/assets/post-skeleton-49f18127.js +++ b/web/dist/assets/post-skeleton-af959eab.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-d02aa0d7.js";import{d as c,o as s,c as n,a3 as p,a as o,U as t,F as l}from"./@vue-d002002f.js";import{_ as i}from"./index-5fa3c6e0.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",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 r}from"./naive-ui-d02aa0d7.js";import{d as c,o as s,c as n,a3 as p,a as o,U as t,F as l}from"./@vue-d002002f.js";import{_ as i}from"./index-ff680598.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",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 599df57a..6bfc7c06 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - +