From ff97e870443826bcc6a4585373391729ff70ec80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:26 +0000 Subject: [PATCH 1/6] mod: bump github.com/redis/rueidis from 1.0.18 to 1.0.19 Bumps [github.com/redis/rueidis](https://github.com/redis/rueidis) from 1.0.18 to 1.0.19. - [Release notes](https://github.com/redis/rueidis/releases) - [Commits](https://github.com/redis/rueidis/compare/v1.0.18...v1.0.19) --- updated-dependencies: - dependency-name: github.com/redis/rueidis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1fae12d..4e52b32c 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/onsi/gomega v1.27.10 github.com/prometheus/client_golang v1.16.0 github.com/pyroscope-io/client v0.7.2 - github.com/redis/rueidis v1.0.18 + github.com/redis/rueidis v1.0.19 github.com/robfig/cron/v3 v3.0.1 github.com/sirupsen/logrus v1.9.3 github.com/smartwalle/alipay/v3 v3.2.16 diff --git a/go.sum b/go.sum index 316bb76a..f4bf08e1 100644 --- a/go.sum +++ b/go.sum @@ -1139,8 +1139,8 @@ github.com/pyroscope-io/client v0.7.2 h1:OX2qdUQsS8RSkn/3C8isD7f/P0YiZQlRbAlecAa github.com/pyroscope-io/client v0.7.2/go.mod h1:FEocnjn+Ngzxy6EtU9ZxXWRvQ0+pffkrBxHLnPpxwi8= github.com/pyroscope-io/godeltaprof v0.1.2 h1:MdlEmYELd5w+lvIzmZvXGNMVzW2Qc9jDMuJaPOR75g4= github.com/pyroscope-io/godeltaprof v0.1.2/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= -github.com/redis/rueidis v1.0.18 h1:yfqQ22QCfIey+w1LHAp006dlJXwATePVUM+1w2ePrIo= -github.com/redis/rueidis v1.0.18/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= +github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo= +github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= From 95a305360b47c0a35ff7a52a47ab21cb4ea076f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:35 +0000 Subject: [PATCH 2/6] mod: bump github.com/huaweicloud/huaweicloud-sdk-go-obs Bumps [github.com/huaweicloud/huaweicloud-sdk-go-obs](https://github.com/huaweicloud/huaweicloud-sdk-go-obs) from 3.23.4+incompatible to 3.23.9+incompatible. - [Release notes](https://github.com/huaweicloud/huaweicloud-sdk-go-obs/releases) - [Commits](https://github.com/huaweicloud/huaweicloud-sdk-go-obs/compare/v3.23.4...v3.23.9) --- updated-dependencies: - dependency-name: github.com/huaweicloud/huaweicloud-sdk-go-obs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1fae12d..41d12fb7 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/gofrs/uuid/v5 v5.0.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/golang-migrate/migrate/v4 v4.15.2 - github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible github.com/json-iterator/go v1.1.12 github.com/meilisearch/meilisearch-go v0.25.1 github.com/minio/minio-go/v7 v7.0.63 diff --git a/go.sum b/go.sum index 316bb76a..11721e3f 100644 --- a/go.sum +++ b/go.sum @@ -744,8 +744,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible h1:XRAk4HBDLCYEdPLWtKf5iZhOi7lfx17aY0oSO9+mcg8= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible h1:zUhCrGMMpJxZGAB30GbQzluDhQuPENxRQfxss7KlpKU= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= From 19d026a692f8154184f6604c4016b3aded0c944d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:51:54 +0000 Subject: [PATCH 3/6] mod: bump modernc.org/sqlite from 1.25.0 to 1.26.0 Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.25.0 to 1.26.0. - [Commits](https://gitlab.com/cznic/sqlite/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: modernc.org/sqlite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1fae12d..270a1d7d 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( gorm.io/gorm v1.25.4 gorm.io/plugin/dbresolver v1.4.7 gorm.io/plugin/soft_delete v1.2.1 - modernc.org/sqlite v1.25.0 + modernc.org/sqlite v1.26.0 ) require ( diff --git a/go.sum b/go.sum index 316bb76a..335d33e5 100644 --- a/go.sum +++ b/go.sum @@ -2151,8 +2151,8 @@ modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= -modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= +modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= From 11b87b9da44bb1ae858ffa0f458223a111812ba4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:52:03 +0000 Subject: [PATCH 4/6] mod: bump github.com/onsi/gomega from 1.27.10 to 1.28.0 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.10 to 1.28.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.10...v1.28.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1fae12d..ce5de5fc 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/meilisearch/meilisearch-go v0.25.1 github.com/minio/minio-go/v7 v7.0.63 github.com/onsi/ginkgo/v2 v2.12.1 - github.com/onsi/gomega v1.27.10 + github.com/onsi/gomega v1.28.0 github.com/prometheus/client_golang v1.16.0 github.com/pyroscope-io/client v0.7.2 github.com/redis/rueidis v1.0.18 diff --git a/go.sum b/go.sum index 316bb76a..bdf2eeff 100644 --- a/go.sum +++ b/go.sum @@ -1033,8 +1033,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= From af723e180b6538ad51363e635a21c890bd644761 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:52:13 +0000 Subject: [PATCH 5/6] mod: bump github.com/go-resty/resty/v2 from 2.8.0 to 2.9.1 Bumps [github.com/go-resty/resty/v2](https://github.com/go-resty/resty) from 2.8.0 to 2.9.1. - [Release notes](https://github.com/go-resty/resty/releases) - [Commits](https://github.com/go-resty/resty/compare/v2.8.0...v2.9.1) --- updated-dependencies: - dependency-name: github.com/go-resty/resty/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1fae12d..71092632 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/getsentry/sentry-go v0.24.1 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-resty/resty/v2 v2.8.0 + github.com/go-resty/resty/v2 v2.9.1 github.com/goccy/go-json v0.10.2 github.com/gofrs/uuid/v5 v5.0.0 github.com/golang-jwt/jwt/v5 v5.0.0 diff --git a/go.sum b/go.sum index 316bb76a..3a605ab4 100644 --- a/go.sum +++ b/go.sum @@ -524,8 +524,8 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-resty/resty/v2 v2.8.0 h1:J29d0JFWwSWrDCysnOK/YjsPMLQTx0TvgJEHVGvf2L8= -github.com/go-resty/resty/v2 v2.8.0/go.mod h1:UCui0cMHekLrSntoMyofdSTaPpinlRHFtPpizuyDW2w= +github.com/go-resty/resty/v2 v2.9.1 h1:PIgGx4VrHvag0juCJ4dDv3MiFRlDmP0vicBucwf+gLM= +github.com/go-resty/resty/v2 v2.9.1/go.mod h1:4/GYJVjh9nhkhGR6AUNW3XhpDYNUr+Uvy9gV/VGZIy4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -1731,6 +1731,7 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From ea323f39c6c707c2865b2a1cee8c1ec774719f83 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 3 Oct 2023 06:58:57 +0800 Subject: [PATCH 6/6] add custom web frontend features base by a profile that fetch from backend support --- CHANGELOG.md | 24 ++++- auto/api/v1/site.go | 63 +++++++++++ config.yaml.sample | 16 +++ internal/conf/conf.go | 2 + internal/conf/config.yaml | 27 +++-- internal/conf/setting.go | 18 ++++ internal/model/web/pub.go | 8 -- internal/model/web/site.go | 16 +++ internal/servants/web/site.go | 39 +++++++ internal/servants/web/web.go | 1 + mirc/web/v1/site.go | 22 ++++ web/.env | 4 +- .../{404-b8b53fcf.js => 404-c0c7310e.js} | 2 +- ...nt-96debf58.js => Anouncement-a1221d42.js} | 2 +- ...ion-b709ad01.js => Collection-55969243.js} | 2 +- ...tacts-db8bb89e.js => Contacts-669f91fa.js} | 2 +- ...wing-eb71a515.js => Following-3acd73c5.js} | 2 +- web/dist/assets/Home-c19b4d50.js | 1 + web/dist/assets/Home-d5a23262.js | 1 - .../{Home-6a728cf8.css => Home-e6b13f04.css} | 2 +- ...sages-4bbf517b.js => Messages-2895f627.js} | 2 +- ...ges-1851378b.css => Messages-9543d2b3.css} | 2 +- .../{Post-e91899fe.js => Post-44974496.js} | 2 +- ...rofile-de924a39.js => Profile-7682ee52.js} | 2 +- web/dist/assets/Setting-94ec4c57.css | 1 + web/dist/assets/Setting-9923d3fd.js | 1 + web/dist/assets/Setting-bfd24152.css | 1 - web/dist/assets/Setting-cf58f1fc.js | 1 - .../{Topic-6e91af53.js => Topic-a2ac0d74.js} | 2 +- web/dist/assets/User-00d998d0.css | 1 - web/dist/assets/User-1ad57452.css | 1 + web/dist/assets/User-e929b372.js | 1 - web/dist/assets/User-f3cd38fc.js | 1 + ...{Wallet-dbe4c788.js => Wallet-d200e3ec.js} | 2 +- ...ontent-845a2453.js => content-a642a616.js} | 2 +- web/dist/assets/index-15a0e03b.js | 1 + web/dist/assets/index-2af3a836.js | 1 - ...{index-c337d1db.css => index-8daef249.css} | 2 +- ...e_vue_type_style_index_0_lang-a20a8596.js} | 2 +- ...e_vue_type_style_index_0_lang-4d372959.js} | 2 +- ...-d9166350.js => post-skeleton-a15059e0.js} | 2 +- ...hisper-694050d3.js => whisper-29f2b0aa.js} | 2 +- ...a50f.js => whisper-add-friend-78adb41e.js} | 2 +- web/dist/index.html | 4 +- web/src/App.vue | 16 ++- web/src/api/site.ts | 9 ++ web/src/components/auth.vue | 5 +- web/src/components/compose.vue | 21 ++-- web/src/components/rightbar.vue | 15 +-- web/src/components/sidebar.vue | 14 +-- web/src/store/index.ts | 100 ++++++++++++++++++ web/src/types/NetReq.d.ts | 18 ++++ web/src/views/Home.vue | 6 +- web/src/views/Messages.vue | 2 +- web/src/views/Setting.vue | 13 +-- web/src/views/User.vue | 6 +- web/src/vite-env.d.ts | 2 +- 57 files changed, 423 insertions(+), 98 deletions(-) create mode 100644 auto/api/v1/site.go create mode 100644 internal/model/web/site.go create mode 100644 internal/servants/web/site.go create mode 100644 mirc/web/v1/site.go rename web/dist/assets/{404-b8b53fcf.js => 404-c0c7310e.js} (85%) rename web/dist/assets/{Anouncement-96debf58.js => Anouncement-a1221d42.js} (91%) rename web/dist/assets/{Collection-b709ad01.js => Collection-55969243.js} (90%) rename web/dist/assets/{Contacts-db8bb89e.js => Contacts-669f91fa.js} (92%) rename web/dist/assets/{Following-eb71a515.js => Following-3acd73c5.js} (95%) create mode 100644 web/dist/assets/Home-c19b4d50.js delete mode 100644 web/dist/assets/Home-d5a23262.js rename web/dist/assets/{Home-6a728cf8.css => Home-e6b13f04.css} (62%) rename web/dist/assets/{Messages-4bbf517b.js => Messages-2895f627.js} (97%) rename web/dist/assets/{Messages-1851378b.css => Messages-9543d2b3.css} (77%) rename web/dist/assets/{Post-e91899fe.js => Post-44974496.js} (98%) rename web/dist/assets/{Profile-de924a39.js => Profile-7682ee52.js} (95%) create mode 100644 web/dist/assets/Setting-94ec4c57.css create mode 100644 web/dist/assets/Setting-9923d3fd.js delete mode 100644 web/dist/assets/Setting-bfd24152.css delete mode 100644 web/dist/assets/Setting-cf58f1fc.js rename web/dist/assets/{Topic-6e91af53.js => Topic-a2ac0d74.js} (95%) delete mode 100644 web/dist/assets/User-00d998d0.css create mode 100644 web/dist/assets/User-1ad57452.css delete mode 100644 web/dist/assets/User-e929b372.js create mode 100644 web/dist/assets/User-f3cd38fc.js rename web/dist/assets/{Wallet-dbe4c788.js => Wallet-d200e3ec.js} (95%) rename web/dist/assets/{content-845a2453.js => content-a642a616.js} (98%) create mode 100644 web/dist/assets/index-15a0e03b.js delete mode 100644 web/dist/assets/index-2af3a836.js rename web/dist/assets/{index-c337d1db.css => index-8daef249.css} (76%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js => main-nav.vue_vue_type_style_index_0_lang-a20a8596.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js => post-item.vue_vue_type_style_index_0_lang-4d372959.js} (98%) rename web/dist/assets/{post-skeleton-d9166350.js => post-skeleton-a15059e0.js} (88%) rename web/dist/assets/{whisper-694050d3.js => whisper-29f2b0aa.js} (95%) rename web/dist/assets/{whisper-add-friend-83d6a50f.js => whisper-add-friend-78adb41e.js} (95%) create mode 100644 web/src/api/site.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9441ddc9..d5c19053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -158,9 +158,31 @@ All notable changes to paopao-ce are documented in this file. UNION SELECT user_id, follow_id he_uid, 10 AS style FROM p_following WHERE is_del=0; + ``` - add tweets count info in Home/Profile page. +- add custom web frontend features base by a profile that fetch from backend support. + can add custom config to conf.yaml to custom web frontend features: + ```yaml + ... + WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" + ... ``` - + ## 0.4.2 ### Fixed - fixed remove multi-objects no effects and occurs resource leak error when use Minio as OSS(Object Storage System).[#371](https://github.com/rocboss/paopao-ce/pull/371) [#372](https://github.com/rocboss/paopao-ce/pull/372) diff --git a/auto/api/v1/site.go b/auto/api/v1/site.go new file mode 100644 index 00000000..7f4f16cf --- /dev/null +++ b/auto/api/v1/site.go @@ -0,0 +1,63 @@ +// Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 + +package v1 + +import ( + "net/http" + + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +type Site interface { + _default_ + + Profile() (*conf.WebProfileConf, mir.Error) + Version() (*web.VersionResp, mir.Error) + + mustEmbedUnimplementedSiteServant() +} + +// RegisterSiteServant register Site servant to gin +func RegisterSiteServant(e *gin.Engine, s Site) { + router := e.Group("v1") + + // register routes info to router + router.Handle("GET", "/site/profile", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + + resp, err := s.Profile() + s.Render(c, resp, err) + }) + router.Handle("GET", "/site/version", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + + resp, err := s.Version() + s.Render(c, resp, err) + }) +} + +// UnimplementedSiteServant can be embedded to have forward compatible implementations. +type UnimplementedSiteServant struct{} + +func (UnimplementedSiteServant) Profile() (*conf.WebProfileConf, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedSiteServant) Version() (*web.VersionResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedSiteServant) mustEmbedUnimplementedSiteServant() {} diff --git a/config.yaml.sample b/config.yaml.sample index 33f9b73d..8ca7b313 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -183,4 +183,20 @@ Sqlite3: # Sqlite3数据库 Redis: InitAddress: - redis:6379 +WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" \ No newline at end of file diff --git a/internal/conf/conf.go b/internal/conf/conf.go index 321a7a91..075c2b06 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -57,6 +57,7 @@ var ( S3Setting *s3Conf LocalOSSSetting *localossConf JWTSetting *jwtConf + WebProfileSetting *WebProfileConf ) func setupSetting(suite []string, noDefault bool) error { @@ -117,6 +118,7 @@ func setupSetting(suite []string, noDefault bool) error { "MinIO": &MinIOSetting, "LocalOSS": &LocalOSSSetting, "S3": &S3Setting, + "WebProfile": &WebProfileSetting, } for k, v := range objects { err := vp.UnmarshalKey(k, v) diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml index c8df7f1b..53cb5c3d 100644 --- a/internal/conf/config.yaml +++ b/internal/conf/config.yaml @@ -13,12 +13,12 @@ Cache: UnreadMsgExpire: 60 # 未读消息过期时间,单位秒, 默认60s UserTweetsExpire: 60 # 获取用户推文列表过期时间,单位秒, 默认60s IndexTweetsExpire: 120 # 获取广场推文列表过期时间,单位秒, 默认120s - TweetCommentsExpire: 180 # 获取推文评论过期时间,单位秒, 默认180s - IndexTrendsExpire: 300 # 获取广场动态信息过期时间,单位秒, 默认300s + TweetCommentsExpire: 120 # 获取推文评论过期时间,单位秒, 默认120s + IndexTrendsExpire: 120 # 获取广场动态信息过期时间,单位秒, 默认120s OnlineUserExpire: 300 # 标记在线用户 过期时间,单位秒, 默认300s - UserInfoExpire: 300 # 获取用户信息过期时间,单位秒, 默认300s - UserProfileExpire: 180 # 获取用户概要过期时间,单位秒, 默认180s - UserRelationExpire: 600 # 用户关系信息过期时间,单位秒, 默认600s + UserInfoExpire: 120 # 获取用户信息过期时间,单位秒, 默认120s + UserProfileExpire: 120 # 获取用户概要过期时间,单位秒, 默认120s + UserRelationExpire: 120 # 用户关系信息过期时间,单位秒, 默认120s MessagesExpire: 60 # 消息列表过期时间,单位秒, 默认60s EventManager: # 事件管理器的配置参数 MinWorker: 64 # 最小后台工作者, 设置范围[5, ++], 默认64 @@ -248,4 +248,19 @@ Redis: Password: SelectDB: ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒 - \ No newline at end of file +WebProfile: + UseFriendship: true # 前端是否使用好友体系 + EnableTrendsBar: true # 广场页面是否开启动态条栏功能 + EnableWallet: false # 是否开启钱包功能 + AllowTweetAttachment: true # 是否允许推文附件 + AllowTweetAttachmentPrice: true # 是否允许推文付费附件 + AllowTweetVideo: true # 是否允许视频推文 + AllowUserRegister: true # 是否允许用户注册 + AllowPhoneBind: true # 是否允许手机绑定 + DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private + DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms + CopyrightTop: "2023 paopao.info" + CopyrightLeft: "Roc's Me" + CopyrightLeftLink: "" + CopyrightRight: "泡泡(PaoPao)开源社区" + CopyrightRightLink: "https://www.paopao.info" diff --git a/internal/conf/setting.go b/internal/conf/setting.go index a09251b2..015a618c 100644 --- a/internal/conf/setting.go +++ b/internal/conf/setting.go @@ -283,6 +283,24 @@ type jwtConf struct { Expire time.Duration } +type WebProfileConf struct { + UseFriendship bool `json:"use_friendship"` + EnableTrendsBar bool `json:"enable_trends_bar"` + EnableWallet bool `json:"enable_wallet"` + AllowTweetAttachment bool `json:"allow_tweet_attachment"` + AllowTweetAttachmentPrice bool `json:"allow_tweet_attachment_price"` + AllowTweetVideo bool `json:"allow_tweet_video"` + AllowUserRegister bool `json:"allow_user_register"` + AllowPhoneBind bool `json:"allow_phone_bind"` + DefaultTweetVisibility string `json:"default_tweet_visibility"` + DefaultMsgLoopInterval int `json:"default_msg_loop_interval"` + CopyrightTop string `json:"copyright_top"` + CopyrightLeft string `json:"copyright_left"` + CopyrightLeftLink string `json:"copyright_left_link"` + CopyrightRight string `json:"copyright_right"` + CopyrightRightLink string `json:"copyright_right_link"` +} + func (s *httpServerConf) GetReadTimeout() time.Duration { return s.ReadTimeout * time.Second } diff --git a/internal/model/web/pub.go b/internal/model/web/pub.go index 223509d2..3aa796c6 100644 --- a/internal/model/web/pub.go +++ b/internal/model/web/pub.go @@ -4,10 +4,6 @@ package web -import ( - "github.com/rocboss/paopao-ce/pkg/version" -) - type GetCaptchaResp struct { Id string `json:"id"` Content string `json:"b64s"` @@ -19,10 +15,6 @@ type SendCaptchaReq struct { ImgCaptchaID string `json:"img_captcha_id" form:"img_captcha_id" binding:"required"` } -type VersionResp struct { - BuildInfo *version.BuildInfo `json:"build_info"` -} - type LoginReq struct { Username string `json:"username" form:"username" binding:"required"` Password string `json:"password" form:"password" binding:"required"` diff --git a/internal/model/web/site.go b/internal/model/web/site.go new file mode 100644 index 00000000..9173dc20 --- /dev/null +++ b/internal/model/web/site.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/pkg/version" +) + +type VersionResp struct { + BuildInfo *version.BuildInfo `json:"build_info"` +} + +type SiteProfileResp = conf.WebProfileConf diff --git a/internal/servants/web/site.go b/internal/servants/web/site.go new file mode 100644 index 00000000..ce137fbf --- /dev/null +++ b/internal/servants/web/site.go @@ -0,0 +1,39 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/alimy/mir/v4" + api "github.com/rocboss/paopao-ce/auto/api/v1" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/model/web" + "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/version" +) + +var ( + _ api.Site = (*siteSrv)(nil) +) + +type siteSrv struct { + api.UnimplementedSiteServant + *base.BaseServant +} + +func (*siteSrv) Profile() (*web.SiteProfileResp, mir.Error) { + return conf.WebProfileSetting, nil +} + +func (*siteSrv) Version() (*web.VersionResp, mir.Error) { + return &web.VersionResp{ + BuildInfo: version.ReadBuildInfo(), + }, nil +} + +func newSiteSrv() api.Site { + return &siteSrv{ + BaseServant: base.NewBaseServant(), + } +} diff --git a/internal/servants/web/web.go b/internal/servants/web/web.go index ae981f74..7f95eee2 100644 --- a/internal/servants/web/web.go +++ b/internal/servants/web/web.go @@ -41,6 +41,7 @@ func RouteWeb(e *gin.Engine) { api.RegisterTrendsServant(e, newTrendsSrv(ds)) api.RegisterFollowshipServant(e, newFollowshipSrv(ds)) api.RegisterFriendshipServant(e, newFriendshipSrv(ds)) + api.RegisterSiteServant(e, newSiteSrv()) // regster servants if needed by configure cfg.Be("Alipay", func() { client := conf.MustAlipayClient() diff --git a/mirc/web/v1/site.go b/mirc/web/v1/site.go new file mode 100644 index 00000000..ba8ca294 --- /dev/null +++ b/mirc/web/v1/site.go @@ -0,0 +1,22 @@ +package v1 + +import ( + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" + "github.com/rocboss/paopao-ce/internal/model/web" +) + +func init() { + Entry[Site]() +} + +// Site 站点本身相关的信息服务 +type Site struct { + Group `mir:"v1"` + + // Version 获取后台版本信息 + Version func(Get) web.VersionResp `mir:"/site/version"` + + // Profile 站点配置概要信息 + Profile func(Get) web.SiteProfileResp `mir:"/site/profile"` +} diff --git a/web/.env b/web/.env index 95bcdd12..80fe27f8 100644 --- a/web/.env +++ b/web/.env @@ -6,7 +6,7 @@ VITE_USE_FRIENDSHIP=true # 模块开启 VITE_ENABLE_ANOUNCEMENT=false VITE_ENABLE_WALLET=false -VITE_ENABLE_FRIENDS_BAR=true +VITE_ENABLE_TRENDS_BAR=true # 功能开启 VITE_ALLOW_TWEET_ATTACHMENT=true @@ -19,7 +19,7 @@ VITE_ALLOW_PHONE_BIND=true # 局部参数 VITE_DEFAULT_MSG_LOOP_INTERVAL=5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms -VITE_DEFAULT_TWEET_VISIBILITY=friend # 推文可见性,默认好友可见 +VITE_DEFAULT_TWEET_VISIBILITY=friend # 推文可见性,默认好友可见 值: public/following/friend/private VITE_DEFAULT_TWEET_MAX_LENGTH=400 # 推文最大长度, 默认400字 VITE_DEFAULT_COMMENT_MAX_LENGTH=300 # 评论最大长度, 默认300字 VITE_DEFAULT_REPLY_MAX_LENGTH=300 # 评论最大长度, 默认300字 diff --git a/web/dist/assets/404-b8b53fcf.js b/web/dist/assets/404-c0c7310e.js similarity index 85% rename from web/dist/assets/404-b8b53fcf.js rename to web/dist/assets/404-c0c7310e.js index 8fd2f8e7..e856f23c 100644 --- a/web/dist/assets/404-b8b53fcf.js +++ b/web/dist/assets/404-c0c7310e.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-2af3a836.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-15a0e03b.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; diff --git a/web/dist/assets/Anouncement-96debf58.js b/web/dist/assets/Anouncement-a1221d42.js similarity index 91% rename from web/dist/assets/Anouncement-96debf58.js rename to web/dist/assets/Anouncement-a1221d42.js index 079633c0..5db5ae2a 100644 --- a/web/dist/assets/Anouncement-96debf58.js +++ b/web/dist/assets/Anouncement-a1221d42.js @@ -1 +1 @@ -import{_ as N}from"./post-skeleton-d9166350.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-2af3a836.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; +import{_ as N}from"./post-skeleton-a15059e0.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-15a0e03b.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; diff --git a/web/dist/assets/Collection-b709ad01.js b/web/dist/assets/Collection-55969243.js similarity index 90% rename from web/dist/assets/Collection-b709ad01.js rename to web/dist/assets/Collection-55969243.js index 590c3c04..f178e0b0 100644 --- a/web/dist/assets/Collection-b709ad01.js +++ b/web/dist/assets/Collection-55969243.js @@ -1 +1 @@ -import{_ as q}from"./whisper-694050d3.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as U}from"./post-skeleton-d9166350.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-2af3a836.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-845a2453.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{b()}),(e,r)=>{const m=E,O=U,P=ae,T=D,F=le,H=R,N=q,V=te,W=ie,j=ne;return o(),n("div",null,[a(m,{title:"收藏"}),a(V,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(T,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",pe,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),p.value>0?(o(),d(j,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",me,[_.value?h("",!0):(o(),d(W,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}});const Ye=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ye as default}; +import{_ as q}from"./whisper-29f2b0aa.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as U}from"./post-skeleton-a15059e0.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-15a0e03b.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{b()}),(e,r)=>{const m=E,O=U,P=ae,T=D,F=le,H=R,N=q,V=te,W=ie,j=ne;return o(),n("div",null,[a(m,{title:"收藏"}),a(V,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(T,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",pe,[(o(!0),n(S,null,$(s.value,i=>(o(),d(F,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(N,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),p.value>0?(o(),d(j,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",me,[_.value?h("",!0):(o(),d(W,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}});const Ye=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ye as default}; diff --git a/web/dist/assets/Contacts-db8bb89e.js b/web/dist/assets/Contacts-669f91fa.js similarity index 92% rename from web/dist/assets/Contacts-db8bb89e.js rename to web/dist/assets/Contacts-669f91fa.js index 1c788a0e..0fee06b6 100644 --- a/web/dist/assets/Contacts-db8bb89e.js +++ b/web/dist/assets/Contacts-669f91fa.js @@ -1 +1 @@ -import{_ as W}from"./whisper-694050d3.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-2af3a836.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-d9166350.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Qe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; +import{_ as W}from"./whisper-29f2b0aa.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-15a0e03b.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-a15059e0.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Qe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; diff --git a/web/dist/assets/Following-eb71a515.js b/web/dist/assets/Following-3acd73c5.js similarity index 95% rename from web/dist/assets/Following-eb71a515.js rename to web/dist/assets/Following-3acd73c5.js index 4b40f06e..93666235 100644 --- a/web/dist/assets/Following-eb71a515.js +++ b/web/dist/assets/Following-3acd73c5.js @@ -1 +1 @@ -import{_ as Q}from"./whisper-694050d3.js";import{d as N,c as O,r as X,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as D,Y as ie,Z as _e}from"./index-2af3a836.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-d9166350.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=X("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const De=D(Oe,[["__scopeId","data-v-1fb7364a"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},V=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,Y=Fe,E=De,G=Te,J=Q,K=ke,L=ze,Z=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":W},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",Ve,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",We,[t.value.length===0?(c(),d("div",je,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(G,{key:P.user_id},{default:a(()=>[n(E,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Z,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; +import{_ as Q}from"./whisper-29f2b0aa.js";import{d as N,c as O,r as X,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as D,Y as ie,Z as _e}from"./index-15a0e03b.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-a15059e0.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=X("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const De=D(Oe,[["__scopeId","data-v-1fb7364a"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},V=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,Y=Fe,E=De,G=Te,J=Q,K=ke,L=ze,Z=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":W},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",Ve,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",We,[t.value.length===0?(c(),d("div",je,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(G,{key:P.user_id},{default:a(()=>[n(E,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Z,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; diff --git a/web/dist/assets/Home-c19b4d50.js b/web/dist/assets/Home-c19b4d50.js new file mode 100644 index 00000000..44d12495 --- /dev/null +++ b/web/dist/assets/Home-c19b4d50.js @@ -0,0 +1 @@ +import{W as De}from"./whisper-add-friend-78adb41e.js";import{_ as Te}from"./whisper-29f2b0aa.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as xe}from"./post-skeleton-a15059e0.js";import{d as ye,H as r,c as _e,b as Ae,e as u,f as w,bf as m,j as I,k as n,w as i,q as E,Y as b,y as he,A as O,x as $,F as fe,u as ge,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as ke}from"./vuex-44de225f.js";import{l as we}from"./lodash-e0b37ac3.js";import{g as Fe,a as Ne,c as Re,b as qe,d as Ge,e as Oe,u as Pe,f as Se,h as Ye,_ as Me}from"./index-15a0e03b.js";import{p as We}from"./content-a642a616.js";import{V,P as L}from"./IEnum-5453a777.js";import{I as Le,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as be,v as Ze,j as Je,e as Xe,w as $e,x as et,y as tt,z as st,A as at,B as nt,C as ot,a as Ie,D as lt,E as it,F as rt,G as ut,H as ct,l as pt,I as dt,J as vt,k as mt}from"./naive-ui-eecf2ec3.js";import{_ as _t}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{b as ft,u as gt}from"./vue-router-e5a2430e.js";import{W as ht}from"./v3-infinite-loading-2c58ec2f.js";import{S as wt}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const yt=K=>{const g=new FileReader,l=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),q=()=>{const _=new Uint8Array(g.result).subarray(0,4);let U="";for(let h=0;h<_.length;h++)U+=_[h].toString(16);switch(U){case"504b0304":case"504b0506":case"504b0708":return l("application/zip");case"504b030414":return l("application/x-zip-compressed");case"504b0508":return l("application/x-zip");case"504b5370":return l("application/octet-stream");default:return!1}};return new Promise((_,U)=>{g.onloadend=()=>{const h=K.type;_(h===""||h==="application/octet-stream"?q():l(h))},g.readAsArrayBuffer(K.slice(0,4))})},At={key:0,class:"compose-wrap"},kt={class:"compose-line"},bt={class:"compose-user"},It={class:"compose-line compose-options"},zt={class:"attachment"},Ct={class:"submit-wrap"},Dt={class:"attachment-list-wrap"},Tt={key:0,class:"attachment-price-wrap"},Ut=I("span",null," 附件价格¥",-1),Bt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Vt={key:1,class:"compose-wrap"},Et=I("div",{class:"login-wrap"},[I("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ft={key:0,class:"login-only-wrap"},Nt={key:1,class:"login-wrap"},Rt=ye({__name:"compose",emits:["post-success"],setup(K,{emit:g}){const l=ke(),q=r([]),_=r(!1),U=r(!1),h=r(!1),y=r(!1),A=r(""),F=r([]),G=r(),D=r(0),p=r("public/image"),T=r([]),N=r([]),d=r([]),f=r([]),B=r(V.PUBLIC),z=r(V.PUBLIC),R=+"400",Y=r("true".toLowerCase()==="true"),j="/v1/attachment",Q=_e(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),ee=_e(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return l.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),te=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},se=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},ae=we.debounce(s=>{Fe({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),H=we.debounce(s=>{Ne({k:s}).then(a=>{let e=[];a.suggest.map(t=>{e.push({label:t,value:t})}),q.value=e,_.value=!1}).catch(a=>{_.value=!1})},200),Z=(s,a)=>{_.value||(_.value=!0,a==="@"?ae(s):H(s))},J=s=>{s.length>R?A.value=s.substring(0,R):A.value=s},P=s=>{p.value=s},ne=s=>{for(let o=0;o30&&(s[o].name=e.substring(0,18)+"..."+e.substring(e.length-9)+"."+t)}T.value=s},S=async s=>{var a,e,t,o,c;return p.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((a=s.file.file)==null?void 0:a.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):p.value==="image"&&((e=s.file.file)==null?void 0:e.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((t=s.file.file)==null?void 0:t.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((o=s.file.file)==null?void 0:o.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):p.value==="attachment"&&!await yt(s.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):p.value==="attachment"&&((c=s.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},oe=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);t.code===0&&(p.value==="public/image"&&N.value.push({id:s.id,content:t.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:t.data.content}),p.value==="attachment"&&f.value.push({id:s.id,content:t.data.content}))}catch{window.$message.error("上传失败")}},M=({file:s,event:a})=>{var e;try{let t=JSON.parse((e=a.target)==null?void 0:e.response);if(t.code!==0){let o=t.msg||"上传失败";t.details&&t.details.length>0&&t.details.map(c=>{o+=":"+c}),window.$message.error(o)}}catch{window.$message.error("上传失败")}},x=({file:s})=>{let a=N.value.findIndex(e=>e.id===s.id);a>-1&&N.value.splice(a,1),a=d.value.findIndex(e=>e.id===s.id),a>-1&&d.value.splice(a,1),a=f.value.findIndex(e=>e.id===s.id),a>-1&&f.value.splice(a,1)},X=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=We(A.value);const e=[];let t=100;e.push({content:A.value,type:L.TEXT,sort:t}),N.value.map(o=>{t++,e.push({content:o.content,type:L.IMAGEURL,sort:t})}),d.value.map(o=>{t++,e.push({content:o.content,type:L.VIDEOURL,sort:t})}),f.value.map(o=>{t++,e.push({content:o.content,type:L.ATTACHMENT,sort:t})}),F.value.length>0&&F.value.map(o=>{t++,e.push({content:o,type:L.LINKURL,sort:t})}),U.value=!0,Re({contents:e,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+D.value*100,visibility:B.value}).then(o=>{var c;window.$message.success("发布成功"),U.value=!1,g("post-success",o),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",F.value=[],N.value=[],d.value=[],f.value=[],B.value=z.value}).catch(o=>{U.value=!1})},W=s=>{l.commit("triggerAuth",!0),l.commit("triggerAuthKey",s)};return Ae(()=>{const s=l.state.profile.defaultTweetVisibility;l.state.profile.useFriendship&&s==="friend"?z.value=V.FRIEND:s==="following"?z.value=V.Following:s==="public"?z.value=V.PUBLIC:z.value=V.PRIVATE,B.value=z.value}),(s,a)=>{const e=be,t=Ze,o=Je,c=Xe,C=$e,le=et,ie=tt,re=st,ue=at,ce=nt,pe=ot,de=Ie,ve=lt,me=it;return u(),w("div",null,[m(l).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(e,{round:"",size:30,src:m(l).state.userInfo.avatar},null,8,["src"])]),n(t,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(ce,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:j,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:S,onFinish:oe,onError:M,onRemove:x,"onUpdate:fileList":ne},{default:i(()=>[I("div",It,[I("div",zt,[n(C,{abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("public/image"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),m(l).state.profile.allowTweetVideo?(u(),E(C,{key:0,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value!=="public/video"||T.value.length===9,onClick:()=>{P("public/video"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),m(l).state.profile.allowTweetAttachment?(u(),E(C,{key:1,abstract:""},{default:i(({handleClick:v})=>[n(c,{disabled:T.value.length>0&&p.value==="public/video"||T.value.length===9,onClick:()=>{P("attachment"),v()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:he(te,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(Qe))]),_:1})]),_:1},8,["onClick"]),Y.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:he(se,["stop"])},{icon:i(()=>[n(o,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(m(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(ie,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(le,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/m(R)*100},null,8,["percentage"])]),default:i(()=>[O(" "+$(A.value.length)+" / "+$(m(R)),1)]),_:1}),n(c,{loading:U.value,onClick:X,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Dt,[n(re),f.value.length>0?(u(),w("div",Tt,[m(l).state.profile.allowTweetAttachmentPrice?(u(),E(ue,{key:0,value:D.value,"onUpdate:value":a[0]||(a[0]=v=>D.value=v),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Ut]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),y.value?(u(),w("div",Bt,[n(ve,{value:B.value,"onUpdate:value":a[1]||(a[1]=v=>B.value=v),name:"radiogroup"},{default:i(()=>[n(de,null,{default:i(()=>[(u(!0),w(fe,null,ge(ee.value,v=>(u(),E(pe,{key:v.value,value:v.value,label:v.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),h.value?(u(),w("div",xt,[n(me,{value:F.value,"onUpdate:value":a[2]||(a[2]=v=>F.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,m(l).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),m(l).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>W("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>W("signup"))},{default:i(()=>[O(" 注册 ")]),_:1})])):b("",!0)]))])}}});const qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Gt="/assets/discover-tweets-ab101944.jpeg",Ot="/assets/following-tweets-e36b4410.jpeg",Pt={class:"slide-bar-item"},St={class:"slide-bar-item-title slide-bar-user-link"},Yt={key:1,class:"skeleton-wrap"},Mt={key:0,class:"empty-wrap"},Wt={key:1},Lt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=ye({__name:"Home",setup(K){const g=ke(),l=ft(),q=gt(),_=rt(),U=r(9),h=r(8),y=r([{title:"最新动态",style:1,username:"",avatar:qt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Gt,show:!1},{title:"正在关注",style:3,username:"",avatar:Ot,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),A=Ve({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),F=r(null),G=r("泡泡广场"),D=r(!1),p=r(!1),T=r(1),N=r(""),d=r([]),f=r(1),B=r(20),z=r(0),R=r(!1),Y=r(!1),j=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Q=e=>{j.value=e,R.value=!0},ee=()=>{R.value=!1},te=()=>{Y.value=!0},se=e=>{_.warning({title:"删除好友",content:"将好友 “"+e.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Ye({user_id:A.id}).then(t=>{window.$message.success("操作成功"),e.user.is_friend=!1}).catch(t=>{})}})},ae=()=>{Y.value=!1,F.value=null},H=e=>{F.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?se(e):te()},Z=e=>{_.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),J(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),J(e.user_id,!0)}).catch(t=>{})}})};function J(e,t){for(let o in d.value)d.value[o].user_id==e&&(d.value[o].user.is_following=t)}const P=()=>{G.value="泡泡广场",l.query&&l.query.q&&(l.query.t&&l.query.t==="tag"?G.value="#"+decodeURIComponent(l.query.q):G.value="搜索: "+decodeURIComponent(l.query.q))},ne=_e(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{D.value=!1,p.value=!1,d.value=[],f.value=1,z.value=0},oe=(e,t)=>{switch(S(),T.value=e.style,l.query.q&&(l.query.q=null,P()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:l.query.q=null,x("following");break;case 21:N.value=e.username,X();break}y.value[t].show=!1},M=()=>{y.value=y.value.slice(0,3),!(!g.state.profile.useFriendship||!g.state.profile.enableTrendsBar||g.state.userInfo.id===0)&&qe({page:1,page_size:50}).then(e=>{var t=0;const o=e.list||[];let c=[];for(;t0&&(y.value=y.value.concat(c))}).catch(e=>{console.log(e)})},x=e=>{D.value=!0,Ge({query:l.query.q?decodeURIComponent(l.query.q):null,type:l.query.t,style:e,page:f.value,page_size:B.value}).then(t=>{D.value=!1,t.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(t.list):(d.value=t.list,window.scrollTo(0,0)),z.value=Math.ceil(t.pager.total_rows/B.value)}).catch(t=>{D.value=!1,f.value>1&&f.value--})},X=()=>{D.value=!0,Oe({username:N.value,style:"post",page:f.value,page_size:B.value}).then(e=>{D.value=!1,e.list.length===0&&(p.value=!0),f.value>1?d.value=d.value.concat(e.list):(d.value=e.list||[],window.scrollTo(0,0)),z.value=Math.ceil(e.pager.total_rows/B.value)}).catch(e=>{d.value=[],f.value>1&&f.value--,D.value=!1})},W=e=>{q.push({name:"post",query:{id:e.id}})},s=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:l.query.q?x("search"):X();break}},a=()=>{f.value{S(),M(),x("newest")}),Ee(()=>({path:l.path,query:l.query,refresh:g.state.refresh}),(e,t)=>{if(P(),e.refresh!==t.refresh){S(),setTimeout(()=>{M(),s()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{M(),s()},0))}),(e,t)=>{const o=_t,c=Rt,C=ct,le=be,ie=pt,re=dt,ue=xe,ce=vt,pe=Ue,de=Be,ve=Te,me=De,v=ut,ze=mt,Ce=Ie;return u(),w("div",null,[n(o,{title:G.value},null,8,["title"]),n(v,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(C,null,{default:i(()=>[n(c,{onPostSuccess:W})]),_:1}),ne.value?(u(),E(C,{key:0},{default:i(()=>[n(m(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":U.value,onClick:oe,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(ie,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(le,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(re,{"line-clamp":2},{default:i(()=>[O($(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),D.value&&d.value.length===0?(u(),w("div",Yt,[n(ue,{num:B.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ce,{size:"large",description:"暂无数据"})])):b("",!0),m(g).state.desktopModelShow?(u(),w("div",Wt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Lt,[(u(!0),w(fe,null,ge(d.value,k=>(u(),E(C,{key:k.id},{default:i(()=>[n(de,{post:k,isOwner:m(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:Q,onHandleFollowAction:Z,onHandleFriendAction:H},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(ve,{show:R.value,user:j.value,onSuccess:ee},null,8,["show","user"]),n(me,{show:Y.value,user:A,onSuccess:ae},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(m(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>a())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,$(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-040841fc"]]);export{Fs as default}; diff --git a/web/dist/assets/Home-d5a23262.js b/web/dist/assets/Home-d5a23262.js deleted file mode 100644 index 9fab831e..00000000 --- a/web/dist/assets/Home-d5a23262.js +++ /dev/null @@ -1 +0,0 @@ -import{W as Ue}from"./whisper-add-friend-83d6a50f.js";import{_ as Be}from"./whisper-694050d3.js";import{_ as xe,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as Ve}from"./post-skeleton-d9166350.js";import{d as Ce,H as l,c as we,b as Ie,e as p,f as h,bf as w,j as A,k as n,w as i,q as x,Y as y,y as ke,A as G,x as se,F as ye,u as Ae,R as Fe,E as Ne}from"./@vue-a481fc63.js";import{u as ze}from"./vuex-44de225f.js";import{l as be}from"./lodash-e0b37ac3.js";import{g as Re,a as qe,c as Ge,b as Oe,d as Pe,e as Se,u as Ye,f as Le,h as Me,_ as We}from"./index-2af3a836.js";import{p as Ke}from"./content-845a2453.js";import{V as B,P as j}from"./IEnum-5453a777.js";import{I as je,V as Qe,A as He,d as Ze,E as Je}from"./@vicons-f0266f88.js";import{o as De,v as Xe,j as $e,e as et,w as tt,x as st,y as at,z as nt,A as ot,B as lt,C as it,a as Te,D as rt,E as ut,F as ct,G as pt,H as dt,l as vt,I as mt,J as _t,k as ft}from"./naive-ui-eecf2ec3.js";import{_ as gt}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{b as ht,u as wt}from"./vue-router-e5a2430e.js";import{W as yt}from"./v3-infinite-loading-2c58ec2f.js";import{S as At}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const kt=Q=>{const F=new FileReader,k=u=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(u),b=()=>{const u=new Uint8Array(F.result).subarray(0,4);let z="";for(let _=0;_{F.onloadend=()=>{const _=Q.type;u(_===""||_==="application/octet-stream"?b():k(_))},F.readAsArrayBuffer(Q.slice(0,4))})},bt={key:0,class:"compose-wrap"},Ct={class:"compose-line"},It={class:"compose-user"},zt={class:"compose-line compose-options"},Dt={class:"attachment"},Tt={class:"submit-wrap"},Ut={class:"attachment-list-wrap"},Bt={key:0,class:"attachment-price-wrap"},xt=A("span",null," 附件价格¥",-1),Et={key:0,class:"eye-wrap"},Vt={key:1,class:"link-wrap"},Ft={key:1,class:"compose-wrap"},Nt=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Rt={key:0,class:"login-only-wrap"},qt={key:1,class:"login-wrap"},Gt=Ce({__name:"compose",emits:["post-success"],setup(Q,{emit:F}){const k=ze(),b=l([]),u=l(!1),z=l(!1),_=l(!1),E=l(!1),D=l(""),C=l([]),N=l(),O=l(0),v=l("public/image"),f=l([]),I=l([]),R=l([]),V=l([]),d=l(B.PUBLIC),g=l(B.PUBLIC),q="true".toLowerCase()==="true",T=+"400",P=l("true".toLowerCase()==="true"),Y=l("true".toLowerCase()==="true"),H=l("true".toLowerCase()==="true"),Z=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),ne="/v1/attachment",oe=we(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),le=we(()=>{let e=[{value:B.PUBLIC,label:"公开"},{value:B.PRIVATE,label:"私密"},{value:B.Following,label:"关注可见"}];return q&&e.push({value:B.FRIEND,label:"好友可见"}),e}),J=()=>{_.value=!_.value,_.value&&E.value&&(E.value=!1)},X=()=>{E.value=!E.value,E.value&&_.value&&(_.value=!1)},$=be.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(a=>{o.push({label:a,value:a})}),b.value=o,u.value=!1}).catch(t=>{u.value=!1})},200),ee=be.debounce(e=>{qe({k:e}).then(t=>{let o=[];t.suggest.map(a=>{o.push({label:a,value:a})}),b.value=o,u.value=!1}).catch(t=>{u.value=!1})},200),ie=(e,t)=>{u.value||(u.value=!0,t==="@"?$(e):ee(e))},S=e=>{e.length>T?D.value=e.substring(0,T):D.value=e},L=e=>{v.value=e},M=e=>{for(let c=0;c30&&(e[c].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+a)}f.value=e},U=async e=>{var t,o,a,c,m;return v.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):v.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):v.value==="public/video"&&!["video/mp4","video/quicktime"].includes((a=e.file.file)==null?void 0:a.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):v.value==="public/video"&&((c=e.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):v.value==="attachment"&&!await kt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):v.value==="attachment"&&((m=e.file.file)==null?void 0:m.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},te=({file:e,event:t})=>{var o;try{let a=JSON.parse((o=t.target)==null?void 0:o.response);a.code===0&&(v.value==="public/image"&&I.value.push({id:e.id,content:a.data.content}),v.value==="public/video"&&R.value.push({id:e.id,content:a.data.content}),v.value==="attachment"&&V.value.push({id:e.id,content:a.data.content}))}catch{window.$message.error("上传失败")}},re=({file:e,event:t})=>{var o;try{let a=JSON.parse((o=t.target)==null?void 0:o.response);if(a.code!==0){let c=a.msg||"上传失败";a.details&&a.details.length>0&&a.details.map(m=>{c+=":"+m}),window.$message.error(c)}}catch{window.$message.error("上传失败")}},W=({file:e})=>{let t=I.value.findIndex(o=>o.id===e.id);t>-1&&I.value.splice(t,1),t=R.value.findIndex(o=>o.id===e.id),t>-1&&R.value.splice(t,1),t=V.value.findIndex(o=>o.id===e.id),t>-1&&V.value.splice(t,1)},ue=()=>{if(D.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Ke(D.value);const o=[];let a=100;o.push({content:D.value,type:j.TEXT,sort:a}),I.value.map(c=>{a++,o.push({content:c.content,type:j.IMAGEURL,sort:a})}),R.value.map(c=>{a++,o.push({content:c.content,type:j.VIDEOURL,sort:a})}),V.value.map(c=>{a++,o.push({content:c.content,type:j.ATTACHMENT,sort:a})}),C.value.length>0&&C.value.map(c=>{a++,o.push({content:c,type:j.LINKURL,sort:a})}),z.value=!0,Ge({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+O.value*100,visibility:d.value}).then(c=>{var m;window.$message.success("发布成功"),z.value=!1,F("post-success",c),_.value=!1,E.value=!1,(m=N.value)==null||m.clear(),f.value=[],D.value="",C.value=[],I.value=[],R.value=[],V.value=[],d.value=g.value}).catch(c=>{z.value=!1})},s=e=>{k.commit("triggerAuth",!0),k.commit("triggerAuthKey",e)};return Ie(()=>{const e="friend".toLowerCase();q&&e==="friend"?g.value=B.FRIEND:e==="following"?g.value=B.Following:e==="public"?g.value=B.PUBLIC:g.value=B.PRIVATE,d.value=g.value}),(e,t)=>{const o=De,a=Xe,c=$e,m=et,K=tt,ce=st,pe=at,de=nt,ve=ot,me=lt,_e=it,fe=Te,ge=rt,he=ut;return p(),h("div",null,[w(k).state.userInfo.id>0?(p(),h("div",bt,[A("div",Ct,[A("div",It,[n(o,{round:"",size:30,src:w(k).state.userInfo.avatar},null,8,["src"])]),n(a,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:u.value,value:D.value,prefix:["@","#"],options:b.value,onSearch:ie,"onUpdate:value":S,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(me,{ref_key:"uploadRef",ref:N,abstract:"","list-type":"image",multiple:!0,max:9,action:ne,headers:{Authorization:oe.value},data:{type:v.value},"file-list":f.value,onBeforeUpload:U,onFinish:te,onError:re,onRemove:W,"onUpdate:fileList":M},{default:i(()=>[A("div",zt,[A("div",Dt,[n(K,{abstract:""},{default:i(({handleClick:r})=>[n(m,{disabled:f.value.length>0&&v.value==="public/video"||f.value.length===9,onClick:()=>{L("public/image"),r()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(w(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),Y.value?(p(),x(K,{key:0,abstract:""},{default:i(({handleClick:r})=>[n(m,{disabled:f.value.length>0&&v.value!=="public/video"||f.value.length===9,onClick:()=>{L("public/video"),r()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(w(Qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),H.value?(p(),x(K,{key:1,abstract:""},{default:i(({handleClick:r})=>[n(m,{disabled:f.value.length>0&&v.value==="public/video"||f.value.length===9,onClick:()=>{L("attachment"),r()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[n(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(w(He))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),n(m,{quaternary:"",circle:"",type:"primary",onClick:ke(J,["stop"])},{icon:i(()=>[n(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(w(Ze))]),_:1})]),_:1},8,["onClick"]),ae.value?(p(),x(m,{key:2,quaternary:"",circle:"",type:"primary",onClick:ke(X,["stop"])},{icon:i(()=>[n(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(w(Je))]),_:1})]),_:1},8,["onClick"])):y("",!0)]),A("div",Tt,[n(pe,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(ce,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:D.value.length/w(T)*100},null,8,["percentage"])]),default:i(()=>[G(" "+se(D.value.length)+" / "+se(w(T)),1)]),_:1}),n(m,{loading:z.value,onClick:ue,type:"primary",secondary:"",round:""},{default:i(()=>[G(" 发布 ")]),_:1},8,["loading"])])]),A("div",Ut,[n(de),V.value.length>0?(p(),h("div",Bt,[Z.value?(p(),x(ve,{key:0,value:O.value,"onUpdate:value":t[0]||(t[0]=r=>O.value=r),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[xt]),_:1},8,["value"])):y("",!0)])):y("",!0)])]),_:1},8,["headers","data","file-list"]),E.value?(p(),h("div",Et,[n(ge,{value:d.value,"onUpdate:value":t[1]||(t[1]=r=>d.value=r),name:"radiogroup"},{default:i(()=>[n(fe,null,{default:i(()=>[(p(!0),h(ye,null,Ae(le.value,r=>(p(),x(_e,{key:r.value,value:r.value,label:r.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):y("",!0),_.value?(p(),h("div",Vt,[n(he,{value:C.value,"onUpdate:value":t[2]||(t[2]=r=>C.value=r),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[G(" 创建链接 ")]),_:1},8,["value"])])):y("",!0)])):(p(),h("div",Ft,[Nt,P.value?y("",!0):(p(),h("div",Rt,[n(m,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=r=>s("signin"))},{default:i(()=>[G(" 登录 ")]),_:1})])),P.value?(p(),h("div",qt,[n(m,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=r=>s("signin"))},{default:i(()=>[G(" 登录 ")]),_:1}),n(m,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=r=>s("signup"))},{default:i(()=>[G(" 注册 ")]),_:1})])):y("",!0)]))])}}});const Ot="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Pt="/assets/discover-tweets-ab101944.jpeg",St="/assets/following-tweets-e36b4410.jpeg",Yt={class:"slide-bar-item"},Lt={class:"slide-bar-item-title slide-bar-user-link"},Mt={key:1,class:"skeleton-wrap"},Wt={key:0,class:"empty-wrap"},Kt={key:1},jt={key:2},Qt={class:"load-more-wrap"},Ht={class:"load-more-spinner"},Zt=Ce({__name:"Home",setup(Q){const F="true".toLowerCase()==="true",k="true".toLowerCase()==="true",b=ze(),u=ht(),z=wt(),_=ct(),E=l(9),D=l(8),C=l([{title:"最新动态",style:1,username:"",avatar:Ot,show:!0},{title:"热门推荐",style:2,username:"",avatar:Pt,show:!1},{title:"正在关注",style:3,username:"",avatar:St,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),N=Fe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=l(null),v=l("泡泡广场"),f=l(!1),I=l(!1),R=l(1),V=l(""),d=l([]),g=l(1),q=l(20),T=l(0),P=l(!1),Y=l(!1),H=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Z=s=>{H.value=s,P.value=!0},ae=()=>{P.value=!1},ne=()=>{Y.value=!0},oe=s=>{_.warning({title:"删除好友",content:"将好友 “"+s.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Me({user_id:N.id}).then(e=>{window.$message.success("操作成功"),s.user.is_friend=!1}).catch(e=>{})}})},le=()=>{Y.value=!1,O.value=null},J=s=>{O.value=s,N.id=s.user.id,N.username=s.user.username,N.nickname=s.user.nickname,s.user.is_friend?oe(s):ne()},X=s=>{_.success({title:"提示",content:"确定"+(s.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.user.is_following?Ye({user_id:s.user.id}).then(e=>{window.$message.success("操作成功"),$(s.user_id,!1)}).catch(e=>{}):Le({user_id:s.user.id}).then(e=>{window.$message.success("关注成功"),$(s.user_id,!0)}).catch(e=>{})}})};function $(s,e){for(let t in d.value)d.value[t].user_id==s&&(d.value[t].user.is_following=e)}const ee=()=>{v.value="泡泡广场",u.query&&u.query.q&&(u.query.t&&u.query.t==="tag"?v.value="#"+decodeURIComponent(u.query.q):v.value="搜索: "+decodeURIComponent(u.query.q))},ie=we(()=>F&&k&&b.state.desktopModelShow&&b.state.userInfo.id>0),S=()=>{f.value=!1,I.value=!1,d.value=[],g.value=1,T.value=0},L=(s,e)=>{switch(S(),R.value=s.style,u.query.q&&(u.query.q=null,ee()),s.style){case 1:U("newest");break;case 2:U("hots");break;case 3:u.query.q=null,U("following");break;case 21:V.value=s.username,te();break}C.value[e].show=!1},M=()=>{C.value=C.value.slice(0,3),!(!F||!k||b.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(s=>{var e=0;const t=s.list||[];let o=[];for(;e0&&(C.value=C.value.concat(o))}).catch(s=>{console.log(s)})},U=s=>{f.value=!0,Pe({query:u.query.q?decodeURIComponent(u.query.q):null,type:u.query.t,style:s,page:g.value,page_size:q.value}).then(e=>{f.value=!1,e.list.length===0&&(I.value=!0),g.value>1?d.value=d.value.concat(e.list):(d.value=e.list,window.scrollTo(0,0)),T.value=Math.ceil(e.pager.total_rows/q.value)}).catch(e=>{f.value=!1,g.value>1&&g.value--})},te=()=>{f.value=!0,Se({username:V.value,style:"post",page:g.value,page_size:q.value}).then(s=>{f.value=!1,s.list.length===0&&(I.value=!0),g.value>1?d.value=d.value.concat(s.list):(d.value=s.list||[],window.scrollTo(0,0)),T.value=Math.ceil(s.pager.total_rows/q.value)}).catch(s=>{d.value=[],g.value>1&&g.value--,f.value=!1})},re=s=>{z.push({name:"post",query:{id:s.id}})},W=()=>{switch(R.value){case 1:U("newest");break;case 2:U("hots");break;case 3:U("following");break;case 21:u.query.q?U("search"):te();break}},ue=()=>{g.value{S(),M(),U("newest")}),Ne(()=>({path:u.path,query:u.query,refresh:b.state.refresh}),(s,e)=>{if(ee(),s.refresh!==e.refresh){S(),setTimeout(()=>{M(),W()},0);return}e.path!=="/post"&&s.path==="/"&&(S(),setTimeout(()=>{M(),W()},0))}),(s,e)=>{const t=gt,o=Gt,a=dt,c=De,m=vt,K=mt,ce=Ve,pe=_t,de=xe,ve=Ee,me=Be,_e=Ue,fe=pt,ge=ft,he=Te;return p(),h("div",null,[n(t,{title:v.value},null,8,["title"]),n(fe,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(a,null,{default:i(()=>[n(o,{onPostSuccess:re})]),_:1}),ie.value?(p(),x(a,{key:0},{default:i(()=>[n(w(At),{modelValue:C.value,"onUpdate:modelValue":e[0]||(e[0]=r=>C.value=r),"wheel-blocks":D.value,"init-blocks":E.value,onClick:L,tag:"div","sub-tag":"div"},{default:i(r=>[A("div",Yt,[n(m,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:i(()=>[n(c,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Lt,[n(K,{"line-clamp":2},{default:i(()=>[G(se(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):y("",!0),f.value&&d.value.length===0?(p(),h("div",Mt,[n(ce,{num:q.value},null,8,["num"])])):y("",!0),A("div",null,[d.value.length===0?(p(),h("div",Wt,[n(pe,{size:"large",description:"暂无数据"})])):y("",!0),w(b).state.desktopModelShow?(p(),h("div",Kt,[(p(!0),h(ye,null,Ae(d.value,r=>(p(),x(a,{key:r.id},{default:i(()=>[n(de,{post:r,isOwner:w(b).state.userInfo.id==r.user_id,addFollowAction:!0,onSendWhisper:Z,onHandleFollowAction:X,onHandleFriendAction:J},null,8,["post","isOwner"])]),_:2},1024))),128))])):(p(),h("div",jt,[(p(!0),h(ye,null,Ae(d.value,r=>(p(),x(a,{key:r.id},{default:i(()=>[n(ve,{post:r,isOwner:w(b).state.userInfo.id==r.user_id,addFollowAction:!0,onSendWhisper:Z,onHandleFollowAction:X,onHandleFriendAction:J},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(me,{show:P.value,user:H.value,onSuccess:ae},null,8,["show","user"]),n(_e,{show:Y.value,user:N,onSuccess:le},null,8,["show","user"])]),_:1}),T.value>0?(p(),x(he,{key:0,justify:"center"},{default:i(()=>[n(w(yt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:e[1]||(e[1]=r=>ue())},{spinner:i(()=>[A("div",Qt,[I.value?y("",!0):(p(),x(ge,{key:0,size:14})),A("span",Ht,se(I.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Rs=We(Zt,[["__scopeId","data-v-d5f478e6"]]);export{Rs as default}; diff --git a/web/dist/assets/Home-6a728cf8.css b/web/dist/assets/Home-e6b13f04.css similarity index 62% rename from web/dist/assets/Home-6a728cf8.css rename to web/dist/assets/Home-e6b13f04.css index 6d91327d..12e408f4 100644 --- a/web/dist/assets/Home-6a728cf8.css +++ b/web/dist/assets/Home-e6b13f04.css @@ -1 +1 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-d5f478e6]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-d5f478e6]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-d5f478e6]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-d5f478e6]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-d5f478e6]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-d5f478e6]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-d5f478e6]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-d5f478e6]{margin:20px}.load-more .load-more-wrap[data-v-d5f478e6]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-d5f478e6]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-d5f478e6],.dark .pagination-wrap[data-v-d5f478e6],.dark .empty-wrap[data-v-d5f478e6],.dark .skeleton-wrap[data-v-d5f478e6]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-d5f478e6]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-d5f478e6]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar[data-v-d5f478e6]{--ti-slider-progress-box-arrow-hover-text-color: #f2f2f2;--ti-slider-progress-box-arrow-normal-text-color: #808080} +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-040841fc]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-040841fc]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-040841fc]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-040841fc]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-040841fc]{margin:20px}.load-more .load-more-wrap[data-v-040841fc]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-040841fc]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-040841fc],.dark .pagination-wrap[data-v-040841fc],.dark .empty-wrap[data-v-040841fc],.dark .skeleton-wrap[data-v-040841fc]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-040841fc]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar[data-v-040841fc]{--ti-slider-progress-box-arrow-hover-text-color: #f2f2f2;--ti-slider-progress-box-arrow-normal-text-color: #808080} diff --git a/web/dist/assets/Messages-4bbf517b.js b/web/dist/assets/Messages-2895f627.js similarity index 97% rename from web/dist/assets/Messages-4bbf517b.js rename to web/dist/assets/Messages-2895f627.js index 09d8ea0a..e7fa8134 100644 --- a/web/dist/assets/Messages-4bbf517b.js +++ b/web/dist/assets/Messages-2895f627.js @@ -1 +1 @@ -import{d as K,c as T,r as me,e as a,f as i,k as s,w as t,bf as o,j as b,y as A,A as d,x as g,Y as _,q,l as ge,h as H,u as se,F as ne,H as f,b as fe}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{u as ve,b as ke}from"./vue-router-e5a2430e.js";import{J as ye,O as he,P as we,Q as be,u as $e,f as Ie,_ as L,R as Ce,S as Me}from"./index-2af3a836.js";import{K as x,k as Se,N as qe,O as ze,Q as ee,U as Oe,r as N,s as Re,t as Ae,X as F,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-f0266f88.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Je,H as Ye}from"./naive-ui-eecf2ec3.js";import{_ as Ee}from"./whisper-694050d3.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{W as Ke}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ze={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:v}){const c=Q,k=ve(),u=te(),y=Te(),$=e=>()=>H(m,null,{default:()=>H(e)}),I=T(()=>{let e=[{label:"私信",key:"whisper",icon:$(N)}],n=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return u.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:$(Re)}):e.push({label:"关注",key:"follow",icon:$(Ae)})),e}),p=e=>{let n=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?$e({user_id:n.id}).then(w=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:n.id}).then(w=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let w=n.type==4&&n.sender_user_id==u.state.userInfo.id?n.receiver_user:n.sender_user;v("send-whisper",w)}break;case"follow":case"unfollow":p(c.message);break}},C=T(()=>c.message.type!==4||c.message.sender_user_id!==u.state.userInfo.id),z=T(()=>c.message.type==4&&c.message.receiver_user_id==u.state.userInfo.id),O=T(()=>c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id),P=e=>{M(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?k.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},r=e=>{M(e),he({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const w=Ne,U=me("router-link"),W=Pe,S=Ue,Y=ae,l=oe,j=We,E=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=R=>M(e.message))},[s(E,{"content-indented":""},{avatar:t(()=>[s(w,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(u).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[b("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||z.value?(a(),i("span",Xe,[s(U,{onClick:n[0]||(n[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",Ze," @"+g(e.message.sender_user.username),1)):_("",!0)])):O.value?(a(),i("span",xe,[s(U,{onClick:n[1]||(n[1]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):_("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),q(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(u).state.userInfo.id?(a(),q(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",ns,[C.value&&e.message.is_read===0?(a(),q(S,{key:0,dot:"",processing:""})):_("",!0),b("span",ts,g(o(ye)(e.message.created_on)),1),s(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[s(Y,{quaternary:"",circle:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(j,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[d(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:n[2]||(n[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(qe))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):_("",!0),e.message.type===5?(a(),i("div",ls,[d(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:n[3]||(n[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:n[4]||(n[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[s(o(m),null,{default:t(()=>[s(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-d6e1bf7b"]]),ds={class:"content"},ps=K({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(v,c)=>{const k=Be;return a(!0),i(ne,null,se(new Array(v.num),u=>(a(),i("div",{class:"skeleton-item",key:u},[b("div",ds,[s(k,{text:"",repeat:2}),s(k,{text:"",style:{width:"60%"}})])]))),128)}}});const ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=K({__name:"Messages",setup(Q){const v=te(),c=ke(),k=f(!1),u=f(!1),y=f(+c.query.p||1),$=f(20),I=f(0),p=f([]),h=f("所有消息"),C=f("all"),z=f(!1),O=f({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),P=()=>{u.value=!1,y.value=1,I.value=0,p.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),J=T(()=>{let l;switch(h.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),M=l=>{switch(l){case"all":h.value="所有消息";break;case"system":h.value="系统消息";break;case"whisper":h.value="我的私信";break;case"requesting":h.value="好友申请";break;case"unread":h.value="未读消息";break}C.value=l,P(),S()},e=()=>{M("unread")},n=()=>{v.state.unreadMsgCount>0&&p.value.length>0&&Me().then(l=>{if(C.value!="unread")for(let j in p.value)p.value[j].is_read=1;else p.value=[];v.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},w=l=>{O.value=l,z.value=!0},U=()=>{z.value=!1},W=()=>{P(),S()},S=()=>{k.value=!0,Ce({style:C.value,page:y.value,page_size:$.value}).then(l=>{k.value=!1,l.list.length===0&&(u.value=!0),y.value>1?p.value=p.value.concat(l.list):(p.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/$.value)}).catch(l=>{k.value=!1,y.value>1&&y.value--})},Y=()=>{y.value{S()}),(l,j)=>{const E=Ge,R=Ee,G=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ye,de=De,pe=Je;return a(),i("div",null,[s(E,{title:"消息"}),s(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),s(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[s(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),s(le,{vertical:""}),s(G,{text:"",size:"small",focusable:!1,onClick:n},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[s(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[s(G,{text:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Fe))]),_:1})]),default:t(()=>[d(" "+g(h.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value&&p.value.length===0?(a(),i("div",vs,[s(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[s(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(p.value,Z=>(a(),q(_e,{key:Z.id},{default:t(()=>[s(ce,{message:Z,onSendWhisper:w,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),I.value>0?(a(),q(X,{key:0,justify:"center"},{default:t(()=>[s(o(Ke),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Y},{spinner:t(()=>[b("div",ws,[u.value?_("",!0):(a(),q(pe,{key:0,size:14})),b("span",bs,g(u.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ks=L($s,[["__scopeId","data-v-3192dfa6"]]);export{Ks as default}; +import{d as K,c as T,r as me,e as a,f as i,k as s,w as t,bf as o,j as b,y as A,A as d,x as g,Y as _,q,l as ge,h as H,u as se,F as ne,H as f,b as fe}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{u as ve,b as ke}from"./vue-router-e5a2430e.js";import{J as ye,O as he,P as we,Q as be,u as $e,f as Ie,_ as L,R as Ce,S as Me}from"./index-15a0e03b.js";import{K as x,k as Se,N as qe,O as ze,Q as ee,U as Oe,r as N,s as Re,t as Ae,X as F,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-f0266f88.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Je,H as Ye}from"./naive-ui-eecf2ec3.js";import{_ as Ee}from"./whisper-29f2b0aa.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as Ke}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ze={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:v}){const c=Q,k=ve(),u=te(),y=Te(),$=e=>()=>H(m,null,{default:()=>H(e)}),I=T(()=>{let e=[{label:"私信",key:"whisper",icon:$(N)}],n=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return u.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:$(Re)}):e.push({label:"关注",key:"follow",icon:$(Ae)})),e}),p=e=>{let n=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?$e({user_id:n.id}).then(w=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:n.id}).then(w=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let w=n.type==4&&n.sender_user_id==u.state.userInfo.id?n.receiver_user:n.sender_user;v("send-whisper",w)}break;case"follow":case"unfollow":p(c.message);break}},C=T(()=>c.message.type!==4||c.message.sender_user_id!==u.state.userInfo.id),z=T(()=>c.message.type==4&&c.message.receiver_user_id==u.state.userInfo.id),O=T(()=>c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id),P=e=>{M(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?k.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},r=e=>{M(e),he({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const w=Ne,U=me("router-link"),W=Pe,S=Ue,Y=ae,l=oe,j=We,E=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=R=>M(e.message))},[s(E,{"content-indented":""},{avatar:t(()=>[s(w,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(u).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[b("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||z.value?(a(),i("span",Xe,[s(U,{onClick:n[0]||(n[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",Ze," @"+g(e.message.sender_user.username),1)):_("",!0)])):O.value?(a(),i("span",xe,[s(U,{onClick:n[1]||(n[1]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(u).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):_("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),q(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(u).state.userInfo.id?(a(),q(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",ns,[C.value&&e.message.is_read===0?(a(),q(S,{key:0,dot:"",processing:""})):_("",!0),b("span",ts,g(o(ye)(e.message.created_on)),1),s(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[s(Y,{quaternary:"",circle:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(j,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[d(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:n[2]||(n[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(qe))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):_("",!0),e.message.type===5?(a(),i("div",ls,[d(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:n[3]||(n[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:n[4]||(n[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[s(o(m),null,{default:t(()=>[s(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[s(o(m),null,{default:t(()=>[s(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-d6e1bf7b"]]),ds={class:"content"},ps=K({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(v,c)=>{const k=Be;return a(!0),i(ne,null,se(new Array(v.num),u=>(a(),i("div",{class:"skeleton-item",key:u},[b("div",ds,[s(k,{text:"",repeat:2}),s(k,{text:"",style:{width:"60%"}})])]))),128)}}});const ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=K({__name:"Messages",setup(Q){const v=te(),c=ke(),k=f(!1),u=f(!1),y=f(+c.query.p||1),$=f(20),I=f(0),p=f([]),h=f("所有消息"),C=f("all"),z=f(!1),O=f({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),P=()=>{u.value=!1,y.value=1,I.value=0,p.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),J=T(()=>{let l;switch(h.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"未读消息",key:"unread",icon:r(F)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(N)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),M=l=>{switch(l){case"all":h.value="所有消息";break;case"system":h.value="系统消息";break;case"whisper":h.value="我的私信";break;case"requesting":h.value="好友申请";break;case"unread":h.value="未读消息";break}C.value=l,P(),S()},e=()=>{M("unread")},n=()=>{v.state.unreadMsgCount>0&&p.value.length>0&&Me().then(l=>{if(C.value!="unread")for(let j in p.value)p.value[j].is_read=1;else p.value=[];v.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},w=l=>{O.value=l,z.value=!0},U=()=>{z.value=!1},W=()=>{P(),S()},S=()=>{k.value=!0,Ce({style:C.value,page:y.value,page_size:$.value}).then(l=>{k.value=!1,l.list.length===0&&(u.value=!0),y.value>1?p.value=p.value.concat(l.list):(p.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/$.value)}).catch(l=>{k.value=!1,y.value>1&&y.value--})},Y=()=>{y.value{S()}),(l,j)=>{const E=Ge,R=Ee,G=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ye,de=De,pe=Je;return a(),i("div",null,[s(E,{title:"消息"}),s(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),s(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[s(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),s(le,{vertical:""}),s(G,{text:"",size:"small",focusable:!1,onClick:n},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[s(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[s(G,{text:""},{icon:t(()=>[s(o(m),null,{default:t(()=>[s(o(Fe))]),_:1})]),default:t(()=>[d(" "+g(h.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value&&p.value.length===0?(a(),i("div",vs,[s(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[s(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(p.value,Z=>(a(),q(_e,{key:Z.id},{default:t(()=>[s(ce,{message:Z,onSendWhisper:w,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),I.value>0?(a(),q(X,{key:0,justify:"center"},{default:t(()=>[s(o(Ke),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Y},{spinner:t(()=>[b("div",ws,[u.value?_("",!0):(a(),q(pe,{key:0,size:14})),b("span",bs,g(u.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ks=L($s,[["__scopeId","data-v-a2e6a3be"]]);export{Ks as default}; diff --git a/web/dist/assets/Messages-1851378b.css b/web/dist/assets/Messages-9543d2b3.css similarity index 77% rename from web/dist/assets/Messages-1851378b.css rename to web/dist/assets/Messages-9543d2b3.css index cf176456..b61cf381 100644 --- a/web/dist/assets/Messages-1851378b.css +++ b/web/dist/assets/Messages-9543d2b3.css @@ -1 +1 @@ -.message-item[data-v-d6e1bf7b]{padding:16px}.message-item.unread[data-v-d6e1bf7b]{background:#fcfffc}.message-item .sender-wrap[data-v-d6e1bf7b]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-d6e1bf7b]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-d6e1bf7b]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-d6e1bf7b]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-d6e1bf7b]{margin-left:6px}.message-item .brief-wrap[data-v-d6e1bf7b]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-d6e1bf7b],.message-item .brief-wrap .whisper-content-wrap[data-v-d6e1bf7b],.message-item .brief-wrap .requesting-friend-wrap[data-v-d6e1bf7b]{display:flex;width:100%}.message-item .view-link[data-v-d6e1bf7b]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-d6e1bf7b]{margin-left:8px;align-items:center}.dark .message-item[data-v-d6e1bf7b]{background-color:#101014bf}.dark .message-item.unread[data-v-d6e1bf7b]{background:#0f180b}.dark .message-item .brief-wrap[data-v-d6e1bf7b]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.load-more[data-v-3192dfa6]{margin:20px}.load-more .load-more-wrap[data-v-3192dfa6]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-3192dfa6]{font-size:14px;opacity:.65}.title[data-v-3192dfa6]{padding-top:4px;opacity:.9}.title-action[data-v-3192dfa6]{display:flex;align-items:center;margin-left:20px}.title-filter[data-v-3192dfa6]{margin-right:20px}.dark .empty-wrap[data-v-3192dfa6],.dark .messages-wrap[data-v-3192dfa6],.dark .pagination-wrap[data-v-3192dfa6]{background-color:#101014bf} +.message-item[data-v-d6e1bf7b]{padding:16px}.message-item.unread[data-v-d6e1bf7b]{background:#fcfffc}.message-item .sender-wrap[data-v-d6e1bf7b]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-d6e1bf7b]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-d6e1bf7b]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-d6e1bf7b]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-d6e1bf7b]{margin-left:6px}.message-item .brief-wrap[data-v-d6e1bf7b]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-d6e1bf7b],.message-item .brief-wrap .whisper-content-wrap[data-v-d6e1bf7b],.message-item .brief-wrap .requesting-friend-wrap[data-v-d6e1bf7b]{display:flex;width:100%}.message-item .view-link[data-v-d6e1bf7b]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-d6e1bf7b]{margin-left:8px;align-items:center}.dark .message-item[data-v-d6e1bf7b]{background-color:#101014bf}.dark .message-item.unread[data-v-d6e1bf7b]{background:#0f180b}.dark .message-item .brief-wrap[data-v-d6e1bf7b]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.load-more[data-v-a2e6a3be]{margin:20px}.load-more .load-more-wrap[data-v-a2e6a3be]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-a2e6a3be]{font-size:14px;opacity:.65}.title[data-v-a2e6a3be]{padding-top:4px;opacity:.9}.title-action[data-v-a2e6a3be]{display:flex;align-items:center;margin-left:20px}.title-filter[data-v-a2e6a3be]{margin-right:20px}.dark .empty-wrap[data-v-a2e6a3be],.dark .messages-wrap[data-v-a2e6a3be],.dark .pagination-wrap[data-v-a2e6a3be]{background-color:#101014bf} diff --git a/web/dist/assets/Post-e91899fe.js b/web/dist/assets/Post-44974496.js similarity index 98% rename from web/dist/assets/Post-e91899fe.js rename to web/dist/assets/Post-44974496.js index de108f59..f739ea99 100644 --- a/web/dist/assets/Post-e91899fe.js +++ b/web/dist/assets/Post-44974496.js @@ -1 +1 @@ -import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-2af3a836.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-845a2453.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-d9166350.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-694050d3.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-edac44ef"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-edac44ef"]]);export{fn as default}; +import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-15a0e03b.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-a642a616.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-a15059e0.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-29f2b0aa.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-edac44ef"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-edac44ef"]]);export{fn as default}; diff --git a/web/dist/assets/Profile-de924a39.js b/web/dist/assets/Profile-7682ee52.js similarity index 95% rename from web/dist/assets/Profile-de924a39.js rename to web/dist/assets/Profile-7682ee52.js index b232e513..5c578d47 100644 --- a/web/dist/assets/Profile-de924a39.js +++ b/web/dist/assets/Profile-7682ee52.js @@ -1 +1 @@ -import{_ as ke}from"./whisper-694050d3.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as Ie}from"./post-skeleton-d9166350.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-2af3a836.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-845a2453.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},et={class:"info-item"},tt={class:"info-item"},at={class:"info-item"},st={key:0,class:"skeleton-wrap"},lt={key:1},ot={key:0,class:"empty-wrap"},nt={key:1},ut={key:0},it={key:1},rt={key:2},ct={key:3},_t={key:4},vt={key:2},dt={key:0},mt={key:1},ft={key:2},pt={key:3},ht={key:4},gt={class:"load-more-wrap"},wt={class:"load-more-spinner"},kt=Oe({__name:"Profile",setup(yt){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(p.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},re=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=G.value,_.value=X.value,H();break;case"comment":l.value=F.value,s.value=J.value,_.value=Z.value,N();break;case"highlight":l.value=x.value,s.value=K.value,_.value=ee.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=te.value,W();break;case"star":l.value=z.value,s.value=Q.value,_.value=ae.value,j();break}},ce=()=>{switch(p.value){case"post":G.value=s.value,H();break;case"comment":J.value=s.value,N();break;case"highlight":K.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":Q.value=s.value,j();break}},_e=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,ce()):P.value=!0};return Te(()=>{D()}),Ae(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const E=Pe,U=De,ve=He,oe=Fe("router-link"),$=Ne,de=Ve,me=Ie,fe=We,C=ye,y=Ee,S=be,pe=ke,he=Ue,ge=je,we=Be;return a(),u("div",null,[r(E,{title:"主页"}),n(o).state.userInfo.id>0?(a(),h(he,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[f("div",Re,[f("div",Ge,[r(U,{size:72,src:n(o).state.userInfo.avatar},null,8,["src"])]),f("div",Je,[f("div",Ke,[f("strong",null,O(n(o).state.userInfo.nickname),1),f("span",null," @"+O(n(o).state.userInfo.username),1),n(o).state.userInfo.is_admin?(a(),h(ve,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),f("div",Ye,[f("span",Qe,"UID. "+O(n(o).state.userInfo.id),1),f("span",Xe,O(n(ze)(n(o).state.userInfo.created_on))+" 加入",1)]),f("div",Ze,[f("span",et,[r(oe,{onClick:c[0]||(c[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(n(o).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",tt,[r(oe,{onClick:c[1]||(c[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(n(o).state.userInfo.followings),1)]),_:1},8,["to"])]),f("span",at," 泡泡  "+O(n(o).state.userInfo.tweets_count),1)])])]),r(de,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":re},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),u("div",st,[r(me,{num:g.value},null,8,["num"])])):(a(),u("div",lt,[l.value.length===0?(a(),u("div",ot,[r(fe,{size:"large",description:"暂无数据"})])):m("",!0),n(o).state.desktopModelShow?(a(),u("div",nt,[p.value==="post"?(a(),u("div",ut,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",it,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",rt,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",ct,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",_t,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(a(),u("div",vt,[p.value==="post"?(a(),u("div",dt,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",mt,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",ft,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",pt,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",ht,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(pe,{show:B.value,user:se.value,onSuccess:ie},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(a(),h(we,{key:1,justify:"center"},{default:v(()=>[r(n(Se),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>_e())},{spinner:v(()=>[f("div",gt,[P.value?m("",!0):(a(),h(ge,{key:0,size:14})),f("span",wt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const ea=Ce(kt,[["__scopeId","data-v-8cfd09d6"]]);export{ea as default}; +import{_ as ke}from"./whisper-29f2b0aa.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as Ie}from"./post-skeleton-a15059e0.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as u,k as r,bf as n,q as h,w as v,Y as m,e as a,j as f,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-15a0e03b.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},et={class:"info-item"},tt={class:"info-item"},at={class:"info-item"},st={key:0,class:"skeleton-wrap"},lt={key:1},ot={key:0,class:"empty-wrap"},nt={key:1},ut={key:0},it={key:1},rt={key:2},ct={key:3},_t={key:4},vt={key:2},dt={key:0},mt={key:1},ft={key:2},pt={key:3},ht={key:4},gt={class:"load-more-wrap"},wt={class:"load-more-spinner"},kt=Oe({__name:"Profile",setup(yt){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),p=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),te=i(0),ae=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(p.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},re=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=G.value,_.value=X.value,H();break;case"comment":l.value=F.value,s.value=J.value,_.value=Z.value,N();break;case"highlight":l.value=x.value,s.value=K.value,_.value=ee.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=te.value,W();break;case"star":l.value=z.value,s.value=Q.value,_.value=ae.value,j();break}},ce=()=>{switch(p.value){case"post":G.value=s.value,H();break;case"comment":J.value=s.value,N();break;case"highlight":K.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":Q.value=s.value,j();break}},_e=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,ce()):P.value=!0};return Te(()=>{D()}),Ae(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const E=Pe,U=De,ve=He,oe=Fe("router-link"),$=Ne,de=Ve,me=Ie,fe=We,C=ye,y=Ee,S=be,pe=ke,he=Ue,ge=je,we=Be;return a(),u("div",null,[r(E,{title:"主页"}),n(o).state.userInfo.id>0?(a(),h(he,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[f("div",Re,[f("div",Ge,[r(U,{size:72,src:n(o).state.userInfo.avatar},null,8,["src"])]),f("div",Je,[f("div",Ke,[f("strong",null,O(n(o).state.userInfo.nickname),1),f("span",null," @"+O(n(o).state.userInfo.username),1),n(o).state.userInfo.is_admin?(a(),h(ve,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),f("div",Ye,[f("span",Qe,"UID. "+O(n(o).state.userInfo.id),1),f("span",Xe,O(n(ze)(n(o).state.userInfo.created_on))+" 加入",1)]),f("div",Ze,[f("span",et,[r(oe,{onClick:c[0]||(c[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(n(o).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",tt,[r(oe,{onClick:c[1]||(c[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:n(o).state.userInfo.username,n:n(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(n(o).state.userInfo.followings),1)]),_:1},8,["to"])]),f("span",at," 泡泡  "+O(n(o).state.userInfo.tweets_count),1)])])]),r(de,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":re},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),u("div",st,[r(me,{num:g.value},null,8,["num"])])):(a(),u("div",lt,[l.value.length===0?(a(),u("div",ot,[r(fe,{size:"large",description:"暂无数据"})])):m("",!0),n(o).state.desktopModelShow?(a(),u("div",nt,[p.value==="post"?(a(),u("div",ut,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",it,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",rt,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",ct,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",_t,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(C,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(a(),u("div",vt,[p.value==="post"?(a(),u("div",dt,[(a(!0),u(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(a(),u("div",mt,[(a(!0),u(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(a(),u("div",ft,[(a(!0),u(b,null,I(x.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(a(),u("div",pt,[(a(!0),u(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(a(),u("div",ht,[(a(!0),u(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:v(()=>[r(S,{post:t,isOwner:n(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(pe,{show:B.value,user:se.value,onSuccess:ie},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(a(),h(we,{key:1,justify:"center"},{default:v(()=>[r(n(Se),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>_e())},{spinner:v(()=>[f("div",gt,[P.value?m("",!0):(a(),h(ge,{key:0,size:14})),f("span",wt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const ea=Ce(kt,[["__scopeId","data-v-8cfd09d6"]]);export{ea as default}; diff --git a/web/dist/assets/Setting-94ec4c57.css b/web/dist/assets/Setting-94ec4c57.css new file mode 100644 index 00000000..89d15e5a --- /dev/null +++ b/web/dist/assets/Setting-94ec4c57.css @@ -0,0 +1 @@ +.setting-card[data-v-7bb19e7f]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-7bb19e7f]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-7bb19e7f]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-7bb19e7f]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-7bb19e7f]{margin-right:10px;width:120px}.setting-card .avatar[data-v-7bb19e7f]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-7bb19e7f]{margin-bottom:10px}.setting-card .hash-link[data-v-7bb19e7f]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-7bb19e7f]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-7bb19e7f]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-7bb19e7f]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-7bb19e7f]{width:100%;height:100%}.dark .setting-card[data-v-7bb19e7f]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-9923d3fd.js b/web/dist/assets/Setting-9923d3fd.js new file mode 100644 index 00000000..365802ef --- /dev/null +++ b/web/dist/assets/Setting-9923d3fd.js @@ -0,0 +1 @@ +import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as we,H as d,R as Z,b as ye,f as g,k as t,w as s,bf as r,q as k,Y as _,e as i,j as m,A as p,x as U,O as be,D as ke,Z as R,y as S,$ as Ce,a0 as Ie}from"./@vue-a481fc63.js";import{u as $e}from"./vuex-44de225f.js";import{a4 as Q,a5 as Pe,a6 as Be,a7 as Ue,a8 as Re,a9 as Se,aa as qe,_ as Ae}from"./index-15a0e03b.js";import{a2 as Ne}from"./@vicons-f0266f88.js";import{h as ze,o as xe,e as De,B as Ke,b as Fe,j as Te,T as je,$ as Oe,L as Ve,a0 as Ee,a1 as Le,d as Me}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const F=q=>(Ce("data-v-7bb19e7f"),q=q(),Ie(),q),We={class:"base-line avatar"},Ge={class:"base-line"},He=F(()=>m("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ye={class:"base-line"},Ze=F(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},Xe={key:1},et=F(()=>m("br",null,null,-1)),tt={key:2,class:"phone-bind-wrap"},at={class:"captcha-img-wrap"},st={class:"captcha-img"},nt=["src"],ot={class:"form-submit-wrap"},lt={key:0},rt={key:1},it=F(()=>m("br",null,null,-1)),ut={key:2,class:"phone-bind-wrap"},dt={class:"captcha-img-wrap"},pt={class:"captcha-img"},ct=["src"],_t={class:"form-submit-wrap"},mt={key:1,class:"phone-bind-wrap"},vt={class:"form-submit-wrap"},ft=we({__name:"Setting",setup(q){const X="/v1/attachment",ee="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),A=d("public/avatar"),te="false".toLowerCase()==="true",o=$e(),$=d(!1),N=d(!1),z=d(!1),L=d(),M=d(),C=d(!1),x=d(!1),P=d(!1),B=d(!1),I=d(60),y=d(!1),b=d(!1),W=d(),G=d(),H=d(),J=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),u=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),ae=async n=>{var e,v;return A.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):A.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},se=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&A.value==="public/avatar"&&Pe({avatar:f.data.content}).then(c=>{var D;window.$message.success("头像更新成功"),(D=L.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},ne=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,oe=(n,e)=>e===a.password,le=()=>{var n;a.reenteredPassword&&((n=J.value)==null||n.validate({trigger:"password-input"}))},re=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(x.value=!0,Be({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,P.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ie=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Ue({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.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=>{N.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(u.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,v||(z.value=!0,Re({activate_code:u.activate_code,captcha_id:u.id,imgCaptcha:u.imgCaptcha}).then(f=>{z.value=!1,b.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:u.activate_code}),u.id="",u.b64s="",u.imgCaptcha="",u.activate_code=""}).catch(f=>{z.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=>{u.id=n.id,u.b64s=n.b64s}).catch(n=>{console.log(n)})},de=()=>{Se({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&B.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}$.value=!0,qe({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{B.value=!0,$.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,B.value=!1)},1e3)}).catch(n=>{$.value=!1,n.code===20012&&T(),console.log(n)})}},ce={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},_e={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},me={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:ne,message:"两次密码输入不一致",trigger:"input"},{validator:oe,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},ve=()=>{C.value=!0,setTimeout(()=>{var n;(n=M.value)==null||n.focus()},30)};return ye(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=he,f=xe,c=De,D=Ke,h=Fe,fe=Te,K=ze,Y=je,w=Oe,ge=Ve,O=Ee,V=Le,E=Me;return i(),g("div",null,[t(v,{title:"设置",theme:""}),t(K,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[t(f,{class:"avatar-img",size:80,src:r(o).state.userInfo.avatar},null,8,["src"]),!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),k(D,{key:0,ref_key:"avatarRef",ref:L,action:X,headers:{Authorization:ee},data:{type:A.value},onBeforeUpload:ae,onFinish:se},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[He,C.value?_("",!0):(i(),g("div",Je,U(r(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:M,class:"nickname-input",value:r(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>r(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:de,maxlength:16},null,8,["value"]),[[ke,C.value]]),!C.value&&(!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0&&r(o).state.userInfo.status==1)?(i(),k(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:ve},{icon:s(()=>[t(fe,null,{default:s(()=>[t(r(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,p(" @"+U(r(o).state.userInfo.username),1)])]),_:1}),r(o).state.profile.allowPhoneBind?(i(),k(K,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),g("div",Qe,[p(U(r(o).state.userInfo.phone)+" ",1),!y.value&&r(o).state.userInfo.status==1?(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(i(),g("div",Xe,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),et,y.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(i(),g("div",tt,[t(E,{ref_key:"phoneFormRef",ref:W,model:a,rules:ce},{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]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",at,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",st,[a.b64s?(i(),g("img",{key:0,src:a.b64s,onClick:T},null,8,nt)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(ge,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:B.value,loading:$.value,onClick:pe},{default:s(()=>[p(U(I.value>0&&B.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",ot,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ie},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),te?(i(),k(K,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.activation&&r(o).state.userInfo.activation.length>0?(i(),g("div",lt,[p(U(r(o).state.userInfo.activation)+" ",1),b.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>b.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(i(),g("div",rt,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),it,b.value?_("",!0):(i(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>b.value=!0)}," 立即激活 "))]),_:1})])),b.value?(i(),g("div",ut,[t(E,{ref_key:"activateFormRef",ref:G,model:u,rules:_e},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:u.activate_code,"onUpdate:value":e[10]||(e[10]=l=>u.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",dt,[t(h,{value:u.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>u.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[u.b64s?(i(),g("img",{key:0,src:u.b64s,onClick:j},null,8,ct)):_("",!0)])])]),_:1}),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",_t,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>b.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(K,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),P.value?_("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>P.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),P.value?(i(),g("div",mt,[t(E,{ref_key:"formRef",ref:H,model:a,rules:me},{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]=R(S(()=>{},["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:le,onKeydown:e[18]||(e[18]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=R(S(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(V,{gutter:[0,24]},{default:s(()=>[t(O,{span:24},{default:s(()=>[m("div",vt,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>P.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:re},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const jt=Ae(ft,[["__scopeId","data-v-7bb19e7f"]]);export{jt as default}; diff --git a/web/dist/assets/Setting-bfd24152.css b/web/dist/assets/Setting-bfd24152.css deleted file mode 100644 index 04dbe4f6..00000000 --- a/web/dist/assets/Setting-bfd24152.css +++ /dev/null @@ -1 +0,0 @@ -.setting-card[data-v-a681720e]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-a681720e]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-a681720e]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-a681720e]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-a681720e]{margin-right:10px;width:120px}.setting-card .avatar[data-v-a681720e]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-a681720e]{margin-bottom:10px}.setting-card .hash-link[data-v-a681720e]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-a681720e]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-a681720e]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-a681720e]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-a681720e]{width:100%;height:100%}.dark .setting-card[data-v-a681720e]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-cf58f1fc.js b/web/dist/assets/Setting-cf58f1fc.js deleted file mode 100644 index d9e9964e..00000000 --- a/web/dist/assets/Setting-cf58f1fc.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{d as ye,H as d,R as Q,b as ke,f as g,k as a,w as s,q as b,Y as _,e as r,j as m,bf as u,A as p,x as S,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{a4 as X,a5 as Ue,a6 as Re,a7 as Se,a8 as qe,a9 as Ae,aa as Be,_ as Ne}from"./index-2af3a836.js";import{a2 as ze}from"./@vicons-f0266f88.js";import{h as xe,o as De,e as Ke,B as Fe,b as Te,j as je,T as Oe,$ as Ve,L as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const T=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ge={class:"base-line avatar"},He={class:"base-line"},Je=T(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},Qe=T(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},ea={key:1},aa=T(()=>m("br",null,null,-1)),ta={key:2,class:"phone-bind-wrap"},sa={class:"captcha-img-wrap"},na={class:"captcha-img"},oa=["src"],la={class:"form-submit-wrap"},ra={key:0},ia={key:1},ua=T(()=>m("br",null,null,-1)),da={key:2,class:"phone-bind-wrap"},pa={class:"captcha-img-wrap"},ca={class:"captcha-img"},_a=["src"],ma={class:"form-submit-wrap"},va={key:1,class:"phone-bind-wrap"},fa={class:"form-submit-wrap"},ga=ye({__name:"Setting",setup(B){const ee="/v1/attachment",ae="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",te="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),R=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),H=d(),J=d(),Y=d(),t=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=M.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!t.password&&t.password.startsWith(e)&&t.password.length>=e.length,le=(n,e)=>e===t.password,re=()=>{var n;t.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Re({password:t.password,old_password:t.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Se({phone:t.phone,captcha:t.phone_captcha}).then(f=>{z.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:t.phone}),t.id="",t.b64s="",t.imgCaptcha="",t.phone="",t.phone_captcha=""}).catch(f=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&O()}))})},j=()=>{X().then(n=>{t.id=n.id,t.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},pe=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},ce=()=>{if(!(I.value>0&&R.value)){if(t.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:t.phone,img_captcha:t.imgCaptcha,img_captcha_id:t.id}).then(n=>{R.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,R.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),O()}),(n,e)=>{const v=we,f=De,c=Ke,K=Fe,h=Te,ge=je,F=xe,Z=Oe,w=Ve,he=Ee,V=Le,E=Me,L=We;return r(),g("div",null,[a(v,{title:"设置",theme:""}),a(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[a(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:ae},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[a(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",He,[Je,C.value?_("",!0):(r(),g("div",Ye,S(u(o).state.userInfo.nickname),1)),be(a(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:pe,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[a(ge,null,{default:s(()=>[a(u(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[Qe,p(" @"+S(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[p(S(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",ea,[a(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),aa,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",ta,[a(L,{ref_key:"phoneFormRef",ref:G,model:t,rules:_e},{default:s(()=>[a(w,{path:"phone",label:"手机号"},{default:s(()=>[a(h,{value:t.phone,"onUpdate:value":e[3]||(e[3]=l=>t.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",sa,[a(h,{value:t.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>t.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",na,[t.b64s?(r(),g("img",{key:0,src:t.b64s,onClick:j},null,8,oa)):_("",!0)])])]),_:1}),a(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[a(he,null,{default:s(()=>[a(h,{value:t.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>t.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),a(c,{type:"primary",ghost:"",disabled:R.value,loading:P.value,onClick:ce},{default:s(()=>[p(S(I.value>0&&R.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[m("div",la,[a(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),te?(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",ra,[p(S(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(r(),g("div",ia,[a(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ua,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",da,[a(L,{ref_key:"activateFormRef",ref:H,model:i,rules:me},{default:s(()=>[a(w,{path:"activate_code",label:"激活码"},{default:s(()=>[a(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",pa,[a(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",ca,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:O},null,8,_a)):_("",!0)])])]),_:1}),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[m("div",ma,[a(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:de},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),a(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),U.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),U.value?(r(),g("div",va,[a(L,{ref_key:"formRef",ref:J,model:t,rules:ve},{default:s(()=>[a(w,{path:"old_password",label:"旧密码"},{default:s(()=>[a(h,{value:t.old_password,"onUpdate:value":e[15]||(e[15]=l=>t.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"password",label:"新密码"},{default:s(()=>[a(h,{value:t.password,"onUpdate:value":e[17]||(e[17]=l=>t.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{ref_key:"rPasswordFormItemRef",ref:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[a(h,{value:t.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>t.reenteredPassword=l),disabled:!t.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[m("div",fa,[a(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Oa=Ne(ga,[["__scopeId","data-v-a681720e"]]);export{Oa as default}; diff --git a/web/dist/assets/Topic-6e91af53.js b/web/dist/assets/Topic-a2ac0d74.js similarity index 95% rename from web/dist/assets/Topic-6e91af53.js rename to web/dist/assets/Topic-a2ac0d74.js index 4f28f182..6a874f07 100644 --- a/web/dist/assets/Topic-6e91af53.js +++ b/web/dist/assets/Topic-a2ac0d74.js @@ -1 +1 @@ -import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-2af3a836.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.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:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-15a0e03b.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.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:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-00d998d0.css b/web/dist/assets/User-00d998d0.css deleted file mode 100644 index 744ca63a..00000000 --- a/web/dist/assets/User-00d998d0.css +++ /dev/null @@ -1 +0,0 @@ -.profile-tabs-wrap[data-v-a3099af3]{padding:0 16px}.profile-baseinfo[data-v-a3099af3]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-a3099af3]{width:72px}.profile-baseinfo .base-info[data-v-a3099af3]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-a3099af3]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-a3099af3]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-a3099af3]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-a3099af3]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-a3099af3]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-a3099af3]{margin:20px}.load-more .load-more-wrap[data-v-a3099af3]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-a3099af3]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-a3099af3],.dark .pagination-wrap[data-v-a3099af3]{background-color:#101014bf} diff --git a/web/dist/assets/User-1ad57452.css b/web/dist/assets/User-1ad57452.css new file mode 100644 index 00000000..ca9fe380 --- /dev/null +++ b/web/dist/assets/User-1ad57452.css @@ -0,0 +1 @@ +.profile-tabs-wrap[data-v-85a170e0]{padding:0 16px}.profile-baseinfo[data-v-85a170e0]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-85a170e0]{width:72px}.profile-baseinfo .base-info[data-v-85a170e0]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-85a170e0]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-85a170e0]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-85a170e0]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-85a170e0]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-85a170e0]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-85a170e0]{margin:20px}.load-more .load-more-wrap[data-v-85a170e0]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-85a170e0]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-85a170e0],.dark .pagination-wrap[data-v-85a170e0]{background-color:#101014bf} diff --git a/web/dist/assets/User-e929b372.js b/web/dist/assets/User-e929b372.js deleted file mode 100644 index ce986b05..00000000 --- a/web/dist/assets/User-e929b372.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Ne,a as Re}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as Ve}from"./post-skeleton-d9166350.js";import{_ as je}from"./whisper-694050d3.js";import{_ as Ee}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{d as Ge,H as i,R as Je,c as Ke,b as Ye,E as Qe,r as Xe,f as u,k as o,w as r,q as g,Y as m,e as s,j as w,x as I,bf as c,A as H,y as me,F,u as T,h as fe}from"./@vue-a481fc63.js";import{u as Ze}from"./vuex-44de225f.js";import{b as ea}from"./vue-router-e5a2430e.js";import{L as aa,K as sa,e as N,h as ta,u as pe,f as he,M as la,_ as na}from"./index-2af3a836.js";import{W as oa}from"./whisper-add-friend-83d6a50f.js";import{W as ua}from"./v3-infinite-loading-2c58ec2f.js";import{k as ia,r as ra,G as ge,s as ca,t as va,J as _a,R as da}from"./@vicons-f0266f88.js";import{F as ma,G as fa,a as pa,j as we,o as ha,M as ga,e as wa,P as ka,k as ya,f as ba,g as Pa,J as Oa,H as Fa}from"./naive-ui-eecf2ec3.js";import"./content-845a2453.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ta={key:0,class:"profile-baseinfo"},Ia={class:"avatar"},xa={class:"base-info"},Aa={class:"username"},$a={class:"userinfo"},za={class:"info-item"},Ua={class:"info-item"},qa={class:"userinfo"},Ca={class:"info-item"},Ma={class:"info-item"},Sa={class:"info-item"},Wa={key:0,class:"user-opts"},La={key:0,class:"skeleton-wrap"},Ba={key:1},Da={key:0,class:"empty-wrap"},Ha={key:1},Na={key:0},Ra={key:1},Va={key:2},ja={key:3},Ea={key:4},Ga={key:2},Ja={key:0},Ka={key:1},Ya={key:2},Qa={key:3},Xa={key:4},Za={class:"load-more-wrap"},es={class:"load-more-spinner"},as=Ge({__name:"User",setup(ss){const R=ma(),d=Ze(),$=ea(),ce="true".toLowerCase()==="true",f=i(!1),y=i(!1),a=Je({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),C=i([]),M=i([]),x=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Y=i(1),Q=i(1),X=i(1),k=i(20),_=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(v=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(v=>{}):he({user_id:e.user.id}).then(v=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(v=>{})}})};function ve(e,v){S(z,e,v),S(U,e,v),S(q,e,v),S(C,e,v),S(M,e,v)}function S(e,v,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==v&&(e.value[E].user.is_following=ie)}const ke=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],C.value=[],M.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Y.value=1,Q.value=1,X.value=1,_.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ye=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,N({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,N({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,N({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,N({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,se.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,N({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,te.value=_.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},be=e=>{switch(p.value=e,p.value){case"post":l.value=z.value,n.value=J.value,_.value=Z.value,j();break;case"comment":l.value=U.value,n.value=K.value,_.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Y.value,_.value=ae.value,ne();break;case"media":l.value=C.value,n.value=Q.value,_.value=se.value,oe();break;case"star":l.value=M.value,n.value=X.value,_.value=te.value,ue();break}},W=()=>{h.value=!0,aa({username:x.value}).then(e=>{h.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),ye()}).catch(e=>{h.value=!1,console.log(e)})},Pe=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Y.value=n.value,ne();break;case"media":Q.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Oe=()=>{V.value=!0},Fe=()=>{G.value=!0},Te=()=>{V.value=!1},Ie=()=>{G.value=!1},A=e=>()=>fe(we,null,{default:()=>fe(e)}),xe=Ke(()=>{let e=[{label:"私信",key:"whisper",icon:A(ra)}];return d.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:A(ge)}):e.push({label:"解封",key:"deblocking",icon:A(ge)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:A(ca)}):e.push({label:"关注",key:"follow",icon:A(va)}),ce&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:A(_a)}):e.push({label:"添加朋友",key:"requesting",icon:A(da)})),e}),Ae=e=>{switch(e){case"whisper":Oe();break;case"delete":$e();break;case"requesting":Fe();break;case"follow":case"unfollow":ze();break;case"banned":case"deblocking":Ue();break}},$e=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,ta({user_id:a.id}).then(e=>{h.value=!1,a.is_friend=!1,j()}).catch(e=>{h.value=!1,console.log(e)})}})},ze=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,a.is_following?pe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)}):he({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},Ue=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{h.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},qe=()=>{n.value<_.value||_.value==0?(y.value=!1,n.value++,Pe()):y.value=!0};return Ye(()=>{W()}),Qe(()=>({path:$.path,query:$.query}),(e,v)=>{v.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",ke(),W())}),(e,v)=>{const ie=Ee,E=ha,re=ga,_e=Xe("router-link"),Ce=wa,Me=ka,Se=je,de=ya,L=ba,We=Pa,Le=Ve,Be=Oa,B=Ne,O=Fa,D=Re,De=fa,He=pa;return s(),u("div",null,[o(ie,{title:"用户详情"}),o(De,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[o(de,{show:h.value},{default:r(()=>[a.id>0?(s(),u("div",Ta,[w("div",Ia,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",xa,[w("div",Aa,[w("strong",null,I(a.nickname),1),w("span",null," @"+I(a.username),1),ce&&c(d).state.userInfo.id>0&&c(d).state.userInfo.username!=a.username&&a.is_friend?(s(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[H(" 好友 ")]),_:1})):m("",!0),c(d).state.userInfo.id>0&&c(d).state.userInfo.username!=a.username&&a.is_following?(s(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[H(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(s(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[H(" 管理员 ")]),_:1})):m("",!0)]),w("div",$a,[w("span",za,"UID. "+I(a.id),1),w("span",Ua,I(c(sa)(a.created_on))+" 加入",1)]),w("div",qa,[w("span",Ca,[o(_e,{onClick:v[0]||(v[0]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[H(" 关注  "+I(a.follows),1)]),_:1},8,["to"])]),w("span",Ma,[o(_e,{onClick:v[1]||(v[1]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[H(" 粉丝  "+I(a.followings),1)]),_:1},8,["to"])]),w("span",Sa," 泡泡  "+I(a.tweets_count),1)])]),c(d).state.userInfo.id>0&&c(d).state.userInfo.username!=a.username?(s(),u("div",Wa,[o(Me,{placement:"bottom-end",trigger:"click",size:"small",options:xe.value,onSelect:Ae},{default:r(()=>[o(Ce,{quaternary:"",circle:""},{icon:r(()=>[o(c(we),null,{default:r(()=>[o(c(ia))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(Se,{show:V.value,user:a,onSuccess:Te},null,8,["show","user"]),o(oa,{show:G.value,user:a,onSuccess:Ie},null,8,["show","user"])]),_:1},8,["show"]),o(We,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":be},{default:r(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),f.value&&l.value.length===0?(s(),u("div",La,[o(Le,{num:k.value},null,8,["num"])])):(s(),u("div",Ba,[l.value.length===0?(s(),u("div",Da,[o(Be,{size:"large",description:"暂无数据"})])):m("",!0),c(d).state.desktopModelShow?(s(),u("div",Ha,[p.value==="post"?(s(),u("div",Na,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ra,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Va,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",ja,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Ea,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(s(),u("div",Ga,[p.value==="post"?(s(),u("div",Ja,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ka,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ya,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Qa,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Xa,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(d).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),_.value>0?(s(),g(He,{key:0,justify:"center"},{default:r(()=>[o(c(ua),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:v[2]||(v[2]=t=>qe())},{spinner:r(()=>[w("div",Za,[y.value?m("",!0):(s(),g(de,{key:0,size:14})),w("span",es,I(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Ss=na(as,[["__scopeId","data-v-a3099af3"]]);export{Ss as default}; diff --git a/web/dist/assets/User-f3cd38fc.js b/web/dist/assets/User-f3cd38fc.js new file mode 100644 index 00000000..75fd9e95 --- /dev/null +++ b/web/dist/assets/User-f3cd38fc.js @@ -0,0 +1 @@ +import{_ as He,a as Ne}from"./post-item.vue_vue_type_style_index_0_lang-4d372959.js";import{_ as Re}from"./post-skeleton-a15059e0.js";import{_ as Ve}from"./whisper-29f2b0aa.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Ee,H as i,R as Ge,c as Je,b as Ke,E as Ye,r as Qe,f as u,k as o,w as r,q as g,Y as m,e as s,j as w,x as I,bf as c,A as H,y as de,F,u as T,h as me}from"./@vue-a481fc63.js";import{u as Xe}from"./vuex-44de225f.js";import{b as Ze}from"./vue-router-e5a2430e.js";import{L as ea,K as aa,e as N,h as sa,u as fe,f as pe,M as ta,_ as la}from"./index-15a0e03b.js";import{W as na}from"./whisper-add-friend-78adb41e.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as ua,r as ia,G as he,s as ra,t as ca,J as va,R as _a}from"./@vicons-f0266f88.js";import{F as da,G as ma,a as fa,j as ge,o as pa,M as ha,e as ga,P as wa,k as ka,f as ya,g as ba,J as Pa,H as Oa}from"./naive-ui-eecf2ec3.js";import"./content-a642a616.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Fa={key:0,class:"profile-baseinfo"},Ta={class:"avatar"},Ia={class:"base-info"},xa={class:"username"},Aa={class:"userinfo"},$a={class:"info-item"},za={class:"info-item"},Ua={class:"userinfo"},qa={class:"info-item"},Ma={class:"info-item"},Ca={class:"info-item"},Sa={key:0,class:"user-opts"},Wa={key:0,class:"skeleton-wrap"},La={key:1},Ba={key:0,class:"empty-wrap"},Da={key:1},Ha={key:0},Na={key:1},Ra={key:2},Va={key:3},ja={key:4},Ea={key:2},Ga={key:0},Ja={key:1},Ka={key:2},Ya={key:3},Qa={key:4},Xa={class:"load-more-wrap"},Za={class:"load-more-spinner"},es=Ee({__name:"User",setup(as){const R=da(),v=Xe(),$=Ze(),f=i(!1),y=i(!1),a=Ge({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),h=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),M=i([]),C=i([]),x=i($.query.s||""),n=i(+$.query.p||1),p=i("post"),J=i(+$.query.p||1),K=i(1),Y=i(1),Q=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),se=i(0),te=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?fe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ce(e.user_id,!1)}).catch(_=>{}):pe({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ce(e.user_id,!0)}).catch(_=>{})}})};function ce(e,_){S(z,e,_),S(U,e,_),S(q,e,_),S(M,e,_),S(C,e,_)}function S(e,_,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==_&&(e.value[E].user.is_following=ie)}const we=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],M.value=[],C.value=[],p.value="post",n.value=1,J.value=1,K.value=1,Y.value=1,Q.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,se.value=0,te.value=0},ke=()=>{switch(p.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,N({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,N({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,N({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,N({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,N({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ye=e=>{switch(p.value=e,p.value){case"post":l.value=z.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=U.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Y.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Q.value,d.value=se.value,oe();break;case"star":l.value=C.value,n.value=X.value,d.value=te.value,ue();break}},W=()=>{h.value=!0,ea({username:x.value}).then(e=>{h.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),ke()}).catch(e=>{h.value=!1,console.log(e)})},be=()=>{switch(p.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Y.value=n.value,ne();break;case"media":Q.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Pe=()=>{V.value=!0},Oe=()=>{G.value=!0},Fe=()=>{V.value=!1},Te=()=>{G.value=!1},A=e=>()=>me(ge,null,{default:()=>me(e)}),Ie=Je(()=>{let e=[{label:"私信",key:"whisper",icon:A(ia)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:A(he)}):e.push({label:"解封",key:"deblocking",icon:A(he)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:A(ra)}):e.push({label:"关注",key:"follow",icon:A(ca)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:A(va)}):e.push({label:"添加朋友",key:"requesting",icon:A(_a)})),e}),xe=e=>{switch(e){case"whisper":Pe();break;case"delete":Ae();break;case"requesting":Oe();break;case"follow":case"unfollow":$e();break;case"banned":case"deblocking":ze();break}},Ae=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,sa({user_id:a.id}).then(e=>{h.value=!1,a.is_friend=!1,j()}).catch(e=>{h.value=!1,console.log(e)})}})},$e=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,a.is_following?fe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)}):pe({user_id:a.id}).then(e=>{h.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},ze=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{h.value=!0,ta({id:a.id,status:a.status===1?2:1}).then(e=>{h.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{h.value=!1,console.log(e)})}})},Ue=()=>{n.value{W()}),Ye(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",we(),W())}),(e,_)=>{const ie=je,E=pa,re=ha,ve=Qe("router-link"),qe=ga,Me=wa,Ce=Ve,_e=ka,L=ya,Se=ba,We=Re,Le=Pa,B=He,O=Oa,D=Ne,Be=ma,De=fa;return s(),u("div",null,[o(ie,{title:"用户详情"}),o(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[o(_e,{show:h.value},{default:r(()=>[a.id>0?(s(),u("div",Fa,[w("div",Ta,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",Ia,[w("div",xa,[w("strong",null,I(a.nickname),1),w("span",null," @"+I(a.username),1),c(v).state.profile.useFriendship&&c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_friend?(s(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[H(" 好友 ")]),_:1})):m("",!0),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username&&a.is_following?(s(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[H(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(s(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[H(" 管理员 ")]),_:1})):m("",!0)]),w("div",Aa,[w("span",$a,"UID. "+I(a.id),1),w("span",za,I(c(aa)(a.created_on))+" 加入",1)]),w("div",Ua,[w("span",qa,[o(ve,{onClick:_[0]||(_[0]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[H(" 关注  "+I(a.follows),1)]),_:1},8,["to"])]),w("span",Ma,[o(ve,{onClick:_[1]||(_[1]=de(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[H(" 粉丝  "+I(a.followings),1)]),_:1},8,["to"])]),w("span",Ca," 泡泡  "+I(a.tweets_count),1)])]),c(v).state.userInfo.id>0&&c(v).state.userInfo.username!=a.username?(s(),u("div",Sa,[o(Me,{placement:"bottom-end",trigger:"click",size:"small",options:Ie.value,onSelect:xe},{default:r(()=>[o(qe,{quaternary:"",circle:""},{icon:r(()=>[o(c(ge),null,{default:r(()=>[o(c(ua))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(Ce,{show:V.value,user:a,onSuccess:Fe},null,8,["show","user"]),o(na,{show:G.value,user:a,onSuccess:Te},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:p.value,"onUpdate:value":ye},{default:r(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),f.value&&l.value.length===0?(s(),u("div",Wa,[o(We,{num:k.value},null,8,["num"])])):(s(),u("div",La,[l.value.length===0?(s(),u("div",Ba,[o(Le,{size:"large",description:"暂无数据"})])):m("",!0),c(v).state.desktopModelShow?(s(),u("div",Da,[p.value==="post"?(s(),u("div",Ha,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Na,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ra,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Va,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",ja,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(B,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(s(),u("div",Ea,[p.value==="post"?(s(),u("div",Ga,[(s(!0),u(F,null,T(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(s(),u("div",Ja,[(s(!0),u(F,null,T(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(s(),u("div",Ka,[(s(!0),u(F,null,T(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(s(),u("div",Ya,[(s(!0),u(F,null,T(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(s(),u("div",Qa,[(s(!0),u(F,null,T(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[o(D,{post:t,isOwner:c(v).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(s(),g(De,{key:0,justify:"center"},{default:r(()=>[o(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=t=>Ue())},{spinner:r(()=>[w("div",Xa,[y.value?m("",!0):(s(),g(_e,{key:0,size:14})),w("span",Za,I(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Cs=la(es,[["__scopeId","data-v-85a170e0"]]);export{Cs as default}; diff --git a/web/dist/assets/Wallet-dbe4c788.js b/web/dist/assets/Wallet-d200e3ec.js similarity index 95% rename from web/dist/assets/Wallet-dbe4c788.js rename to web/dist/assets/Wallet-d200e3ec.js index 88634b3d..a3438b8f 100644 --- a/web/dist/assets/Wallet-dbe4c788.js +++ b/web/dist/assets/Wallet-d200e3ec.js @@ -1 +1 @@ -import{_ as K}from"./post-skeleton-d9166350.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{d as Z,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{a0 as _e,a1 as re,a2 as ue,a3 as pe,J as de,_ as me}from"./index-2af3a836.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Z({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,d=fe,F=ye,f=we,$=ke,L=be,U=K,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,G=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),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",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; +import{_ as K}from"./post-skeleton-a15059e0.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-a20a8596.js";import{d as Z,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{a0 as _e,a1 as re,a2 as ue,a3 as pe,J as de,_ as me}from"./index-15a0e03b.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Z({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,d=fe,F=ye,f=we,$=ke,L=be,U=K,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,G=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),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",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; diff --git a/web/dist/assets/content-845a2453.js b/web/dist/assets/content-a642a616.js similarity index 98% rename from web/dist/assets/content-845a2453.js rename to web/dist/assets/content-a642a616.js index 4faeadac..c8e770c8 100644 --- a/web/dist/assets/content-845a2453.js +++ b/web/dist/assets/content-a642a616.js @@ -1 +1 @@ -import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as z}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as F,X as L,e as T,i as U}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-2af3a836.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},W={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},S=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",W,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,$(n.content),1)],8,q)])]))),128))])}}});const ot=B(S,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},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=F,_=A,f=V,w=L;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=T,i=U;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(z))]),_:1})]),default:o(()=>[D(" "+$(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(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; +import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as z}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as F,X as L,e as T,i as U}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-15a0e03b.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},W={class:"link-txt-wrap"},q=["href"],H={class:"link-txt"},S=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",W,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",H,$(n.content),1)],8,q)])]))),128))])}}});const ot=B(S,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},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=F,_=A,f=V,w=L;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=T,i=U;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(z))]),_:1})]),default:o(()=>[D(" "+$(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(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/index-15a0e03b.js b/web/dist/assets/index-15a0e03b.js new file mode 100644 index 00000000..ada2fff0 --- /dev/null +++ b/web/dist/assets/index-15a0e03b.js @@ -0,0 +1 @@ +import{d as V,H as L,R as X,b as B,e as f,q as F,w as u,j as w,k as s,bf as d,f as R,A as U,Z as q,y as N,Y as E,c as Q,E as j,r as ue,F as ee,u as te,x as A,h as k,a5 as ve,s as oe,l as we,ag as ye}from"./@vue-a481fc63.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-e5a2430e.js";import{c as Pe,u as W}from"./vuex-44de225f.js";import{a as Te}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Oe,d as Ce,e as me,f as Me,g as Ie,h as _e,i as Ee,j as K,k as Ue,u as Se,l as $e,m as De,n as xe,o as qe,p as Ne,q as Fe,r as Ke,s as Ve,t as Be}from"./naive-ui-eecf2ec3.js";import{h as S}from"./moment-2ab8298d.js";import{S as We,M as ze,L as He,C as Ye,B as je,P as Qe,W as Ze,a as Ge,H as re,b as se,c as ne}from"./@vicons-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))h(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&h(c)}).observe(document,{childList:!0,subtree:!0});function r(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function h(n){if(n.ep)return;n.ep=!0;const l=r(n);fetch(n.href,l)}})();const Je="modulepreload",Xe=function(e){return"/"+e},ae={},T=function(t,r,h){if(!r||r.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(r.map(l=>{if(l=Xe(l),l in ae)return;ae[l]=!0;const c=l.endsWith(".css"),I=c?'[rel="stylesheet"]':"";if(!!h)for(let _=n.length-1;_>=0;_--){const i=n[_];if(i.href===l&&(!c||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${I}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":Je,c||(g.as="script",g.crossOrigin=""),g.href=l,document.head.appendChild(g),c)return new Promise((_,i)=>{g.addEventListener("load",_),g.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>t()).catch(l=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l})},et=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-c19b4d50.js"),["assets/Home-c19b4d50.js","assets/whisper-add-friend-78adb41e.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-e6b13f04.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-44974496.js"),["assets/Post-44974496.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-a642a616.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-39447b75.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-a2ac0d74.js"),["assets/Topic-a2ac0d74.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-a1221d42.js"),["assets/Anouncement-a1221d42.js","assets/post-skeleton-a15059e0.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-7682ee52.js"),["assets/Profile-7682ee52.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-54de1ef0.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-f3cd38fc.js"),["assets/User-f3cd38fc.js","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-78adb41e.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-1ad57452.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-2895f627.js"),["assets/Messages-2895f627.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-29f2b0aa.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-9543d2b3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-55969243.js"),["assets/Collection-55969243.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js","assets/content-a642a616.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-e605040f.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-669f91fa.js"),["assets/Contacts-669f91fa.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-3acd73c5.js"),["assets/Following-3acd73c5.js","assets/whisper-29f2b0aa.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-a15059e0.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-d200e3ec.js"),["assets/Wallet-d200e3ec.js","assets/post-skeleton-a15059e0.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-9923d3fd.js"),["assets/Setting-9923d3fd.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-94ec4c57.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-c0c7310e.js"),["assets/404-c0c7310e.js","assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],he=be({history:ke(),routes:et});he.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Pe({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",unreadMsgCount:0,userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},profile:{useFriendship:!0,enableTrendsBar:!0,enableWallet:!1,allowTweetAttachment:!0,allowTweetAttachmentPrice:!0,allowTweetVideo:!0,allowUserRegister:!0,allowPhoneBind:!0,defaultTweetVisibility:"friend",defaultMsgLoopInterval:5e3,copyrightTop:"2023 paopao.info",copyrightLeft:"Roc's Me",copyrightLeftLink:"",copyrightRight:"泡泡(PaoPao)开源社区",copyrightRightLink:"https://www.paopao.info"}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},updateUnreadMsgCount(e,t){e.unreadMsgCount=t},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)},loadDefaultSiteProfile(e){e.profile.useFriendship="true".toLowerCase()==="true",e.profile.enableTrendsBar="true".toLowerCase()==="true",e.profile.enableWallet="false".toLocaleLowerCase()==="true",e.profile.allowTweetAttachment="true".toLowerCase()==="true",e.profile.allowTweetAttachmentPrice="false".toLowerCase()==="true",e.profile.allowTweetVideo="true".toLowerCase()==="true",e.profile.allowUserRegister="true".toLowerCase()==="true",e.profile.allowPhoneBind="true".toLowerCase()==="true",e.profile.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=+"5000",e.profile.copyrightTop="2023 paopao.info",e.profile.copyrightLeft="Roc's Me",e.profile.copyrightLeftLink="",e.profile.copyrightRight="泡泡(PaoPao)开源社区",e.profile.copyrightRightLink="https://www.paopao.info"},updateSiteProfile(e,t){const r=e.profile;e.profile.useFriendship=t.use_friendship??r.useFriendship,e.profile.enableTrendsBar=t.enable_trends_bar??r.enableTrendsBar,e.profile.enableWallet=t.enable_wallet??r.enableWallet,e.profile.allowTweetAttachment=t.allow_tweet_attachment??r.allowTweetAttachment,e.profile.allowTweetAttachmentPrice=t.allow_tweet_attachment_price??r.allowTweetAttachmentPrice,e.profile.allowTweetVideo=t.allow_tweet_video??r.allowTweetVideo,e.profile.allowUserRegister=t.allow_user_register??r.allowUserRegister,e.profile.allowPhoneBind=t.allow_phone_bind??r.allowPhoneBind,e.profile.defaultTweetVisibility=t.default_tweet_visibility??r.defaultTweetVisibility,e.profile.defaultMsgLoopInterval=t.default_msg_loop_interval??r.defaultMsgLoopInterval,e.profile.copyrightTop=t.copyright_top??r.copyrightTop,e.profile.copyrightLeft=t.copyright_left??r.copyrightLeft,e.profile.copyrightLeftLink=t.copyright_left_link??r.copyrightLeftLink,e.profile.copyrightRight=t.copyright_right??r.copyrightRight,e.profile.copyrightRightLink=t.copyright_right_link??r.copyrightRightLink},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),Z=Te.create({baseURL:"",timeout:3e4});Z.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Z.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Z(e)}const le=e=>o({method:"post",url:"/v1/auth/login",data:e}),ot=e=>o({method:"post",url:"/v1/auth/register",data:e}),Y=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),rt={class:"auth-wrap"},st={key:0},nt=V({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),I={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,i)=>!!c.password&&c.password.startsWith(i)&&c.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},P=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(O=>{O||(r.value=!0,le({username:n.username,password:n.password}).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("登录成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),t.commit("refresh"),n.username="",n.password=""}).catch(m=>{r.value=!1}))})},g=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=l.value)==null||i.validate(O=>{O||(r.value=!0,ot({username:c.username,password:c.password}).then(m=>le({username:c.username,password:c.password})).then(m=>{const b=(m==null?void 0:m.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(m=>{window.$message.success("注册成功"),r.value=!1,t.commit("updateUserinfo",m),t.commit("triggerAuth",!1),c.username="",c.password="",c.repassword=""}).catch(m=>{r.value=!1}))})};return B(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Y(_).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(_,i)=>{const O=Ae,m=Re,b=pe,a=de,v=Oe,D=Ce,$=me,x=Me,p=Ie,C=_e,z=Ee;return f(),F(z,{show:d(t).state.authModalShow,"onUpdate:show":i[7]||(i[7]=y=>d(t).state.authModalShow=y),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:u(()=>[w("div",rt,[s(C,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?E("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(O,{type:"success"},{default:u(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[1]||(i[1]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),F(p,{key:1,"default-value":d(t).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:u(()=>[s(x,{name:"signin",tab:"登录"},{default:u(()=>[s(D,{ref_key:"loginRef",ref:h,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(v,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[3]||(i[3]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(P,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:P},{default:u(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:I},{default:u(()=>[s(v,{label:"用户名",path:"username"},{default:u(()=>[s(a,{value:c.username,"onUpdate:value":i[4]||(i[4]=y=>c.username=y),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(v,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:c.password,"onUpdate:value":i[5]||(i[5]=y=>c.password=y),onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(v,{label:"重复密码",path:"repassword"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:c.repassword,"onUpdate:value":i[6]||(i[6]=y=>c.repassword=y),onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:g},{default:u(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):E("",!0)]),_:1})])]),_:1},8,["show"])}}});const fe=(e,t)=>{const r=e.__vccOpts||e;for(const[h,n]of t)r[h]=n;return r},at=fe(nt,[["__scopeId","data-v-6f778fc4"]]),no=e=>o({method:"get",url:"/v1/posts",params:e}),lt=e=>o({method:"get",url:"/v1/tags",params:e}),ao=e=>o({method:"get",url:"/v1/post",params:e}),lo=e=>o({method:"get",url:"/v1/post/star",params:e}),io=e=>o({method:"post",url:"/v1/post/star",data:e}),uo=e=>o({method:"get",url:"/v1/post/collection",params:e}),co=e=>o({method:"post",url:"/v1/post/collection",data:e}),po=e=>o({method:"get",url:"/v1/post/comments",params:e}),mo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),_o=e=>o({method:"get",url:"/v1/trends/index",params:e}),ho=e=>o({method:"post",url:"/v1/post",data:e}),fo=e=>o({method:"delete",url:"/v1/post",data:e}),go=e=>o({method:"post",url:"/v1/post/lock",data:e}),vo=e=>o({method:"post",url:"/v1/post/stick",data:e}),wo=e=>o({method:"post",url:"/v1/post/highlight",data:e}),yo=e=>o({method:"post",url:"/v1/post/visibility",data:e}),bo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),ko=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Po=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Oo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Io=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Eo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),So=e=>o({method:"post",url:"/v1/captcha",data:e}),$o=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Do=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),xo=e=>o({method:"post",url:"/v1/friend/add",data:e}),qo=e=>o({method:"post",url:"/v1/user/follow",data:e}),No=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Fo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ko=e=>o({method:"get",url:"/v1/user/followings",params:e}),Vo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Bo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),zo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Ho=e=>o({method:"post",url:"/v1/user/password",data:e}),Yo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),jo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ie=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Qo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Zo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Go=()=>o({method:"post",url:"/v1/user/message/readall"}),Jo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Xo=e=>o({method:"get",url:"/v1/user/profile",params:e}),er=e=>o({method:"get",url:"/v1/user/posts",params:e}),tr=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),or=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rr=e=>o({method:"get",url:"/v1/user/recharge",params:e}),sr=e=>o({method:"get",url:"/v1/suggest/users",params:e}),nr=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),ar=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),lr=e=>o({method:"get",url:"/v1/attachment",params:e}),ir=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),it=()=>o({method:"get",url:"/v1/admin/site/status"});S.locale("zh-cn");const ut=e=>S.unix(e).fromNow(),ur=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=S.unix(e),r=S();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):S().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>S.unix(e).utc(!0).format("YYYY年MM月"),ct={key:0,class:"rightbar-wrap"},pt={class:"search-wrap"},dt={class:"post-num"},mt={class:"post-num"},_t={class:"copyright"},ht=["href"],ft=["href"],gt={class:"site-info-item"},vt=V({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),I=L(0),P=L(0),g=L(0),_=L(0),i=L(null),O=+"6",m=+"12",b=()=>{it().then(p=>{I.value=p.register_user_count,P.value=p.online_user_count,g.value=p.history_max_online,_.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{h.value=!0,lt({type:"hot_extral",num:m,extral_num:O}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,h.value=!1}).catch(p=>{h.value=!1})},v=p=>p>=1e3?(p/1e3).toFixed(1)+"k":p,D=()=>{c.push({name:"home",query:{q:n.value}})},$=Q({get:()=>l.state.userLogined&&r.value.length!==0,set:p=>{}});j(()=>({refreshTopicFollow:l.state.refreshTopicFollow,userLogined:l.state.userLogined}),(p,C)=>{(p.refreshTopicFollow!==C.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(C=>{C.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return B(()=>{i.value&&x.observe(i.value),a()}),(p,C)=>{const z=K,y=de,G=ue("router-link"),J=Ue,H=_e,ge=pe;return d(l).state.collapsedRight?E("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":C[0]||(C[0]=M=>n.value=M),onKeyup:q(N(D,["prevent"]),["enter"])},{prefix:u(()=>[s(z,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),F(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):E("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:h.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,M=>(f(),R("div",{class:"hot-tag-item",key:M.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:M.tag,t:"tag"}}},{default:u(()=>[U(" #"+A(M.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(M.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",_t,"© "+A(d(l).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(l).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightLeft),9,ht),w("a",{href:d(l).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(l).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(l).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(I.value)+" 注册用户,"+A(P.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):E("",!0)]))}}});const wt=fe(vt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-52afee68.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Pt={class:"user-info"},Tt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Ot={class:"user-mini-wrap"},Ct={key:1,class:"user-wrap"},Mt={key:0,class:"login-only-wrap"},It={key:1,class:"login-wrap"},Et=V({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),I="false".toLowerCase()==="true";j(r,()=>{l.value=r.name}),j(t.state,()=>{n.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?c.value||(ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)}),c.value=setInterval(()=>{ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)})},t.state.profile.defaultMsgLoopInterval)):c.value&&clearInterval(c.value)}),B(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const P=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return I&&a.push({label:"公告",key:"anouncement",icon:()=>k(ze),href:"/anouncement"}),a.push({label:"主页",key:"profile",icon:()=>k(He),href:"/profile"}),a.push({label:"消息",key:"messages",icon:()=>k(Ye),href:"/messages"}),a.push({label:"收藏",key:"collection",icon:()=>k(je),href:"/collection"}),t.state.profile.useFriendship&&a.push({label:"好友",key:"contacts",icon:()=>k(Qe),href:"/contacts"}),t.state.profile.enableWallet&&a.push({label:"钱包",key:"wallet",icon:()=>k(Ze),href:"/wallet"}),a.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?a:[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}]}),g=a=>"href"in a?k("div",{},a.label):a.label,_=a=>a.key==="messages"?k($e,{dot:!0,show:n.value,processing:!0},{default:()=>k(K,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(K,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},O=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),O()};return window.$store=t,window.$message=Se(),(a,v)=>{const D=De,$=xe,x=qe,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:O},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:P.value,"render-label":g,"render-icon":_,value:l.value,"onUpdate:value":i},null,8,["options","value"]),d(t).state.userInfo.id>0?(f(),R("div",Lt,[s(x,{class:"user-avatar",round:"",size:34,src:d(t).state.userInfo.avatar},null,8,["src"]),w("div",Pt,[w("div",Tt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(K),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Ot,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(K),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Ct,[d(t).state.profile.allowUserRegister?E("",!0):(f(),R("div",Mt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=C=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",It,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=C=>m("signin"))},{default:u(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=C=>m("signup"))},{default:u(()=>[U(" 注册 ")]),_:1})])):E("",!0)]))])}}});const Ut=()=>o({method:"get",url:"/v1/site/profile"}),St={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=V({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?Fe:null);function h(){t.commit("loadDefaultSiteProfile"),Ut().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return B(()=>{h()}),(n,l)=>{const c=Et,I=ue("router-view"),P=wt,g=at,_=Ke,i=Ve,O=Be,m=Ne;return f(),F(m,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(_,null,{default:u(()=>{var b;return[w("div",{class:we(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",St,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):E("",!0),w("div",Dt,[s(I,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),F(ve,null,[n.$route.meta.keepAlive?(f(),F(oe(a),{key:0})):E("",!0)],1024)),n.$route.meta.keepAlive?E("",!0):(f(),F(oe(a),{key:0}))]),_:1})]),s(P)]),s(g)],2)]}),_:1})]),_:1}),s(O)]),_:1},8,["theme"])}}});ye(xt).use(he).use(tt).mount("#app");export{$o as $,io as A,co as B,ao as C,po as D,yt as E,Mo as F,Eo as G,Io as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Vo as P,Zo as Q,Qo as R,Go as S,Jo as T,cr as U,ar as V,lr as W,mo as X,Fo as Y,Ko as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,Uo as a4,jo as a5,Ho as a6,Wo as a7,zo as a8,Yo as a9,So as aa,Et as ab,_o as b,ho as c,no as d,er as e,qo as f,sr as g,Bo as h,ur as i,Po as j,Co as k,bo as l,ko as m,Oo as n,Ao as o,Ro as p,To as q,lo as r,uo as s,Lo as t,No as u,fo as v,go as w,vo as x,wo as y,yo as z}; diff --git a/web/dist/assets/index-2af3a836.js b/web/dist/assets/index-2af3a836.js deleted file mode 100644 index 6e6ebc5e..00000000 --- a/web/dist/assets/index-2af3a836.js +++ /dev/null @@ -1 +0,0 @@ -import{d as Y,H as k,R as oe,b as G,e as w,q as K,w as a,j as y,k as s,f as C,A as S,Z as q,y as N,Y as $,bf as f,c as J,E as Z,r as me,F as se,u as ne,x as A,h as P,a5 as Pe,s as re,l as Le,ag as Oe}from"./@vue-a481fc63.js";import{c as Te,a as Ae,u as pe,b as Ce}from"./vue-router-e5a2430e.js";import{c as Ee,u as B}from"./vuex-44de225f.js";import{a as Ie}from"./axios-4a70c6fc.js";import{_ as Me,N as Re,a as _e,b as he,c as $e,d as Ue,e as ge,f as Se,g as De,h as fe,i as xe,j as W,k as qe,u as Ne,l as Ke,m as Fe,n as Ve,o as ze,p as He,q as We,r as Ye,s as Be,t as je}from"./naive-ui-eecf2ec3.js";import{h as D}from"./moment-2ab8298d.js";import{S as Qe,M as Ze,L as Ge,C as Je,B as Xe,P as et,W as tt,a as ot,H as ae,b as le,c as ue}from"./@vicons-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))c(u);new MutationObserver(u=>{for(const n of u)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(u){const n={};return u.integrity&&(n.integrity=u.integrity),u.referrerPolicy&&(n.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?n.credentials="include":u.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(u){if(u.ep)return;u.ep=!0;const n=r(u);fetch(u.href,n)}})();const st="modulepreload",nt=function(e){return"/"+e},ie={},T=function(t,r,c){if(!r||r.length===0)return t();const u=document.getElementsByTagName("link");return Promise.all(r.map(n=>{if(n=nt(n),n in ie)return;ie[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=u.length-1;b>=0;b--){const _=u[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":st,m||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),m)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},rt=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-d5a23262.js"),["assets/Home-d5a23262.js","assets/whisper-add-friend-83d6a50f.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-694050d3.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js","assets/content-845a2453.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-6a728cf8.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-e91899fe.js"),["assets/Post-e91899fe.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-845a2453.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-694050d3.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-39447b75.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-6e91af53.js"),["assets/Topic-6e91af53.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-96debf58.js"),["assets/Anouncement-96debf58.js","assets/post-skeleton-d9166350.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-de924a39.js"),["assets/Profile-de924a39.js","assets/whisper-694050d3.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js","assets/content-845a2453.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-54de1ef0.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-e929b372.js"),["assets/User-e929b372.js","assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js","assets/content-845a2453.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/whisper-694050d3.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-83d6a50f.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-00d998d0.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-4bbf517b.js"),["assets/Messages-4bbf517b.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-694050d3.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-1851378b.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-b709ad01.js"),["assets/Collection-b709ad01.js","assets/whisper-694050d3.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js","assets/content-845a2453.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-e605040f.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-db8bb89e.js"),["assets/Contacts-db8bb89e.js","assets/whisper-694050d3.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-eb71a515.js"),["assets/Following-eb71a515.js","assets/whisper-694050d3.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-d9166350.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-dbe4c788.js"),["assets/Wallet-dbe4c788.js","assets/post-skeleton-d9166350.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-cf58f1fc.js"),["assets/Setting-cf58f1fc.js","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-b8b53fcf.js"),["assets/404-b8b53fcf.js","assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],ve=Te({history:Ae(),routes:rt});ve.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const at=Ee({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",unreadMsgCount:0,userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},updateUnreadMsgCount(e,t){e.unreadMsgCount=t},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),X=Ie.create({baseURL:"",timeout:3e4});X.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));X.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return X(e)}const ce=e=>o({method:"post",url:"/v1/auth/login",data:e}),lt=e=>o({method:"post",url:"/v1/auth/register",data:e}),Q=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),ut={class:"auth-wrap"},it={key:0},ct=Y({__name:"auth",setup(e){const t=k("true".toLowerCase()==="true"),r=B(),c=k(!1),u=k(),n=oe({username:"",password:""}),m=k(),d=oe({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,i)=>!!d.password&&d.password.startsWith(i)&&d.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},v=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=u.value)==null||i.validate(E=>{E||(c.value=!0,ce({username:n.username,password:n.password}).then(h=>{const I=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",I),Q(I)}).then(h=>{window.$message.success("登录成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),r.commit("refresh"),n.username="",n.password=""}).catch(h=>{c.value=!1}))})},b=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=m.value)==null||i.validate(E=>{E||(c.value=!0,lt({username:d.username,password:d.password}).then(h=>ce({username:d.username,password:d.password})).then(h=>{const I=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",I),Q(I)}).then(h=>{window.$message.success("注册成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(h=>{c.value=!1}))})};return G(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Q(_).then(i=>{r.commit("updateUserinfo",i),r.commit("triggerAuth",!1)}).catch(i=>{r.commit("userLogout")}):r.commit("userLogout")}),(_,i)=>{const E=Me,h=Re,I=_e,M=he,L=$e,x=Ue,l=ge,O=Se,F=De,H=fe,V=xe;return w(),K(V,{show:f(r).state.authModalShow,"onUpdate:show":i[7]||(i[7]=p=>f(r).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",ut,[s(H,{bordered:!1},{default:a(()=>[t.value?$("",!0):(w(),C("div",it,[s(I,{justify:"center"},{default:a(()=>[s(h,null,{default:a(()=>[s(E,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(x,{ref_key:"loginRef",ref:u,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(M,{value:n.username,"onUpdate:value":i[0]||(i[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(M,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[1]||(i[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),K(F,{key:1,"default-value":f(r).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(O,{name:"signin",tab:"登录"},{default:a(()=>[s(x,{ref_key:"loginRef",ref:u,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(M,{value:n.username,"onUpdate:value":i[2]||(i[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(M,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[3]||(i[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(O,{name:"signup",tab:"注册"},{default:a(()=>[s(x,{ref_key:"registerRef",ref:m,model:d,rules:U},{default:a(()=>[s(L,{label:"用户名",path:"username"},{default:a(()=>[s(M,{value:d.username,"onUpdate:value":i[4]||(i[4]=p=>d.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(M,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":i[5]||(i[5]=p=>d.password=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"重复密码",path:"repassword"},{default:a(()=>[s(M,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":i[6]||(i[6]=p=>d.repassword=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):$("",!0)]),_:1})])]),_:1},8,["show"])}}});const we=(e,t)=>{const r=e.__vccOpts||e;for(const[c,u]of t)r[c]=u;return r},dt=we(ct,[["__scopeId","data-v-053dfa44"]]),io=e=>o({method:"get",url:"/v1/posts",params:e}),mt=e=>o({method:"get",url:"/v1/tags",params:e}),co=e=>o({method:"get",url:"/v1/post",params:e}),mo=e=>o({method:"get",url:"/v1/post/star",params:e}),po=e=>o({method:"post",url:"/v1/post/star",data:e}),_o=e=>o({method:"get",url:"/v1/post/collection",params:e}),ho=e=>o({method:"post",url:"/v1/post/collection",data:e}),go=e=>o({method:"get",url:"/v1/post/comments",params:e}),fo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),vo=e=>o({method:"get",url:"/v1/trends/index",params:e}),wo=e=>o({method:"post",url:"/v1/post",data:e}),yo=e=>o({method:"delete",url:"/v1/post",data:e}),bo=e=>o({method:"post",url:"/v1/post/lock",data:e}),ko=e=>o({method:"post",url:"/v1/post/stick",data:e}),Po=e=>o({method:"post",url:"/v1/post/highlight",data:e}),Lo=e=>o({method:"post",url:"/v1/post/visibility",data:e}),Oo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),To=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),Ao=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Co=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Eo=e=>o({method:"post",url:"/v1/post/comment",data:e}),Io=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Mo=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),$o=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Uo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Do=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),xo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),qo=e=>o({method:"post",url:"/v1/captcha",data:e}),No=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ko=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Fo=e=>o({method:"post",url:"/v1/friend/add",data:e}),Vo=e=>o({method:"post",url:"/v1/user/follow",data:e}),zo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Ho=e=>o({method:"get",url:"/v1/user/follows",params:e}),Wo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Yo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Bo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),jo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Qo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Zo=e=>o({method:"post",url:"/v1/user/password",data:e}),Go=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Jo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Xo=e=>o({method:"get",url:"/v1/user/messages",params:e}),es=e=>o({method:"post",url:"/v1/user/message/read",data:e}),ts=()=>o({method:"post",url:"/v1/user/message/readall"}),os=e=>o({method:"get",url:"/v1/user/collections",params:e}),ss=e=>o({method:"get",url:"/v1/user/profile",params:e}),ns=e=>o({method:"get",url:"/v1/user/posts",params:e}),rs=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),as=e=>o({method:"post",url:"/v1/user/recharge",data:e}),ls=e=>o({method:"get",url:"/v1/user/recharge",params:e}),us=e=>o({method:"get",url:"/v1/suggest/users",params:e}),is=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),cs=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),ds=e=>o({method:"get",url:"/v1/attachment",params:e}),ms=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),pt=()=>o({method:"get",url:"/v1/admin/site/status"});D.locale("zh-cn");const _t=e=>D.unix(e).fromNow(),ps=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},_s=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},hs=e=>D.unix(e).utc(!0).format("YYYY年MM月"),ht={key:0,class:"rightbar-wrap"},gt={class:"search-wrap"},ft={class:"post-num"},vt={class:"post-num"},wt={class:"copyright"},yt=["href"],bt=["href"],kt={class:"site-info-item"},Pt=Y({__name:"rightbar",setup(e){const t=k([]),r=k([]),c=k(!1),u=k(""),n=B(),m=pe(),d=k(0),U=k(0),v=k(0),b=k(0),_=k(null),i="2023 paopao.info",E="Roc's Me",h="",I="泡泡(PaoPao)开源社区",M="https://www.paopao.info",L=+"6",x=+"12",l=()=>{pt().then(g=>{d.value=g.register_user_count,U.value=g.online_user_count,v.value=g.history_max_online,b.value=g.server_up_time}).catch(g=>{}),p.disconnect()},O=()=>{c.value=!0,mt({type:"hot_extral",num:x,extral_num:L}).then(g=>{t.value=g.topics,r.value=g.extral_topics??[],V.value=!0,c.value=!1}).catch(g=>{c.value=!1})},F=g=>g>=1e3?(g/1e3).toFixed(1)+"k":g,H=()=>{m.push({name:"home",query:{q:u.value}})},V=J({get:()=>n.state.userLogined&&r.value.length!==0,set:g=>{}});Z(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(g,z)=>{(g.refreshTopicFollow!==z.refreshTopicFollow||g.userLogined)&&O(),n.state.userInfo.is_admin&&l()});const p=new IntersectionObserver(g=>{g.forEach(z=>{z.isIntersecting&&l()})},{root:null,rootMargin:"0px",threshold:1});return G(()=>{_.value&&p.observe(_.value),O()}),(g,z)=>{const ye=W,be=he,ee=me("router-link"),te=qe,j=fe,ke=_e;return f(n).state.collapsedRight?$("",!0):(w(),C("div",ht,[y("div",gt,[s(be,{round:"",clearable:"",placeholder:"搜一搜...",value:u.value,"onUpdate:value":z[0]||(z[0]=R=>u.value=R),onKeyup:q(N(H,["prevent"]),["enter"])},{prefix:a(()=>[s(ye,{component:f(Qe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),V.value?(w(),K(j,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),C(se,null,ne(r.value,R=>(w(),C("div",{class:"hot-tag-item",key:R.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:R.tag,t:"tag"}}},{default:a(()=>[S(" #"+A(R.tag),1)]),_:2},1032,["to"]),y("div",ft,A(F(R.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):$("",!0),s(j,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),C(se,null,ne(t.value,R=>(w(),C("div",{class:"hot-tag-item",key:R.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:R.tag,t:"tag"}}},{default:a(()=>[S(" #"+A(R.tag),1)]),_:2},1032,["to"]),y("div",vt,A(F(R.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(j,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",wt,"© "+A(f(i)),1),y("div",null,[s(ke,null,{default:a(()=>[y("a",{href:f(h),target:"_blank",class:"hash-link"},A(f(E)),9,yt),y("a",{href:f(M),target:"_blank",class:"hash-link"},A(f(I)),9,bt)]),_:1})])]),_:1}),f(n).state.userInfo.is_admin?(w(),C("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:_},[y("span",kt,A(d.value)+" 注册用户,"+A(U.value)+" 人在线,最高在线 "+A(v.value)+" 人,站点上线于 "+A(f(_t)(b.value)),1)],512)):$("",!0)]))}}});const Lt=we(Pt,[["__scopeId","data-v-0a6cd0b6"]]),Ot="/assets/logo-52afee68.png",Tt={class:"sidebar-wrap"},At={class:"logo-wrap"},Ct={key:0,class:"user-wrap"},Et={class:"user-info"},It={class:"nickname"},Mt={class:"nickname-txt"},Rt={class:"username"},$t={class:"user-mini-wrap"},Ut={key:1,class:"user-wrap"},St={key:0,class:"login-only-wrap"},Dt={key:1,class:"login-wrap"},xt=Y({__name:"sidebar",setup(e){const t=B(),r=Ce(),c=pe(),u=k(!1),n=k(r.name||""),m=k(),d="true".toLowerCase()==="true",U="false".toLowerCase()==="true",v="false".toLocaleLowerCase()==="true",b=k("true".toLowerCase()==="true"),_=+"5000";Z(r,()=>{n.value=r.name}),Z(t.state,()=>{u.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?m.value||(de().then(l=>{u.value=l.count>0,t.commit("updateUnreadMsgCount",l.count)}).catch(l=>{console.log(l)}),m.value=setInterval(()=>{de().then(l=>{u.value=l.count>0,t.commit("updateUnreadMsgCount",l.count)}).catch(l=>{console.log(l)})},_)):m.value&&clearInterval(m.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const i=J(()=>{const l=[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}];return U&&l.push({label:"公告",key:"anouncement",icon:()=>P(Ze),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>P(Ge),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>P(Je),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>P(Xe),href:"/collection"}),d&&l.push({label:"好友",key:"contacts",icon:()=>P(et),href:"/contacts"}),v&&l.push({label:"钱包",key:"wallet",icon:()=>P(tt),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>P(ot),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}]}),E=l=>"href"in l?P("div",{},l.label):l.label,h=l=>l.key==="messages"?P(Ke,{dot:!0,show:u.value,processing:!0},{default:()=>P(W,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):P(W,null,{default:l.icon}),I=(l,O={})=>{n.value=l,c.push({name:l,query:{t:new Date().getTime()}})},M=()=>{r.path==="/"&&t.commit("refresh"),I("home")},L=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},x=()=>{t.commit("userLogout"),t.commit("refresh"),M()};return window.$store=t,window.$message=Ne(),(l,O)=>{const F=Fe,H=Ve,V=ze,p=ge;return w(),C("div",Tt,[y("div",At,[s(F,{class:"logo-img",width:"36",src:f(Ot),"preview-disabled":!0,onClick:M},null,8,["src"])]),s(H,{accordion:!0,"icon-size":24,options:i.value,"render-label":E,"render-icon":h,value:n.value,"onUpdate:value":I},null,8,["options","value"]),f(t).state.userInfo.id>0?(w(),C("div",Ct,[s(V,{class:"user-avatar",round:"",size:34,src:f(t).state.userInfo.avatar},null,8,["src"]),y("div",Et,[y("div",It,[y("span",Mt,A(f(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:x},{icon:a(()=>[s(f(W),null,{default:a(()=>[s(f(ue))]),_:1})]),_:1})]),y("div",Rt,"@"+A(f(t).state.userInfo.username),1)]),y("div",$t,[s(p,{class:"logout",quaternary:"",circle:"",onClick:x},{icon:a(()=>[s(f(W),{size:24},{default:a(()=>[s(f(ue))]),_:1})]),_:1})])])):(w(),C("div",Ut,[b.value?$("",!0):(w(),C("div",St,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[0]||(O[0]=g=>L("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),b.value?(w(),C("div",Dt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[1]||(O[1]=g=>L("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:O[2]||(O[2]=g=>L("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):$("",!0)]))])}}});const qt={"has-sider":"",class:"main-wrap",position:"static"},Nt={key:0},Kt={class:"content-wrap"},Ft=Y({__name:"App",setup(e){const t=B(),r=J(()=>t.state.theme==="dark"?We:null);return(c,u)=>{const n=xt,m=me("router-view"),d=Lt,U=dt,v=Ye,b=Be,_=je,i=He;return w(),K(i,{theme:r.value},{default:a(()=>[s(b,null,{default:a(()=>[s(v,null,{default:a(()=>{var E;return[y("div",{class:Le(["app-container",{dark:((E=r.value)==null?void 0:E.name)==="dark",mobile:!f(t).state.desktopModelShow}])},[y("div",qt,[f(t).state.desktopModelShow?(w(),C("div",Nt,[s(n)])):$("",!0),y("div",Kt,[s(m,{class:"app-wrap"},{default:a(({Component:h})=>[(w(),K(Pe,null,[c.$route.meta.keepAlive?(w(),K(re(h),{key:0})):$("",!0)],1024)),c.$route.meta.keepAlive?$("",!0):(w(),K(re(h),{key:0}))]),_:1})]),s(d)]),s(U)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});Oe(Ft).use(ve).use(at).mount("#app");export{No as $,po as A,ho as B,co as C,go as D,Ot as E,Uo as F,Do as G,So as H,mt as I,_t as J,hs as K,ss as L,ms as M,Ko as N,Fo as O,Yo as P,es as Q,Xo as R,ts as S,os as T,_s as U,cs as V,ds as W,fo as X,Ho as Y,Wo as Z,we as _,is as a,Q as a0,rs as a1,as as a2,ls as a3,xo as a4,Jo as a5,Zo as a6,jo as a7,Qo as a8,Go as a9,qo as aa,xt as ab,vo as b,wo as c,io as d,ns as e,Vo as f,us as g,Bo as h,ps as i,Co as j,$o as k,Oo as l,To as m,Ro as n,Io as o,Mo as p,Eo as q,mo as r,_o as s,Ao as t,zo as u,yo as v,bo as w,ko as x,Po as y,Lo as z}; diff --git a/web/dist/assets/index-c337d1db.css b/web/dist/assets/index-8daef249.css similarity index 76% rename from web/dist/assets/index-c337d1db.css rename to web/dist/assets/index-8daef249.css index 48e358ec..a8981b79 100644 --- a/web/dist/assets/index-c337d1db.css +++ b/web/dist/assets/index-8daef249.css @@ -1 +1 @@ -.auth-wrap[data-v-053dfa44]{margin-top:-30px}.dark .auth-wrap[data-v-053dfa44]{background-color:#101014bf}.rightbar-wrap[data-v-0a6cd0b6]::-webkit-scrollbar{width:0;height:0}.rightbar-wrap[data-v-0a6cd0b6]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px);max-height:100vh;overflow:auto}.rightbar-wrap .search-wrap[data-v-0a6cd0b6]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-0a6cd0b6]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-0a6cd0b6]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-0a6cd0b6]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-0a6cd0b6]{margin-bottom:10px}.rightbar-wrap .site-info[data-v-0a6cd0b6]{margin-top:8px;padding-left:16px;padding-right:16px}.rightbar-wrap .site-info .site-info-item[data-v-0a6cd0b6]{font-size:10px;opacity:.75}.rightbar-wrap .copyright-wrap .copyright[data-v-0a6cd0b6]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-0a6cd0b6]{font-size:12px}.dark .hottopic-wrap[data-v-0a6cd0b6],.dark .copyright-wrap[data-v-0a6cd0b6]{background-color:#18181c}.sidebar-wrap::-webkit-scrollbar{width:0;height:0}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box;max-height:100vh;overflow:auto}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.sidebar-wrap .logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.sidebar-wrap .logo-wrap .logo-img{margin-left:24px}.sidebar-wrap .logo-wrap .logo-img:hover{cursor:pointer}.sidebar-wrap .user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.sidebar-wrap .user-wrap .user-mini-wrap{display:none}.sidebar-wrap .user-wrap .user-avatar{margin-right:8px}.sidebar-wrap .user-wrap .user-info{display:flex;flex-direction:column}.sidebar-wrap .user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.sidebar-wrap .user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sidebar-wrap .user-wrap .user-info .nickname .logout{margin-left:6px}.sidebar-wrap .user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.sidebar-wrap .user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-only-wrap button{margin:0 4px;width:80%}.sidebar-wrap .user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 600px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.following-link{color:#000;color:none;text-decoration:none;cursor:pointer;opacity:.75}.following-link:hover{opacity:.8}.slide-bar-user-link{text-decoration:none;cursor:pointer}.slide-bar-user-link:hover{color:#18a058;opacity:.8}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .following-link,.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} +.auth-wrap[data-v-6f778fc4]{margin-top:-30px}.dark .auth-wrap[data-v-6f778fc4]{background-color:#101014bf}.rightbar-wrap[data-v-181f8063]::-webkit-scrollbar{width:0;height:0}.rightbar-wrap[data-v-181f8063]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px);max-height:100vh;overflow:auto}.rightbar-wrap .search-wrap[data-v-181f8063]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-181f8063]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-181f8063]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-181f8063]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-181f8063]{margin-bottom:10px}.rightbar-wrap .site-info[data-v-181f8063]{margin-top:8px;padding-left:16px;padding-right:16px}.rightbar-wrap .site-info .site-info-item[data-v-181f8063]{font-size:10px;opacity:.75}.rightbar-wrap .copyright-wrap .copyright[data-v-181f8063]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-181f8063]{font-size:12px}.dark .hottopic-wrap[data-v-181f8063],.dark .copyright-wrap[data-v-181f8063]{background-color:#18181c}.sidebar-wrap::-webkit-scrollbar{width:0;height:0}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box;max-height:100vh;overflow:auto}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.sidebar-wrap .logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.sidebar-wrap .logo-wrap .logo-img{margin-left:24px}.sidebar-wrap .logo-wrap .logo-img:hover{cursor:pointer}.sidebar-wrap .user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.sidebar-wrap .user-wrap .user-mini-wrap{display:none}.sidebar-wrap .user-wrap .user-avatar{margin-right:8px}.sidebar-wrap .user-wrap .user-info{display:flex;flex-direction:column}.sidebar-wrap .user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.sidebar-wrap .user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sidebar-wrap .user-wrap .user-info .nickname .logout{margin-left:6px}.sidebar-wrap .user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.sidebar-wrap .user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-only-wrap button{margin:0 4px;width:80%}.sidebar-wrap .user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.sidebar-wrap .user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 600px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.following-link{color:#000;color:none;text-decoration:none;cursor:pointer;opacity:.75}.following-link:hover{opacity:.8}.slide-bar-user-link{text-decoration:none;cursor:pointer}.slide-bar-user-link:hover{color:#18a058;opacity:.8}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .following-link,.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js index e35f9057..cb7eae9e 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a20a8596.js @@ -1 +1 @@ -import{ab as A}from"./index-2af3a836.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; +import{ab as A}from"./index-15a0e03b.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js index fa43c8c6..eccb1406 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-4d372959.js @@ -1 +1 @@ -import{p as R,a as V,_ as E,b as J,c as U}from"./content-845a2453.js";import{d as W,c as x,r as Y,e as l,f as b,k as n,al as G,w as s,j as u,F as K,u as Q,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{U as ee,A as te,B as oe}from"./index-2af3a836.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=W({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=W({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; +import{p as R,a as V,_ as E,b as J,c as U}from"./content-a642a616.js";import{d as W,c as x,r as Y,e as l,f as b,k as n,al as G,w as s,j as u,F as K,u as Q,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{U as ee,A as te,B as oe}from"./index-15a0e03b.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=W({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=W({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=Y("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=U,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},G({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(K,null,Q(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; diff --git a/web/dist/assets/post-skeleton-d9166350.js b/web/dist/assets/post-skeleton-a15059e0.js similarity index 88% rename from web/dist/assets/post-skeleton-d9166350.js rename to web/dist/assets/post-skeleton-a15059e0.js index 48073614..9e3050d5 100644 --- a/web/dist/assets/post-skeleton-d9166350.js +++ b/web/dist/assets/post-skeleton-a15059e0.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-2af3a836.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-15a0e03b.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/whisper-694050d3.js b/web/dist/assets/whisper-29f2b0aa.js similarity index 95% rename from web/dist/assets/whisper-694050d3.js rename to web/dist/assets/whisper-29f2b0aa.js index f411ec87..89d899ba 100644 --- a/web/dist/assets/whisper-694050d3.js +++ b/web/dist/assets/whisper-29f2b0aa.js @@ -1 +1 @@ -import{$ as b,_ as k}from"./index-2af3a836.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; +import{$ as b,_ as k}from"./index-15a0e03b.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; diff --git a/web/dist/assets/whisper-add-friend-83d6a50f.js b/web/dist/assets/whisper-add-friend-78adb41e.js similarity index 95% rename from web/dist/assets/whisper-add-friend-83d6a50f.js rename to web/dist/assets/whisper-add-friend-78adb41e.js index b6552518..7f65d506 100644 --- a/web/dist/assets/whisper-add-friend-83d6a50f.js +++ b/web/dist/assets/whisper-add-friend-78adb41e.js @@ -1 +1 @@ -import{N as b,_ as k}from"./index-2af3a836.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; +import{N as b,_ as k}from"./index-15a0e03b.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; diff --git a/web/dist/index.html b/web/dist/index.html index 0a040321..8f729bf4 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + @@ -29,7 +29,7 @@ - + diff --git a/web/src/App.vue b/web/src/App.vue index c19e49d1..d62ec0a1 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -43,12 +43,26 @@