diff --git a/CHANGELOG.md b/CHANGELOG.md index 9abeddbd..2d65bf0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ TODO; ### Change - frontend: optimize to use fold/unfold action for post item display. +### Fixed +- fixed follow page incorrect results. + ## 0.5.1 ### Added - User/Profile page add setting option when page's user is self. diff --git a/go.mod b/go.mod index 7cdbb84b..05bf5318 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/RoaringBitmap/roaring v1.6.0 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 github.com/alimy/mir/v4 v4.0.0 - github.com/alimy/tryst v0.8.3 + github.com/alimy/tryst v0.10.1 github.com/alimy/yesql v1.9.0 github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible github.com/allegro/bigcache/v3 v3.1.0 @@ -22,7 +22,7 @@ require ( github.com/getsentry/sentry-go v0.25.0 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.1 - github.com/go-resty/resty/v2 v2.9.1 + github.com/go-resty/resty/v2 v2.10.0 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 @@ -32,29 +32,29 @@ require ( 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 - github.com/onsi/ginkgo/v2 v2.12.1 - github.com/onsi/gomega v1.28.0 - github.com/prometheus/client_golang v1.16.0 + github.com/onsi/ginkgo/v2 v2.13.0 + github.com/onsi/gomega v1.29.0 + github.com/prometheus/client_golang v1.17.0 github.com/pyroscope-io/client v0.7.2 - github.com/redis/rueidis v1.0.19 + github.com/redis/rueidis v1.0.20 github.com/robfig/cron/v3 v3.0.1 github.com/sirupsen/logrus v1.9.3 - github.com/smartwalle/alipay/v3 v3.2.16 + github.com/smartwalle/alipay/v3 v3.2.19 github.com/sourcegraph/conc v0.3.0 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.17.0 github.com/sqlc-dev/sqlc v1.22.0 - github.com/tencentyun/cos-go-sdk-v5 v0.7.44 + github.com/tencentyun/cos-go-sdk-v5 v0.7.45 github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc go.uber.org/automaxprocs v1.5.3 - google.golang.org/grpc v1.58.2 + google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.31.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/resty.v1 v1.12.0 - gorm.io/driver/mysql v1.5.1 - gorm.io/driver/postgres v1.5.2 - gorm.io/driver/sqlite v1.5.3 - gorm.io/gorm v1.25.4 + gorm.io/driver/mysql v1.5.2 + gorm.io/driver/postgres v1.5.3 + gorm.io/driver/sqlite v1.5.4 + gorm.io/gorm v1.25.5 gorm.io/plugin/dbresolver v1.4.7 gorm.io/plugin/soft_delete v1.2.1 modernc.org/sqlite v1.26.0 @@ -92,13 +92,13 @@ require ( github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/cel-go v0.18.1 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.6 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect @@ -131,11 +131,11 @@ require ( github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect github.com/pingcap/log v1.1.0 // indirect - github.com/pingcap/tidb/parser v0.0.0-20231011150025-7f9ab7f2d3d0 // indirect + github.com/pingcap/tidb/parser v0.0.0-20230815160630-b69fa21942d1 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/pyroscope-io/godeltaprof v0.1.2 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/riza-io/grpc-go v0.2.0 // indirect @@ -143,9 +143,9 @@ require ( github.com/rs/xid v1.5.0 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartwalle/ncrypto v1.0.3 // indirect - github.com/smartwalle/ngx v1.0.7 // indirect - github.com/smartwalle/nsign v1.0.8 // indirect + github.com/smartwalle/ncrypto v1.0.4 // indirect + github.com/smartwalle/ngx v1.0.9 // indirect + github.com/smartwalle/nsign v1.0.9 // indirect github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -159,13 +159,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.25.0 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.13.0 // indirect + golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.15.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.13.0 // indirect @@ -177,9 +177,9 @@ require ( modernc.org/cc/v3 v3.40.0 // indirect modernc.org/ccgo/v3 v3.16.13 // indirect modernc.org/libc v1.24.1 // indirect - modernc.org/mathutil v1.6.0 // indirect + modernc.org/mathutil v1.5.0 // indirect modernc.org/memory v1.6.0 // indirect modernc.org/opt v0.1.3 // indirect - modernc.org/strutil v1.2.0 // indirect + modernc.org/strutil v1.1.3 // indirect modernc.org/token v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index eda1bc15..78a8454e 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,8 @@ github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:C github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/alimy/mir/v4 v4.0.0 h1:MzGfmoLjjvR69jbZEmpKJO3tUuqB0RGRv1UWPbtukBg= github.com/alimy/mir/v4 v4.0.0/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= -github.com/alimy/tryst v0.8.3 h1:k54a9YesCGUTqfyDp9NL55TI8CxIj8HNJZyzbIoNab8= -github.com/alimy/tryst v0.8.3/go.mod h1:ua2eJbFrisHPh7z93Bgc0jNBE8Khu1SCx2p/6t3OzZI= +github.com/alimy/tryst v0.10.1 h1:ks0CwITNu8VuCBeIxov7acuXWfPn1ySR/FpKbdDOy7A= +github.com/alimy/tryst v0.10.1/go.mod h1:6FcqEImav7S62em+p+MODh+stt/UPp23HobUOK3XwFY= github.com/alimy/yesql v1.9.0 h1:pk52k5alrzPduTpayjdZjYygk1iAR4xnDEumByq5gtM= github.com/alimy/yesql v1.9.0/go.mod h1:ocPS5B8hYPaYo8Ru7HrDqhF+MFQI0PftT1Q4VMSYPt4= github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k= @@ -545,8 +545,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.9.1 h1:PIgGx4VrHvag0juCJ4dDv3MiFRlDmP0vicBucwf+gLM= -github.com/go-resty/resty/v2 v2.9.1/go.mod h1:4/GYJVjh9nhkhGR6AUNW3XhpDYNUr+Uvy9gV/VGZIy4= +github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= +github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= 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= @@ -674,8 +674,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -710,8 +710,9 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -759,8 +760,8 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru/v2 v2.0.6 h1:3xi/Cafd1NaoEnS/yDssIiuVeDVywU0QdFGl3aQaQHM= -github.com/hashicorp/golang-lru/v2 v2.0.6/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -1047,8 +1048,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA= -github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1058,8 +1059,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.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= -github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= 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= @@ -1113,8 +1114,8 @@ github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c h1:CgbKAHto5CQgW github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c/go.mod h1:4qGtCB0QK0wBzKtFEGDhxXnSnbQApw1gc9siScUl8ew= github.com/pingcap/log v1.1.0 h1:ELiPxACz7vdo1qAvvaWJg1NrYFoY6gqAh/+Uo6aXdD8= github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= -github.com/pingcap/tidb/parser v0.0.0-20231011150025-7f9ab7f2d3d0 h1:Yq9C9Ed2bkUt+8fohqb4E6C0/AyPOPEBYqzx6KFGtMg= -github.com/pingcap/tidb/parser v0.0.0-20231011150025-7f9ab7f2d3d0/go.mod h1:cwq4bKUlftpWuznB+rqNwbN0xy6/i5SL/nYvEKeJn4s= +github.com/pingcap/tidb/parser v0.0.0-20230815160630-b69fa21942d1 h1:FvX5fDJ32eblK9f6KJIOVujjtu3FDEfcRGHsEDfJ4kI= +github.com/pingcap/tidb/parser v0.0.0-20230815160630-b69fa21942d1/go.mod h1:pWA6mNa/o7UTDKrg+4H75NdpRgpWRTox/cqQjaQ4ZBU= github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -1139,15 +1140,15 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1156,8 +1157,8 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1170,15 +1171,15 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pyroscope-io/client v0.7.2 h1:OX2qdUQsS8RSkn/3C8isD7f/P0YiZQlRbAlecAaj/R8= 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.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo= -github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= +github.com/redis/rueidis v1.0.20 h1:OVEVkQBgNV5t7BC2YKXD2rd+BxuD4ExboyHKayiRgsI= +github.com/redis/rueidis v1.0.20/go.mod h1:8EOzvsg3o5dUDitRj4vpsolUKkSIvFz88PeQnqwTVk0= 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= @@ -1234,14 +1235,14 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartwalle/alipay/v3 v3.2.16 h1:oSzcQgV+kUHH7ko7FjYowU4RIm6chuQjgXeuChUbj0M= -github.com/smartwalle/alipay/v3 v3.2.16/go.mod h1:5EC6QZNr51TjmDAJFHSEJMLLSoTtge7583W2vuNmOYc= -github.com/smartwalle/ncrypto v1.0.3 h1:fnzjoriZt2LZeD8ljEtRe2eU33Au7i8vIF4Gafz5RuI= -github.com/smartwalle/ncrypto v1.0.3/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= -github.com/smartwalle/ngx v1.0.7 h1:BIQo6wmAnERehogNKUnthoxwBavTWxbR9oLFcGjWXKQ= -github.com/smartwalle/ngx v1.0.7/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= -github.com/smartwalle/nsign v1.0.8 h1:78KWtwKPrdt4Xsn+tNEBVxaTLIJBX9YRX0ZSrMUeuHo= -github.com/smartwalle/nsign v1.0.8/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc= +github.com/smartwalle/alipay/v3 v3.2.19 h1:fbIGefQPHzgAON6+NKx+NnUpsYjfwtbKWsVoX8I4wj4= +github.com/smartwalle/alipay/v3 v3.2.19/go.mod h1:KWg91KsY+eIOf26ZfZeH7bed1bWulGpGrL1ErHF3jWo= +github.com/smartwalle/ncrypto v1.0.4 h1:P2rqQxDepJwgeO5ShoC+wGcK2wNJDmcdBOWAksuIgx8= +github.com/smartwalle/ncrypto v1.0.4/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= +github.com/smartwalle/ngx v1.0.9 h1:pUXDvWRZJIHVrCKA1uZ15YwNti+5P4GuJGbpJ4WvpMw= +github.com/smartwalle/ngx v1.0.9/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= +github.com/smartwalle/nsign v1.0.9 h1:8poAgG7zBd8HkZy9RQDwasC6XZvJpDGQWSjzL2FZL6E= +github.com/smartwalle/nsign v1.0.9/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -1310,8 +1311,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= -github.com/tencentyun/cos-go-sdk-v5 v0.7.44 h1:Vvz28KVdmSUrwTH2MWgAMlhzUAh+lQBSSAW1J7qJDW8= -github.com/tencentyun/cos-go-sdk-v5 v0.7.44/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= +github.com/tencentyun/cos-go-sdk-v5 v0.7.45 h1:5/ZGOv846tP6+2X7w//8QjLgH2KcUK+HciFbfjWquFU= +github.com/tencentyun/cos-go-sdk-v5 v0.7.45/go.mod h1:DH9US8nB+AJXqwu/AMOrCFN1COv3dpytXuJWHgdg7kE= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1466,8 +1467,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1593,8 +1594,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1759,8 +1760,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1768,7 +1769,7 @@ golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1790,7 +1791,6 @@ 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= @@ -2040,8 +2040,8 @@ google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2102,23 +2102,23 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= -gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= -gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= +gorm.io/driver/mysql v1.5.2 h1:QC2HRskSE75wBuOxe0+iCkyJZ+RqpudsQtqkp+IMuXs= +gorm.io/driver/mysql v1.5.2/go.mod h1:pQLhh1Ut/WUAySdTHwBpBv6+JKcj+ua4ZFx1QQTBzb8= gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= -gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= +gorm.io/driver/postgres v1.5.3 h1:qKGY5CPHOuj47K/VxbCXJfFvIUeqMSXXadqdCY+MbBU= +gorm.io/driver/postgres v1.5.3/go.mod h1:F+LtvlFhZT7UBiA81mC9W6Su3D4WUhSboc/36QZU0gk= gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c= -gorm.io/driver/sqlite v1.5.3 h1:7/0dUgX28KAcopdfbRWWl68Rflh6osa4rDh+m51KL2g= -gorm.io/driver/sqlite v1.5.3/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= +gorm.io/driver/sqlite v1.5.4 h1:IqXwXi8M/ZlPzH/947tn5uik3aYQslP9BVveoax0nV0= +gorm.io/driver/sqlite v1.5.4/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.4 h1:iyNd8fNAe8W9dvtlgeRI5zSVZPsq3OpcTu37cYcpCmw= -gorm.io/gorm v1.25.4/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls= +gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/plugin/dbresolver v1.4.7 h1:ZwtwmJQxTx9us7o6zEHFvH1q4OeEo1pooU7efmnunJA= gorm.io/plugin/dbresolver v1.4.7/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= gorm.io/plugin/soft_delete v1.2.1 h1:qx9D/c4Xu6w5KT8LviX8DgLcB9hkKl6JC9f44Tj7cGU= @@ -2203,8 +2203,8 @@ modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= -modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= @@ -2217,8 +2217,8 @@ modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs 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.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= diff --git a/internal/conf/conf.go b/internal/conf/conf.go index 075c2b06..4e1b513f 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -128,8 +128,8 @@ func setupSetting(suite []string, noDefault bool) error { } CacheSetting.CientSideCacheExpire *= time.Second - EventManagerSetting.TickWaitTime *= time.Second - MetricManagerSetting.TickWaitTime *= time.Second + EventManagerSetting.MaxIdleTime *= time.Second + MetricManagerSetting.MaxIdleTime *= time.Second JWTSetting.Expire *= time.Second SimpleCacheIndexSetting.CheckTickDuration *= time.Second SimpleCacheIndexSetting.ExpireTickDuration *= time.Second diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml index 42231d87..2028a808 100644 --- a/internal/conf/config.yaml +++ b/internal/conf/config.yaml @@ -22,16 +22,16 @@ Cache: MessagesExpire: 60 # 消息列表过期时间,单位秒, 默认60s EventManager: # 事件管理器的配置参数 MinWorker: 64 # 最小后台工作者, 设置范围[5, ++], 默认64 + MaxTempWorker: -1 # 最大临时工作者, -1为无限制, 默认-1 MaxEventBuf: 128 # 最大log缓存条数, 设置范围[10, ++], 默认128 MaxTempEventBuf: 256 # 最大log缓存条数, 设置范围[10, ++], 默认256 - MaxTickCount: 60 # 最大的循环周期, 设置范围[60, ++], 默认60 - TickWaitTime: 1 # 一个周期的等待时间,单位:秒 默认1s + MaxIdleTime: 60 # 临时工作者最大空闲等待时间,单位:秒 默认60 MetricManager: # 指标监控管理器的配置参数 MinWorker: 32 # 最小后台工作者, 设置范围[5, ++], 默认32 + MaxTempWorker: -1 # 最大临时工作者, -1为无限制, 默认-1 MaxEventBuf: 128 # 最大log缓存条数, 设置范围[10, ++], 默认128 MaxTempEventBuf: 256 # 最大log缓存条数, 设置范围[10, ++], 默认256 - MaxTickCount: 60 # 最大的循环周期, 设置范围[60, ++], 默认60 - TickWaitTime: 1 # 一个周期的等待时间,单位:秒 默认1s + MaxIdleTime: 60 # 临时工作者最大空闲等待时间,单位:秒 默认60 JobManager: # Cron Job理器的配置参数 MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次 UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次 diff --git a/internal/conf/logger_observe.go b/internal/conf/logger_observe.go index dc83a83e..af09a736 100644 --- a/internal/conf/logger_observe.go +++ b/internal/conf/logger_observe.go @@ -56,8 +56,7 @@ func newObserveLogHook() *observeLogHook { MinWorker: s.MinWorker, MaxRequestBuf: s.MaxLogBuffer, MaxRequestTempBuf: 100, - MaxTickCount: 60, - TickWaitTime: time.Second, + MaxIdleTime: 60 * time.Second, } return &observeLogHook{ client: obx.NewClient(obc, acc, func(req *http.Request, resp *http.Response, err error) { diff --git a/internal/conf/setting.go b/internal/conf/setting.go index fdd776c9..85b5e0f8 100644 --- a/internal/conf/setting.go +++ b/internal/conf/setting.go @@ -115,18 +115,18 @@ type cacheConf struct { type eventManagerConf struct { MinWorker int + MaxTempWorker int MaxEventBuf int MaxTempEventBuf int - MaxTickCount int - TickWaitTime time.Duration + MaxIdleTime time.Duration } type metricManagerConf struct { MinWorker int + MaxTempWorker int MaxEventBuf int MaxTempEventBuf int - MaxTickCount int - TickWaitTime time.Duration + MaxIdleTime time.Duration } type jobManagerConf struct { diff --git a/internal/core/cache.go b/internal/core/cache.go index bff7ca5c..f2fa5d3f 100644 --- a/internal/core/cache.go +++ b/internal/core/cache.go @@ -116,3 +116,8 @@ type WebCache interface { ExistUnreadMsgCountResp(uid int64) bool PutHistoryMaxOnline(newScore int) (int, error) } + +type MetricCache interface { + SetEventTempWorkerCount(name string, count int32) + GetEventTempWorkerCount(name string) int32 +} diff --git a/internal/events/events.go b/internal/events/events.go index 69a976ea..e35fa77f 100644 --- a/internal/events/events.go +++ b/internal/events/events.go @@ -11,6 +11,7 @@ import ( "github.com/alimy/tryst/pool" "github.com/robfig/cron/v3" "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/metrics/statistics" "github.com/sirupsen/logrus" ) @@ -89,21 +90,24 @@ func initEventManager() { var opts []pool.Option s := conf.EventManagerSetting if s.MinWorker > 5 { - opts = append(opts, pool.MinWorkerOpt(s.MinWorker)) + opts = append(opts, pool.WithMinWorker(s.MinWorker)) } else { - opts = append(opts, pool.MinWorkerOpt(5)) + opts = append(opts, pool.WithMinWorker(5)) } if s.MaxEventBuf > 10 { - opts = append(opts, pool.MaxRequestBufOpt(s.MaxEventBuf)) + opts = append(opts, pool.WithMaxRequestBuf(s.MaxEventBuf)) } else { - opts = append(opts, pool.MaxRequestBufOpt(10)) + opts = append(opts, pool.WithMaxRequestBuf(10)) } if s.MaxTempEventBuf > 10 { - opts = append(opts, pool.MaxRequestTempBufOpt(s.MaxTempEventBuf)) + opts = append(opts, pool.WithMaxRequestTempBuf(s.MaxTempEventBuf)) } else { - opts = append(opts, pool.MaxRequestTempBufOpt(10)) + opts = append(opts, pool.WithMaxRequestTempBuf(10)) } - opts = append(opts, pool.MaxTickCountOpt(s.MaxTickCount), pool.TickWaitTimeOpt(s.TickWaitTime)) + if cfg.If("Metrics") { + opts = append(opts, pool.WithWorkerHook(NewEventWorkerHook("default", statistics.NewMetricCache()))) + } + opts = append(opts, pool.WithMaxIdelTime(s.MaxIdleTime), pool.WithMaxTempWorker(s.MaxTempWorker)) _defaultEventManager = NewEventManager(func(req Event, err error) { if err != nil { logrus.Errorf("handle event[%s] occurs error: %s", req.Name(), err) diff --git a/internal/events/events_tryst.go b/internal/events/events_tryst.go index 0aaac020..b08a4978 100644 --- a/internal/events/events_tryst.go +++ b/internal/events/events_tryst.go @@ -7,6 +7,7 @@ package events import ( "github.com/alimy/tryst/event" "github.com/alimy/tryst/pool" + "github.com/rocboss/paopao-ce/internal/core" ) type Event = event.Event @@ -17,6 +18,11 @@ type EventManager interface { OnEvent(event Event) } +type simpleWorkerHook struct { + name string + cache core.MetricCache +} + type simpleEventManager struct { em event.EventManager } @@ -33,8 +39,23 @@ func (s *simpleEventManager) OnEvent(event Event) { s.em.OnEvent(event) } +func (h *simpleWorkerHook) OnJoin(count int32) { + h.cache.SetEventTempWorkerCount(h.name, count) +} + +func (h *simpleWorkerHook) OnLeave(count int32) { + h.cache.SetEventTempWorkerCount(h.name, count) +} + func NewEventManager(fn pool.RespFn[Event], opts ...pool.Option) EventManager { return &simpleEventManager{ em: event.NewEventManager(fn, opts...), } } + +func NewEventWorkerHook(name string, mc core.MetricCache) pool.WorkerHook { + return &simpleWorkerHook{ + name: name, + cache: mc, + } +} diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index ffe7d12a..439d8540 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -49,23 +49,23 @@ func Initial() { func initMetricManager() { var opts []pool.Option - s := conf.EventManagerSetting + s := conf.MetricManagerSetting if s.MinWorker > 5 { - opts = append(opts, pool.MinWorkerOpt(s.MinWorker)) + opts = append(opts, pool.WithMinWorker(s.MinWorker)) } else { - opts = append(opts, pool.MinWorkerOpt(5)) + opts = append(opts, pool.WithMinWorker(5)) } if s.MaxEventBuf > 10 { - opts = append(opts, pool.MaxRequestBufOpt(s.MaxEventBuf)) + opts = append(opts, pool.WithMaxRequestBuf(s.MaxEventBuf)) } else { - opts = append(opts, pool.MaxRequestBufOpt(10)) + opts = append(opts, pool.WithMaxRequestBuf(10)) } if s.MaxTempEventBuf > 10 { - opts = append(opts, pool.MaxRequestTempBufOpt(s.MaxTempEventBuf)) + opts = append(opts, pool.WithMaxRequestTempBuf(s.MaxTempEventBuf)) } else { - opts = append(opts, pool.MaxRequestTempBufOpt(10)) + opts = append(opts, pool.WithMaxRequestTempBuf(10)) } - opts = append(opts, pool.MaxTickCountOpt(s.MaxTickCount), pool.TickWaitTimeOpt(s.TickWaitTime)) + opts = append(opts, pool.WithMaxIdelTime(s.MaxIdleTime), pool.WithMaxTempWorker(s.MaxTempWorker)) _defaultMetricManager = event.NewEventManager(func(req Metric, err error) { if err != nil { logrus.Errorf("handle event[%s] occurs error: %s", req.Name(), err) diff --git a/internal/metrics/prometheus/metrics.go b/internal/metrics/prometheus/metrics.go index d7c073b1..34ed99b3 100644 --- a/internal/metrics/prometheus/metrics.go +++ b/internal/metrics/prometheus/metrics.go @@ -13,8 +13,10 @@ import ( type metrics struct { siteInfo *prometheus.GaugeVec + runtime *prometheus.GaugeVec ds core.DataService wc core.WebCache + mc core.MetricCache } func (m *metrics) updateSiteInfo() { @@ -31,13 +33,21 @@ func (m *metrics) updateSiteInfo() { } } +func (m *metrics) updateRuntime() { + m.runtime.With(prometheus.Labels{"name": "default"}).Set(float64(m.mc.GetEventTempWorkerCount("default"))) +} + func (m *metrics) onUpdate() { logrus.Debugf("update promethues metrics job running") m.updateSiteInfo() + m.updateRuntime() } -func newMetrics(reg prometheus.Registerer, ds core.DataService, wc core.WebCache) *metrics { +func newMetrics(reg prometheus.Registerer, ds core.DataService, wc core.WebCache, mc core.MetricCache) *metrics { m := &metrics{ + ds: ds, + wc: wc, + mc: mc, siteInfo: prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "paopao", @@ -49,9 +59,18 @@ func newMetrics(reg prometheus.Registerer, ds core.DataService, wc core.WebCache // metric name "name", }), - ds: ds, - wc: wc, + runtime: prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Namespace: "runtime", + Subsystem: "event_manager", + Name: "temp_worker_count", + Help: "runtime's event manager temp worker count info", + }, + []string{ + // metric name + "name", + }), } - reg.MustRegister(m.siteInfo) + reg.MustRegister(m.siteInfo, m.runtime) return m } diff --git a/internal/metrics/prometheus/prometheus.go b/internal/metrics/prometheus/prometheus.go index f9764464..e93565cf 100644 --- a/internal/metrics/prometheus/prometheus.go +++ b/internal/metrics/prometheus/prometheus.go @@ -27,7 +27,7 @@ func scheduleJobs(metrics *metrics) { logrus.Debug("shedule prometheus metrics update jobs complete") } -func NewHandler(ds core.DataService, wc core.WebCache) http.Handler { +func NewHandler(ds core.DataService, wc core.WebCache, mc core.MetricCache) http.Handler { // Create non-global registry. registry := prometheus.NewRegistry() // Add go runtime metrics and process collectors. @@ -35,7 +35,7 @@ func NewHandler(ds core.DataService, wc core.WebCache) http.Handler { collectors.NewGoCollector(), collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), ) - metrics := newMetrics(registry, ds, wc) + metrics := newMetrics(registry, ds, wc, mc) scheduleJobs(metrics) return promhttp.HandlerFor(registry, promhttp.HandlerOpts{EnableOpenMetrics: true}) } diff --git a/internal/metrics/statistics/cache.go b/internal/metrics/statistics/cache.go new file mode 100644 index 00000000..bec47c39 --- /dev/null +++ b/internal/metrics/statistics/cache.go @@ -0,0 +1,38 @@ +// 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 statistics + +import ( + "sync" + + "github.com/rocboss/paopao-ce/internal/core" +) + +var ( + _metricCache core.MetricCache + _onceMetricCache sync.Once +) + +type metricCache struct { + eventTempWorkerCount map[string]int32 +} + +func (m *metricCache) SetEventTempWorkerCount(name string, count int32) { + // 直接赋值,不需要加锁,因为这仅仅是一个统计信息 + m.eventTempWorkerCount[name] = count +} + +func (m *metricCache) GetEventTempWorkerCount(name string) int32 { + return m.eventTempWorkerCount[name] +} + +func NewMetricCache() core.MetricCache { + _onceMetricCache.Do(func() { + _metricCache = &metricCache{ + eventTempWorkerCount: make(map[string]int32), + } + }) + return _metricCache +} diff --git a/internal/servants/web/followship.go b/internal/servants/web/followship.go index 22b41635..0344841a 100644 --- a/internal/servants/web/followship.go +++ b/internal/servants/web/followship.go @@ -35,7 +35,7 @@ func (s *followshipSrv) ListFollowings(r *web.ListFollowingsReq) (*web.ListFollo logrus.Errorf("Ds.GetUserByUsername err: %s", err) return nil, web.ErrNoExistUsername } - res, err := s.Ds.ListFollowings(he.ID, r.PageSize, r.Page-1) + res, err := s.Ds.ListFollowings(he.ID, r.PageSize, (r.Page-1)*r.PageSize) if err != nil { logrus.Errorf("Ds.ListFollowings err: %s", err) return nil, web.ErrListFollowingsFailed @@ -55,7 +55,7 @@ func (s *followshipSrv) ListFollows(r *web.ListFollowsReq) (*web.ListFollowsResp logrus.Errorf("Ds.GetUserByUsername err: %s", err) return nil, web.ErrNoExistUsername } - res, err := s.Ds.ListFollows(he.ID, r.PageSize, r.Page-1) + res, err := s.Ds.ListFollows(he.ID, r.PageSize, (r.Page-1)*r.PageSize) if err != nil { logrus.Errorf("Ds.ListFollows err: %s", err) return nil, web.ErrListFollowsFailed diff --git a/internal/service/metrics.go b/internal/service/metrics.go index d83a5fd4..14ffbfed 100644 --- a/internal/service/metrics.go +++ b/internal/service/metrics.go @@ -14,6 +14,7 @@ import ( "github.com/rocboss/paopao-ce/internal/dao" "github.com/rocboss/paopao-ce/internal/dao/cache" "github.com/rocboss/paopao-ce/internal/metrics/prometheus" + "github.com/rocboss/paopao-ce/internal/metrics/statistics" ) var ( @@ -44,9 +45,9 @@ func (s *metricsService) String() string { func newMetricsService() Service { addr := conf.MetricsServerSetting.HttpIp + ":" + conf.MetricsServerSetting.HttpPort server := httpServers.from(addr, func() *httpServer { - ds, wc := dao.DataService(), cache.NewWebCache() + ds, wc, mc := dao.DataService(), cache.NewWebCache(), statistics.NewMetricCache() mux := http.NewServeMux() - mux.Handle("/metrics", prometheus.NewHandler(ds, wc)) + mux.Handle("/metrics", prometheus.NewHandler(ds, wc, mc)) return &httpServer{ baseServer: newBaseServe(), server: &http.Server{ diff --git a/pkg/http/client.go b/pkg/http/client.go index d77c1d14..150b23b1 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -34,8 +34,7 @@ type AsyncClientConf struct { MinWorker int MaxRequestBuf int MaxRequestTempBuf int - MaxTickCount int - TickWaitTime time.Duration + MaxIdleTime time.Duration } type wormClient struct { @@ -64,11 +63,10 @@ func NewAsyncClient(client *http.Client, conf *AsyncClientConf) AsyncClient { pool: gp.NewGoroutinePool(func(req *http.Request) (*http.Response, error) { return client.Do(req) }, - gp.MinWorkerOpt(minWorker), - gp.MaxRequestBufOpt(maxRequestBuf), - gp.MaxRequestTempBufOpt(maxRequestTempBuf), - gp.MaxTickCountOpt(conf.MaxTickCount), - gp.TickWaitTimeOpt(conf.TickWaitTime), + gp.WithMinWorker(minWorker), + gp.WithMaxRequestBuf(maxRequestBuf), + gp.WithMaxRequestTempBuf(maxRequestTempBuf), + gp.WithMaxIdelTime(conf.MaxIdleTime), ), } } diff --git a/pkg/types/bitmap_roaring.go b/pkg/types/bitmap_roaring.go new file mode 100644 index 00000000..d620d2fa --- /dev/null +++ b/pkg/types/bitmap_roaring.go @@ -0,0 +1,157 @@ +// 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 types + +import ( + "github.com/RoaringBitmap/roaring" + "github.com/RoaringBitmap/roaring/roaring64" + "github.com/alimy/tryst/types" +) + +type roaringBitmap struct { + Map *roaring.Bitmap +} + +type roaring64Bitmap struct { + Map *roaring64.Bitmap +} + +func (m *roaringBitmap) MarshalBinary() ([]byte, error) { + if m == nil { + return []byte{}, nil + } + return m.Map.MarshalBinary() +} + +func (m *roaringBitmap) UnmarshalBinary(data []byte) (res *roaringBitmap, err error) { + res = &roaringBitmap{ + Map: roaring.New(), + } + err = res.Map.UnmarshalBinary(data) + return +} + +func (m *roaring64Bitmap) MarshalBinary() ([]byte, error) { + if m == nil { + return []byte{}, nil + } + return m.Map.MarshalBinary() +} + +func (m *roaring64Bitmap) UnmarshalBinary(data []byte) (res *roaring64Bitmap, err error) { + res = &roaring64Bitmap{ + Map: roaring64.New(), + } + err = res.Map.UnmarshalBinary(data) + return +} + +// Bitmap alias type of types.Binary[*roaringBitmap] +type Bitmap = types.Binary[*roaringBitmap] + +// NullBitmap alias type of types.NullBinary[*roaringBitmap] +type NullBitmap = types.NullBinary[*roaringBitmap] + +// Bitmap64 alias type of types.Binary[*roaring64Bitmap] +type Bitmap64 = types.Binary[*roaring64Bitmap] + +// NullBitmap64 alias type of types.NullBinary[*roaring64Bitmap] +type NullBitmap64 = types.NullBinary[*roaring64Bitmap] + +// NewBitmap create a Bitmap instance +func NewBitmap() (res *Bitmap) { + return &types.Binary[*roaringBitmap]{ + Data: &roaringBitmap{ + Map: roaring.New(), + }, + } +} + +// NewNullBitmap create a NullBitmap instance +func NewNullBitmap() *NullBitmap { + return &types.NullBinary[*roaringBitmap]{ + Data: &roaringBitmap{ + Map: roaring.New(), + }, + } +} + +// NewBitmap64 create a Bitmap64 instance +func NewBitmap64() *Bitmap64 { + return &types.Binary[*roaring64Bitmap]{ + Data: &roaring64Bitmap{ + Map: roaring64.New(), + }, + } +} + +// NewNullBitmap64 create a NullBitmap64 instance +func NewNullBitmap64() *NullBitmap64 { + return &types.NullBinary[*roaring64Bitmap]{ + Data: &roaring64Bitmap{ + Map: roaring64.New(), + }, + } +} + +// MustBitmap create a Bitmap instance +func MustBitmap(data ...[]byte) (res *Bitmap) { + res = &types.Binary[*roaringBitmap]{ + Data: &roaringBitmap{ + Map: roaring.New(), + }, + } + if len(data) > 0 && len(data[0]) > 0 { + if err := res.Data.Map.UnmarshalBinary(data[0]); err != nil { + panic(err) + } + } + return +} + +// MustNullBitmap create a NullBitmap instance +func MustNullBitmap(data ...[]byte) (res *NullBitmap) { + res = &types.NullBinary[*roaringBitmap]{ + Data: &roaringBitmap{ + Map: roaring.New(), + }, + } + if len(data) > 0 && len(data[0]) > 0 { + if err := res.Data.Map.UnmarshalBinary(data[0]); err != nil { + panic(err) + } + } + return +} + +// MustBitmap64 create a Bitmap64 instance +func MustBitmap64(data ...[]byte) (res *Bitmap64) { + res = &types.Binary[*roaring64Bitmap]{ + Data: &roaring64Bitmap{ + Map: roaring64.New(), + }, + } + if len(data) > 0 && len(data[0]) > 0 { + if err := res.Data.Map.UnmarshalBinary(data[0]); err != nil { + panic(err) + } + } + return +} + +// MustNullBitmap64 create a NullBitmap64 instance +func MustNullBitmap64(data ...[]byte) (res *NullBitmap64) { + res = &types.NullBinary[*roaring64Bitmap]{ + Data: &roaring64Bitmap{ + Map: roaring64.New(), + }, + } + if len(data) > 0 && len(data[0]) > 0 { + if err := res.Data.Map.UnmarshalBinary(data[0]); err != nil { + panic(err) + } + } + return +} diff --git a/pkg/types/bitmap_roaring_test.go b/pkg/types/bitmap_roaring_test.go new file mode 100644 index 00000000..e045914e --- /dev/null +++ b/pkg/types/bitmap_roaring_test.go @@ -0,0 +1,36 @@ +// 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 types_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/rocboss/paopao-ce/pkg/types" +) + +var _ = Describe("Bitmap", Ordered, func() { + It("sql scaner for Bitmap", func() { + bitmap := types.NewBitmap() + bitmap.Data.Map.Add(128) + value, err := bitmap.Value() + Expect(err).To(BeNil()) + + var bm types.Bitmap + bm.Scan(value) + Expect(bm.Data.Map.Contains(128)).To(BeTrue()) + }) + + It("sql scaner for Bitmap64", func() { + bitmap := types.NewBitmap64() + bitmap.Data.Map.Add(128) + value, err := bitmap.Value() + Expect(err).To(BeNil()) + + var bm types.Bitmap64 + bm.Scan(value) + Expect(bm.Data.Map.Contains(128)).To(BeTrue()) + }) +}) diff --git a/web/dist/assets/404-7d89528a.js b/web/dist/assets/404-85eda774.js similarity index 85% rename from web/dist/assets/404-7d89528a.js rename to web/dist/assets/404-85eda774.js index 40173f20..d9e031c9 100644 --- a/web/dist/assets/404-7d89528a.js +++ b/web/dist/assets/404-85eda774.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-e04968a0.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-107d9fcb.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-5d57cf15.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-785b0794.js b/web/dist/assets/Anouncement-5ba820b0.js similarity index 91% rename from web/dist/assets/Anouncement-785b0794.js rename to web/dist/assets/Anouncement-5ba820b0.js index e85c1281..fbde06d8 100644 --- a/web/dist/assets/Anouncement-785b0794.js +++ b/web/dist/assets/Anouncement-5ba820b0.js @@ -1 +1 @@ -import{_ as N}from"./post-skeleton-4a65c483.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-e04968a0.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-65699bcb.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-5d57cf15.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-71625ce1.js b/web/dist/assets/Collection-205b60a9.js similarity index 90% rename from web/dist/assets/Collection-71625ce1.js rename to web/dist/assets/Collection-205b60a9.js index 1bec9224..30a99ba8 100644 --- a/web/dist/assets/Collection-71625ce1.js +++ b/web/dist/assets/Collection-205b60a9.js @@ -1 +1 @@ -import{_ as q}from"./whisper-a090f673.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-229a49b5.js";import{_ as U}from"./post-skeleton-4a65c483.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-e04968a0.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-17b86479.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-5534d7cd.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-c0153d25.js";import{_ as U}from"./post-skeleton-65699bcb.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-5d57cf15.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-d5e071f1.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-c3c5bab2.js b/web/dist/assets/Contacts-383ba191.js similarity index 92% rename from web/dist/assets/Contacts-c3c5bab2.js rename to web/dist/assets/Contacts-383ba191.js index 70fb9536..21f1feca 100644 --- a/web/dist/assets/Contacts-c3c5bab2.js +++ b/web/dist/assets/Contacts-383ba191.js @@ -1 +1 @@ -import{_ as W}from"./whisper-a090f673.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-e04968a0.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-4a65c483.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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:"私信 @"+o.contact.username,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-42e975ce"]]),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-5534d7cd.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-5d57cf15.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-65699bcb.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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:"私信 @"+o.contact.username,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-42e975ce"]]),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-4a1f6982.js b/web/dist/assets/Following-4a1f6982.js new file mode 100644 index 00000000..110b474e --- /dev/null +++ b/web/dist/assets/Following-4a1f6982.js @@ -0,0 +1 @@ +import{_ as X}from"./whisper-5534d7cd.js";import{d as N,c as O,r as ee,e as i,f,k as n,w as a,j as r,y as oe,A as S,x as g,q as $,Y as F,bf as w,h as U,H as _,b as ne,F as C,u as te}from"./@vue-a481fc63.js";import{K as se,u as ae,f as le,_ as D,Y as ce,Z as ie}from"./index-5d57cf15.js";import{k as ue,r as _e,s as re,t as pe}from"./@vicons-f0266f88.js";import{F as me,j as B,o as de,M as fe,e as ve,P as ge,O as we,G as he,a as ke,f as ye,g as be,J as $e,k as Fe,H as ze}from"./naive-ui-eecf2ec3.js";import{_ as Pe}from"./post-skeleton-65699bcb.js";import{_ as Te}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js";import{W as qe}from"./v3-infinite-loading-2c58ec2f.js";import{b as xe}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 Ie={class:"follow-item"},Me={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(x,{emit:d}){const o=x,u=me(),t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注 @":"关注 @")+o.contact.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?ae({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):le({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:"私信 @"+o.contact.username,key:"whisper",icon:t(_e)}];return o.contact.is_following?e.push({label:"取消关注 @"+o.contact.username,key:"unfollow",icon:t(re)}):e.push({label:"关注 @"+o.contact.username,key:"follow",icon:t(pe)}),e}),m=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};d("send-whisper",l);break}};return(e,l)=>{const p=de,v=ee("router-link"),k=fe,P=ve,y=ge,T=we;return i(),f("div",Ie,[n(T,{"content-indented":""},{avatar:a(()=>[n(p,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[r("span",Me,[n(v,{onClick:l[0]||(l[0]=oe(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),r("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(i(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),r("div",Ue,[r("span",Ce," UID. "+g(e.contact.user_id),1),r("span",Be,g(w(se)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[r("div",Ne,[n(y,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:m},{default:a(()=>[n(P,{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-5dd79903"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Ae={class:"load-more-spinner"},Re=N({__name:"Following",setup(x){const d=xe(),o=_(!1),u=_(!1),t=_([]),z=d.query.n||"粉丝详情",h=d.query.s||"",m=_(d.query.t||"follows"),e=_(+d.query.p||1),l=_(20),p=_(0),v=_(!1),k=_({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1});function P(c){t.value=[],o.value=!1,u.value=!1,e.value=1,p.value=0,m.value=c}const y=O(()=>m.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=c=>{k.value=c,v.value=!0},V=()=>{v.value=!1},W=()=>{e.value{P(c),q()},q=()=>{m.value==="follows"?H(h):m.value==="followings"&&A(h)},H=(c,b=!1)=>{t.value.length===0&&(o.value=!0),ce({username:c,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)),p.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},A=(c,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:c,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)),p.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return ne(()=>{q()}),(c,b)=>{const s=Te,I=ye,R=be,Y=Pe,E=$e,G=De,J=ze,K=X,L=he,Z=Fe,Q=ke;return i(),f(C,null,[r("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(L,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":m.value,"onUpdate:value":j},{default:a(()=>[n(I,{name:"follows",tab:"正在关注"}),n(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(i(),f("div",Ve,[n(Y,{num:l.value},null,8,["num"])])):(i(),f("div",We,[t.value.length===0?(i(),f("div",je,[n(E,{size:"large",description:"暂无数据"})])):F("",!0),(i(!0),f(C,null,te(t.value,M=>(i(),$(J,{key:M.user_id},{default:a(()=>[n(G,{contact:M,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(K,{show:v.value,user:k.value,onSuccess:V},null,8,["show","user"])]),_:1})]),p.value>0?(i(),$(Q,{key:0,justify:"center"},{default:a(()=>[n(w(qe),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:W},{spinner:a(()=>[r("div",He,[u.value?F("",!0):(i(),$(Z,{key:0,size:14})),r("span",Ae,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=D(Re,[["__scopeId","data-v-dbf3bbcc"]]);export{wo as default}; diff --git a/web/dist/assets/Following-79bd0e5a.js b/web/dist/assets/Following-79bd0e5a.js deleted file mode 100644 index 20522d3d..00000000 --- a/web/dist/assets/Following-79bd0e5a.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Q}from"./whisper-a090f673.js";import{d as N,c as O,r as X,e as c,f,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{K as te,u as se,f as ae,_ as D,Y as le,Z as ce}from"./index-e04968a0.js";import{k as ie,r as _e,s as ue,t as re}from"./@vicons-f0266f88.js";import{F as pe,j as B,o as me,M as de,e as fe,P as ve,O as ge,G as we,a as he,f as ke,g as ye,J as be,k as $e,H as Fe}from"./naive-ui-eecf2ec3.js";import{_ as ze}from"./post-skeleton-4a65c483.js";import{_ as Te}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js";import{W as qe}from"./v3-infinite-loading-2c58ec2f.js";import{b as xe}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 Ie={class:"follow-item"},Me={class:"nickname-wrap"},Pe={class:"username-wrap"},Se={class:"user-info"},Ue={class:"info-item"},Ce={class:"info-item"},Be={class:"item-header-extra"},Ne=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:d}){const o=I,u=pe(),t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注 @":"关注 @")+o.contact.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?se({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ae({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:"私信 @"+o.contact.username,key:"whisper",icon:t(_e)}];return o.contact.is_following?e.push({label:"取消关注 @"+o.contact.username,key:"unfollow",icon:t(ue)}):e.push({label:"关注 @"+o.contact.username,key:"follow",icon:t(re)}),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};d("send-whisper",l);break}};return(e,l)=>{const m=me,v=X("router-link"),k=de,y=fe,T=ve,q=ge;return c(),f("div",Ie,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Me,[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",Pe," @"+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",Se,[_("span",Ue," UID. "+g(e.contact.user_id),1),_("span",Ce,g(w(te)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Be,[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(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Oe=D(Ne,[["__scopeId","data-v-5dd79903"]]),De={key:0,class:"skeleton-wrap"},Ve={key:1},We={key:0,class:"empty-wrap"},je={class:"load-more-wrap"},He={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const d=xe(),o=i(!1),u=i(!1),t=i([]),z=d.query.n||"粉丝详情",h=d.query.s||"",p=i(d.query.t||"follows"),e=i(+d.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),le({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),ce({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=Te,M=ke,A=ye,R=ze,Y=be,E=Oe,G=Fe,J=Q,K=we,L=$e,Z=he;return c(),f(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(A,{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(),f("div",De,[n(R,{num:l.value},null,8,["num"])])):(c(),f("div",Ve,[t.value.length===0?(c(),f("div",We,[n(Y,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),f(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(qe),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:V},{spinner:a(()=>[_("div",je,[u.value?F("",!0):(c(),$(L,{key:0,size:14})),_("span",He,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const go=D(Ae,[["__scopeId","data-v-598cf32e"]]);export{go as default}; diff --git a/web/dist/assets/Following-6b5e92ae.css b/web/dist/assets/Following-b11fb642.css similarity index 64% rename from web/dist/assets/Following-6b5e92ae.css rename to web/dist/assets/Following-b11fb642.css index 304cda89..2e446072 100644 --- a/web/dist/assets/Following-6b5e92ae.css +++ b/web/dist/assets/Following-b11fb642.css @@ -1 +1 @@ -.follow-item[data-v-5dd79903]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-5dd79903]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-5dd79903],.follow-item .username-wrap[data-v-5dd79903]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-5dd79903]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-5dd79903]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-5dd79903]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-5dd79903]{background-color:#101014bf}.dark .follow-item[data-v-5dd79903]:hover{background:#18181c}.main-content-wrap[data-v-598cf32e]{padding:20px}.load-more[data-v-598cf32e]{margin:20px}.load-more .load-more-wrap[data-v-598cf32e]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-598cf32e]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-598cf32e],.dark .empty-wrap[data-v-598cf32e],.dark .skeleton-wrap[data-v-598cf32e]{background-color:#101014bf} +.follow-item[data-v-5dd79903]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-5dd79903]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-5dd79903],.follow-item .username-wrap[data-v-5dd79903]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-5dd79903]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-5dd79903]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-5dd79903]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-5dd79903]{background-color:#101014bf}.dark .follow-item[data-v-5dd79903]:hover{background:#18181c}.main-content-wrap[data-v-dbf3bbcc]{padding:20px}.load-more[data-v-dbf3bbcc]{margin:20px}.load-more .load-more-wrap[data-v-dbf3bbcc]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-dbf3bbcc]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-dbf3bbcc],.dark .empty-wrap[data-v-dbf3bbcc],.dark .skeleton-wrap[data-v-dbf3bbcc]{background-color:#101014bf} diff --git a/web/dist/assets/Home-c974ee05.js b/web/dist/assets/Home-a73036c0.js similarity index 98% rename from web/dist/assets/Home-c974ee05.js rename to web/dist/assets/Home-a73036c0.js index 1951c3c5..1d8ed1f7 100644 --- a/web/dist/assets/Home-c974ee05.js +++ b/web/dist/assets/Home-a73036c0.js @@ -1 +1 @@ -import{W as Te}from"./whisper-add-friend-035a8849.js";import{_ as De}from"./whisper-a090f673.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-229a49b5.js";import{_ as xe}from"./post-skeleton-4a65c483.js";import{d as we,H as r,c as ve,b as ye,e as u,f as w,bf as f,j as I,k as n,w as i,q as E,Y as b,y as ge,A as O,x as me,F as _e,u as fe,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as Ae}from"./vuex-44de225f.js";import{l as he}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-e04968a0.js";import{p as Le}from"./content-17b86479.js";import{V,P as K}from"./IEnum-5453a777.js";import{I as We,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as ke,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 be,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-8791d5c4.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=j=>{const g=new FileReader,o=m=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(m),q=()=>{const m=new Uint8Array(g.result).subarray(0,4);let D="";for(let h=0;h{g.onloadend=()=>{const h=j.type;m(h===""||h==="application/octet-stream"?q():o(h))},g.readAsArrayBuffer(j.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"},Tt={class:"attachment-list-wrap"},Dt={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=we({__name:"compose",emits:["post-success"],setup(j,{emit:g}){const o=Ae(),q=r([]),m=r(!1),D=r(!1),h=r(!1),y=r(!1),A=r(""),N=r([]),G=r(),C=r(0),p=r("public/image"),T=r([]),R=r([]),d=r([]),_=r([]),U=r(V.PUBLIC),z=r(V.PUBLIC),M=r("true".toLowerCase()==="true"),L="/v1/attachment",Q=ve(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),H=ve(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return o.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),$=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},ee=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},te=he.debounce(s=>{Fe({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),se=he.debounce(s=>{Ne({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),Z=(s,a)=>{m.value||(m.value=!0,a==="@"?te(s):se(s))},J=s=>{s.length>o.state.profile.defaultTweetMaxLength?A.value=s.substring(0,o.state.profile.defaultTweetMaxLength):A.value=s},P=s=>{p.value=s},X=s=>{for(let t=0;t30&&(s[t].name=l.substring(0,18)+"..."+l.substring(l.length-9)+"."+e)}T.value=s},ae=async s=>{var a,l,e,t,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"&&((l=s.file.file)==null?void 0:l.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((e=s.file.file)==null?void 0:e.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((t=s.file.file)==null?void 0:t.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},S=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);e.code===0&&(p.value==="public/image"&&R.value.push({id:s.id,content:e.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:e.data.content}),p.value==="attachment"&&_.value.push({id:s.id,content:e.data.content}))}catch{window.$message.error("上传失败")}},ne=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);if(e.code!==0){let t=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(c=>{t+=":"+c}),window.$message.error(t)}}catch{window.$message.error("上传失败")}},W=({file:s})=>{let a=R.value.findIndex(l=>l.id===s.id);a>-1&&R.value.splice(a,1),a=d.value.findIndex(l=>l.id===s.id),a>-1&&d.value.splice(a,1),a=_.value.findIndex(l=>l.id===s.id),a>-1&&_.value.splice(a,1)},x=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=Le(A.value);const l=[];let e=100;l.push({content:A.value,type:K.TEXT,sort:e}),R.value.map(t=>{e++,l.push({content:t.content,type:K.IMAGEURL,sort:e})}),d.value.map(t=>{e++,l.push({content:t.content,type:K.VIDEOURL,sort:e})}),_.value.map(t=>{e++,l.push({content:t.content,type:K.ATTACHMENT,sort:e})}),N.value.length>0&&N.value.map(t=>{e++,l.push({content:t,type:K.LINKURL,sort:e})}),D.value=!0,Re({contents:l,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+C.value*100,visibility:U.value}).then(t=>{var c;window.$message.success("发布成功"),D.value=!1,g("post-success",t),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",N.value=[],R.value=[],d.value=[],_.value=[],U.value=z.value}).catch(t=>{D.value=!1})},Y=s=>{o.commit("triggerAuth",!0),o.commit("triggerAuthKey",s)};return ye(()=>{const s=o.state.profile.defaultTweetVisibility;o.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,U.value=z.value}),(s,a)=>{const l=ke,e=Ze,t=Je,c=Xe,F=$e,B=et,oe=tt,le=st,ie=at,re=nt,ue=ot,ce=be,pe=lt,de=it;return u(),w("div",null,[f(o).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(l,{round:"",size:30,src:f(o).state.userInfo.avatar},null,8,["src"])]),n(e,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:m.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(re,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:L,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:ae,onFinish:S,onError:ne,onRemove:W,"onUpdate:fileList":X},{default:i(()=>[I("div",It,[I("div",zt,[n(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(We))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),f(o).state.profile.allowTweetVideo?(u(),E(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),f(o).state.profile.allowTweetAttachment?(u(),E(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:ge($,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Qe))]),_:1})]),_:1},8,["onClick"]),M.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:ge(ee,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(oe,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(B,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/f(o).state.profile.defaultTweetMaxLength*100},null,8,["percentage"])]),default:i(()=>[O(" 已输入"+me(A.value.length)+"字 ",1)]),_:1}),n(c,{loading:D.value,onClick:x,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Tt,[n(le),_.value.length>0?(u(),w("div",Dt,[f(o).state.profile.allowTweetAttachmentPrice?(u(),E(ie,{key:0,value:C.value,"onUpdate:value":a[0]||(a[0]=v=>C.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(pe,{value:U.value,"onUpdate:value":a[1]||(a[1]=v=>U.value=v),name:"radiogroup"},{default:i(()=>[n(ce,null,{default:i(()=>[(u(!0),w(_e,null,fe(H.value,v=>(u(),E(ue,{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(de,{value:N.value,"onUpdate:value":a[2]||(a[2]=v=>N.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,f(o).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),f(o).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>Y("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"},Lt={key:1},Wt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=we({__name:"Home",setup(j){const g=Ae(),o=ft(),q=gt(),m=rt(),D=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}),N=r(null),G=r("泡泡广场"),C=r(!1),p=r(!1),T=r(1),R=r(""),d=r([]),_=r(1),U=r(20),z=r(0),M=r(!1),L=r(!1),Q=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),H=e=>{Q.value=e,M.value=!0},$=()=>{M.value=!1},ee=()=>{L.value=!0},te=e=>{m.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=>{})}})},se=()=>{L.value=!1,N.value=null},Z=e=>{N.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?te(e):ee()},J=e=>{m.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),P(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),P(e.user_id,!0)}).catch(t=>{})}})};function P(e,t){for(let c in d.value)d.value[c].user_id==e&&(d.value[c].user.is_following=t)}const X=()=>{G.value="泡泡广场",o.query&&o.query.q&&(o.query.t&&o.query.t==="tag"?G.value="#"+decodeURIComponent(o.query.q):G.value="搜索: "+decodeURIComponent(o.query.q))},ae=ve(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{C.value=!1,p.value=!1,d.value=[],_.value=1,z.value=0},ne=(e,t)=>{switch(S(),T.value=e.style,o.query.q&&(o.query.q=null,X()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:o.query.q=null,x("following");break;case 21:R.value=e.username,Y();break}y.value[t].show=!1},W=()=>{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 c=e.list||[];let F=[];for(;t0&&(y.value=y.value.concat(F))}).catch(e=>{console.log(e)})},x=e=>{C.value=!0,Ge({query:o.query.q?decodeURIComponent(o.query.q):null,type:o.query.t,style:e,page:_.value,page_size:U.value}).then(t=>{C.value=!1,t.list.length===0&&(p.value=!0),_.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/U.value)}).catch(t=>{C.value=!1,_.value>1&&_.value--})},Y=()=>{C.value=!0,Oe({username:R.value,style:"post",page:_.value,page_size:U.value}).then(e=>{C.value=!1,e.list.length===0&&(p.value=!0),_.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/U.value)}).catch(e=>{d.value=[],_.value>1&&_.value--,C.value=!1})},s=e=>{q.push({name:"post",query:{id:e.id}})},a=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:o.query.q?x("search"):Y();break}},l=()=>{_.value{S(),W(),x("newest")}),Ee(()=>({path:o.path,query:o.query,refresh:g.state.refresh}),(e,t)=>{if(X(),e.refresh!==t.refresh){S(),setTimeout(()=>{W(),a()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{W(),a()},0))}),(e,t)=>{const c=_t,F=Rt,B=ct,oe=ke,le=pt,ie=dt,re=xe,ue=vt,ce=Ue,pe=Be,de=De,v=Te,Ie=ut,ze=mt,Ce=be;return u(),w("div",null,[n(c,{title:G.value},null,8,["title"]),n(Ie,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(B,null,{default:i(()=>[n(F,{onPostSuccess:s})]),_:1}),ae.value?(u(),E(B,{key:0},{default:i(()=>[n(f(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":D.value,onClick:ne,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(le,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(oe,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(ie,{"line-clamp":2},{default:i(()=>[O(me(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),C.value&&d.value.length===0?(u(),w("div",Yt,[n(re,{num:U.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ue,{size:"large",description:"暂无数据"})])):b("",!0),f(g).state.desktopModelShow?(u(),w("div",Lt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(ce,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Wt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(de,{show:M.value,user:Q.value,onSuccess:$},null,8,["show","user"]),n(v,{show:L.value,user:A,onSuccess:se},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(f(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>l())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,me(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-325ca19f"]]);export{Fs as default}; +import{W as Te}from"./whisper-add-friend-78948174.js";import{_ as De}from"./whisper-5534d7cd.js";import{_ as Ue,a as Be}from"./post-item.vue_vue_type_style_index_0_lang-c0153d25.js";import{_ as xe}from"./post-skeleton-65699bcb.js";import{d as we,H as r,c as ve,b as ye,e as u,f as w,bf as f,j as I,k as n,w as i,q as E,Y as b,y as ge,A as O,x as me,F as _e,u as fe,R as Ve,E as Ee}from"./@vue-a481fc63.js";import{u as Ae}from"./vuex-44de225f.js";import{l as he}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-5d57cf15.js";import{p as Le}from"./content-d5e071f1.js";import{V,P as K}from"./IEnum-5453a777.js";import{I as We,V as Ke,A as je,d as Qe,E as He}from"./@vicons-f0266f88.js";import{o as ke,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 be,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-107d9fcb.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=j=>{const g=new FileReader,o=m=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(m),q=()=>{const m=new Uint8Array(g.result).subarray(0,4);let D="";for(let h=0;h{g.onloadend=()=>{const h=j.type;m(h===""||h==="application/octet-stream"?q():o(h))},g.readAsArrayBuffer(j.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"},Tt={class:"attachment-list-wrap"},Dt={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=we({__name:"compose",emits:["post-success"],setup(j,{emit:g}){const o=Ae(),q=r([]),m=r(!1),D=r(!1),h=r(!1),y=r(!1),A=r(""),N=r([]),G=r(),C=r(0),p=r("public/image"),T=r([]),R=r([]),d=r([]),_=r([]),U=r(V.PUBLIC),z=r(V.PUBLIC),M=r("true".toLowerCase()==="true"),L="/v1/attachment",Q=ve(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),H=ve(()=>{let s=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return o.state.profile.useFriendship&&s.push({value:V.FRIEND,label:"好友可见"}),s}),$=()=>{h.value=!h.value,h.value&&y.value&&(y.value=!1)},ee=()=>{y.value=!y.value,y.value&&h.value&&(h.value=!1)},te=he.debounce(s=>{Fe({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),se=he.debounce(s=>{Ne({k:s}).then(a=>{let l=[];a.suggest.map(e=>{l.push({label:e,value:e})}),q.value=l,m.value=!1}).catch(a=>{m.value=!1})},200),Z=(s,a)=>{m.value||(m.value=!0,a==="@"?te(s):se(s))},J=s=>{s.length>o.state.profile.defaultTweetMaxLength?A.value=s.substring(0,o.state.profile.defaultTweetMaxLength):A.value=s},P=s=>{p.value=s},X=s=>{for(let t=0;t30&&(s[t].name=l.substring(0,18)+"..."+l.substring(l.length-9)+"."+e)}T.value=s},ae=async s=>{var a,l,e,t,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"&&((l=s.file.file)==null?void 0:l.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):p.value==="public/video"&&!["video/mp4","video/quicktime"].includes((e=s.file.file)==null?void 0:e.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):p.value==="public/video"&&((t=s.file.file)==null?void 0:t.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},S=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);e.code===0&&(p.value==="public/image"&&R.value.push({id:s.id,content:e.data.content}),p.value==="public/video"&&d.value.push({id:s.id,content:e.data.content}),p.value==="attachment"&&_.value.push({id:s.id,content:e.data.content}))}catch{window.$message.error("上传失败")}},ne=({file:s,event:a})=>{var l;try{let e=JSON.parse((l=a.target)==null?void 0:l.response);if(e.code!==0){let t=e.msg||"上传失败";e.details&&e.details.length>0&&e.details.map(c=>{t+=":"+c}),window.$message.error(t)}}catch{window.$message.error("上传失败")}},W=({file:s})=>{let a=R.value.findIndex(l=>l.id===s.id);a>-1&&R.value.splice(a,1),a=d.value.findIndex(l=>l.id===s.id),a>-1&&d.value.splice(a,1),a=_.value.findIndex(l=>l.id===s.id),a>-1&&_.value.splice(a,1)},x=()=>{if(A.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:s,users:a}=Le(A.value);const l=[];let e=100;l.push({content:A.value,type:K.TEXT,sort:e}),R.value.map(t=>{e++,l.push({content:t.content,type:K.IMAGEURL,sort:e})}),d.value.map(t=>{e++,l.push({content:t.content,type:K.VIDEOURL,sort:e})}),_.value.map(t=>{e++,l.push({content:t.content,type:K.ATTACHMENT,sort:e})}),N.value.length>0&&N.value.map(t=>{e++,l.push({content:t,type:K.LINKURL,sort:e})}),D.value=!0,Re({contents:l,tags:Array.from(new Set(s)),users:Array.from(new Set(a)),attachment_price:+C.value*100,visibility:U.value}).then(t=>{var c;window.$message.success("发布成功"),D.value=!1,g("post-success",t),h.value=!1,y.value=!1,(c=G.value)==null||c.clear(),T.value=[],A.value="",N.value=[],R.value=[],d.value=[],_.value=[],U.value=z.value}).catch(t=>{D.value=!1})},Y=s=>{o.commit("triggerAuth",!0),o.commit("triggerAuthKey",s)};return ye(()=>{const s=o.state.profile.defaultTweetVisibility;o.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,U.value=z.value}),(s,a)=>{const l=ke,e=Ze,t=Je,c=Xe,F=$e,B=et,oe=tt,le=st,ie=at,re=nt,ue=ot,ce=be,pe=lt,de=it;return u(),w("div",null,[f(o).state.userInfo.id>0?(u(),w("div",At,[I("div",kt,[I("div",bt,[n(l,{round:"",size:30,src:f(o).state.userInfo.avatar},null,8,["src"])]),n(e,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:m.value,value:A.value,prefix:["@","#"],options:q.value,onSearch:Z,"onUpdate:value":J,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),n(re,{ref_key:"uploadRef",ref:G,abstract:"","list-type":"image",multiple:!0,max:9,action:L,headers:{Authorization:Q.value},data:{type:p.value},"file-list":T.value,onBeforeUpload:ae,onFinish:S,onError:ne,onRemove:W,"onUpdate:fileList":X},{default:i(()=>[I("div",It,[I("div",zt,[n(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(We))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),f(o).state.profile.allowTweetVideo?(u(),E(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Ke))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),f(o).state.profile.allowTweetAttachment?(u(),E(F,{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(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),n(c,{quaternary:"",circle:"",type:"primary",onClick:ge($,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(Qe))]),_:1})]),_:1},8,["onClick"]),M.value?(u(),E(c,{key:2,quaternary:"",circle:"",type:"primary",onClick:ge(ee,["stop"])},{icon:i(()=>[n(t,{size:"20",color:"var(--primary-color)"},{default:i(()=>[n(f(He))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),I("div",Ct,[n(oe,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[n(B,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:A.value.length/f(o).state.profile.defaultTweetMaxLength*100},null,8,["percentage"])]),default:i(()=>[O(" 已输入"+me(A.value.length)+"字 ",1)]),_:1}),n(c,{loading:D.value,onClick:x,type:"primary",secondary:"",round:""},{default:i(()=>[O(" 发布 ")]),_:1},8,["loading"])])]),I("div",Tt,[n(le),_.value.length>0?(u(),w("div",Dt,[f(o).state.profile.allowTweetAttachmentPrice?(u(),E(ie,{key:0,value:C.value,"onUpdate:value":a[0]||(a[0]=v=>C.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(pe,{value:U.value,"onUpdate:value":a[1]||(a[1]=v=>U.value=v),name:"radiogroup"},{default:i(()=>[n(ce,null,{default:i(()=>[(u(!0),w(_e,null,fe(H.value,v=>(u(),E(ue,{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(de,{value:N.value,"onUpdate:value":a[2]||(a[2]=v=>N.value=v),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[O(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(u(),w("div",Vt,[Et,f(o).state.profile.allowUserRegister?b("",!0):(u(),w("div",Ft,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[3]||(a[3]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1})])),f(o).state.profile.allowUserRegister?(u(),w("div",Nt,[n(c,{strong:"",secondary:"",round:"",type:"primary",onClick:a[4]||(a[4]=v=>Y("signin"))},{default:i(()=>[O(" 登录 ")]),_:1}),n(c,{strong:"",secondary:"",round:"",type:"info",onClick:a[5]||(a[5]=v=>Y("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"},Lt={key:1},Wt={key:2},Kt={class:"load-more-wrap"},jt={class:"load-more-spinner"},Qt=we({__name:"Home",setup(j){const g=Ae(),o=ft(),q=gt(),m=rt(),D=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}),N=r(null),G=r("泡泡广场"),C=r(!1),p=r(!1),T=r(1),R=r(""),d=r([]),_=r(1),U=r(20),z=r(0),M=r(!1),L=r(!1),Q=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),H=e=>{Q.value=e,M.value=!0},$=()=>{M.value=!1},ee=()=>{L.value=!0},te=e=>{m.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=>{})}})},se=()=>{L.value=!1,N.value=null},Z=e=>{N.value=e,A.id=e.user.id,A.username=e.user.username,A.nickname=e.user.nickname,e.user.is_friend?te(e):ee()},J=e=>{m.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Pe({user_id:e.user.id}).then(t=>{window.$message.success("操作成功"),P(e.user_id,!1)}).catch(t=>{}):Se({user_id:e.user.id}).then(t=>{window.$message.success("关注成功"),P(e.user_id,!0)}).catch(t=>{})}})};function P(e,t){for(let c in d.value)d.value[c].user_id==e&&(d.value[c].user.is_following=t)}const X=()=>{G.value="泡泡广场",o.query&&o.query.q&&(o.query.t&&o.query.t==="tag"?G.value="#"+decodeURIComponent(o.query.q):G.value="搜索: "+decodeURIComponent(o.query.q))},ae=ve(()=>g.state.profile.useFriendship&&g.state.profile.enableTrendsBar&&g.state.desktopModelShow&&g.state.userInfo.id>0),S=()=>{C.value=!1,p.value=!1,d.value=[],_.value=1,z.value=0},ne=(e,t)=>{switch(S(),T.value=e.style,o.query.q&&(o.query.q=null,X()),e.style){case 1:x("newest");break;case 2:x("hots");break;case 3:o.query.q=null,x("following");break;case 21:R.value=e.username,Y();break}y.value[t].show=!1},W=()=>{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 c=e.list||[];let F=[];for(;t0&&(y.value=y.value.concat(F))}).catch(e=>{console.log(e)})},x=e=>{C.value=!0,Ge({query:o.query.q?decodeURIComponent(o.query.q):null,type:o.query.t,style:e,page:_.value,page_size:U.value}).then(t=>{C.value=!1,t.list.length===0&&(p.value=!0),_.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/U.value)}).catch(t=>{C.value=!1,_.value>1&&_.value--})},Y=()=>{C.value=!0,Oe({username:R.value,style:"post",page:_.value,page_size:U.value}).then(e=>{C.value=!1,e.list.length===0&&(p.value=!0),_.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/U.value)}).catch(e=>{d.value=[],_.value>1&&_.value--,C.value=!1})},s=e=>{q.push({name:"post",query:{id:e.id}})},a=()=>{switch(T.value){case 1:x("newest");break;case 2:x("hots");break;case 3:x("following");break;case 21:o.query.q?x("search"):Y();break}},l=()=>{_.value{S(),W(),x("newest")}),Ee(()=>({path:o.path,query:o.query,refresh:g.state.refresh}),(e,t)=>{if(X(),e.refresh!==t.refresh){S(),setTimeout(()=>{W(),a()},0);return}t.path!=="/post"&&e.path==="/"&&(S(),setTimeout(()=>{W(),a()},0))}),(e,t)=>{const c=_t,F=Rt,B=ct,oe=ke,le=pt,ie=dt,re=xe,ue=vt,ce=Ue,pe=Be,de=De,v=Te,Ie=ut,ze=mt,Ce=be;return u(),w("div",null,[n(c,{title:G.value},null,8,["title"]),n(Ie,{class:"main-content-wrap",bordered:""},{default:i(()=>[n(B,null,{default:i(()=>[n(F,{onPostSuccess:s})]),_:1}),ae.value?(u(),E(B,{key:0},{default:i(()=>[n(f(wt),{modelValue:y.value,"onUpdate:modelValue":t[0]||(t[0]=k=>y.value=k),"wheel-blocks":h.value,"init-blocks":D.value,onClick:ne,tag:"div","sub-tag":"div"},{default:i(k=>[I("div",Pt,[n(le,{value:"1",offset:[-4,48],dot:"",show:k.slotData.show},{default:i(()=>[n(oe,{round:"",size:48,src:k.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),I("div",St,[n(ie,{"line-clamp":2},{default:i(()=>[O(me(k.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),C.value&&d.value.length===0?(u(),w("div",Yt,[n(re,{num:U.value},null,8,["num"])])):b("",!0),I("div",null,[d.value.length===0?(u(),w("div",Mt,[n(ue,{size:"large",description:"暂无数据"})])):b("",!0),f(g).state.desktopModelShow?(u(),w("div",Lt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(ce,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))])):(u(),w("div",Wt,[(u(!0),w(_e,null,fe(d.value,k=>(u(),E(B,{key:k.id},{default:i(()=>[n(pe,{post:k,isOwner:f(g).state.userInfo.id==k.user_id,addFollowAction:!0,onSendWhisper:H,onHandleFollowAction:J,onHandleFriendAction:Z},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),n(de,{show:M.value,user:Q.value,onSuccess:$},null,8,["show","user"]),n(v,{show:L.value,user:A,onSuccess:se},null,8,["show","user"])]),_:1}),z.value>0?(u(),E(Ce,{key:0,justify:"center"},{default:i(()=>[n(f(ht),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:t[1]||(t[1]=k=>l())},{spinner:i(()=>[I("div",Kt,[p.value?b("",!0):(u(),E(ze,{key:0,size:14})),I("span",jt,me(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Fs=Me(Qt,[["__scopeId","data-v-325ca19f"]]);export{Fs as default}; diff --git a/web/dist/assets/Messages-84df664c.js b/web/dist/assets/Messages-5f22f29e.js similarity index 98% rename from web/dist/assets/Messages-84df664c.js rename to web/dist/assets/Messages-5f22f29e.js index 87f1d9c6..effcb0b2 100644 --- a/web/dist/assets/Messages-84df664c.js +++ b/web/dist/assets/Messages-5f22f29e.js @@ -1 +1 @@ -import{d as K,c as T,r as me,e as a,f as i,k as n,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-e04968a0.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-a090f673.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user,s=[{label:"私信 @"+e.username,key:"whisper",icon:$(N)}];return u.state.userInfo.id!=e.id&&(e.is_following?s.push({label:"取消关注 @"+e.username,key:"unfollow",icon:$(Re)}):s.push({label:"关注 @"+e.username,key:"follow",icon:$(Ae)})),s}),p=e=>{let s=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(s.is_following?"取消关注 @":"关注 @")+s.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.is_following?$e({user_id:s.id}).then(w=>{window.$message.success("操作成功"),s.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:s.id}).then(w=>{window.$message.success("关注成功"),s.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const s=c.message;if(s.type!=99){let w=s.type==4&&s.sender_user_id==u.state.userInfo.id?s.receiver_user:s.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(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{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:s[5]||(s[5]=R=>M(e.message))},[n(E,{"content-indented":""},{avatar:t(()=>[n(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,[n(U,{onClick:s[0]||(s[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,[n(U,{onClick:s[1]||(s[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(()=>[n(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(()=>[n(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),n(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[n(Y,{quaternary:"",circle:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[n(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:s[2]||(s[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(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:s[3]||(s[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:s[4]||(s[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[n(o(m),null,{default:t(()=>[n(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-019d5af4"]]),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,[n(k,{text:"",repeat:2}),n(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")},s=()=>{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,[n(E,{title:"消息"}),n(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[n(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),n(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[n(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),n(le,{vertical:""}),n(G,{text:"",size:"small",focusable:!1,onClick:s},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[n(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[n(G,{text:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(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,[n(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[n(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(()=>[n(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(()=>[n(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}; +import{d as K,c as T,r as me,e as a,f as i,k as n,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-5d57cf15.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-5534d7cd.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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=c.message.type==4&&c.message.sender_user_id==u.state.userInfo.id?c.message.receiver_user:c.message.sender_user,s=[{label:"私信 @"+e.username,key:"whisper",icon:$(N)}];return u.state.userInfo.id!=e.id&&(e.is_following?s.push({label:"取消关注 @"+e.username,key:"unfollow",icon:$(Re)}):s.push({label:"关注 @"+e.username,key:"follow",icon:$(Ae)})),s}),p=e=>{let s=e.type==4&&e.sender_user_id==u.state.userInfo.id?e.receiver_user:e.sender_user;y.success({title:"提示",content:"确定"+(s.is_following?"取消关注 @":"关注 @")+s.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.is_following?$e({user_id:s.id}).then(w=>{window.$message.success("操作成功"),s.is_following=!1,setTimeout(()=>{v("reload")},50)}).catch(w=>{}):Ie({user_id:s.id}).then(w=>{window.$message.success("关注成功"),s.is_following=!0,setTimeout(()=>{v("reload")},50)}).catch(w=>{})}})},h=e=>{switch(e){case"whisper":const s=c.message;if(s.type!=99){let w=s.type==4&&s.sender_user_id==u.state.userInfo.id?s.receiver_user:s.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(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},J=e=>{M(e),we({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},M=e=>{c.message.receiver_user_id==u.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{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:s[5]||(s[5]=R=>M(e.message))},[n(E,{"content-indented":""},{avatar:t(()=>[n(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,[n(U,{onClick:s[0]||(s[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,[n(U,{onClick:s[1]||(s[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(()=>[n(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(()=>[n(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),n(l,{placement:"bottom-end",trigger:"click",size:"small",options:I.value,onSelect:h},{default:t(()=>[n(Y,{quaternary:"",circle:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[n(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:s[2]||(s[2]=A(R=>P(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(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:s[3]||(s[3]=A(R=>r(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ze))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:s[4]||(s[4]=A(R=>J(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),i("span",rs,[n(o(m),null,{default:t(()=>[n(o(Oe))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),i("span",is,[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const _s=L(cs,[["__scopeId","data-v-019d5af4"]]),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,[n(k,{text:"",repeat:2}),n(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")},s=()=>{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,[n(E,{title:"消息"}),n(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[n(R,{show:z.value,user:O.value,onSuccess:U},null,8,["show","user"]),n(X,{justify:"space-between"},{default:t(()=>[b("div",gs,[n(G,{text:"",size:"small",focusable:!1,onClick:e},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(F))]),_:1})]),default:t(()=>[d(" "+g(o(v).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),n(le,{vertical:""}),n(G,{text:"",size:"small",focusable:!1,onClick:s},{default:t(()=>[d("全标已读")]),_:1})]),b("div",fs,[n(re,{placement:"bottom-end",trigger:"click",size:"small",options:J.value,onSelect:M},{default:t(()=>[n(G,{text:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(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,[n(ie,{num:$.value},null,8,["num"])])):(a(),i("div",ks,[p.value.length===0?(a(),i("div",ys,[n(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(()=>[n(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(()=>[n(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/Post-1f21e9b6.js b/web/dist/assets/Post-0fe19df6.js similarity index 98% rename from web/dist/assets/Post-1f21e9b6.js rename to web/dist/assets/Post-0fe19df6.js index 47cbbc32..06095693 100644 --- a/web/dist/assets/Post-1f21e9b6.js +++ b/web/dist/assets/Post-0fe19df6.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-e04968a0.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-17b86479.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-4a65c483.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-a090f673.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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:"私信 @"+l.post.user.username,key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注 @"+l.post.user.username,key:"unfollow",icon:h(Ut)}):e.push({label:"关注 @"+l.post.user.username,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?"取消关注 @":"关注 @")+l.post.user.username+" 吗?",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-5d57cf15.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-d5e071f1.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-65699bcb.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-5534d7cd.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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:"私信 @"+l.post.user.username,key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注 @"+l.post.user.username,key:"unfollow",icon:h(Ut)}):e.push({label:"关注 @"+l.post.user.username,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?"取消关注 @":"关注 @")+l.post.user.username+" 吗?",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-3861dc0e.js b/web/dist/assets/Profile-dbdbe695.js similarity index 96% rename from web/dist/assets/Profile-3861dc0e.js rename to web/dist/assets/Profile-dbdbe695.js index 155eecae..12691dc5 100644 --- a/web/dist/assets/Profile-3861dc0e.js +++ b/web/dist/assets/Profile-dbdbe695.js @@ -1 +1 @@ -import{_ as ze}from"./whisper-a090f673.js";import{_ as Me,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-229a49b5.js";import{_ as xe}from"./post-skeleton-4a65c483.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js";import{d as Se,H as r,c as Ce,b as Le,E as Ne,r as Ue,f as i,k as u,bf as o,q as h,w as _,Y as f,e as a,j as m,x as O,A as E,y as ue,F as b,u as I,h as ie}from"./@vue-a481fc63.js";import{u as De}from"./vuex-44de225f.js";import{b as He,u as Be}from"./vue-router-e5a2430e.js";import{e as L,K as Ve,u as je,f as Re,_ as We}from"./index-e04968a0.js";import{p as G}from"./count-e2caa1c1.js";import{W as Ee}from"./v3-infinite-loading-2c58ec2f.js";import{k as Ge,a as Je}from"./@vicons-f0266f88.js";import{F as Ke,G as Qe,a as Ye,j as re,o as Xe,M as Ze,e as et,P as tt,f as at,g as st,J as lt,k as ot,H as nt}from"./naive-ui-eecf2ec3.js";import"./content-17b86479.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 ut={class:"profile-baseinfo"},it={class:"avatar"},rt={class:"base-info"},ct={class:"username"},_t={class:"userinfo"},vt={class:"info-item"},dt={class:"info-item"},mt={class:"userinfo"},ft={class:"info-item"},pt={class:"info-item"},ht={class:"info-item"},gt={class:"user-opts"},wt={key:0,class:"skeleton-wrap"},kt={key:1},yt={key:0,class:"empty-wrap"},bt={key:1},It={key:0},Pt={key:1},Ot={key:2},Tt={key:3},At={key:4},Ft={key:2},zt={key:0},Mt={key:1},qt={key:2},xt={key:3},$t={key:4},St={class:"load-more-wrap"},Ct={class:"load-more-spinner"},Lt=Se({__name:"Profile",setup(Nt){const n=De(),T=He(),ce=Be(),_e=Ke(),d=r(!1),P=r(!1),l=r([]),A=r([]),F=r([]),z=r([]),M=r([]),q=r([]),p=r("post"),J=r(+T.query.p||1),K=r(1),Q=r(1),Y=r(1),X=r(1),s=r(+T.query.p||1),g=r(20),v=r(0),Z=r(0),ee=r(0),te=r(0),ae=r(0),se=r(0),U=r(!1),le=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),ve=e=>()=>ie(re,null,{default:()=>ie(e)}),de=Ce(()=>[{label:"设置",key:"setting",icon:ve(Je)}]),me=e=>{switch(e){case"setting":ce.push({name:"setting",query:{t:new Date().getTime()}});break}},w=e=>{le.value=e,U.value=!0},fe=()=>{U.value=!1},k=e=>{_e.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?je({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Re({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(e,c){x(A.value,e,c),x(F.value,e,c),x(z.value,e,c),x(M.value,e,c),x(q.value,e,c)}function x(e,c,W){if(e&&e.length>0)for(let N in e)e[N].user_id==c&&(e[N].user.is_following=W)}const D=()=>{switch(p.value){case"post":H();break;case"comment":B();break;case"highlight":V();break;case"media":j();break;case"star":R();break}},H=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,Z.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},B=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,te.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},R=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),q.value=l.value,se.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},pe=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=J.value,v.value=Z.value,H();break;case"comment":l.value=F.value,s.value=K.value,v.value=ee.value,B();break;case"highlight":l.value=z.value,s.value=Q.value,v.value=te.value,V();break;case"media":l.value=M.value,s.value=Y.value,v.value=ae.value,j();break;case"star":l.value=q.value,s.value=X.value,v.value=se.value,R();break}},he=()=>{switch(p.value){case"post":J.value=s.value,H();break;case"comment":K.value=s.value,B();break;case"highlight":Q.value=s.value,V();break;case"media":Y.value=s.value,j();break;case"star":X.value=s.value,R();break}},ge=()=>{s.value{D()}),Ne(()=>({path:T.path,query:T.query,refresh:n.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 W=$e,N=Xe,we=Ze,ne=Ue("router-link"),ke=et,ye=tt,$=at,be=st,Ie=xe,Pe=lt,S=Me,y=nt,C=qe,Oe=ze,Te=Qe,Ae=ot,Fe=Ye;return a(),i("div",null,[u(W,{title:"主页"}),o(n).state.userInfo.id>0?(a(),h(Te,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[m("div",ut,[m("div",it,[u(N,{size:72,src:o(n).state.userInfo.avatar},null,8,["src"])]),m("div",rt,[m("div",ct,[m("strong",null,O(o(n).state.userInfo.nickname),1),m("span",null," @"+O(o(n).state.userInfo.username),1),o(n).state.userInfo.is_admin?(a(),h(we,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[E(" 管理员 ")]),_:1})):f("",!0)]),m("div",_t,[m("span",vt,"UID. "+O(o(n).state.userInfo.id),1),m("span",dt,O(o(Ve)(o(n).state.userInfo.created_on))+" 加入",1)]),m("div",mt,[m("span",ft,[u(ne,{onClick:c[0]||(c[0]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[E(" 关注  "+O(o(G)(o(n).state.userInfo.follows)),1)]),_:1},8,["to"])]),m("span",pt,[u(ne,{onClick:c[1]||(c[1]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[E(" 粉丝  "+O(o(G)(o(n).state.userInfo.followings)),1)]),_:1},8,["to"])]),m("span",ht," 泡泡  "+O(o(G)(o(n).state.userInfo.tweets_count)),1)])]),m("div",gt,[u(ye,{placement:"bottom-end",trigger:"click",size:"small",options:de.value,onSelect:me},{default:_(()=>[u(ke,{quaternary:"",circle:""},{icon:_(()=>[u(o(re),null,{default:_(()=>[u(o(Ge))]),_:1})]),_:1})]),_:1},8,["options"])])]),u(be,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":pe},{default:_(()=>[u($,{name:"post",tab:"泡泡"}),u($,{name:"comment",tab:"评论"}),u($,{name:"highlight",tab:"亮点"}),u($,{name:"media",tab:"图文"}),u($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),i("div",wt,[u(Ie,{num:g.value},null,8,["num"])])):(a(),i("div",kt,[l.value.length===0?(a(),i("div",yt,[u(Pe,{size:"large",description:"暂无数据"})])):f("",!0),o(n).state.desktopModelShow?(a(),i("div",bt,[p.value==="post"?(a(),i("div",It,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Pt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",Ot,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",Tt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",At,[(a(!0),i(b,null,I(q.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)])):(a(),i("div",Ft,[p.value==="post"?(a(),i("div",zt,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Mt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",qt,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",xt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",$t,[(a(!0),i(b,null,I(q.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)]))])),u(Oe,{show:U.value,user:le.value,onSuccess:fe},null,8,["show","user"])]),_:1})):f("",!0),v.value>0?(a(),h(Fe,{key:1,justify:"center"},{default:_(()=>[u(o(Ee),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>ge())},{spinner:_(()=>[m("div",St,[P.value?f("",!0):(a(),h(Ae,{key:0,size:14})),m("span",Ct,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):f("",!0)])}}});const ha=We(Lt,[["__scopeId","data-v-106c824e"]]);export{ha as default}; +import{_ as ze}from"./whisper-5534d7cd.js";import{_ as Me,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-c0153d25.js";import{_ as xe}from"./post-skeleton-65699bcb.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js";import{d as Se,H as r,c as Ce,b as Le,E as Ne,r as Ue,f as i,k as u,bf as o,q as h,w as _,Y as f,e as a,j as m,x as O,A as E,y as ue,F as b,u as I,h as ie}from"./@vue-a481fc63.js";import{u as De}from"./vuex-44de225f.js";import{b as He,u as Be}from"./vue-router-e5a2430e.js";import{e as L,K as Ve,u as je,f as Re,_ as We}from"./index-5d57cf15.js";import{p as G}from"./count-e2caa1c1.js";import{W as Ee}from"./v3-infinite-loading-2c58ec2f.js";import{k as Ge,a as Je}from"./@vicons-f0266f88.js";import{F as Ke,G as Qe,a as Ye,j as re,o as Xe,M as Ze,e as et,P as tt,f as at,g as st,J as lt,k as ot,H as nt}from"./naive-ui-eecf2ec3.js";import"./content-d5e071f1.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 ut={class:"profile-baseinfo"},it={class:"avatar"},rt={class:"base-info"},ct={class:"username"},_t={class:"userinfo"},vt={class:"info-item"},dt={class:"info-item"},mt={class:"userinfo"},ft={class:"info-item"},pt={class:"info-item"},ht={class:"info-item"},gt={class:"user-opts"},wt={key:0,class:"skeleton-wrap"},kt={key:1},yt={key:0,class:"empty-wrap"},bt={key:1},It={key:0},Pt={key:1},Ot={key:2},Tt={key:3},At={key:4},Ft={key:2},zt={key:0},Mt={key:1},qt={key:2},xt={key:3},$t={key:4},St={class:"load-more-wrap"},Ct={class:"load-more-spinner"},Lt=Se({__name:"Profile",setup(Nt){const n=De(),T=He(),ce=Be(),_e=Ke(),d=r(!1),P=r(!1),l=r([]),A=r([]),F=r([]),z=r([]),M=r([]),q=r([]),p=r("post"),J=r(+T.query.p||1),K=r(1),Q=r(1),Y=r(1),X=r(1),s=r(+T.query.p||1),g=r(20),v=r(0),Z=r(0),ee=r(0),te=r(0),ae=r(0),se=r(0),U=r(!1),le=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),ve=e=>()=>ie(re,null,{default:()=>ie(e)}),de=Ce(()=>[{label:"设置",key:"setting",icon:ve(Je)}]),me=e=>{switch(e){case"setting":ce.push({name:"setting",query:{t:new Date().getTime()}});break}},w=e=>{le.value=e,U.value=!0},fe=()=>{U.value=!1},k=e=>{_e.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?je({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Re({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(e,c){x(A.value,e,c),x(F.value,e,c),x(z.value,e,c),x(M.value,e,c),x(q.value,e,c)}function x(e,c,W){if(e&&e.length>0)for(let N in e)e[N].user_id==c&&(e[N].user.is_following=W)}const D=()=>{switch(p.value){case"post":H();break;case"comment":B();break;case"highlight":V();break;case"media":j();break;case"star":R();break}},H=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,Z.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},B=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,te.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},R=()=>{d.value=!0,L({username:n.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)),v.value=Math.ceil(e.pager.total_rows/g.value),q.value=l.value,se.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},pe=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=J.value,v.value=Z.value,H();break;case"comment":l.value=F.value,s.value=K.value,v.value=ee.value,B();break;case"highlight":l.value=z.value,s.value=Q.value,v.value=te.value,V();break;case"media":l.value=M.value,s.value=Y.value,v.value=ae.value,j();break;case"star":l.value=q.value,s.value=X.value,v.value=se.value,R();break}},he=()=>{switch(p.value){case"post":J.value=s.value,H();break;case"comment":K.value=s.value,B();break;case"highlight":Q.value=s.value,V();break;case"media":Y.value=s.value,j();break;case"star":X.value=s.value,R();break}},ge=()=>{s.value{D()}),Ne(()=>({path:T.path,query:T.query,refresh:n.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 W=$e,N=Xe,we=Ze,ne=Ue("router-link"),ke=et,ye=tt,$=at,be=st,Ie=xe,Pe=lt,S=Me,y=nt,C=qe,Oe=ze,Te=Qe,Ae=ot,Fe=Ye;return a(),i("div",null,[u(W,{title:"主页"}),o(n).state.userInfo.id>0?(a(),h(Te,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[m("div",ut,[m("div",it,[u(N,{size:72,src:o(n).state.userInfo.avatar},null,8,["src"])]),m("div",rt,[m("div",ct,[m("strong",null,O(o(n).state.userInfo.nickname),1),m("span",null," @"+O(o(n).state.userInfo.username),1),o(n).state.userInfo.is_admin?(a(),h(we,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[E(" 管理员 ")]),_:1})):f("",!0)]),m("div",_t,[m("span",vt,"UID. "+O(o(n).state.userInfo.id),1),m("span",dt,O(o(Ve)(o(n).state.userInfo.created_on))+" 加入",1)]),m("div",mt,[m("span",ft,[u(ne,{onClick:c[0]||(c[0]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[E(" 关注  "+O(o(G)(o(n).state.userInfo.follows)),1)]),_:1},8,["to"])]),m("span",pt,[u(ne,{onClick:c[1]||(c[1]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[E(" 粉丝  "+O(o(G)(o(n).state.userInfo.followings)),1)]),_:1},8,["to"])]),m("span",ht," 泡泡  "+O(o(G)(o(n).state.userInfo.tweets_count)),1)])]),m("div",gt,[u(ye,{placement:"bottom-end",trigger:"click",size:"small",options:de.value,onSelect:me},{default:_(()=>[u(ke,{quaternary:"",circle:""},{icon:_(()=>[u(o(re),null,{default:_(()=>[u(o(Ge))]),_:1})]),_:1})]),_:1},8,["options"])])]),u(be,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":pe},{default:_(()=>[u($,{name:"post",tab:"泡泡"}),u($,{name:"comment",tab:"评论"}),u($,{name:"highlight",tab:"亮点"}),u($,{name:"media",tab:"图文"}),u($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),i("div",wt,[u(Ie,{num:g.value},null,8,["num"])])):(a(),i("div",kt,[l.value.length===0?(a(),i("div",yt,[u(Pe,{size:"large",description:"暂无数据"})])):f("",!0),o(n).state.desktopModelShow?(a(),i("div",bt,[p.value==="post"?(a(),i("div",It,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Pt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",Ot,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",Tt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",At,[(a(!0),i(b,null,I(q.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)])):(a(),i("div",Ft,[p.value==="post"?(a(),i("div",zt,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Mt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",qt,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",xt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",$t,[(a(!0),i(b,null,I(q.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)]))])),u(Oe,{show:U.value,user:le.value,onSuccess:fe},null,8,["show","user"])]),_:1})):f("",!0),v.value>0?(a(),h(Fe,{key:1,justify:"center"},{default:_(()=>[u(o(Ee),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>ge())},{spinner:_(()=>[m("div",St,[P.value?f("",!0):(a(),h(Ae,{key:0,size:14})),m("span",Ct,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):f("",!0)])}}});const ha=We(Lt,[["__scopeId","data-v-106c824e"]]);export{ha as default}; diff --git a/web/dist/assets/Setting-5be14630.js b/web/dist/assets/Setting-6298f275.js similarity index 98% rename from web/dist/assets/Setting-5be14630.js rename to web/dist/assets/Setting-6298f275.js index 0d3d6b30..6f5302b0 100644 --- a/web/dist/assets/Setting-5be14630.js +++ b/web/dist/assets/Setting-6298f275.js @@ -1 +1 @@ -import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-e04968a0.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}; +import{_ as he}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-5d57cf15.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/Topic-da7ca967.js b/web/dist/assets/Topic-8f1894f8.js similarity index 95% rename from web/dist/assets/Topic-da7ca967.js rename to web/dist/assets/Topic-8f1894f8.js index 4c4dff31..22a8bfc0 100644 --- a/web/dist/assets/Topic-da7ca967.js +++ b/web/dist/assets/Topic-8f1894f8.js @@ -1 +1 @@ -import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-e04968a0.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-8791d5c4.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-5d57cf15.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-107d9fcb.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-a118b5f4.js b/web/dist/assets/User-3e9be705.js similarity index 97% rename from web/dist/assets/User-a118b5f4.js rename to web/dist/assets/User-3e9be705.js index dbde26c3..b0481cec 100644 --- a/web/dist/assets/User-a118b5f4.js +++ b/web/dist/assets/User-3e9be705.js @@ -1 +1 @@ -import{_ as He,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-229a49b5.js";import{_ as je}from"./post-skeleton-4a65c483.js";import{_ as Ee}from"./whisper-a090f673.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js";import{d as Je,H as i,R as Ke,c as Qe,b as Ye,E as Xe,r as Ze,f as u,k as o,w as c,q as g,Y as m,e as t,j as w,x,bf as r,A as R,y as me,F,u as T,h as fe}from"./@vue-a481fc63.js";import{u as ea}from"./vuex-44de225f.js";import{b as aa,u as ta}from"./vue-router-e5a2430e.js";import{L as sa,K as la,e as B,h as na,u as pe,f as he,M as oa,_ as ua}from"./index-e04968a0.js";import{W as ia}from"./whisper-add-friend-035a8849.js";import{p as ce}from"./count-e2caa1c1.js";import{W as ra}from"./v3-infinite-loading-2c58ec2f.js";import{k as ca,a as va,r as _a,G as ge,s as da,t as ma,J as fa,R as pa}from"./@vicons-f0266f88.js";import{F as ha,G as ga,a as wa,j as we,o as ka,M as ya,e as ba,P as Pa,f as Oa,g as Fa,k as Ta,J as Ia,H as xa}from"./naive-ui-eecf2ec3.js";import"./content-17b86479.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 Aa={key:0,class:"profile-baseinfo"},$a={class:"avatar"},qa={class:"base-info"},za={class:"username"},Ua={class:"userinfo"},Ma={class:"info-item"},Sa={class:"info-item"},Ca={class:"userinfo"},Wa={class:"info-item"},La={class:"info-item"},Da={class:"info-item"},Na={key:0,class:"user-opts"},Ra={key:0,class:"skeleton-wrap"},Ba={key:1},Ha={key:0,class:"empty-wrap"},Va={key:1},ja={key:0},Ea={key:1},Ga={key:2},Ja={key:3},Ka={key:4},Qa={key:2},Ya={key:0},Xa={key:1},Za={key:2},et={key:3},at={key:4},tt={class:"load-more-wrap"},st={class:"load-more-spinner"},lt=Je({__name:"User",setup(nt){const H=ha(),v=ea(),$=aa(),ke=ta(),f=i(!1),y=i(!1),a=Ke({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}),p=i(!1),V=i(!1),G=i(!1),l=i([]),q=i([]),z=i([]),U=i([]),M=i([]),S=i([]),A=i($.query.s||""),n=i(+$.query.p||1),h=i("post"),J=i(+$.query.p||1),K=i(1),Q=i(1),Y=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),te=i(0),se=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=>{H.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(_=>{}):he({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(_=>{})}})};function ve(e,_){C(q,e,_),C(z,e,_),C(U,e,_),C(M,e,_),C(S,e,_)}function C(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 ye=()=>{y.value=!1,l.value=[],q.value=[],z.value=[],U.value=[],M.value=[],S.value=[],h.value="post",n.value=1,J.value=1,K.value=1,Q.value=1,Y.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,te.value=0,se.value=0},be=()=>{switch(h.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,B({username:A.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),q.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,B({username:A.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),z.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,B({username:A.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),U.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,B({username:A.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,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,B({username:A.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),S.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},Pe=e=>{switch(h.value=e,h.value){case"post":l.value=q.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=z.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=U.value,n.value=Q.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Y.value,d.value=te.value,oe();break;case"star":l.value=S.value,n.value=X.value,d.value=se.value,ue();break}},W=()=>{p.value=!0,sa({username:A.value}).then(e=>{p.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),be()}).catch(e=>{p.value=!1,console.log(e)})},Oe=()=>{switch(h.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Q.value=n.value,ne();break;case"media":Y.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Fe=()=>{V.value=!0},Te=()=>{G.value=!0},Ie=()=>{V.value=!1},xe=()=>{G.value=!1},I=e=>()=>fe(we,null,{default:()=>fe(e)}),Ae=Qe(()=>{if(v.state.userInfo.username==a.username)return[{label:"设置",key:"setting",icon:I(va)}];let e=[{label:"私信",key:"whisper",icon:I(_a)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:I(ge)}):e.push({label:"解封",key:"deblocking",icon:I(ge)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:I(da)}):e.push({label:"关注",key:"follow",icon:I(ma)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:I(fa)}):e.push({label:"添加朋友",key:"requesting",icon:I(pa)})),e}),$e=e=>{switch(e){case"whisper":Fe();break;case"delete":qe();break;case"requesting":Te();break;case"follow":case"unfollow":ze();break;case"banned":case"deblocking":Ue();break;case"setting":ke.push({name:"setting",query:{t:new Date().getTime()}});break}},qe=()=>{H.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,na({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,j()}).catch(e=>{p.value=!1,console.log(e)})}})},ze=()=>{H.success({title:"提示",content:"确定"+(a.is_following?"取消关注 @":"关注 @")+a.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?pe({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)}):he({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},Ue=()=>{H.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,oa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},Me=()=>{n.value{W()}),Xe(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(A.value=$.query.s||"",ye(),W())}),(e,_)=>{const ie=Ge,E=ka,re=ya,_e=Ze("router-link"),Se=ba,Ce=Pa,We=Ee,L=Oa,Le=Fa,de=Ta,De=je,Ne=Ia,D=He,O=xa,N=Ve,Re=ga,Be=wa;return t(),u("div",null,[o(ie,{title:"用户详情"}),o(Re,{class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[o(de,{show:p.value},{default:c(()=>[a.id>0?(t(),u("div",Aa,[w("div",$a,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",qa,[w("div",za,[w("strong",null,x(a.nickname),1),w("span",null," @"+x(a.username),1),r(v).state.profile.useFriendship&&r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_friend?(t(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:c(()=>[R(" 好友 ")]),_:1})):m("",!0),r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_following?(t(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:c(()=>[R(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(t(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),w("div",Ua,[w("span",Ma,"UID. "+x(a.id),1),w("span",Sa,x(r(la)(a.created_on))+" 加入",1)]),w("div",Ca,[w("span",Wa,[o(_e,{onClick:_[0]||(_[0]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:c(()=>[R(" 关注  "+x(r(ce)(a.follows)),1)]),_:1},8,["to"])]),w("span",La,[o(_e,{onClick:_[1]||(_[1]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:c(()=>[R(" 粉丝  "+x(r(ce)(a.followings)),1)]),_:1},8,["to"])]),w("span",Da," 泡泡  "+x(r(ce)(a.tweets_count||0)),1)])]),r(v).state.userInfo.id>0?(t(),u("div",Na,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Ae.value,onSelect:$e},{default:c(()=>[o(Se,{quaternary:"",circle:""},{icon:c(()=>[o(r(we),null,{default:c(()=>[o(r(ca))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(We,{show:V.value,user:a,onSuccess:Ie},null,8,["show","user"]),o(ia,{show:G.value,user:a,onSuccess:xe},null,8,["show","user"]),p.value?m("",!0):(t(),g(Le,{key:1,class:"profile-tabs-wrap",type:"line",animated:"",value:h.value,"onUpdate:value":Pe},{default:c(()=>[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"]))]),_:1},8,["show"]),f.value&&l.value.length===0?(t(),u("div",Ra,[o(De,{num:k.value},null,8,["num"])])):(t(),u("div",Ba,[l.value.length===0?(t(),u("div",Ha,[o(Ne,{size:"large",description:"暂无数据"})])):m("",!0),r(v).state.desktopModelShow?(t(),u("div",Va,[h.value==="post"?(t(),u("div",ja,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Ea,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Ga,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",Ja,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",Ka,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(t(),u("div",Qa,[h.value==="post"?(t(),u("div",Ya,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Xa,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Za,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",et,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",at,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(t(),g(Be,{key:0,justify:"center"},{default:c(()=>[o(r(ra),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=s=>Me())},{spinner:c(()=>[w("div",tt,[y.value?m("",!0):(t(),g(de,{key:0,size:14})),w("span",st,x(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Nt=ua(lt,[["__scopeId","data-v-00ab4b4e"]]);export{Nt as default}; +import{_ as He,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-c0153d25.js";import{_ as je}from"./post-skeleton-65699bcb.js";import{_ as Ee}from"./whisper-5534d7cd.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js";import{d as Je,H as i,R as Ke,c as Qe,b as Ye,E as Xe,r as Ze,f as u,k as o,w as c,q as g,Y as m,e as t,j as w,x,bf as r,A as R,y as me,F,u as T,h as fe}from"./@vue-a481fc63.js";import{u as ea}from"./vuex-44de225f.js";import{b as aa,u as ta}from"./vue-router-e5a2430e.js";import{L as sa,K as la,e as B,h as na,u as pe,f as he,M as oa,_ as ua}from"./index-5d57cf15.js";import{W as ia}from"./whisper-add-friend-78948174.js";import{p as ce}from"./count-e2caa1c1.js";import{W as ra}from"./v3-infinite-loading-2c58ec2f.js";import{k as ca,a as va,r as _a,G as ge,s as da,t as ma,J as fa,R as pa}from"./@vicons-f0266f88.js";import{F as ha,G as ga,a as wa,j as we,o as ka,M as ya,e as ba,P as Pa,f as Oa,g as Fa,k as Ta,J as Ia,H as xa}from"./naive-ui-eecf2ec3.js";import"./content-d5e071f1.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 Aa={key:0,class:"profile-baseinfo"},$a={class:"avatar"},qa={class:"base-info"},za={class:"username"},Ua={class:"userinfo"},Ma={class:"info-item"},Sa={class:"info-item"},Ca={class:"userinfo"},Wa={class:"info-item"},La={class:"info-item"},Da={class:"info-item"},Na={key:0,class:"user-opts"},Ra={key:0,class:"skeleton-wrap"},Ba={key:1},Ha={key:0,class:"empty-wrap"},Va={key:1},ja={key:0},Ea={key:1},Ga={key:2},Ja={key:3},Ka={key:4},Qa={key:2},Ya={key:0},Xa={key:1},Za={key:2},et={key:3},at={key:4},tt={class:"load-more-wrap"},st={class:"load-more-spinner"},lt=Je({__name:"User",setup(nt){const H=ha(),v=ea(),$=aa(),ke=ta(),f=i(!1),y=i(!1),a=Ke({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}),p=i(!1),V=i(!1),G=i(!1),l=i([]),q=i([]),z=i([]),U=i([]),M=i([]),S=i([]),A=i($.query.s||""),n=i(+$.query.p||1),h=i("post"),J=i(+$.query.p||1),K=i(1),Q=i(1),Y=i(1),X=i(1),k=i(20),d=i(0),Z=i(0),ee=i(0),ae=i(0),te=i(0),se=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=>{H.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(_=>{}):he({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(_=>{})}})};function ve(e,_){C(q,e,_),C(z,e,_),C(U,e,_),C(M,e,_),C(S,e,_)}function C(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 ye=()=>{y.value=!1,l.value=[],q.value=[],z.value=[],U.value=[],M.value=[],S.value=[],h.value="post",n.value=1,J.value=1,K.value=1,Q.value=1,Y.value=1,X.value=1,d.value=0,Z.value=0,ee.value=0,ae.value=0,te.value=0,se.value=0},be=()=>{switch(h.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,B({username:A.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),q.value=l.value,Z.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,B({username:A.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),z.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,B({username:A.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),U.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,B({username:A.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,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,B({username:A.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),S.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},Pe=e=>{switch(h.value=e,h.value){case"post":l.value=q.value,n.value=J.value,d.value=Z.value,j();break;case"comment":l.value=z.value,n.value=K.value,d.value=ee.value,le();break;case"highlight":l.value=U.value,n.value=Q.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=Y.value,d.value=te.value,oe();break;case"star":l.value=S.value,n.value=X.value,d.value=se.value,ue();break}},W=()=>{p.value=!0,sa({username:A.value}).then(e=>{p.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),be()}).catch(e=>{p.value=!1,console.log(e)})},Oe=()=>{switch(h.value){case"post":J.value=n.value,j();break;case"comment":K.value=n.value,le();break;case"highlight":Q.value=n.value,ne();break;case"media":Y.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Fe=()=>{V.value=!0},Te=()=>{G.value=!0},Ie=()=>{V.value=!1},xe=()=>{G.value=!1},I=e=>()=>fe(we,null,{default:()=>fe(e)}),Ae=Qe(()=>{if(v.state.userInfo.username==a.username)return[{label:"设置",key:"setting",icon:I(va)}];let e=[{label:"私信",key:"whisper",icon:I(_a)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:I(ge)}):e.push({label:"解封",key:"deblocking",icon:I(ge)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:I(da)}):e.push({label:"关注",key:"follow",icon:I(ma)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:I(fa)}):e.push({label:"添加朋友",key:"requesting",icon:I(pa)})),e}),$e=e=>{switch(e){case"whisper":Fe();break;case"delete":qe();break;case"requesting":Te();break;case"follow":case"unfollow":ze();break;case"banned":case"deblocking":Ue();break;case"setting":ke.push({name:"setting",query:{t:new Date().getTime()}});break}},qe=()=>{H.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,na({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,j()}).catch(e=>{p.value=!1,console.log(e)})}})},ze=()=>{H.success({title:"提示",content:"确定"+(a.is_following?"取消关注 @":"关注 @")+a.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?pe({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)}):he({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},Ue=()=>{H.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,oa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},Me=()=>{n.value{W()}),Xe(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(A.value=$.query.s||"",ye(),W())}),(e,_)=>{const ie=Ge,E=ka,re=ya,_e=Ze("router-link"),Se=ba,Ce=Pa,We=Ee,L=Oa,Le=Fa,de=Ta,De=je,Ne=Ia,D=He,O=xa,N=Ve,Re=ga,Be=wa;return t(),u("div",null,[o(ie,{title:"用户详情"}),o(Re,{class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[o(de,{show:p.value},{default:c(()=>[a.id>0?(t(),u("div",Aa,[w("div",$a,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",qa,[w("div",za,[w("strong",null,x(a.nickname),1),w("span",null," @"+x(a.username),1),r(v).state.profile.useFriendship&&r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_friend?(t(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:c(()=>[R(" 好友 ")]),_:1})):m("",!0),r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_following?(t(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:c(()=>[R(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(t(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),w("div",Ua,[w("span",Ma,"UID. "+x(a.id),1),w("span",Sa,x(r(la)(a.created_on))+" 加入",1)]),w("div",Ca,[w("span",Wa,[o(_e,{onClick:_[0]||(_[0]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:c(()=>[R(" 关注  "+x(r(ce)(a.follows)),1)]),_:1},8,["to"])]),w("span",La,[o(_e,{onClick:_[1]||(_[1]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:c(()=>[R(" 粉丝  "+x(r(ce)(a.followings)),1)]),_:1},8,["to"])]),w("span",Da," 泡泡  "+x(r(ce)(a.tweets_count||0)),1)])]),r(v).state.userInfo.id>0?(t(),u("div",Na,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Ae.value,onSelect:$e},{default:c(()=>[o(Se,{quaternary:"",circle:""},{icon:c(()=>[o(r(we),null,{default:c(()=>[o(r(ca))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(We,{show:V.value,user:a,onSuccess:Ie},null,8,["show","user"]),o(ia,{show:G.value,user:a,onSuccess:xe},null,8,["show","user"]),p.value?m("",!0):(t(),g(Le,{key:1,class:"profile-tabs-wrap",type:"line",animated:"",value:h.value,"onUpdate:value":Pe},{default:c(()=>[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"]))]),_:1},8,["show"]),f.value&&l.value.length===0?(t(),u("div",Ra,[o(De,{num:k.value},null,8,["num"])])):(t(),u("div",Ba,[l.value.length===0?(t(),u("div",Ha,[o(Ne,{size:"large",description:"暂无数据"})])):m("",!0),r(v).state.desktopModelShow?(t(),u("div",Va,[h.value==="post"?(t(),u("div",ja,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Ea,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Ga,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",Ja,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",Ka,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(t(),u("div",Qa,[h.value==="post"?(t(),u("div",Ya,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Xa,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Za,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",et,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",at,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(t(),g(Be,{key:0,justify:"center"},{default:c(()=>[o(r(ra),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=s=>Me())},{spinner:c(()=>[w("div",tt,[y.value?m("",!0):(t(),g(de,{key:0,size:14})),w("span",st,x(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Nt=ua(lt,[["__scopeId","data-v-00ab4b4e"]]);export{Nt as default}; diff --git a/web/dist/assets/Wallet-af76ceb9.js b/web/dist/assets/Wallet-01451225.js similarity index 95% rename from web/dist/assets/Wallet-af76ceb9.js rename to web/dist/assets/Wallet-01451225.js index 4d3b7ca0..5abbea3b 100644 --- a/web/dist/assets/Wallet-af76ceb9.js +++ b/web/dist/assets/Wallet-01451225.js @@ -1 +1 @@ -import{_ as K}from"./post-skeleton-4a65c483.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-e04968a0.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-65699bcb.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-5d57cf15.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-17b86479.js b/web/dist/assets/content-d5e071f1.js similarity index 99% rename from web/dist/assets/content-17b86479.js rename to web/dist/assets/content-d5e071f1.js index 52284368..2cf31a63 100644 --- a/web/dist/assets/content-17b86479.js +++ b/web/dist/assets/content-d5e071f1.js @@ -1 +1 @@ -import{d as E,e,f as l,F as i,u as k,k as r,w as s,bf as c,j as C,y,x as I,q as g,Y as m,H as j,A as D,h}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as $,V as A,W as V,m as R,X as L,e as P,i as T}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-e04968a0.js";import{e as W}from"./paopao-video-player-2fe58954.js";const Z={class:"link-wrap"},q={class:"link-txt-wrap"},z=["href"],F={class:"link-txt"},H=E({__name:"post-link",props:{links:{default:()=>[]}},setup(f){const o=f;return(u,a)=>{const x=$;return e(),l("div",Z,[(e(!0),l(i,null,k(o.links,n=>(e(),l("div",{class:"link-item",key:n.id},[r(x,{class:"hash-link"},{default:s(()=>[r(c(N))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:a[0]||(a[0]=y(()=>{},["stop"]))},[C("span",F,I(n.content),1)],8,z)])]))),128))])}}});const st=B(H,[["__scopeId","data-v-36eef76b"]]),X={key:0},rt=E({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(f){const o=f;return(u,a)=>{const x=A,n=V;return o.videos.length>0?(e(),l("div",X,[r(n,{"x-gap":4,"y-gap":4,cols:u.full?1:5},{default:s(()=>[r(x,{span:u.full?1:3},{default:s(()=>[(e(!0),l(i,null,k(o.videos,v=>(e(),g(c(W),{onClick:a[0]||(a[0]=y(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):m("",!0)}}}),Y={class:"images-wrap"},ot=E({__name:"post-image",props:{imgs:{default:()=>[]}},setup(f){const o=f,u="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",a="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=R,_=A,p=V,w=L;return e(),l("div",Y,[[1].includes(o.imgs.length)?(e(),g(w,{key:0},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:2},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[0]||(n[0]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[2,3].includes(o.imgs.length)?(e(),g(w,{key:1},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[1]||(n[1]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[4].includes(o.imgs.length)?(e(),g(w,{key:2},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[2]||(n[2]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[5].includes(o.imgs.length)?(e(),g(w,{key:3},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[3]||(n[3]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[4]||(n[4]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),[6].includes(o.imgs.length)?(e(),g(w,{key:4},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[5]||(n[5]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[6]||(n[6]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),o.imgs.length===7?(e(),g(w,{key:5},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[7]||(n[7]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[8]||(n[8]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===8?(e(),g(w,{key:6},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[9]||(n[9]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[10]||(n[10]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===9?(e(),g(w,{key:7},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<3?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[11]||(n[11]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=3&&d<6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[12]||(n[12]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[13]||(n[13]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0)])}}});const G={class:"attachment-wrap"},J=E({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(f){const o=f,u=j(!1),a=j(""),x=j(0),n=_=>{u.value=!0,x.value=_.id,a.value="这是一个免费附件,您可以直接下载?",_.type===8&&(a.value=()=>h("div",{},[h("p",{},"这是一个收费附件,下载将收取"+(o.price/100).toFixed(2)+"元")]),M({id:x.value}).then(p=>{p.paid&&(a.value=()=>h("div",{},[h("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(p=>{u.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,p)=>{const w=$,t=P,d=T;return e(),l("div",G,[(e(!0),l(i,null,k(_.attachments,b=>(e(),l("div",{class:"attach-item",key:b.id},[r(t,{onClick:y(K=>n(b),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:s(()=>[r(w,null,{default:s(()=>[r(c(U))]),_:1})]),default:s(()=>[D(" "+I(b.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),r(d,{show:u.value,"onUpdate:show":p[0]||(p[0]=b=>u.value=b),"mask-closable":!1,preset:"dialog",title:"下载提示",content:a.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),at=f=>{const o=[],u=[];var a=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(a,n=>(o.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(u.push(n.substr(1).trim()),''+n.trim()+" ")),{content:f,tags:o,users:u}},ct=(f,o,u,a,x=!0)=>{const n=f.length>a;if(x&&n){f=f.substring(0,a);let p=f.charAt(a-1);(p=="#"||p=="#"||p=="@")&&(f=f.substring(0,a-1))}const v=/(#|#)([^#@\s])+?\s+?/g,_=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(v,p=>''+p.trim()+" ").replace(_,p=>''+p.trim()+" "),n&&(f=f.trimEnd()+(x?"... ":" ")+''+(x?o:u)+" "),f};export{ot as _,lt as a,rt as b,st as c,ct as d,at as p}; +import{d as E,e,f as l,F as i,u as k,k as r,w as s,bf as c,j as C,y,x as I,q as g,Y as m,H as j,A as D,h}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as $,V as A,W as V,m as R,X as L,e as P,i as T}from"./naive-ui-eecf2ec3.js";import{_ as B,V as M,W as O}from"./index-5d57cf15.js";import{e as W}from"./paopao-video-player-2fe58954.js";const Z={class:"link-wrap"},q={class:"link-txt-wrap"},z=["href"],F={class:"link-txt"},H=E({__name:"post-link",props:{links:{default:()=>[]}},setup(f){const o=f;return(u,a)=>{const x=$;return e(),l("div",Z,[(e(!0),l(i,null,k(o.links,n=>(e(),l("div",{class:"link-item",key:n.id},[r(x,{class:"hash-link"},{default:s(()=>[r(c(N))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:a[0]||(a[0]=y(()=>{},["stop"]))},[C("span",F,I(n.content),1)],8,z)])]))),128))])}}});const st=B(H,[["__scopeId","data-v-36eef76b"]]),X={key:0},rt=E({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(f){const o=f;return(u,a)=>{const x=A,n=V;return o.videos.length>0?(e(),l("div",X,[r(n,{"x-gap":4,"y-gap":4,cols:u.full?1:5},{default:s(()=>[r(x,{span:u.full?1:3},{default:s(()=>[(e(!0),l(i,null,k(o.videos,v=>(e(),g(c(W),{onClick:a[0]||(a[0]=y(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):m("",!0)}}}),Y={class:"images-wrap"},ot=E({__name:"post-image",props:{imgs:{default:()=>[]}},setup(f){const o=f,u="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",a="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=R,_=A,p=V,w=L;return e(),l("div",Y,[[1].includes(o.imgs.length)?(e(),g(w,{key:0},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:2},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[0]||(n[0]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[2,3].includes(o.imgs.length)?(e(),g(w,{key:1},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[1]||(n[1]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[4].includes(o.imgs.length)?(e(),g(w,{key:2},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,t=>(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[2]||(n[2]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[5].includes(o.imgs.length)?(e(),g(w,{key:3},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[3]||(n[3]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[4]||(n[4]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),[6].includes(o.imgs.length)?(e(),g(w,{key:4},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d<3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[5]||(n[5]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,{key:t.id},[d>=3?(e(),g(_,{key:0},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[6]||(n[6]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),o.imgs.length===7?(e(),g(w,{key:5},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[7]||(n[7]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[8]||(n[8]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===8?(e(),g(w,{key:6},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[9]||(n[9]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=4?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[10]||(n[10]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),o.imgs.length===9?(e(),g(w,{key:7},{default:s(()=>[r(p,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d<3?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[11]||(n[11]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=3&&d<6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[12]||(n[12]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),r(p,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(i,null,k(o.imgs,(t,d)=>(e(),l(i,null,[d>=6?(e(),g(_,{key:t.id},{default:s(()=>[r(v,{onError:()=>t.content=c(u),onClick:n[13]||(n[13]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(a),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0)])}}});const G={class:"attachment-wrap"},J=E({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(f){const o=f,u=j(!1),a=j(""),x=j(0),n=_=>{u.value=!0,x.value=_.id,a.value="这是一个免费附件,您可以直接下载?",_.type===8&&(a.value=()=>h("div",{},[h("p",{},"这是一个收费附件,下载将收取"+(o.price/100).toFixed(2)+"元")]),M({id:x.value}).then(p=>{p.paid&&(a.value=()=>h("div",{},[h("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(p=>{u.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,p)=>{const w=$,t=P,d=T;return e(),l("div",G,[(e(!0),l(i,null,k(_.attachments,b=>(e(),l("div",{class:"attach-item",key:b.id},[r(t,{onClick:y(K=>n(b),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:s(()=>[r(w,null,{default:s(()=>[r(c(U))]),_:1})]),default:s(()=>[D(" "+I(b.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),r(d,{show:u.value,"onUpdate:show":p[0]||(p[0]=b=>u.value=b),"mask-closable":!1,preset:"dialog",title:"下载提示",content:a.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(J,[["__scopeId","data-v-22563084"]]),at=f=>{const o=[],u=[];var a=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(a,n=>(o.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(u.push(n.substr(1).trim()),''+n.trim()+" ")),{content:f,tags:o,users:u}},ct=(f,o,u,a,x=!0)=>{const n=f.length>a;if(x&&n){f=f.substring(0,a);let p=f.charAt(a-1);(p=="#"||p=="#"||p=="@")&&(f=f.substring(0,a-1))}const v=/(#|#)([^#@\s])+?\s+?/g,_=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(v,p=>''+p.trim()+" ").replace(_,p=>''+p.trim()+" "),n&&(f=f.trimEnd()+(x?"... ":" ")+''+(x?o:u)+" "),f};export{ot as _,lt as a,rt as b,st as c,ct as d,at as p}; diff --git a/web/dist/assets/index-e04968a0.js b/web/dist/assets/index-5d57cf15.js similarity index 90% rename from web/dist/assets/index-e04968a0.js rename to web/dist/assets/index-5d57cf15.js index 9fdb7c2b..e2311495 100644 --- a/web/dist/assets/index-e04968a0.js +++ b/web/dist/assets/index-5d57cf15.js @@ -1 +1 @@ -import{d as K,H as L,R as X,b as V,e as f,q as z,w as u,j as w,k as s,bf as d,f as R,A as S,Z as N,y as q,Y as I,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 Te,u as W}from"./vuex-44de225f.js";import{a as Pe}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Me,d as Ee,e as me,f as Ce,g as Oe,h as _e,i as Ie,j as F,k as Se,u as Ue,l as $e,m as De,n as xe,o as Ne,p as qe,q as ze,r as Fe,s as Ke,t as Ve}from"./naive-ui-eecf2ec3.js";import{h as U}from"./moment-2ab8298d.js";import{S as We,M as Be,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={},P=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"),O=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}"]${O}`))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:()=>P(()=>import("./Home-c974ee05.js"),["assets/Home-c974ee05.js","assets/whisper-add-friend-035a8849.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-a090f673.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-229a49b5.js","assets/content-17b86479.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-bed4fc16.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>P(()=>import("./Post-1f21e9b6.js"),["assets/Post-1f21e9b6.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-17b86479.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-4a65c483.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-a090f673.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-8791d5c4.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:()=>P(()=>import("./Topic-da7ca967.js"),["assets/Topic-da7ca967.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-8791d5c4.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:()=>P(()=>import("./Anouncement-785b0794.js"),["assets/Anouncement-785b0794.js","assets/post-skeleton-4a65c483.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-8791d5c4.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:()=>P(()=>import("./Profile-3861dc0e.js"),["assets/Profile-3861dc0e.js","assets/whisper-a090f673.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-229a49b5.js","assets/content-17b86479.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js","assets/main-nav-569a7b0c.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-909e78bc.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>P(()=>import("./User-a118b5f4.js"),["assets/User-a118b5f4.js","assets/post-item.vue_vue_type_style_index_0_lang-229a49b5.js","assets/content-17b86479.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-a8987469.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/whisper-a090f673.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-035a8849.js","assets/whisper-add-friend-01aea97d.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-59f1210f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>P(()=>import("./Messages-84df664c.js"),["assets/Messages-84df664c.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-a090f673.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-a71f605f.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>P(()=>import("./Collection-71625ce1.js"),["assets/Collection-71625ce1.js","assets/whisper-a090f673.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-229a49b5.js","assets/content-17b86479.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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:()=>P(()=>import("./Contacts-c3c5bab2.js"),["assets/Contacts-c3c5bab2.js","assets/whisper-a090f673.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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-4b1622b8.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>P(()=>import("./Following-79bd0e5a.js"),["assets/Following-79bd0e5a.js","assets/whisper-a090f673.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-4a65c483.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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/Following-6b5e92ae.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>P(()=>import("./Wallet-af76ceb9.js"),["assets/Wallet-af76ceb9.js","assets/post-skeleton-4a65c483.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-8791d5c4.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:()=>P(()=>import("./Setting-5be14630.js"),["assets/Setting-5be14630.js","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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:()=>P(()=>import("./404-7d89528a.js"),["assets/404-7d89528a.js","assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.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=Te({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,defaultTweetMaxLength:2e3,tweetWebEllipsisSize:400,tweetMobileEllipsisSize:300,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.defaultTweetMaxLength=+"2000",e.profile.tweetWebEllipsisSize=+"400",e.profile.tweetMobileEllipsisSize=+"300",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.defaultTweetMaxLength=t.default_tweet_max_length??r.defaultTweetMaxLength,e.profile.tweetWebEllipsisSize=t.tweet_web_ellipsis_size??r.tweetWebEllipsisSize,e.profile.tweetMobileEllipsisSize=t.tweet_mobile_ellipsis_size??r.tweetMobileEllipsisSize,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=Pe.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=K({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),O={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"}]},T=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(M=>{M||(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(M=>{M||(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 V(()=>{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 M=Ae,m=Re,b=pe,a=de,v=Me,D=Ee,$=me,x=Ce,p=Oe,E=_e,B=Ie;return f(),z(B,{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(E,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(M,{type:"success"},{default:u(()=>[S("账号登录")]),_: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:N(q(T,["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:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),z(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:N(q(T,["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:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:O},{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:N(q(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:N(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:g},{default:u(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):I("",!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}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Po=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}),Mo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Eo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Oo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Io=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),So=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Uo=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}),No=e=>o({method:"post",url:"/v1/user/follow",data:e}),qo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Fo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ko=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Vo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=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"});U.locale("zh-cn");const ut=e=>U.unix(e).fromNow(),ur=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>U.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=K({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),O=L(0),T=L(0),g=L(0),_=L(0),i=L(null),M=+"6",m=+"12",b=()=>{it().then(p=>{O.value=p.register_user_count,T.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:M}).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,E)=>{(p.refreshTopicFollow!==E.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(E=>{E.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,E)=>{const B=F,y=de,G=ue("router-link"),J=Se,H=_e,ge=pe;return d(l).state.collapsedRight?I("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":E[0]||(E[0]=C=>n.value=C),onKeyup:N(q(D,["prevent"]),["enter"])},{prefix:u(()=>[s(B,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),z(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,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):I("",!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,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(C.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(O.value)+" 注册用户,"+A(T.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):I("",!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"},Tt={class:"user-info"},Pt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Mt={class:"user-mini-wrap"},Et={key:1,class:"user-wrap"},Ct={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},It=K({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),O="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)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const T=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return O&&a.push({label:"公告",key:"anouncement",icon:()=>k(Be),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(F,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(F,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},M=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),M()};return window.$store=t,window.$message=Ue(),(a,v)=>{const D=De,$=xe,x=Ne,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:M},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:T.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",Tt,[w("div",Pt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(F),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(F),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Et,[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=E=>m("signup"))},{default:u(()=>[S(" 注册 ")]),_:1})])):I("",!0)]))])}}});const St=()=>o({method:"get",url:"/v1/site/profile"}),Ut={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=K({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?ze:null);function h(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&St().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return V(()=>{h()}),(n,l)=>{const c=It,O=ue("router-view"),T=wt,g=at,_=Fe,i=Ke,M=Ve,m=qe;return f(),z(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",Ut,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):I("",!0),w("div",Dt,[s(O,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),z(ve,null,[n.$route.meta.keepAlive?(f(),z(oe(a),{key:0})):I("",!0)],1024)),n.$route.meta.keepAlive?I("",!0):(f(),z(oe(a),{key:0}))]),_:1})]),s(T)]),s(g)],2)]}),_:1})]),_:1}),s(M)]),_: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,Co as F,Io as G,Oo as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Ko 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,zo as Y,Fo as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,So as a4,jo as a5,Ho as a6,Wo as a7,Bo as a8,Yo as a9,Uo as aa,It as ab,_o as b,ho as c,no as d,er as e,No as f,sr as g,Vo as h,ur as i,To as j,Eo as k,bo as l,ko as m,Mo as n,Ao as o,Ro as p,Po as q,lo as r,uo as s,Lo as t,qo as u,fo as v,go as w,vo as x,wo as y,yo as z}; +import{d as K,H as L,R as X,b as V,e as f,q as z,w as u,j as w,k as s,bf as d,f as R,A as S,Z as N,y as q,Y as I,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 Te,u as W}from"./vuex-44de225f.js";import{a as Pe}from"./axios-4a70c6fc.js";import{_ as Ae,N as Re,a as pe,b as de,c as Me,d as Ee,e as me,f as Ce,g as Oe,h as _e,i as Ie,j as F,k as Se,u as Ue,l as $e,m as De,n as xe,o as Ne,p as qe,q as ze,r as Fe,s as Ke,t as Ve}from"./naive-ui-eecf2ec3.js";import{h as U}from"./moment-2ab8298d.js";import{S as We,M as Be,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={},P=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"),O=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}"]${O}`))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:()=>P(()=>import("./Home-a73036c0.js"),["assets/Home-a73036c0.js","assets/whisper-add-friend-78948174.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-5534d7cd.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-c0153d25.js","assets/content-d5e071f1.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-bed4fc16.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>P(()=>import("./Post-0fe19df6.js"),["assets/Post-0fe19df6.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-d5e071f1.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-65699bcb.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-5534d7cd.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-107d9fcb.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:()=>P(()=>import("./Topic-8f1894f8.js"),["assets/Topic-8f1894f8.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-107d9fcb.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:()=>P(()=>import("./Anouncement-5ba820b0.js"),["assets/Anouncement-5ba820b0.js","assets/post-skeleton-65699bcb.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-107d9fcb.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:()=>P(()=>import("./Profile-dbdbe695.js"),["assets/Profile-dbdbe695.js","assets/whisper-5534d7cd.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-c0153d25.js","assets/content-d5e071f1.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js","assets/main-nav-569a7b0c.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-909e78bc.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>P(()=>import("./User-3e9be705.js"),["assets/User-3e9be705.js","assets/post-item.vue_vue_type_style_index_0_lang-c0153d25.js","assets/content-d5e071f1.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-a8987469.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/whisper-5534d7cd.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-78948174.js","assets/whisper-add-friend-01aea97d.css","assets/count-e2caa1c1.js","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-59f1210f.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>P(()=>import("./Messages-5f22f29e.js"),["assets/Messages-5f22f29e.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-5534d7cd.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-a71f605f.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>P(()=>import("./Collection-205b60a9.js"),["assets/Collection-205b60a9.js","assets/whisper-5534d7cd.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-c0153d25.js","assets/content-d5e071f1.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-a8987469.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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:()=>P(()=>import("./Contacts-383ba191.js"),["assets/Contacts-383ba191.js","assets/whisper-5534d7cd.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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-4b1622b8.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>P(()=>import("./Following-4a1f6982.js"),["assets/Following-4a1f6982.js","assets/whisper-5534d7cd.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-65699bcb.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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/Following-b11fb642.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>P(()=>import("./Wallet-01451225.js"),["assets/Wallet-01451225.js","assets/post-skeleton-65699bcb.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-107d9fcb.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:()=>P(()=>import("./Setting-6298f275.js"),["assets/Setting-6298f275.js","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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:()=>P(()=>import("./404-85eda774.js"),["assets/404-85eda774.js","assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.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=Te({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,defaultTweetMaxLength:2e3,tweetWebEllipsisSize:400,tweetMobileEllipsisSize:300,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.defaultTweetMaxLength=+"2000",e.profile.tweetWebEllipsisSize=+"400",e.profile.tweetMobileEllipsisSize=+"300",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.defaultTweetMaxLength=t.default_tweet_max_length??r.defaultTweetMaxLength,e.profile.tweetWebEllipsisSize=t.tweet_web_ellipsis_size??r.tweetWebEllipsisSize,e.profile.tweetMobileEllipsisSize=t.tweet_mobile_ellipsis_size??r.tweetMobileEllipsisSize,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=Pe.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=K({__name:"auth",setup(e){const t=W(),r=L(!1),h=L(),n=X({username:"",password:""}),l=L(),c=X({username:"",password:"",repassword:""}),O={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"}]},T=_=>{var i;_.preventDefault(),_.stopPropagation(),(i=h.value)==null||i.validate(M=>{M||(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(M=>{M||(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 V(()=>{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 M=Ae,m=Re,b=pe,a=de,v=Me,D=Ee,$=me,x=Ce,p=Oe,E=_e,B=Ie;return f(),z(B,{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(E,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(m,null,{default:u(()=>[s(M,{type:"success"},{default:u(()=>[S("账号登录")]),_: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:N(q(T,["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:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),z(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:N(q(T,["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:N(q(T,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:T},{default:u(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:l,model:c,rules:O},{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:N(q(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:N(q(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:g},{default:u(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):I("",!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}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Po=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}),Mo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Eo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Oo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Io=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),So=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Uo=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}),No=e=>o({method:"post",url:"/v1/user/follow",data:e}),qo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Fo=e=>o({method:"get",url:"/v1/user/followings",params:e}),Ko=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Vo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Wo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Bo=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"});U.locale("zh-cn");const ut=e=>U.unix(e).fromNow(),ur=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},cr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},pr=e=>U.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=K({__name:"rightbar",setup(e){const t=L([]),r=L([]),h=L(!1),n=L(""),l=W(),c=ce(),O=L(0),T=L(0),g=L(0),_=L(0),i=L(null),M=+"6",m=+"12",b=()=>{it().then(p=>{O.value=p.register_user_count,T.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:M}).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,E)=>{(p.refreshTopicFollow!==E.refreshTopicFollow||p.userLogined)&&a(),l.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(E=>{E.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,E)=>{const B=F,y=de,G=ue("router-link"),J=Se,H=_e,ge=pe;return d(l).state.collapsedRight?I("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":E[0]||(E[0]=C=>n.value=C),onKeyup:N(q(D,["prevent"]),["enter"])},{prefix:u(()=>[s(B,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),z(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,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",dt,A(v(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):I("",!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,C=>(f(),R("div",{class:"hot-tag-item",key:C.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:u(()=>[S(" #"+A(C.tag),1)]),_:2},1032,["to"]),w("div",mt,A(v(C.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(O.value)+" 注册用户,"+A(T.value)+" 人在线,最高在线 "+A(g.value)+" 人,站点上线于 "+A(d(ut)(_.value)),1)],512)):I("",!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"},Tt={class:"user-info"},Pt={class:"nickname"},At={class:"nickname-txt"},Rt={class:"username"},Mt={class:"user-mini-wrap"},Et={key:1,class:"user-wrap"},Ct={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},It=K({__name:"sidebar",setup(e){const t=W(),r=Le(),h=ce(),n=L(!1),l=L(r.name||""),c=L(),O="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)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const T=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>k(re),href:"/"},{label:"话题",key:"topic",icon:()=>k(se),href:"/topic"}];return O&&a.push({label:"公告",key:"anouncement",icon:()=>k(Be),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(F,{color:a.key===l.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):k(F,null,{default:a.icon}),i=(a,v={})=>{l.value=a,h.push({name:a,query:{t:new Date().getTime()}})},M=()=>{r.path==="/"&&t.commit("refresh"),i("home")},m=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),M()};return window.$store=t,window.$message=Ue(),(a,v)=>{const D=De,$=xe,x=Ne,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:M},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:T.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",Tt,[w("div",Pt,[w("span",At,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(F),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",Rt,"@"+A(d(t).state.userInfo.username),1)]),w("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(F),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Et,[d(t).state.profile.allowUserRegister?I("",!0):(f(),R("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[0]||(v[0]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:v[1]||(v[1]=E=>m("signin"))},{default:u(()=>[S(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:v[2]||(v[2]=E=>m("signup"))},{default:u(()=>[S(" 注册 ")]),_:1})])):I("",!0)]))])}}});const St=()=>o({method:"get",url:"/v1/site/profile"}),Ut={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=K({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?ze:null);function h(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&St().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return V(()=>{h()}),(n,l)=>{const c=It,O=ue("router-view"),T=wt,g=at,_=Fe,i=Ke,M=Ve,m=qe;return f(),z(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",Ut,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(c)])):I("",!0),w("div",Dt,[s(O,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),z(ve,null,[n.$route.meta.keepAlive?(f(),z(oe(a),{key:0})):I("",!0)],1024)),n.$route.meta.keepAlive?I("",!0):(f(),z(oe(a),{key:0}))]),_:1})]),s(T)]),s(g)],2)]}),_:1})]),_:1}),s(M)]),_: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,Co as F,Io as G,Oo as H,lt as I,ut as J,pr as K,Xo as L,ir as M,Do as N,xo as O,Ko 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,zo as Y,Fo as Z,fe as _,nr as a,Y as a0,tr as a1,or as a2,rr as a3,So as a4,jo as a5,Ho as a6,Wo as a7,Bo as a8,Yo as a9,Uo as aa,It as ab,_o as b,ho as c,no as d,er as e,No as f,sr as g,Vo as h,ur as i,To as j,Eo as k,bo as l,ko as m,Mo as n,Ao as o,Ro as p,Po as q,lo as r,uo as s,Lo as t,qo as u,fo as v,go as w,vo as x,wo as y,yo as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js index adc2d93c..35a3b642 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-8791d5c4.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-107d9fcb.js @@ -1 +1 @@ -import{ab as A}from"./index-e04968a0.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-5d57cf15.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-229a49b5.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c0153d25.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-229a49b5.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c0153d25.js index 7c8b643f..f67cd293 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-229a49b5.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-c0153d25.js @@ -1 +1 @@ -import{d as E,a as V,_ as W,b as J,c as U}from"./content-17b86479.js";import{d as Y,H as G,c as q,r as K,e as l,f as x,k as a,al as Q,w as n,j as u,F as X,u as Z,y as h,bf as i,A as _,x as d,q as c,Y as r,h as z}from"./@vue-a481fc63.js";import{u as ee}from"./vuex-44de225f.js";import{u as te}from"./vue-router-e5a2430e.js";import{U as se,A as oe,B as ne}from"./index-e04968a0.js";import{c as ae}from"./copy-to-clipboard-4ef7d3eb.js";import{k as le,l as ie,n as ue,o as ce,r as re,s as pe,t as _e,J as de,R as me,q as ve}from"./@vicons-f0266f88.js";import{j as f,o as he,M as fe,e as ke,P as ge,a as ye,O as we}from"./naive-ui-eecf2ec3.js";const be={class:"post-item"},Ce={class:"nickname-wrap"},xe={class:"username-wrap"},$e={class:"timestamp-mobile"},Oe={class:"item-header-extra"},qe=["innerHTML"],ze=["onClick"],Te=["onClick"],We=Y({__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(T,{emit:g}){const o=T,y=te(),$=ee(),w=G(!0),m=t=>()=>z(f,null,{default:()=>z(t)}),S=q(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:m(re)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:m(pe)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:m(_e)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:m(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:m(me)})),t.push({label:"复制链接",key:"copyTweetLink",icon:m(ve)}),t}),B=async t=>{switch(t){case"copyTweetLink":ae(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",o.post.user);break;case"delete":case"requesting":g("handle-friend-action",o.post);break;case"follow":case"unfollow":g("handle-follow-action",o.post);break}},e=q({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),F=()=>{oe({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=()=>{ne({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)})},b=t=>{y.push({name:"post",query:{id:t}})},A=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&($.commit("refresh"),v[0]==="tag"?y.push({name:"home",query:{q:v[1],t:"tag"}}):y.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?w.value=!w.value:b(s)};return(t,s)=>{const p=he,v=K("router-link"),C=fe,L=ke,M=ge,O=V,H=W,j=J,D=U,I=ye,N=we;return l(),x("div",be,[a(N,{"content-indented":""},Q({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",Ce,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[_(d(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",xe," @"+d(e.value.user.username),1),e.value.is_top?(l(),c(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",$e,d(i(se)(e.value.created_on))+" "+d(e.value.ip_loc),1)])]),"header-extra":n(()=>[u("div",Oe,[a(M,{placement:"bottom-end",trigger:"click",size:"small",options:S.value,onSelect:B},{default:n(()=>[a(L,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(le))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{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(H,{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:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item",onClick:h(F,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ie))]),_:1}),_(" "+d(e.value.upvote_count),1)],8,ze),u("div",{class:"opt-item",onClick:s[3]||(s[3]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),_(" "+d(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),_(" "+d(e.value.collection_count),1)],8,Te)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[u("div",{onClick:s[2]||(s[2]=k=>b(e.value.id))},[(l(!0),x(X,null,Z(e.value.texts,k=>(l(),x("span",{key:k.id,class:"post-text",onClick:s[1]||(s[1]=h(R=>A(R,e.value.id),["stop"])),innerHTML:i(E)(k.content,"展开","收起",i($).state.profile.tweetMobileEllipsisSize,w.value)},null,8,qe))),128))])]),key:"0"}:void 0]),1024)])}}});const Se={class:"nickname-wrap"},Be={class:"username-wrap"},Fe={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Le=["onClick"],Me=["onClick"],Je=Y({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(T,{emit:g}){const o=T,y=te(),$=ee(),w=G(!0),m=t=>()=>z(f,null,{default:()=>z(t)}),S=q(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:m(re)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:m(pe)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:m(_e)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:m(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:m(me)})),t.push({label:"复制链接",key:"copyTweetLink",icon:m(ve)}),t}),B=async t=>{switch(t){case"copyTweetLink":ae(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",o.post.user);break;case"delete":case"requesting":g("handle-friend-action",o.post);break;case"follow":case"unfollow":g("handle-follow-action",o.post);break}},e=q({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),F=()=>{oe({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=()=>{ne({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)})},b=t=>{y.push({name:"post",query:{id:t}})},A=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&($.commit("refresh"),v[0]==="tag"?y.push({name:"home",query:{q:v[1],t:"tag"}}):y.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?w.value=!w.value:b(s)};return(t,s)=>{const p=he,v=K("router-link"),C=fe,L=ke,M=ge,O=V,H=W,j=J,D=U,I=ye,N=we;return l(),x("div",{class:"post-item",onClick:s[3]||(s[3]=k=>b(e.value.id))},[a(N,{"content-indented":""},Q({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",Se,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[_(d(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Be," @"+d(e.value.user.username),1),e.value.is_top?(l(),c(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":n(()=>[u("div",Fe,[u("span",Pe,d(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+d(i(se)(e.value.created_on)),1),a(M,{placement:"bottom-end",trigger:"hover",size:"small",options:S.value,onSelect:B},{default:n(()=>[a(L,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(le))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{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(H,{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:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item hover",onClick:h(F,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ie))]),_:1}),_(" "+d(e.value.upvote_count),1)],8,Le),u("div",{class:"opt-item hover",onClick:s[2]||(s[2]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),_(" "+d(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),_(" "+d(e.value.collection_count),1)],8,Me)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[(l(!0),x(X,null,Z(e.value.texts,k=>(l(),x("span",{key:k.id,class:"post-text hover",onClick:s[1]||(s[1]=h(R=>A(R,e.value.id),["stop"])),innerHTML:i(E)(k.content,"展开","收起",i($).state.profile.tweetWebEllipsisSize,w.value)},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Je as _,We as a}; +import{d as E,a as V,_ as W,b as J,c as U}from"./content-d5e071f1.js";import{d as Y,H as G,c as q,r as K,e as l,f as x,k as a,al as Q,w as n,j as u,F as X,u as Z,y as h,bf as i,A as _,x as d,q as c,Y as r,h as z}from"./@vue-a481fc63.js";import{u as ee}from"./vuex-44de225f.js";import{u as te}from"./vue-router-e5a2430e.js";import{U as se,A as oe,B as ne}from"./index-5d57cf15.js";import{c as ae}from"./copy-to-clipboard-4ef7d3eb.js";import{k as le,l as ie,n as ue,o as ce,r as re,s as pe,t as _e,J as de,R as me,q as ve}from"./@vicons-f0266f88.js";import{j as f,o as he,M as fe,e as ke,P as ge,a as ye,O as we}from"./naive-ui-eecf2ec3.js";const be={class:"post-item"},Ce={class:"nickname-wrap"},xe={class:"username-wrap"},$e={class:"timestamp-mobile"},Oe={class:"item-header-extra"},qe=["innerHTML"],ze=["onClick"],Te=["onClick"],We=Y({__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(T,{emit:g}){const o=T,y=te(),$=ee(),w=G(!0),m=t=>()=>z(f,null,{default:()=>z(t)}),S=q(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:m(re)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:m(pe)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:m(_e)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:m(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:m(me)})),t.push({label:"复制链接",key:"copyTweetLink",icon:m(ve)}),t}),B=async t=>{switch(t){case"copyTweetLink":ae(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",o.post.user);break;case"delete":case"requesting":g("handle-friend-action",o.post);break;case"follow":case"unfollow":g("handle-follow-action",o.post);break}},e=q({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),F=()=>{oe({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=()=>{ne({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)})},b=t=>{y.push({name:"post",query:{id:t}})},A=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&($.commit("refresh"),v[0]==="tag"?y.push({name:"home",query:{q:v[1],t:"tag"}}):y.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?w.value=!w.value:b(s)};return(t,s)=>{const p=he,v=K("router-link"),C=fe,L=ke,M=ge,O=V,H=W,j=J,D=U,I=ye,N=we;return l(),x("div",be,[a(N,{"content-indented":""},Q({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",Ce,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[_(d(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",xe," @"+d(e.value.user.username),1),e.value.is_top?(l(),c(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",$e,d(i(se)(e.value.created_on))+" "+d(e.value.ip_loc),1)])]),"header-extra":n(()=>[u("div",Oe,[a(M,{placement:"bottom-end",trigger:"click",size:"small",options:S.value,onSelect:B},{default:n(()=>[a(L,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(le))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{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(H,{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:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item",onClick:h(F,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ie))]),_:1}),_(" "+d(e.value.upvote_count),1)],8,ze),u("div",{class:"opt-item",onClick:s[3]||(s[3]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),_(" "+d(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),_(" "+d(e.value.collection_count),1)],8,Te)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[u("div",{onClick:s[2]||(s[2]=k=>b(e.value.id))},[(l(!0),x(X,null,Z(e.value.texts,k=>(l(),x("span",{key:k.id,class:"post-text",onClick:s[1]||(s[1]=h(R=>A(R,e.value.id),["stop"])),innerHTML:i(E)(k.content,"展开","收起",i($).state.profile.tweetMobileEllipsisSize,w.value)},null,8,qe))),128))])]),key:"0"}:void 0]),1024)])}}});const Se={class:"nickname-wrap"},Be={class:"username-wrap"},Fe={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Le=["onClick"],Me=["onClick"],Je=Y({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(T,{emit:g}){const o=T,y=te(),$=ee(),w=G(!0),m=t=>()=>z(f,null,{default:()=>z(t)}),S=q(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:m(re)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:m(pe)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:m(_e)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:m(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:m(me)})),t.push({label:"复制链接",key:"copyTweetLink",icon:m(ve)}),t}),B=async t=>{switch(t){case"copyTweetLink":ae(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":g("send-whisper",o.post.user);break;case"delete":case"requesting":g("handle-friend-action",o.post);break;case"follow":case"unfollow":g("handle-follow-action",o.post);break}},e=q({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),F=()=>{oe({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=()=>{ne({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)})},b=t=>{y.push({name:"post",query:{id:t}})},A=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&($.commit("refresh"),v[0]==="tag"?y.push({name:"home",query:{q:v[1],t:"tag"}}):y.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?w.value=!w.value:b(s)};return(t,s)=>{const p=he,v=K("router-link"),C=fe,L=ke,M=ge,O=V,H=W,j=J,D=U,I=ye,N=we;return l(),x("div",{class:"post-item",onClick:s[3]||(s[3]=k=>b(e.value.id))},[a(N,{"content-indented":""},Q({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",Se,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[_(d(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Be," @"+d(e.value.user.username),1),e.value.is_top?(l(),c(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":n(()=>[u("div",Fe,[u("span",Pe,d(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+d(i(se)(e.value.created_on)),1),a(M,{placement:"bottom-end",trigger:"hover",size:"small",options:S.value,onSelect:B},{default:n(()=>[a(L,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(le))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{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(H,{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:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item hover",onClick:h(F,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ie))]),_:1}),_(" "+d(e.value.upvote_count),1)],8,Le),u("div",{class:"opt-item hover",onClick:s[2]||(s[2]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),_(" "+d(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),_(" "+d(e.value.collection_count),1)],8,Me)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[(l(!0),x(X,null,Z(e.value.texts,k=>(l(),x("span",{key:k.id,class:"post-text hover",onClick:s[1]||(s[1]=h(R=>A(R,e.value.id),["stop"])),innerHTML:i(E)(k.content,"展开","收起",i($).state.profile.tweetWebEllipsisSize,w.value)},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Je as _,We as a}; diff --git a/web/dist/assets/post-skeleton-4a65c483.js b/web/dist/assets/post-skeleton-65699bcb.js similarity index 88% rename from web/dist/assets/post-skeleton-4a65c483.js rename to web/dist/assets/post-skeleton-65699bcb.js index 52be0421..9769597e 100644 --- a/web/dist/assets/post-skeleton-4a65c483.js +++ b/web/dist/assets/post-skeleton-65699bcb.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-e04968a0.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-5d57cf15.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-a090f673.js b/web/dist/assets/whisper-5534d7cd.js similarity index 95% rename from web/dist/assets/whisper-a090f673.js rename to web/dist/assets/whisper-5534d7cd.js index 58ce21a9..1692329a 100644 --- a/web/dist/assets/whisper-a090f673.js +++ b/web/dist/assets/whisper-5534d7cd.js @@ -1 +1 @@ -import{$ as b,_ as k}from"./index-e04968a0.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-5d57cf15.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-035a8849.js b/web/dist/assets/whisper-add-friend-78948174.js similarity index 95% rename from web/dist/assets/whisper-add-friend-035a8849.js rename to web/dist/assets/whisper-add-friend-78948174.js index c1ffd957..41a1cc7e 100644 --- a/web/dist/assets/whisper-add-friend-035a8849.js +++ b/web/dist/assets/whisper-add-friend-78948174.js @@ -1 +1 @@ -import{N as b,_ as k}from"./index-e04968a0.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-5d57cf15.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 b8f2507d..fdf972f1 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/views/Following.vue b/web/src/views/Following.vue index cfe866ef..e1ad214a 100644 --- a/web/src/views/Following.vue +++ b/web/src/views/Following.vue @@ -66,6 +66,15 @@ const whisperReceiver = ref({ status: 1, }); +function resetPage(tab: "follows" | "followings") { + list.value = []; + loading.value = false; + noMore.value = false; + page.value = 1; + totalPage.value = 0; + tabler.value = tab; +} + const completeStr = computed(() => { if (tabler.value == "follows") { return '没有更多关注了' @@ -94,7 +103,7 @@ const nextPage = () => { }; const changeTab = (tab: "follows" | "followings") => { - tabler.value = tab; + resetPage(tab); loadPage(); };