Merge branch 'dev' into x/gorm

pull/351/head
Michael Li 1 year ago
commit 96f41363df
No known key found for this signature in database

@ -5,6 +5,7 @@ All notable changes to paopao-ce are documented in this file.
### Added ### Added
- add `pprof` feature support [#327](https://github.com/rocboss/paopao-ce/pull/327) - add `pprof` feature support [#327](https://github.com/rocboss/paopao-ce/pull/327)
- use compiler profile-guided optimization (PGO) to further optimize builds. [#327](https://github.com/rocboss/paopao-ce/pull/327) - use compiler profile-guided optimization (PGO) to further optimize builds. [#327](https://github.com/rocboss/paopao-ce/pull/327)
- frontend: re-add stars page embed to profile page. [#339](https://github.com/rocboss/paopao-ce/pull/339)
### Changed ### Changed
- change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333) - change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333)

@ -1 +1 @@
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}; import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as a}from"./vue-router-b8e3382f.js";import{F as i,e as c,a2 as u}from"./naive-ui-62663ad7.js";import{d as l,c as d,V as t,a1 as o,o as f,e as x}from"./@vue-e0e89260.js";import{_ as g}from"./index-4ee34f7b.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-d502290a.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default};

@ -1,3 +1,3 @@
import{i as d}from"./@vue-d002002f.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return`<style cssr-id="${i}"> import{i as d}from"./@vue-e0e89260.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return`<style cssr-id="${i}">
${r} ${r}
</style>`}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u}; </style>`}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
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};

@ -0,0 +1 @@
import{_ as F}from"./post-skeleton-852fbfbe.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-cdf4e6f1.js";import{d as R,r as n,j as S,c as o,V as a,a1 as p,o as e,_ as u,O as l,F as I,a4 as L,Q as M,a as s,M as _,L as O}from"./@vue-e0e89260.js";import{F as P,G as j,I as q,H as D}from"./naive-ui-62663ad7.js";import{_ as E}from"./index-4ee34f7b.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-d502290a.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.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 G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=R({__name:"Anouncement",setup(J){const d=V(),g=z(),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,K)=>{const y=N,k=j,x=F,w=q,B=D,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[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",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default};

@ -1 +0,0 @@
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};

@ -0,0 +1 @@
import{_ as P,a as S}from"./post-item.vue_vue_type_style_index_0_lang-2a15a53c.js";import{_ as V}from"./post-skeleton-852fbfbe.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as I}from"./vuex-473b3783.js";import{b as L}from"./vue-router-b8e3382f.js";import{L as N,_ as R}from"./index-4ee34f7b.js";import{d as j,r as s,j as q,c as o,V as e,a1 as c,_ as g,O as v,o as t,F as f,a4 as h,Q as k}from"./@vue-e0e89260.js";import{F as E,G,I as H,H as O}from"./naive-ui-62663ad7.js";import"./content-9a833cfa.js";import"./@vicons-d502290a.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.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 Q={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},K=j({__name:"Collection",setup(W){const m=I(),y=L(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return q(()=>{u()}),(n,X)=>{const C=$,b=V,x=H,z=P,d=O,B=S,F=E,M=G;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",Q,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(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))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[e(M,{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 Mt=R(K,[["__scopeId","data-v-a5302c9b"]]);export{Mt as default};

@ -0,0 +1 @@
import{u as N,b as P}from"./vue-router-b8e3382f.js";import{d as k,o as e,c as n,a as s,V as a,M as d,r as c,j as R,a1 as f,_ as S,O as h,F as y,a4 as U,Q as q}from"./@vue-e0e89260.js";import{o as x,F as D,G as O,I as T,H as j}from"./naive-ui-62663ad7.js";import{_ as b,O as E}from"./index-4ee34f7b.js";import{_ as G}from"./post-skeleton-852fbfbe.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as L}from"./vuex-473b3783.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.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-d502290a.js";/* empty css */const Q={class:"avatar"},A={class:"base-info"},J={class:"username"},K={class:"uid"},W=k({__name:"contact-item",props:{contact:{}},setup(C){const l=N(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=x;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",Q,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",A,[s("div",J,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",K,"UID. "+d(t.contact.user_id),1)])])}}});const X=b(W,[["__scopeId","data-v-08ee9b2e"]]),Y={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=L(),u=P(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};R(()=>{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,z=T,B=X,V=j,F=D,M=O;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",Y,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Z,[o.value.length===0?(e(),n("div",tt,[a(z,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,U(o.value,g=>(e(),q(V,{key:g.user_id},{default:f(()=>[a(B,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(M,{page:_.value,"onUpdate:page":w,"page-slot":S(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const zt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{zt as default};

@ -1 +0,0 @@
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};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.profile-baseinfo[data-v-d6cf5ae7]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-d6cf5ae7]{width:55px}.profile-baseinfo .base-info[data-v-d6cf5ae7]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-d6cf5ae7]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-d6cf5ae7]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-d6cf5ae7]{padding:0 16px}.pagination-wrap[data-v-d6cf5ae7]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-d6cf5ae7]{background-color:#18181c}.dark .profile-wrap[data-v-d6cf5ae7],.dark .pagination-wrap[data-v-d6cf5ae7]{background-color:#101014bf}

@ -1 +0,0 @@
.profile-baseinfo[data-v-1f072d05]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-1f072d05]{width:55px}.profile-baseinfo .base-info[data-v-1f072d05]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-1f072d05]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-1f072d05]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-1f072d05]{padding:0 16px}.pagination-wrap[data-v-1f072d05]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-1f072d05]{background-color:#18181c}.dark .profile-wrap[data-v-1f072d05],.dark .pagination-wrap[data-v-1f072d05]{background-color:#101014bf}

@ -1 +0,0 @@
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};

@ -0,0 +1 @@
import{_ as A,a as E}from"./post-item.vue_vue_type_style_index_0_lang-2a15a53c.js";import{_ as G}from"./post-skeleton-852fbfbe.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as L}from"./vuex-473b3783.js";import{b as O}from"./vue-router-b8e3382f.js";import{A as Q,B as J,_ as K}from"./index-4ee34f7b.js";import{d as W,r as l,j as X,w as Y,c as n,V as a,_,Q as w,a1 as f,O as P,o as t,a as i,M as b,F as x,a4 as z}from"./@vue-e0e89260.js";import{F as Z,G as ee,o as te,f as ae,g as oe,I as se,H as ne}from"./naive-ui-62663ad7.js";import"./content-9a833cfa.js";import"./@vicons-d502290a.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.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:"profile-baseinfo"},re={class:"avatar"},_e={class:"base-info"},ie={class:"username"},pe={class:"uid"},ue={key:0,class:"skeleton-wrap"},ce={key:1},me={key:0,class:"empty-wrap"},de={key:1},ve={key:2},fe={key:1,class:"pagination-wrap"},ge=W({__name:"Profile",setup(he){const o=L(),p=O(),r=l(!1),u=l([]),c=l("post"),I=l(+p.query.p||1),q=l(1),s=l(+p.query.p||1),m=l(20),v=l(0),g=()=>{c.value=="post"?h():(c.value="star")&&y()},h=()=>{r.value=!0,Q({username:o.state.userInfo.username,page:s.value,page_size:m.value}).then(e=>{r.value=!1,u.value=e.list,v.value=Math.ceil(e.pager.total_rows/m.value),window.scrollTo(0,0)}).catch(e=>{r.value=!1})},y=()=>{r.value=!0,J({page:s.value,page_size:m.value}).then(e=>{r.value=!1,u.value=e.list,v.value=Math.ceil(e.pager.total_rows/m.value),window.scrollTo(0,0)}).catch(e=>{r.value=!1})},B=e=>{c.value=e,e=="post"?(s.value=I.value,h()):e=="star"&&(s.value=q.value,y())},M=e=>{s.value=e,c.value=="post"?(I.value=e,h()):c.value=="star"&&(q.value=s.value,y())};return X(()=>{g()}),Y(()=>({path:p.path,query:p.query,refresh:o.state.refresh}),(e,k)=>{if(e.refresh!==k.refresh){s.value=+p.query.p||1,setTimeout(()=>{g()},0);return}k.path!=="/post"&&e.path==="/profile"&&(s.value=+p.query.p||1,setTimeout(()=>{g()},0))}),(e,k)=>{const U=H,V=te,S=ae,$=oe,C=G,F=se,N=A,T=ne,D=E,R=Z,j=ee;return t(),n("div",null,[a(U,{title:"主页"}),_(o).state.userInfo.id>0?(t(),w(R,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:f(()=>[i("div",le,[i("div",re,[a(V,{size:"large",src:_(o).state.userInfo.avatar},null,8,["src"])]),i("div",_e,[i("div",ie,[i("strong",null,b(_(o).state.userInfo.nickname),1),i("span",null," @"+b(_(o).state.userInfo.username),1)]),i("div",pe,"UID. "+b(_(o).state.userInfo.id),1)])]),a($,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":B},{default:f(()=>[a(S,{name:"post",tab:"泡泡"}),a(S,{name:"star",tab:"点赞"})]),_:1}),r.value?(t(),n("div",ue,[a(C,{num:m.value},null,8,["num"])])):(t(),n("div",ce,[u.value.length===0?(t(),n("div",me,[a(F,{size:"large",description:"暂无数据"})])):P("",!0),_(o).state.desktopModelShow?(t(),n("div",de,[(t(!0),n(x,null,z(u.value,d=>(t(),w(T,{key:d.id},{default:f(()=>[a(N,{post:d},null,8,["post"])]),_:2},1024))),128))])):(t(),n("div",ve,[(t(!0),n(x,null,z(u.value,d=>(t(),w(T,{key:d.id},{default:f(()=>[a(D,{post:d},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):P("",!0),v.value>0?(t(),n("div",fe,[a(j,{page:s.value,"onUpdate:page":M,"page-slot":_(o).state.collapsedRight?5:8,"page-count":v.value},null,8,["page","page-slot","page-count"])])):P("",!0)])}}});const Ke=K(ge,[["__scopeId","data-v-d6cf5ae7"]]);export{Ke as default};

File diff suppressed because one or more lines are too long

@ -1 +1 @@
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}; import{w as F,x as z,y as I,z as j,_ as E}from"./index-4ee34f7b.js";import{p as U}from"./@vicons-d502290a.js";import{d as $,r as i,n as q,j as A,a3 as x,o as c,c as _,V as n,a1 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a7 as P,F as Q,a4 as G}from"./@vue-e0e89260.js";import{o as H,O as B,j as J,e as K,P as R,M as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-62663ad7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-9bd717cc.js";import{u as ne}from"./vuex-473b3783.js";import"./vue-router-b8e3382f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.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":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({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=x("router-link"),g=H,k=B,a=J,d=K,v=R,p=W;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(()=>[V(" #"+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(U))]),_: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);D(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,j({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=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},P({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(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(Q,null,G(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-15794a53"]]);export{Me as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
import{h as r}from"./moment-b7869f98.js";r.locale("zh-cn");const f=e=>r.unix(e).fromNow(),a=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},n=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()};export{f as a,n as b,a as f}; import{h as r}from"./moment-2ab8298d.js";r.locale("zh-cn");const f=e=>r.unix(e).fromNow(),a=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},n=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()};export{f as a,n as b,a as f};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.nav-title-card{z-index:99;width:100%;top:0;position:sticky;border-radius:0;border-bottom:0;background-color:#ffffffbf;backdrop-filter:blur(12px)}.nav-title-card .navbar{height:30px;position:relative;display:flex;align-items:center}.nav-title-card .navbar .drawer-btn,.nav-title-card .navbar .back-btn{margin-right:8px}.nav-title-card .navbar .theme-switch-wrap{position:absolute;right:0;top:calc(50% - 9px)}.dark .nav-title-card{background-color:#101014bf}

@ -0,0 +1 @@
.nav-title-card{z-index:99;width:100%;top:0;position:sticky;border-radius:0;border-bottom:0;background-color:#ffffffbf;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.nav-title-card .navbar{height:30px;position:relative;display:flex;align-items:center}.nav-title-card .navbar .drawer-btn,.nav-title-card .navbar .back-btn{margin-right:8px}.nav-title-card .navbar .theme-switch-wrap{position:absolute;right:0;top:calc(50% - 9px)}.dark .nav-title-card{background-color:#101014bf}

@ -1 +0,0 @@
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 _};

@ -0,0 +1 @@
import{$ as B}from"./index-4ee34f7b.js";import{u as E}from"./vuex-473b3783.js";import{u as S}from"./vue-router-b8e3382f.js";import{j as A}from"./vooks-a50491fd.js";import{D as C,y as D,z as N,F as P}from"./@vicons-d502290a.js";import{a3 as R,a4 as V,j as I,e as j,a5 as x,h as F}from"./naive-ui-62663ad7.js";import{d as H,r as h,j as $,o as a,c as f,_ as o,V as e,a1 as t,O as c,a as q,Q as _,e as L,M as U,F as Q}from"./@vue-e0e89260.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=S(),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 $(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(s,d)=>{const y=B,b=R,O=V,r=I,p=j,M=x,T=F;return a(),f(Q,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(()=>[q("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(C))]),_: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(D))]),_:1})]),_:1})):c("",!0),L(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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-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 _}; import{U as r}from"./naive-ui-62663ad7.js";import{d as c,o as s,c as n,a4 as p,a as o,V as t,F as l}from"./@vue-e0e89260.js";import{_ as i}from"./index-4ee34f7b.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 _};

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.state-error[data-v-a7077831]{display:flex;flex-direction:column;align-items:center}.retry[data-v-a7077831]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-a7077831]:hover{opacity:.8}

@ -1 +0,0 @@
import{r as v,R as B,j as H,H as L,o as b,c as h,S as p,U as N,N as u,a as d,L as g,w as y,y as j,V as C,W as V}from"./@vue-d002002f.js";const x=(e,o)=>{const t=e.__vccOpts||e;for(const[n,a]of o)t[n]=a;return t},$={},O=e=>(C("data-v-259be2b2"),e=e(),V(),e),R={class:"container"},M=O(()=>d("div",{class:"spinner"},null,-1)),T=[M];function U(e,o){return b(),h("div",R,T)}const D=x($,[["render",U],["__scopeId","data-v-259be2b2"],["__file","/home/oumoussa/side-projects/infinite/src/components/Spinner.vue"]]),W=e=>({loading(){e.value="loading"},loaded(){e.value="loaded"},complete(){e.value="complete"},error(){e.value="error"}}),z=(e,o,t)=>()=>{const n=t.parentEl||document.documentElement;t.prevHeight=n.scrollHeight,o.loading(),e("infinite",o)},A=(e,o)=>{const t=e.getBoundingClientRect();if(!o)return t.top>=0&&t.bottom<=window.innerHeight;const n=o.getBoundingClientRect();return t.top>=n.top&&t.bottom<=n.bottom},_=e=>{e.parentEl=document.querySelector(e.target)||null;let o=`0px 0px ${e.distance}px 0px`;e.top&&(o=`${e.distance}px 0px 0px 0px`);const t=new IntersectionObserver(n=>{n[0].isIntersecting&&(e.firstload&&e.emit(),e.firstload=!0)},{root:e.parentEl,rootMargin:o});return t.observe(e.infiniteLoading.value),t},F={class:"state-error"},G={__name:"InfiniteLoading",props:{top:{type:Boolean,required:!1},target:{type:[String,Boolean],required:!1},distance:{type:Number,required:!1,default:0},identifier:{required:!1},firstload:{type:Boolean,required:!1,default:!0},slots:{type:Object,required:!1}},emits:["infinite"],setup(e,{emit:o}){const t=e;let n=null;const a=v(null),s=v("ready"),{top:m,firstload:E,target:k,distance:I}=t,{identifier:f}=B(t),r={infiniteLoading:a,target:k,top:m,firstload:E,distance:I,prevHeight:0,parentEl:null};r.emit=z(o,W(s),r);const S=()=>y(s,async i=>{const l=r.parentEl||document.documentElement;await j(),i=="loaded"&&m&&(l.scrollTop=l.scrollHeight-r.prevHeight),i=="loaded"&&A(a.value,r.parentEl)&&r.emit(),i=="complete"&&n.disconnect()}),q=()=>y(f,()=>{s.value="ready",n.disconnect(),n=_(r)});return H(()=>{n=_(r),S(),f&&q()}),L(()=>{n.disconnect()}),(i,l)=>(b(),h("div",{ref_key:"infiniteLoading",ref:a},[s.value=="loading"?p(i.$slots,"spinner",{key:0},()=>[N(D)],!0):u("v-if",!0),s.value=="complete"?p(i.$slots,"complete",{key:1},()=>{var c;return[d("span",null,g(((c=e.slots)==null?void 0:c.complete)||"No more results!"),1)]},!0):u("v-if",!0),s.value=="error"?p(i.$slots,"error",{key:2,retry:r.emit},()=>{var c;return[d("span",F,[d("span",null,g(((c=e.slots)==null?void 0:c.error)||"Oops something went wrong!"),1),d("button",{class:"retry",onClick:l[0]||(l[0]=(...w)=>r.emit&&r.emit(...w))}," retry ")])]},!0):u("v-if",!0)],512))}},J=x(G,[["__scopeId","data-v-9d82030b"],["__file","/home/oumoussa/side-projects/infinite/src/components/InfiniteLoading.vue"]]);export{J as K};

@ -1 +0,0 @@
.container[data-v-259be2b2]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-259be2b2]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-259be2b2 .9s linear infinite}@keyframes spin-259be2b2{to{transform:rotate(360deg)}}.state-error[data-v-9d82030b]{display:flex;flex-direction:column;align-items:center}.retry[data-v-9d82030b]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-9d82030b]:hover{opacity:.8}

@ -0,0 +1 @@
import{d as L,r as v,S as C,w as $,j as H,I as M,o as x,c as h,z as N,v as O,a as i,U as u,V,M as g,O as y,y as E,W as D,X as R}from"./@vue-e0e89260.js";function T(t,o){const n=t.getBoundingClientRect();if(!o)return n.top>=0&&n.bottom<=window.innerHeight;const e=o.getBoundingClientRect();return n.top>=e.top&&n.bottom<=e.bottom}async function U(t){return await E(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null}function w(t){let o=`0px 0px ${t.distance}px 0px`;t.top&&(o=`${t.distance}px 0px 0px 0px`);const n=new IntersectionObserver(e=>{e[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:o});return n.observe(t.infiniteLoading.value),n}const I=(t,o)=>{const n=t.__vccOpts||t;for(const[e,c]of o)n[e]=c;return n},j={},q=t=>(D("data-v-d3e37633"),t=t(),R(),t),z={class:"container"},W=q(()=>i("div",{class:"spinner"},null,-1)),A=[W];function F(t,o){return x(),h("div",z,A)}const G=I(j,[["render",F],["__scopeId","data-v-d3e37633"]]),J={class:"state-error"},K=L({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:o}){const n=t;let e=null,c=0;const d=v(null),s=v(""),{top:p,firstload:k,distance:S}=n,{identifier:_,target:B}=C(n),a={infiniteLoading:d,top:p,firstload:k,distance:S,parentEl:null,emit(){c=(a.parentEl||document.documentElement).scrollHeight,m.loading(),o("infinite",m)}},m={loading(){s.value="loading"},async loaded(){s.value="loaded";const r=a.parentEl||document.documentElement;await E(),p&&(r.scrollTop=r.scrollHeight-c),T(d.value,a.parentEl)&&a.emit()},complete(){s.value="complete",e==null||e.disconnect()},error(){s.value="error"}};return $(_,()=>{e==null||e.disconnect(),e=w(a)}),H(async()=>{a.parentEl=await U(B),e=w(a)}),M(()=>{e==null||e.disconnect()}),(r,f)=>(x(),h("div",{ref_key:"infiniteLoading",ref:d,style:{"min-height":"1px"}},[N(i("div",null,[u(r.$slots,"spinner",{},()=>[V(G)],!0)],512),[[O,s.value=="loading"]]),s.value=="complete"?u(r.$slots,"complete",{key:0},()=>{var l;return[i("span",null,g(((l=r.slots)==null?void 0:l.complete)||"No more results!"),1)]},!0):y("",!0),s.value=="error"?u(r.$slots,"error",{key:1,retry:a.emit},()=>{var l;return[i("span",J,[i("span",null,g(((l=r.slots)==null?void 0:l.error)||"Oops something went wrong!"),1),i("button",{class:"retry",onClick:f[0]||(f[0]=(...b)=>a.emit&&a.emit(...b))},"retry")])]},!0):y("",!0)],512))}}),X=I(K,[["__scopeId","data-v-a7077831"]]);export{X as W};

@ -1 +1 @@
import{r as f,X as c,w as q,n as k,g as U,j as X,h as g,k as B,D as V}from"./@vue-d002002f.js";import{o as h,a as v}from"./evtd-b614532e.js";function N(e){const n=f(!!e.value);if(n.value)return c(n);const t=q(e,o=>{o&&(n.value=!0,t())});return c(n)}function ee(e){const n=k(e),t=f(n.value);return q(n,o=>{t.value=o}),typeof e=="function"?t:{__v_isRef:!0,get value(){return t.value},set value(o){e.set(o)}}}function I(){return U()!==null}const $=typeof window<"u";let y,L;const Y=()=>{var e,n;y=$?(n=(e=document)===null||e===void 0?void 0:e.fonts)===null||n===void 0?void 0:n.ready:void 0,L=!1,y!==void 0?y.then(()=>{L=!0}):L=!0};Y();function ne(e){if(L)return;let n=!1;X(()=>{L||y==null||y.then(()=>{n||e()})}),g(()=>{n=!0})}const M=f(null);function _(e){if(e.clientX>0||e.clientY>0)M.value={x:e.clientX,y:e.clientY};else{const{target:n}=e;if(n instanceof Element){const{left:t,top:o,width:u,height:i}=n.getBoundingClientRect();t>0||o>0?M.value={x:t+u/2,y:o+i/2}:M.value={x:0,y:0}}else M.value=null}}let E=0,H=!0;function te(){if(!$)return c(f(null));E===0&&h("click",document,_,!0);const e=()=>{E+=1};return H&&(H=I())?(B(e),g(()=>{E-=1,E===0&&v("click",document,_,!0)})):e(),c(M)}const K=f(void 0);let C=0;function S(){K.value=Date.now()}let F=!0;function ie(e){if(!$)return c(f(!1));const n=f(!1);let t=null;function o(){t!==null&&window.clearTimeout(t)}function u(){o(),n.value=!0,t=window.setTimeout(()=>{n.value=!1},e)}C===0&&h("click",window,S,!0);const i=()=>{C+=1,h("click",window,u,!0)};return F&&(F=I())?(B(i),g(()=>{C-=1,C===0&&v("click",window,S,!0),v("click",window,u,!0),o()})):i(),c(n)}let T=0;const O=typeof window<"u"&&window.matchMedia!==void 0,p=f(null);let r,w;function x(e){e.matches&&(p.value="dark")}function P(e){e.matches&&(p.value="light")}function Q(){r=window.matchMedia("(prefers-color-scheme: dark)"),w=window.matchMedia("(prefers-color-scheme: light)"),r.matches?p.value="dark":w.matches?p.value="light":p.value=null,r.addEventListener?(r.addEventListener("change",x),w.addEventListener("change",P)):r.addListener&&(r.addListener(x),w.addListener(P))}function z(){"removeEventListener"in r?(r.removeEventListener("change",x),w.removeEventListener("change",P)):"removeListener"in r&&(r.removeListener(x),w.removeListener(P)),r=void 0,w=void 0}let R=!0;function ae(){return O?(T===0&&Q(),R&&(R=I())&&(B(()=>{T+=1}),g(()=>{T-=1,T===0&&z()})),c(p)):c(p)}function oe(e,n){return q(e,t=>{t!==void 0&&(n.value=t)}),k(()=>e.value===void 0?n.value:e.value)}function ue(){const e=f(!1);return X(()=>{e.value=!0}),c(e)}function se(e,n){return k(()=>{for(const t of n)if(e[t]!==void 0)return e[t];return e[n[n.length-1]]})}const A=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function re(){return A}const G={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function J(e){return`(min-width: ${e}px)`}const b={};function le(e=G){if(!$)return k(()=>[]);if(typeof window.matchMedia!="function")return k(()=>[]);const n=f({}),t=Object.keys(e),o=(u,i)=>{u.matches?n.value[i]=!0:n.value[i]=!1};return t.forEach(u=>{const i=e[u];let s,l;b[i]===void 0?(s=window.matchMedia(J(i)),s.addEventListener?s.addEventListener("change",a=>{l.forEach(d=>{d(a,u)})}):s.addListener&&s.addListener(a=>{l.forEach(d=>{d(a,u)})}),l=new Set,b[i]={mql:s,cbs:l}):(s=b[i].mql,l=b[i].cbs),l.add(o),s.matches&&l.forEach(a=>{a(s,u)})}),g(()=>{t.forEach(u=>{const{cbs:i}=b[e[u]];i.has(o)&&i.delete(o)})}),k(()=>{const{value:u}=n;return t.filter(i=>u[i])})}function fe(e={},n){const t=V({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:u}=e,i=a=>{switch(a.key){case"Control":t.ctrl=!0;break;case"Meta":t.command=!0,t.win=!0;break;case"Shift":t.shift=!0;break;case"Tab":t.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const m=o[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:D=!1}=m;j&&a.stopPropagation(),D&&a.preventDefault(),m.handler(a)}})},s=a=>{switch(a.key){case"Control":t.ctrl=!1;break;case"Meta":t.command=!1,t.win=!1;break;case"Shift":t.shift=!1;break;case"Tab":t.tab=!1;break}u!==void 0&&Object.keys(u).forEach(d=>{if(d!==a.key)return;const m=u[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:D=!1}=m;j&&a.stopPropagation(),D&&a.preventDefault(),m.handler(a)}})},l=()=>{(n===void 0||n.value)&&(h("keydown",document,i),h("keyup",document,s)),n!==void 0&&q(n,a=>{a?(h("keydown",document,i),h("keyup",document,s)):(v("keydown",document,i),v("keyup",document,s))})};return I()?(B(l),g(()=>{(n===void 0||n.value)&&(v("keydown",document,i),v("keyup",document,s))})):l(),c(t)}export{re as a,oe as b,se as c,fe as d,ie as e,te as f,le as g,N as h,ue as i,ae as j,ne as o,ee as u}; import{r as f,Y as c,w as q,n as k,g as U,j as Y,h as g,k as B,E as V}from"./@vue-e0e89260.js";import{o as h,a as v}from"./evtd-b614532e.js";function N(e){const n=f(!!e.value);if(n.value)return c(n);const t=q(e,o=>{o&&(n.value=!0,t())});return c(n)}function ee(e){const n=k(e),t=f(n.value);return q(n,o=>{t.value=o}),typeof e=="function"?t:{__v_isRef:!0,get value(){return t.value},set value(o){e.set(o)}}}function I(){return U()!==null}const $=typeof window<"u";let y,E;const X=()=>{var e,n;y=$?(n=(e=document)===null||e===void 0?void 0:e.fonts)===null||n===void 0?void 0:n.ready:void 0,E=!1,y!==void 0?y.then(()=>{E=!0}):E=!0};X();function ne(e){if(E)return;let n=!1;Y(()=>{E||y==null||y.then(()=>{n||e()})}),g(()=>{n=!0})}const M=f(null);function D(e){if(e.clientX>0||e.clientY>0)M.value={x:e.clientX,y:e.clientY};else{const{target:n}=e;if(n instanceof Element){const{left:t,top:o,width:u,height:i}=n.getBoundingClientRect();t>0||o>0?M.value={x:t+u/2,y:o+i/2}:M.value={x:0,y:0}}else M.value=null}}let L=0,H=!0;function te(){if(!$)return c(f(null));L===0&&h("click",document,D,!0);const e=()=>{L+=1};return H&&(H=I())?(B(e),g(()=>{L-=1,L===0&&v("click",document,D,!0)})):e(),c(M)}const K=f(void 0);let C=0;function S(){K.value=Date.now()}let F=!0;function ie(e){if(!$)return c(f(!1));const n=f(!1);let t=null;function o(){t!==null&&window.clearTimeout(t)}function u(){o(),n.value=!0,t=window.setTimeout(()=>{n.value=!1},e)}C===0&&h("click",window,S,!0);const i=()=>{C+=1,h("click",window,u,!0)};return F&&(F=I())?(B(i),g(()=>{C-=1,C===0&&v("click",window,S,!0),v("click",window,u,!0),o()})):i(),c(n)}let T=0;const O=typeof window<"u"&&window.matchMedia!==void 0,p=f(null);let r,w;function x(e){e.matches&&(p.value="dark")}function P(e){e.matches&&(p.value="light")}function Q(){r=window.matchMedia("(prefers-color-scheme: dark)"),w=window.matchMedia("(prefers-color-scheme: light)"),r.matches?p.value="dark":w.matches?p.value="light":p.value=null,r.addEventListener?(r.addEventListener("change",x),w.addEventListener("change",P)):r.addListener&&(r.addListener(x),w.addListener(P))}function z(){"removeEventListener"in r?(r.removeEventListener("change",x),w.removeEventListener("change",P)):"removeListener"in r&&(r.removeListener(x),w.removeListener(P)),r=void 0,w=void 0}let R=!0;function ae(){return O?(T===0&&Q(),R&&(R=I())&&(B(()=>{T+=1}),g(()=>{T-=1,T===0&&z()})),c(p)):c(p)}function oe(e,n){return q(e,t=>{t!==void 0&&(n.value=t)}),k(()=>e.value===void 0?n.value:e.value)}function ue(){const e=f(!1);return Y(()=>{e.value=!0}),c(e)}function se(e,n){return k(()=>{for(const t of n)if(e[t]!==void 0)return e[t];return e[n[n.length-1]]})}const A=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function re(){return A}const G={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function J(e){return`(min-width: ${e}px)`}const b={};function le(e=G){if(!$)return k(()=>[]);if(typeof window.matchMedia!="function")return k(()=>[]);const n=f({}),t=Object.keys(e),o=(u,i)=>{u.matches?n.value[i]=!0:n.value[i]=!1};return t.forEach(u=>{const i=e[u];let s,l;b[i]===void 0?(s=window.matchMedia(J(i)),s.addEventListener?s.addEventListener("change",a=>{l.forEach(d=>{d(a,u)})}):s.addListener&&s.addListener(a=>{l.forEach(d=>{d(a,u)})}),l=new Set,b[i]={mql:s,cbs:l}):(s=b[i].mql,l=b[i].cbs),l.add(o),s.matches&&l.forEach(a=>{a(s,u)})}),g(()=>{t.forEach(u=>{const{cbs:i}=b[e[u]];i.has(o)&&i.delete(o)})}),k(()=>{const{value:u}=n;return t.filter(i=>u[i])})}function fe(e={},n){const t=V({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:u}=e,i=a=>{switch(a.key){case"Control":t.ctrl=!0;break;case"Meta":t.command=!0,t.win=!0;break;case"Shift":t.shift=!0;break;case"Tab":t.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const m=o[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},s=a=>{switch(a.key){case"Control":t.ctrl=!1;break;case"Meta":t.command=!1,t.win=!1;break;case"Shift":t.shift=!1;break;case"Tab":t.tab=!1;break}u!==void 0&&Object.keys(u).forEach(d=>{if(d!==a.key)return;const m=u[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},l=()=>{(n===void 0||n.value)&&(h("keydown",document,i),h("keyup",document,s)),n!==void 0&&q(n,a=>{a?(h("keydown",document,i),h("keyup",document,s)):(v("keydown",document,i),v("keyup",document,s))})};return I()?(B(l),g(()=>{(n===void 0||n.value)&&(v("keydown",document,i),v("keyup",document,s))})):l(),c(t)}export{re as a,oe as b,se as c,fe as d,ie as e,te as f,le as g,N as h,ue as i,ae as j,ne as o,ee as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
import{w as M,_ as V,D as H,$ as U,i as k,n as B}from"./@vue-d002002f.js";/*! import{w as M,$ as V,E as H,a0 as U,i as k,n as B}from"./@vue-e0e89260.js";/*!
* vuex v4.1.0 * vuex v4.1.0
* (c) 2022 Evan You * (c) 2022 Evan You
* @license MIT * @license MIT

@ -8,26 +8,26 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<title></title> <title></title>
<script type="module" crossorigin src="/assets/index-ff680598.js"></script> <script type="module" crossorigin src="/assets/index-4ee34f7b.js"></script>
<link rel="modulepreload" crossorigin href="/assets/@vue-d002002f.js"> <link rel="modulepreload" crossorigin href="/assets/@vue-e0e89260.js">
<link rel="modulepreload" crossorigin href="/assets/vue-router-29e6667f.js"> <link rel="modulepreload" crossorigin href="/assets/vue-router-b8e3382f.js">
<link rel="modulepreload" crossorigin href="/assets/vuex-4d2f7b35.js"> <link rel="modulepreload" crossorigin href="/assets/vuex-473b3783.js">
<link rel="modulepreload" crossorigin href="/assets/axios-4a70c6fc.js"> <link rel="modulepreload" crossorigin href="/assets/axios-4a70c6fc.js">
<link rel="modulepreload" crossorigin href="/assets/seemly-76b7b838.js"> <link rel="modulepreload" crossorigin href="/assets/seemly-76b7b838.js">
<link rel="modulepreload" crossorigin href="/assets/evtd-b614532e.js"> <link rel="modulepreload" crossorigin href="/assets/evtd-b614532e.js">
<link rel="modulepreload" crossorigin href="/assets/@css-render-6b6cdab1.js"> <link rel="modulepreload" crossorigin href="/assets/@css-render-580d83ec.js">
<link rel="modulepreload" crossorigin href="/assets/vooks-77bdadbd.js"> <link rel="modulepreload" crossorigin href="/assets/vooks-a50491fd.js">
<link rel="modulepreload" crossorigin href="/assets/vdirs-b0483831.js"> <link rel="modulepreload" crossorigin href="/assets/vdirs-b0483831.js">
<link rel="modulepreload" crossorigin href="/assets/@juggle-41516555.js"> <link rel="modulepreload" crossorigin href="/assets/@juggle-41516555.js">
<link rel="modulepreload" crossorigin href="/assets/@emotion-8a8e73f6.js"> <link rel="modulepreload" crossorigin href="/assets/@emotion-8a8e73f6.js">
<link rel="modulepreload" crossorigin href="/assets/css-render-6a5c5852.js"> <link rel="modulepreload" crossorigin href="/assets/css-render-6a5c5852.js">
<link rel="modulepreload" crossorigin href="/assets/vueuc-0232e3b9.js"> <link rel="modulepreload" crossorigin href="/assets/vueuc-59ca65c3.js">
<link rel="modulepreload" crossorigin href="/assets/lodash-es-8412e618.js"> <link rel="modulepreload" crossorigin href="/assets/lodash-es-8412e618.js">
<link rel="modulepreload" crossorigin href="/assets/treemate-25c27bff.js"> <link rel="modulepreload" crossorigin href="/assets/treemate-25c27bff.js">
<link rel="modulepreload" crossorigin href="/assets/async-validator-dee29e8b.js"> <link rel="modulepreload" crossorigin href="/assets/async-validator-dee29e8b.js">
<link rel="modulepreload" crossorigin href="/assets/date-fns-975a2d8f.js"> <link rel="modulepreload" crossorigin href="/assets/date-fns-975a2d8f.js">
<link rel="modulepreload" crossorigin href="/assets/naive-ui-d02aa0d7.js"> <link rel="modulepreload" crossorigin href="/assets/naive-ui-62663ad7.js">
<link rel="modulepreload" crossorigin href="/assets/@vicons-4022100b.js"> <link rel="modulepreload" crossorigin href="/assets/@vicons-d502290a.js">
<link rel="stylesheet" href="/assets/index-c5cff9e7.css"> <link rel="stylesheet" href="/assets/index-c5cff9e7.css">
<link rel="stylesheet" href="/assets/vfonts-7afd136d.css"> <link rel="stylesheet" href="/assets/vfonts-7afd136d.css">
</head> </head>

@ -19,25 +19,25 @@
"less": "^4.1.3", "less": "^4.1.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.4", "moment": "^2.29.4",
"naive-ui": "^2.34.3", "naive-ui": "^2.34.4",
"paopao-video-player": "^1.0.0", "paopao-video-player": "^1.0.0",
"qrcanvas-vue": "^3.0.0", "qrcanvas-vue": "^3.0.0",
"qrcode": "^1.5.3", "qrcode": "^1.5.3",
"unplugin-vue-components": "^0.24.1", "unplugin-vue-components": "^0.25.1",
"v3-infinite-loading": "^1.2.2", "v3-infinite-loading": "^1.3.1",
"vfonts": "^0.0.3", "vfonts": "^0.0.3",
"vue": "^3.3.1", "vue": "^3.3.4",
"vue-router": "4", "vue-router": "4",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "^1.3.0", "@tauri-apps/cli": "^1.3.0",
"@types/node": "^18.16.0", "@types/node": "^18.16.0",
"@types/qrcode": "^1.5.0", "@types/qrcode": "^1.5.1",
"@vitejs/plugin-vue": "^4.2.2", "@vitejs/plugin-vue": "^4.2.3",
"@vue/compiler-sfc": "^3.3.1", "@vue/compiler-sfc": "^3.3.4",
"rollup-plugin-visualizer": "^5.9.0", "rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.0.4", "typescript": "^5.1.6",
"vite": "^4.3.5" "vite": "^4.4.6"
} }
} }

@ -1,12 +1,14 @@
import { request } from '@/utils/request'; import { request } from "@/utils/request";
/** 获取验证码 */ /** 获取验证码 */
export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise<NetReq.UserGetCaptcha> => { export const getCaptcha = (
return request({ params: NetParams.UserGetCaptcha = {}
method: 'get', ): Promise<NetReq.UserGetCaptcha> => {
url: '/v1/captcha', return request({
params method: "get",
}); url: "/v1/captcha",
params,
});
}; };
/** /**
@ -15,11 +17,11 @@ export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise<NetRe
* @returns Promise * @returns Promise
*/ */
export const sendCaptcha = (data: any) => { export const sendCaptcha = (data: any) => {
return request({ return request({
method: 'post', method: "post",
url: '/v1/captcha', url: "/v1/captcha",
data data,
}); });
}; };
/** /**
@ -27,12 +29,14 @@ export const sendCaptcha = (data: any) => {
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.UserWhisper> => { export const sendUserWhisper = (
return request({ data: NetParams.UserWhisper
method: 'post', ): Promise<NetParams.UserWhisper> => {
url: '/v1/user/whisper', return request({
data method: "post",
}); url: "/v1/user/whisper",
data,
});
}; };
/** /**
@ -40,12 +44,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const requestingFriend = (data: NetParams.RequestingFriend): Promise<NetReq.RequestingFriend> => { export const requestingFriend = (
return request({ data: NetParams.RequestingFriend
method: 'post', ): Promise<NetReq.RequestingFriend> => {
url: '/v1/friend/requesting', return request({
data method: "post",
}); url: "/v1/friend/requesting",
data,
});
}; };
/** /**
@ -53,12 +59,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const addFriend = (data: NetParams.AddFriend): Promise<NetReq.AddFriend> => { export const addFriend = (
return request({ data: NetParams.AddFriend
method: 'post', ): Promise<NetReq.AddFriend> => {
url: '/v1/friend/add', return request({
data method: "post",
}); url: "/v1/friend/add",
data,
});
}; };
/** /**
@ -66,12 +74,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const rejectFriend = (data: NetParams.RejectFriend): Promise<NetReq.RejectFriend> => { export const rejectFriend = (
return request({ data: NetParams.RejectFriend
method: 'post', ): Promise<NetReq.RejectFriend> => {
url: '/v1/friend/reject', return request({
data method: "post",
}); url: "/v1/friend/reject",
data,
});
}; };
/** /**
@ -79,12 +89,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const deleteFriend = (data: NetParams.DeleteFriend): Promise<NetReq.DeleteFriend> => { export const deleteFriend = (
return request({ data: NetParams.DeleteFriend
method: 'post', ): Promise<NetReq.DeleteFriend> => {
url: '/v1/friend/delete', return request({
data method: "post",
}); url: "/v1/friend/delete",
data,
});
}; };
/** /**
@ -92,12 +104,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const getContacts = (data: NetParams.GetContacts): Promise<NetReq.GetContacts> => { export const getContacts = (
return request({ data: NetParams.GetContacts
method: 'post', ): Promise<NetReq.GetContacts> => {
url: '/v1/user/contacts', return request({
data method: "post",
}); url: "/v1/user/contacts",
data,
});
}; };
/** /**
@ -105,12 +119,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise<NetParams.
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const bindUserPhone = (data: NetParams.UserBindUserPhone): Promise<NetParams.UserBindUserPhone> => { export const bindUserPhone = (
return request({ data: NetParams.UserBindUserPhone
method: 'post', ): Promise<NetParams.UserBindUserPhone> => {
url: '/v1/user/phone', return request({
data method: "post",
}); url: "/v1/user/phone",
data,
});
}; };
/** /**
@ -118,30 +134,36 @@ export const bindUserPhone = (data: NetParams.UserBindUserPhone): Promise<NetPar
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const activateUser = (data: NetParams.UserActivation): Promise<NetParams.UserActivation> => { export const activateUser = (
return request({ data: NetParams.UserActivation
method: 'post', ): Promise<NetParams.UserActivation> => {
url: '/v1/user/activate', return request({
data method: "post",
}); url: "/v1/user/activate",
data,
});
}; };
/** 更改密码 */ /** 更改密码 */
export const changePassword = (data: NetParams.UserChangePassword): Promise<NetReq.UserChangePassword> => { export const changePassword = (
return request({ data: NetParams.UserChangePassword
method: 'post', ): Promise<NetReq.UserChangePassword> => {
url: '/v1/user/password', return request({
data method: "post",
}); url: "/v1/user/password",
data,
});
}; };
/** 更改昵称 */ /** 更改昵称 */
export const changeNickname = (data: NetParams.UserChangeNickname): Promise<NetReq.UserChangeNickname> => { export const changeNickname = (
return request({ data: NetParams.UserChangeNickname
method: 'post', ): Promise<NetReq.UserChangeNickname> => {
url: '/v1/user/nickname', return request({
data method: "post",
}); url: "/v1/user/nickname",
data,
});
}; };
/** /**
@ -150,29 +172,33 @@ export const changeNickname = (data: NetParams.UserChangeNickname): Promise<NetR
* @returns Promise * @returns Promise
*/ */
export const changeAvatar = (data: any) => { export const changeAvatar = (data: any) => {
return request({ return request({
method: 'post', method: "post",
url: '/v1/user/avatar', url: "/v1/user/avatar",
data data,
}); });
}; };
/** 获取未读消息数 */ /** 获取未读消息数 */
export const getUnreadMsgCount = (params: NetParams.UserGetUnreadMsgCount = {}): Promise<NetReq.UserGetUnreadMsgCount> => { export const getUnreadMsgCount = (
return request({ params: NetParams.UserGetUnreadMsgCount = {}
method: 'get', ): Promise<NetReq.UserGetUnreadMsgCount> => {
url: '/v1/user/msgcount/unread', return request({
params method: "get",
}); url: "/v1/user/msgcount/unread",
params,
});
}; };
/** 获取消息列表 */ /** 获取消息列表 */
export const getMessages = (params: NetParams.UserGetMessages): Promise<NetReq.UserGetMessages> => { export const getMessages = (
return request({ params: NetParams.UserGetMessages
method: 'get', ): Promise<NetReq.UserGetMessages> => {
url: '/v1/user/messages', return request({
params method: "get",
}); url: "/v1/user/messages",
params,
});
}; };
/** /**
@ -181,47 +207,66 @@ export const getMessages = (params: NetParams.UserGetMessages): Promise<NetReq.U
* @returns Promise * @returns Promise
*/ */
export const readMessage = (data: any) => { export const readMessage = (data: any) => {
return request({ return request({
method: 'post', method: "post",
url: '/v1/user/message/read', url: "/v1/user/message/read",
data data,
}); });
}; };
/** 获取收藏列表 */ /** 获取收藏列表 */
export const getCollections = (params: NetParams.UserGetCollections): Promise<NetReq.UserGetCollections> => { export const getCollections = (
return request({ params: NetParams.UserGetCollections
method: 'get', ): Promise<NetReq.UserGetCollections> => {
url: '/v1/user/collections', return request({
params method: "get",
}); url: "/v1/user/collections",
params,
});
};
/** 获取点赞列表 */
export const getStars = (
params: NetParams.UserGetStars
): Promise<NetReq.UserGetStars> => {
return request({
method: "get",
url: "/v1/user/stars",
params,
});
}; };
/** 获取用户基础信息 */ /** 获取用户基础信息 */
export const getUserProfile = (params: NetParams.UserGetUserProfile): Promise<NetReq.UserGetUserProfile> => { export const getUserProfile = (
return request({ params: NetParams.UserGetUserProfile
method: 'get', ): Promise<NetReq.UserGetUserProfile> => {
url: '/v1/user/profile', return request({
params method: "get",
}); url: "/v1/user/profile",
params,
});
}; };
/** 获取用户帖子列表 */ /** 获取用户帖子列表 */
export const getUserPosts = (params: NetParams.UserGetUserPosts): Promise<NetReq.UserGetUserPosts> => { export const getUserPosts = (
return request({ params: NetParams.UserGetUserPosts
method: 'get', ): Promise<NetReq.UserGetUserPosts> => {
url: '/v1/user/posts', return request({
params method: "get",
}); url: "/v1/user/posts",
params,
});
}; };
/** 获取账单列表 */ /** 获取账单列表 */
export const getBills = (params: NetParams.UserGetBills): Promise<NetReq.UserGetBills> => { export const getBills = (
return request({ params: NetParams.UserGetBills
method: 'get', ): Promise<NetReq.UserGetBills> => {
url: '/v1/user/wallet/bills', return request({
params method: "get",
}); url: "/v1/user/wallet/bills",
params,
});
}; };
/** /**
@ -229,12 +274,14 @@ export const getBills = (params: NetParams.UserGetBills): Promise<NetReq.UserGet
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const reqRecharge = (data: NetParams.UserReqRecharge): Promise<NetReq.UserReqRecharge> => { export const reqRecharge = (
return request({ data: NetParams.UserReqRecharge
method: 'post', ): Promise<NetReq.UserReqRecharge> => {
url: '/v1/user/recharge', return request({
data method: "post",
}); url: "/v1/user/recharge",
data,
});
}; };
/** /**
@ -242,12 +289,14 @@ export const reqRecharge = (data: NetParams.UserReqRecharge): Promise<NetReq.Use
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getRecharge = (params: NetParams.UserGetRecharge): Promise<NetReq.UserGetRecharge> => { export const getRecharge = (
return request({ params: NetParams.UserGetRecharge
method: 'get', ): Promise<NetReq.UserGetRecharge> => {
url: '/v1/user/recharge', return request({
params method: "get",
}); url: "/v1/user/recharge",
params,
});
}; };
/** /**
@ -255,12 +304,14 @@ export const getRecharge = (params: NetParams.UserGetRecharge): Promise<NetReq.U
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getSuggestUsers = (params: { k: string }): Promise<NetReq.UserGetSuggestUsers> => { export const getSuggestUsers = (params: {
return request({ k: string;
method: 'get', }): Promise<NetReq.UserGetSuggestUsers> => {
url: '/v1/suggest/users', return request({
params method: "get",
}); url: "/v1/suggest/users",
params,
});
}; };
/** /**
@ -268,12 +319,14 @@ export const getSuggestUsers = (params: { k: string }): Promise<NetReq.UserGetSu
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getSuggestTags = (params: { k: string }): Promise<NetReq.UserGetSuggestTags> => { export const getSuggestTags = (params: {
return request({ k: string;
method: 'get', }): Promise<NetReq.UserGetSuggestTags> => {
url: '/v1/suggest/tags', return request({
params method: "get",
}); url: "/v1/suggest/tags",
params,
});
}; };
/** /**
@ -281,12 +334,14 @@ export const getSuggestTags = (params: { k: string }): Promise<NetReq.UserGetSug
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const precheckAttachment = (params: NetParams.UserPrecheckAttachment): Promise<NetReq.UserPrecheckAttachment> => { export const precheckAttachment = (
return request({ params: NetParams.UserPrecheckAttachment
method: 'get', ): Promise<NetReq.UserPrecheckAttachment> => {
url: '/v1/attachment/precheck', return request({
params method: "get",
}); url: "/v1/attachment/precheck",
params,
});
}; };
/** /**
@ -294,12 +349,14 @@ export const precheckAttachment = (params: NetParams.UserPrecheckAttachment): Pr
* @param {Object} params * @param {Object} params
* @returns Promise * @returns Promise
*/ */
export const getAttachment = (params: NetParams.UserGetAttachment): Promise<NetReq.UserGetAttachment> => { export const getAttachment = (
return request({ params: NetParams.UserGetAttachment
method: 'get', ): Promise<NetReq.UserGetAttachment> => {
url: '/v1/attachment', return request({
params method: "get",
}); url: "/v1/attachment",
params,
});
}; };
/** /**
@ -307,10 +364,12 @@ export const getAttachment = (params: NetParams.UserGetAttachment): Promise<NetR
* @param {Object} data * @param {Object} data
* @returns Promise * @returns Promise
*/ */
export const changeUserStatus = (data: NetParams.UserStatusReq): Promise<NetReq.UserChangeStatus> => { export const changeUserStatus = (
return request({ data: NetParams.UserStatusReq
method: 'post', ): Promise<NetReq.UserChangeStatus> => {
url: '/v1/admin/user/status', return request({
data method: "post",
}); url: "/v1/admin/user/status",
data,
});
}; };

@ -27,6 +27,11 @@ declare module NetParams {
page_size: number; page_size: number;
} }
interface UserGetStars {
page: number,
page_size: number
}
interface UserPrecheckAttachment { interface UserPrecheckAttachment {
id: number; id: number;
} }

@ -55,6 +55,13 @@ declare module NetReq {
pager: Item.PagerProps; pager: Item.PagerProps;
} }
interface UserGetStars {
/** 帖子列表 */
list: Item.PostProps[];
/** 页码信息 */
pager: Item.PagerProps;
}
type UserGetUserProfile = Item.UserInfo; type UserGetUserProfile = Item.UserInfo;
interface UserGetBills { interface UserGetBills {

@ -20,9 +20,9 @@
<div class="uid">UID. {{ store.state.userInfo.id }}</div> <div class="uid">UID. {{ store.state.userInfo.id }}</div>
</div> </div>
</div> </div>
<n-tabs class="profile-tabs-wrap" animated> <n-tabs class="profile-tabs-wrap" type="line" animated @update:value="changeTab">
<n-tab-pane name="post" tab="泡泡"> </n-tab-pane> <n-tab-pane name="post" tab="泡泡"> </n-tab-pane>
<!-- <n-tab-pane name="comment" tab="评论"> </n-tab-pane> --> <n-tab-pane name="star" tab="点赞"> </n-tab-pane>
</n-tabs> </n-tabs>
<div v-if="loading" class="skeleton-wrap"> <div v-if="loading" class="skeleton-wrap">
<post-skeleton :num="pageSize" /> <post-skeleton :num="pageSize" />
@ -57,20 +57,30 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted, watch } from 'vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { getUserPosts } from '@/api/user'; import { getUserPosts, getStars } from '@/api/user';
const store = useStore(); const store = useStore();
const route = useRoute(); const route = useRoute();
const loading = ref(false); const loading = ref(false);
const list = ref<Item.PostProps[]>([]); const list = ref<Item.PostProps[]>([]);
const pageType = ref<"post" | "star">('post');
const postPage = ref(+(route.query.p as string) || 1);
const starPage = ref(1);
const page = ref(+(route.query.p as string) || 1); const page = ref(+(route.query.p as string) || 1);
const pageSize = ref(20); const pageSize = ref(20);
const totalPage = ref(0); const totalPage = ref(0);
const loadPage = () => {
if (pageType.value == "post") {
loadPosts()
} else if (pageType.value = "star") {
loadStars()
}
};
const loadPosts = () => { const loadPosts = () => {
loading.value = true; loading.value = true;
getUserPosts({ getUserPosts({
@ -89,13 +99,68 @@ const loadPosts = () => {
loading.value = false; loading.value = false;
}); });
}; };
const loadStars = () => {
loading.value = true;
getStars({
page: page.value,
page_size: pageSize.value,
})
.then((rsp) => {
loading.value = false;
list.value = rsp.list;
totalPage.value = Math.ceil(rsp.pager.total_rows / pageSize.value);
window.scrollTo(0, 0);
})
.catch((err) => {
loading.value = false;
});
};
const changeTab = (tab: "post" | "star") => {
pageType.value = tab;
if (tab == "post") {
page.value = postPage.value
loadPosts();
} else if (tab == "star") {
page.value = starPage.value
loadStars();
}
};
const updatePage = (p: number) => { const updatePage = (p: number) => {
page.value = p; page.value = p;
loadPosts(); if (pageType.value == "post") {
postPage.value = p
loadPosts();
} else if (pageType.value == "star") {
starPage.value = page.value
loadStars();
}
}; };
onMounted(() => { onMounted(() => {
loadPosts(); loadPage();
}); });
watch(
() => ({
path: route.path,
query: route.query,
refresh: store.state.refresh,
}),
(to, from) => {
if (to.refresh !== from.refresh) {
page.value = +(route.query.p as string) || 1;
setTimeout(() => {
loadPage();
}, 0);
return;
}
if (from.path !== '/post' && to.path === '/profile') {
page.value = +(route.query.p as string) || 1;
setTimeout(() => {
loadPage();
}, 0);
}
}
);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save