mirror of https://github.com/rocboss/paopao-ce
commit
eb24396c6d
@ -0,0 +1,66 @@
|
|||||||
|
// Code generated by go-mir. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - mir v4.0.0
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/alimy/mir/v4"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Relax interface {
|
||||||
|
_default_
|
||||||
|
|
||||||
|
// Chain provide handlers chain for gin
|
||||||
|
Chain() gin.HandlersChain
|
||||||
|
|
||||||
|
GetUnreadMsgCount(*web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error)
|
||||||
|
|
||||||
|
mustEmbedUnimplementedRelaxServant()
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterRelaxServant register Relax servant to gin
|
||||||
|
func RegisterRelaxServant(e *gin.Engine, s Relax) {
|
||||||
|
router := e.Group("v1")
|
||||||
|
// use chain for router
|
||||||
|
middlewares := s.Chain()
|
||||||
|
router.Use(middlewares...)
|
||||||
|
|
||||||
|
// register routes info to router
|
||||||
|
router.Handle("GET", "/user/msgcount/unread", func(c *gin.Context) {
|
||||||
|
select {
|
||||||
|
case <-c.Request.Context().Done():
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
req := new(web.GetUnreadMsgCountReq)
|
||||||
|
if err := s.Bind(c, req); err != nil {
|
||||||
|
s.Render(c, nil, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := s.GetUnreadMsgCount(req)
|
||||||
|
if err != nil {
|
||||||
|
s.Render(c, nil, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var rv _render_ = resp
|
||||||
|
rv.Render(c)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedRelaxServant can be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedRelaxServant struct{}
|
||||||
|
|
||||||
|
func (UnimplementedRelaxServant) Chain() gin.HandlersChain {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedRelaxServant) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) {
|
||||||
|
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedRelaxServant) mustEmbedUnimplementedRelaxServant() {}
|
After Width: | Height: | Size: 379 KiB |
@ -0,0 +1,30 @@
|
|||||||
|
// 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 conf
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alimy/tryst/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
_defaultKeyPoolSize = 128
|
||||||
|
)
|
||||||
|
|
||||||
|
// 以下包含一些在cache中会用到的池化后的key
|
||||||
|
var (
|
||||||
|
KeyUnreadMsg cache.KeyPool[int64]
|
||||||
|
)
|
||||||
|
|
||||||
|
func initCacheKeyPool() {
|
||||||
|
poolSize := _defaultKeyPoolSize
|
||||||
|
if poolSize < CacheSetting.KeyPoolSize {
|
||||||
|
poolSize = CacheSetting.KeyPoolSize
|
||||||
|
}
|
||||||
|
KeyUnreadMsg = cache.MustKeyPool[int64](poolSize, func(key int64) string {
|
||||||
|
return fmt.Sprintf("paopao:unreadmsg:%d", key)
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
// 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 cache
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/Masterminds/semver/v3"
|
||||||
|
"github.com/redis/rueidis"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/conf"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/core"
|
||||||
|
"github.com/rocboss/paopao-ce/pkg/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_webCache core.WebCache = (*redisWebCache)(nil)
|
||||||
|
)
|
||||||
|
|
||||||
|
type redisWebCache struct {
|
||||||
|
cscExpire time.Duration
|
||||||
|
unreadMsgExpire int64
|
||||||
|
c rueidis.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *redisWebCache) Name() string {
|
||||||
|
return "RedisWebCache"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *redisWebCache) Version() *semver.Version {
|
||||||
|
return semver.MustParse("v0.1.0")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *redisWebCache) GetUnreadMsgCountResp(uid int64) ([]byte, error) {
|
||||||
|
key := conf.KeyUnreadMsg.Get(uid)
|
||||||
|
res, err := rueidis.MGetCache(s.c, context.Background(), s.cscExpire, []string{key})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
message := res[key]
|
||||||
|
return message.AsBytes()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *redisWebCache) PutUnreadMsgCountResp(uid int64, data []byte) error {
|
||||||
|
return s.c.Do(context.Background(), s.c.B().Set().
|
||||||
|
Key(conf.KeyUnreadMsg.Get(uid)).
|
||||||
|
Value(utils.String(data)).
|
||||||
|
ExSeconds(s.unreadMsgExpire).
|
||||||
|
Build()).
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *redisWebCache) DelUnreadMsgCountResp(uid int64) error {
|
||||||
|
return s.c.Do(context.Background(), s.c.B().Del().Key(conf.KeyUnreadMsg.Get(uid)).Build()).Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
func newWebCache() *redisWebCache {
|
||||||
|
s := conf.CacheSetting
|
||||||
|
return &redisWebCache{
|
||||||
|
cscExpire: s.CientSideCacheExpire,
|
||||||
|
unreadMsgExpire: s.UnreadMsgExpire,
|
||||||
|
c: conf.MustRedisClient(),
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
// 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 events
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/alimy/tryst/cfg"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_onceInitial sync.Once
|
||||||
|
)
|
||||||
|
|
||||||
|
func Initial() {
|
||||||
|
_onceInitial.Do(func() {
|
||||||
|
initEventManager()
|
||||||
|
if cfg.If("JobManager") {
|
||||||
|
initJobManager()
|
||||||
|
logrus.Debugln("initial JobManager")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
// 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 events
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/robfig/cron/v3"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_defaultJobManager JobManager = (*jobManager)(nil)
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
EntryID = cron.EntryID
|
||||||
|
)
|
||||||
|
|
||||||
|
// JobFn job help function that implement cron.Job interface
|
||||||
|
type JobFn func()
|
||||||
|
|
||||||
|
func (fn JobFn) Run() {
|
||||||
|
fn()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Job job interface
|
||||||
|
type Job interface {
|
||||||
|
cron.Schedule
|
||||||
|
cron.Job
|
||||||
|
}
|
||||||
|
|
||||||
|
type simpleJob struct {
|
||||||
|
cron.Schedule
|
||||||
|
cron.Job
|
||||||
|
}
|
||||||
|
|
||||||
|
// JobManager job manger interface
|
||||||
|
type JobManager interface {
|
||||||
|
Start()
|
||||||
|
Stop()
|
||||||
|
Remove(id EntryID)
|
||||||
|
Schedule(Job) EntryID
|
||||||
|
}
|
||||||
|
|
||||||
|
type jobManager struct {
|
||||||
|
m *cron.Cron
|
||||||
|
}
|
||||||
|
|
||||||
|
func (j *jobManager) Start() {
|
||||||
|
j.m.Start()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (j *jobManager) Stop() {
|
||||||
|
j.m.Stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove an entry from being run in the future.
|
||||||
|
func (j *jobManager) Remove(id EntryID) {
|
||||||
|
j.m.Remove(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Schedule adds a Job to the Cron to be run on the given schedule.
|
||||||
|
// The job is wrapped with the configured Chain.
|
||||||
|
func (j *jobManager) Schedule(job Job) EntryID {
|
||||||
|
return j.m.Schedule(job, job)
|
||||||
|
}
|
||||||
|
|
||||||
|
func initJobManager() {
|
||||||
|
_defaultJobManager = &jobManager{
|
||||||
|
m: cron.New(),
|
||||||
|
}
|
||||||
|
StartJobManager()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StartJobManager() {
|
||||||
|
_defaultJobManager.Start()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StopJobManager() {
|
||||||
|
_defaultJobManager.Stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewJob create new Job instance
|
||||||
|
func NewJob(s cron.Schedule, fn JobFn) Job {
|
||||||
|
return &simpleJob{
|
||||||
|
Schedule: s,
|
||||||
|
Job: fn,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveJob an entry from being run in the future.
|
||||||
|
func RemoveJob(id EntryID) {
|
||||||
|
_defaultJobManager.Remove(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ScheduleJob adds a Job to the Cron to be run on the given schedule.
|
||||||
|
// The job is wrapped with the configured Chain.
|
||||||
|
func ScheduleJob(job Job) EntryID {
|
||||||
|
return _defaultJobManager.Schedule(job)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Schedule adds a Job to the Cron to be run on the given schedule.
|
||||||
|
// The job is wrapped with the configured Chain.
|
||||||
|
func Schedule(s cron.Schedule, fn JobFn) EntryID {
|
||||||
|
job := &simpleJob{
|
||||||
|
Schedule: s,
|
||||||
|
Job: fn,
|
||||||
|
}
|
||||||
|
return _defaultJobManager.Schedule(job)
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
// 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 events
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/alimy/tryst/event"
|
||||||
|
"github.com/alimy/tryst/pool"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/conf"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_defaultEventManager event.EventManager
|
||||||
|
)
|
||||||
|
|
||||||
|
func initEventManager() {
|
||||||
|
var opts []pool.Option
|
||||||
|
s := conf.EventManagerSetting
|
||||||
|
if s.MinWorker > 5 {
|
||||||
|
opts = append(opts, pool.MinWorkerOpt(s.MinWorker))
|
||||||
|
} else {
|
||||||
|
opts = append(opts, pool.MinWorkerOpt(5))
|
||||||
|
}
|
||||||
|
if s.MaxEventBuf > 10 {
|
||||||
|
opts = append(opts, pool.MaxRequestBufOpt(s.MaxEventBuf))
|
||||||
|
} else {
|
||||||
|
opts = append(opts, pool.MaxRequestBufOpt(10))
|
||||||
|
}
|
||||||
|
if s.MaxTempEventBuf > 10 {
|
||||||
|
opts = append(opts, pool.MaxRequestTempBufOpt(s.MaxTempEventBuf))
|
||||||
|
} else {
|
||||||
|
opts = append(opts, pool.MaxRequestTempBufOpt(10))
|
||||||
|
}
|
||||||
|
opts = append(opts, pool.MaxTickCountOpt(s.MaxTickCount), pool.TickWaitTimeOpt(s.TickWaitTime))
|
||||||
|
_defaultEventManager = event.NewEventManager(func(req event.Event, err error) {
|
||||||
|
if err != nil {
|
||||||
|
logrus.Errorf("handle event[%s] occurs error: %s", req.Name(), err)
|
||||||
|
}
|
||||||
|
}, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StartEventManager() {
|
||||||
|
_defaultEventManager.Start()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StopEventManager() {
|
||||||
|
_defaultEventManager.Stop()
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnEvent push event to gorotine pool then handled automatic.
|
||||||
|
func OnEvent(event event.Event) {
|
||||||
|
_defaultEventManager.OnEvent(event)
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
// 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 joint
|
||||||
|
|
||||||
|
import (
|
||||||
|
stdJson "encoding/json"
|
||||||
|
|
||||||
|
"github.com/rocboss/paopao-ce/pkg/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
func RespMarshal(data any) (stdJson.RawMessage, error) {
|
||||||
|
return json.Marshal(data)
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2023 ROC. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/joint"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetUnreadMsgCountReq struct {
|
||||||
|
SimpleInfo `json:"-" binding:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetUnreadMsgCountResp struct {
|
||||||
|
Count int64 `json:"count"`
|
||||||
|
JsonResp json.RawMessage `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *GetUnreadMsgCountResp) Render(c *gin.Context) {
|
||||||
|
if len(r.JsonResp) != 0 {
|
||||||
|
c.JSON(http.StatusOK, r.JsonResp)
|
||||||
|
} else {
|
||||||
|
c.JSON(http.StatusOK, &joint.JsonResp{
|
||||||
|
Code: 0,
|
||||||
|
Msg: "success",
|
||||||
|
Data: r,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -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 base
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/alimy/tryst/event"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/core/ms"
|
||||||
|
)
|
||||||
|
|
||||||
|
type pushPostToSearchEvent struct {
|
||||||
|
event.UnimplementedEvent
|
||||||
|
fn func(*ms.Post)
|
||||||
|
post *ms.Post
|
||||||
|
}
|
||||||
|
|
||||||
|
type pushAllPostToSearchEvent struct {
|
||||||
|
event.UnimplementedEvent
|
||||||
|
fn func() error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *pushPostToSearchEvent) Name() string {
|
||||||
|
return "servants.base.pushPostToSearchEvent"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *pushPostToSearchEvent) Action() (err error) {
|
||||||
|
p.fn(p.post)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *pushAllPostToSearchEvent) Name() string {
|
||||||
|
return "servants.base.pushAllPostToSearchEvent"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *pushAllPostToSearchEvent) Action() error {
|
||||||
|
return p.fn()
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
// Copyright 2023 ROC. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/alimy/tryst/event"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/core"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/core/ms"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/events"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/joint"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
type cacheUnreadMsgEvent struct {
|
||||||
|
event.UnimplementedEvent
|
||||||
|
ds core.DataService
|
||||||
|
wc core.WebCache
|
||||||
|
uid int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type createMessageEvent struct {
|
||||||
|
event.UnimplementedEvent
|
||||||
|
ds core.DataService
|
||||||
|
wc core.WebCache
|
||||||
|
message *ms.Message
|
||||||
|
}
|
||||||
|
|
||||||
|
func onCacheUnreadMsgEvent(uid int64) {
|
||||||
|
events.OnEvent(&cacheUnreadMsgEvent{
|
||||||
|
ds: _ds,
|
||||||
|
wc: _wc,
|
||||||
|
uid: uid,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func onCreateMessageEvent(data *ms.Message) {
|
||||||
|
events.OnEvent(&createMessageEvent{
|
||||||
|
ds: _ds,
|
||||||
|
wc: _wc,
|
||||||
|
message: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *cacheUnreadMsgEvent) Name() string {
|
||||||
|
return "cacheUnreadMsgEvent"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *cacheUnreadMsgEvent) Action() error {
|
||||||
|
count, err := e.ds.GetUnreadCount(e.uid)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cacheUnreadMsgEvent action occurs error: %w", err)
|
||||||
|
}
|
||||||
|
resp := &joint.JsonResp{
|
||||||
|
Code: 0,
|
||||||
|
Msg: "success",
|
||||||
|
Data: &web.GetUnreadMsgCountResp{
|
||||||
|
Count: count,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
data, err := json.Marshal(resp)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cacheUnreadMsgEvent action marshal resp occurs error: %w", err)
|
||||||
|
}
|
||||||
|
if err = e.wc.PutUnreadMsgCountResp(e.uid, data); err != nil {
|
||||||
|
return fmt.Errorf("cacheUnreadMsgEvent action put resp data to redis cache occurs error: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *createMessageEvent) Name() string {
|
||||||
|
return "createMessageEvent"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *createMessageEvent) Action() (err error) {
|
||||||
|
if _, err = e.ds.CreateMessage(e.message); err == nil {
|
||||||
|
err = e.wc.DelUnreadMsgCountResp(e.message.ReceiverUserID)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
// Copyright 2023 ROC. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/alimy/mir/v4"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/redis/rueidis"
|
||||||
|
api "github.com/rocboss/paopao-ce/auto/api/v1"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/core"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/web"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/servants/base"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/servants/chain"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ api.Relax = (*relaxSrv)(nil)
|
||||||
|
)
|
||||||
|
|
||||||
|
type relaxSrv struct {
|
||||||
|
api.UnimplementedRelaxServant
|
||||||
|
*base.DaoServant
|
||||||
|
wc core.WebCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *relaxSrv) Chain() gin.HandlersChain {
|
||||||
|
return gin.HandlersChain{chain.JwtSurely()}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *relaxSrv) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnreadMsgCountResp, mir.Error) {
|
||||||
|
if data, xerr := s.wc.GetUnreadMsgCountResp(req.Uid); xerr == nil && len(data) > 0 {
|
||||||
|
// logrus.Debugln("GetUnreadMsgCount get resp from cache")
|
||||||
|
return &web.GetUnreadMsgCountResp{
|
||||||
|
JsonResp: data,
|
||||||
|
}, nil
|
||||||
|
} else if !rueidis.IsRedisNil(xerr) {
|
||||||
|
logrus.Warnf("GetUnreadMsgCount from cache occurs error: %s", xerr)
|
||||||
|
}
|
||||||
|
// 使用缓存机制特殊处理
|
||||||
|
onCacheUnreadMsgEvent(req.Uid)
|
||||||
|
return &web.GetUnreadMsgCountResp{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func newRelaxSrv(s *base.DaoServant, wc core.WebCache) api.Relax {
|
||||||
|
return &relaxSrv{
|
||||||
|
DaoServant: s,
|
||||||
|
wc: wc,
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
. "github.com/alimy/mir/v4"
|
||||||
|
. "github.com/alimy/mir/v4/engine"
|
||||||
|
"github.com/rocboss/paopao-ce/internal/model/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Entry[Relax]()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Relax 放宽授权的服务
|
||||||
|
type Relax struct {
|
||||||
|
Chain `mir:"-"`
|
||||||
|
Group `mir:"v1"`
|
||||||
|
|
||||||
|
// GetUnreadMsgCount 获取当前用户未读消息数量
|
||||||
|
GetUnreadMsgCount func(Get, web.GetUnreadMsgCountReq) web.GetUnreadMsgCountResp `mir:"/user/msgcount/unread"`
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# eg.1 : sh run.sh
|
||||||
|
# eg.2, push all release: sh run.sh push
|
||||||
|
# eg.3, push all release with dev branch: sh run.sh push dev
|
||||||
|
|
||||||
|
function push {
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
echo "git push origin $1:$1"
|
||||||
|
git push origin $1:$1
|
||||||
|
|
||||||
|
echo "git push alimy $1:$1"
|
||||||
|
git push alimy $1:$1
|
||||||
|
|
||||||
|
echo "git push bitbus $1:$1"
|
||||||
|
git push bitbus $1:$1
|
||||||
|
else
|
||||||
|
push_all dev r/paopao-ce r/paopao-ce-plus r/paopao-ce-pro r/paopao-ce-xtra
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function push_all {
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
push
|
||||||
|
else
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
push $1
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"push")
|
||||||
|
shift
|
||||||
|
push_all $@
|
||||||
|
;;
|
||||||
|
"merge")
|
||||||
|
echo "merge command"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
push_all
|
||||||
|
;;
|
||||||
|
esac
|
@ -1,3 +1,3 @@
|
|||||||
ALTER TABLE p_post_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT '';
|
ALTER TABLE p_post_content ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT '';
|
||||||
ALTER TABLE p_comment_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT '';
|
ALTER TABLE p_comment_content ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT '';
|
||||||
ALTER TABLE p_comment_reply ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT '';
|
ALTER TABLE p_comment_reply ALTER COLUMN content SET DATA TYPE TEXT, ALTER COLUMN content SET NOT NULL, ALTER COLUMN content SET DEFAULT '';
|
||||||
|
@ -1 +0,0 @@
|
|||||||
import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as a}from"./vue-router-edf90322.js";import{F as i,e as c,a2 as u}from"./naive-ui-702193c2.js";import{d as l,c as d,V as t,a2 as o,o as f,e as x}from"./@vue-7e1ab0af.js";import{_ as g}from"./index-b4b0f710.js";import"./vuex-f1ee712f.js";import"./vooks-e23078ea.js";import"./evtd-b614532e.js";import"./@vicons-b98681e0.js";import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./@css-render-16be7445.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default};
|
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-5497f713.js";import{u as a}from"./vue-router-e5a2430e.js";import{F as i,e as c,a2 as u}from"./naive-ui-d8de3dda.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-d9671de1.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default};
|
@ -1,3 +1,3 @@
|
|||||||
import{i as d}from"./@vue-7e1ab0af.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return`<style cssr-id="${i}">
|
import{i as d}from"./@vue-a481fc63.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return`<style cssr-id="${i}">
|
||||||
${r}
|
${r}
|
||||||
</style>`}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u};
|
</style>`}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
import{_ as F}from"./post-skeleton-3703f541.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as V}from"./vuex-f1ee712f.js";import{b as z}from"./vue-router-edf90322.js";import{a as A}from"./formatTime-4210fcd1.js";import{F as R,Q as S,H as L,G as M}from"./naive-ui-702193c2.js";import{d as O,r as n,j as P,c as o,V as a,a2 as p,o as e,_ as u,O as l,F as Q,a5 as j,Q as q,a as s,M as _,L as D}from"./@vue-7e1ab0af.js";import{_ as E}from"./index-b4b0f710.js";import"./vooks-e23078ea.js";import"./evtd-b614532e.js";import"./@vicons-b98681e0.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./@css-render-16be7445.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},I={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=O({__name:"Anouncement",setup(J){const d=V(),g=z(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return P(()=>{}),(m,K)=>{const y=N,k=S,x=F,w=L,B=M,C=R;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",I,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(Q,null,j(r.value,t=>(e(),q(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:D({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default};
|
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as F}from"./post-skeleton-73b6be04.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-5497f713.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{a as R}from"./formatTime-4210fcd1.js";import{F as S,Q as V,I as q,G as I}from"./naive-ui-d8de3dda.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as H}from"./@vue-a481fc63.js";import{_ as L}from"./index-d9671de1.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-7a4ef312.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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";/* empty css */const M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={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),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return j(()=>{}),(c,J)=>{const k=N,y=V,x=F,w=q,B=I,C=S;return e(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(e(),o("div",M,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",O,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(D,null,E(r.value,t=>(e(),G(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:H({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const yt=L(Y,[["__scopeId","data-v-d4d04859"]]);export{yt as default};
|
@ -1 +0,0 @@
|
|||||||
import{_ as N,a as P}from"./post-item.vue_vue_type_style_index_0_lang-ebd1ae42.js";import{_ as S}from"./post-skeleton-3703f541.js";import{_ as V}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as $}from"./vuex-f1ee712f.js";import{b as Q}from"./vue-router-edf90322.js";import{N as R,_ as j}from"./index-b4b0f710.js";import{d as q,r as s,j as E,c as o,V as e,a2 as c,_ as g,O as v,o as t,F as f,a5 as h,Q as k}from"./@vue-7e1ab0af.js";import{F as G,Q as H,H as I,G as L}from"./naive-ui-702193c2.js";import"./content-1c30deb5.js";import"./@vicons-b98681e0.js";import"./paopao-video-player-66a1a537.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-e23078ea.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./@css-render-16be7445.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const O={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},K=q({__name:"Collection",setup(W){const m=$(),y=Q(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,R({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return E(()=>{u()}),(n,X)=>{const C=V,b=S,x=I,z=N,d=L,B=P,F=G,M=H;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Nt=j(K,[["__scopeId","data-v-a5302c9b"]]);export{Nt as default};
|
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as q}from"./whisper-24717711.js";import{_ as I,a as V}from"./post-item.vue_vue_type_style_index_0_lang-369aa3bd.js";import{_ as W}from"./post-skeleton-73b6be04.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-5497f713.js";import{u as G}from"./vuex-44de225f.js";import{b as H}from"./vue-router-e5a2430e.js";import{N as L,_ as Q}from"./index-d9671de1.js";import{d as T,H as s,b as U,f as o,k as n,w as u,bf as h,Y as w,e,F as k,u as y,q as C}from"./@vue-a481fc63.js";import{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-cbd53e51.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.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";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 J={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},X={key:1},Z={key:2},ee={key:0,class:"pagination-wrap"},oe=T({__name:"Collection",setup(te){const m=G(),S=H(),_=s(!1),i=s([]),l=s(+S.query.p||1),p=s(20),r=s(0),c=s(!1),d=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),f=t=>{d.value=t,c.value=!0},b=()=>{c.value=!1},v=()=>{_.value=!0,L({page:l.value,page_size:p.value}).then(t=>{_.value=!1,i.value=t.list,r.value=Math.ceil(t.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(t=>{_.value=!1})},x=t=>{l.value=t,v()};return U(()=>{v()}),(t,ne)=>{const $=E,z=W,B=A,F=I,g=D,M=V,N=q,P=Y,R=j;return e(),o("div",null,[n($,{title:"收藏"}),n(P,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{size:"large",description:"暂无数据"})])):w("",!0),h(m).state.desktopModelShow?(e(),o("div",X,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(F,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))])):(e(),o("div",Z,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(M,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))]))])),n(N,{show:c.value,user:d.value,onSuccess:b},null,8,["show","user"])]),_:1}),r.value>0?(e(),o("div",ee,[n(R,{page:l.value,"onUpdate:page":x,"page-slot":h(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):w("",!0)])}}});const Ve=Q(oe,[["__scopeId","data-v-760779af"]]);export{Ve as default};
|
@ -0,0 +1 @@
|
|||||||
|
.pagination-wrap[data-v-760779af]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-760779af],.dark .empty-wrap[data-v-760779af],.dark .skeleton-wrap[data-v-760779af]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
|||||||
.pagination-wrap[data-v-a5302c9b]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-a5302c9b],.dark .empty-wrap[data-v-a5302c9b],.dark .skeleton-wrap[data-v-a5302c9b]{background-color:#101014bf}
|
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as T}from"./whisper-24717711.js";import{d as N,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as z,u as W,q as E}from"./@vue-a481fc63.js";import{b as G}from"./formatTime-4210fcd1.js";import{i as Q,p as Y}from"./@vicons-7a4ef312.js";import{j as x,o as J,e as K,O as X,L as Z,F as ee,Q as te,I as ne,G as oe}from"./naive-ui-d8de3dda.js";import{_ as q,b as se}from"./index-d9671de1.js";import{_ as ae}from"./post-skeleton-73b6be04.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-5497f713.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}from"./vue-router-e5a2430e.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./axios-4a70c6fc.js";/* empty css */const re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:h}){const _=b,r=e=>()=>I(x,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=J,d=A("router-link"),w=K,k=X,y=Z;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(x),null,{default:n(()=>[t(g(Q))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=q(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},be=N({__name:"Contacts",setup(b){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,C()};U(()=>{C()});const C=(p=!1)=>{l.value.length===0&&(r.value=!0),se({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const B=ce,F=ae,M=ne,P=ge,V=oe,D=T,O=ee,R=te;return s(),c(z,null,[i("div",null,[t(B,{title:"好友"}),t(O,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(F,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):S("",!0),(s(!0),c(z,null,W(l.value,$=>(s(),E(V,{class:"list-item",key:$.user_id},{default:n(()=>[t(P,{contact:$,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(R,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):S("",!0)],64)}}});const Ye=q(be,[["__scopeId","data-v-e20fef94"]]);export{Ye as default};
|
@ -0,0 +1 @@
|
|||||||
|
.contact-item[data-v-d62f19da]{width:100%;box-sizing:border-box;padding:12px 16px}.contact-item[data-v-d62f19da]:hover{background:#f7f9f9}.contact-item .nickname-wrap[data-v-d62f19da],.contact-item .username-wrap[data-v-d62f19da]{line-height:16px;font-size:16px}.contact-item .top-tag[data-v-d62f19da]{transform:scale(.75)}.contact-item .user-info .info-item[data-v-d62f19da]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.contact-item .item-header-extra[data-v-d62f19da]{display:flex;align-items:center;opacity:.75}.dark .contact-item[data-v-d62f19da]{background-color:#101014bf}.dark .contact-item[data-v-d62f19da]:hover{background:#18181c}.pagination-wrap[data-v-e20fef94]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-e20fef94],.dark .empty-wrap[data-v-e20fef94],.dark .skeleton-wrap[data-v-e20fef94]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
|||||||
import{u as N,b as P}from"./vue-router-edf90322.js";import{b as Q}from"./formatTime-4210fcd1.js";import{d as k,o,c as s,a as e,V as a,M as l,_ as C,r as c,j as R,a2 as f,O as h,F as y,a5 as S,Q as U}from"./@vue-7e1ab0af.js";import{o as q,F as T,Q as j,H as x,G as E}from"./naive-ui-702193c2.js";import{_ as b,Q as G}from"./index-b4b0f710.js";import{_ as H}from"./post-skeleton-3703f541.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as O}from"./vuex-f1ee712f.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./evtd-b614532e.js";import"./@css-render-16be7445.js";import"./vooks-e23078ea.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./@vicons-b98681e0.js";/* empty css */const A={class:"avatar"},J={class:"base-info"},K={class:"username"},W={class:"user-info"},X={class:"info-item"},Y={class:"info-item"},Z=k({__name:"contact-item",props:{contact:{}},setup(w){const u=N(),m=t=>{u.push({name:"user",query:{s:t}})};return(t,n)=>{const _=q;return o(),s("div",{class:"contact-item",onClick:n[0]||(n[0]=i=>m(t.contact.username))},[e("div",A,[a(_,{size:54,src:t.contact.avatar},null,8,["src"])]),e("div",J,[e("div",K,[e("strong",null,l(t.contact.nickname),1),e("span",null," @"+l(t.contact.username),1)]),e("div",W,[e("span",X,"UID. "+l(t.contact.user_id),1),e("span",Y,l(C(Q)(t.contact.created_on))+" 加入",1)])])])}}});const tt=b(Z,[["__scopeId","data-v-644d2c15"]]),et={key:0,class:"skeleton-wrap"},ot={key:1},nt={key:0,class:"empty-wrap"},st={key:0,class:"pagination-wrap"},at=k({__name:"Contacts",setup(w){const u=O(),m=P(),t=c(!1),n=c([]),_=c(+m.query.p||1),i=c(20),d=c(0),$=r=>{_.value=r,v()};R(()=>{v()});const v=(r=!1)=>{n.value.length===0&&(t.value=!0),G({page:_.value,page_size:i.value}).then(p=>{t.value=!1,n.value=p.list,d.value=Math.ceil(p.pager.total_rows/i.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(r,p)=>{const z=L,B=H,I=x,V=tt,D=E,F=T,M=j;return o(),s(y,null,[e("div",null,[a(z,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(o(),s("div",et,[a(B,{num:i.value},null,8,["num"])])):(o(),s("div",ot,[n.value.length===0?(o(),s("div",nt,[a(I,{size:"large",description:"暂无数据"})])):h("",!0),(o(!0),s(y,null,S(n.value,g=>(o(),U(D,{key:g.user_id},{default:f(()=>[a(V,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(o(),s("div",st,[a(M,{page:_.value,"onUpdate:page":$,"page-slot":C(u).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const Mt=b(at,[["__scopeId","data-v-3b2bf978"]]);export{Mt as default};
|
|
@ -1 +0,0 @@
|
|||||||
.contact-item[data-v-644d2c15]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-644d2c15]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-644d2c15]{width:54px}.contact-item .base-info[data-v-644d2c15]{position:relative;margin-left:12px;padding-top:2px;width:calc(100% - 66px)}.contact-item .base-info .username[data-v-644d2c15]{line-height:16px;font-size:16px}.contact-item .base-info .user-info[data-v-644d2c15]{margin-top:6px}.contact-item .base-info .user-info .info-item[data-v-644d2c15]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.dark .contact-item[data-v-644d2c15]{background-color:#101014bf}.dark .contact-item[data-v-644d2c15]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf}
|
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
.follow-item[data-v-64f1874c]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-64f1874c]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-64f1874c],.follow-item .username-wrap[data-v-64f1874c]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-64f1874c]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-64f1874c]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-64f1874c]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-64f1874c]{background-color:#101014bf}.dark .follow-item[data-v-64f1874c]:hover{background:#18181c}.main-content-wrap[data-v-1f0f223d]{padding:20px}.pagination-wrap[data-v-1f0f223d]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-1f0f223d],.dark .empty-wrap[data-v-1f0f223d],.dark .skeleton-wrap[data-v-1f0f223d]{background-color:#101014bf}
|
|
@ -0,0 +1 @@
|
|||||||
|
.follow-item[data-v-1fb7364a]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-1fb7364a]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-1fb7364a],.follow-item .username-wrap[data-v-1fb7364a]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-1fb7364a]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-1fb7364a]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-1fb7364a]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-1fb7364a]{background-color:#101014bf}.dark .follow-item[data-v-1fb7364a]:hover{background:#18181c}.main-content-wrap[data-v-0a10234f]{padding:20px}.pagination-wrap[data-v-0a10234f]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-0a10234f],.dark .empty-wrap[data-v-0a10234f],.dark .skeleton-wrap[data-v-0a10234f]{background-color:#101014bf}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-899c075b]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-899c075b]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-899c075b]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-899c075b]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-899c075b]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-899c075b]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-899c075b]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-899c075b]{margin:20px}.load-more .load-more-wrap[data-v-899c075b]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-899c075b]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-899c075b],.dark .pagination-wrap[data-v-899c075b],.dark .empty-wrap[data-v-899c075b],.dark .skeleton-wrap[data-v-899c075b]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-899c075b]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-899c075b]{color:#63e2b7;opacity:.8}
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.load-more[data-v-8f151fd6]{margin:20px}.load-more .load-more-wrap[data-v-8f151fd6]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-8f151fd6]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-8f151fd6],.dark .pagination-wrap[data-v-8f151fd6],.dark .empty-wrap[data-v-8f151fd6],.dark .skeleton-wrap[data-v-8f151fd6]{background-color:#101014bf}
|
|
@ -1 +1 @@
|
|||||||
var L=(A=>(A[A.TITLE=1]="TITLE",A[A.TEXT=2]="TEXT",A[A.IMAGEURL=3]="IMAGEURL",A[A.VIDEOURL=4]="VIDEOURL",A[A.AUDIOURL=5]="AUDIOURL",A[A.LINKURL=6]="LINKURL",A[A.ATTACHMENT=7]="ATTACHMENT",A[A.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",A))(L||{}),R=(A=>(A[A.PUBLIC=0]="PUBLIC",A[A.PRIVATE=1]="PRIVATE",A[A.FRIEND=2]="FRIEND",A))(R||{}),U=(A=>(A[A.NO=0]="NO",A[A.YES=1]="YES",A))(U||{});export{L as P,R as V,U as Y};
|
var L=(A=>(A[A.TITLE=1]="TITLE",A[A.TEXT=2]="TEXT",A[A.IMAGEURL=3]="IMAGEURL",A[A.VIDEOURL=4]="VIDEOURL",A[A.AUDIOURL=5]="AUDIOURL",A[A.LINKURL=6]="LINKURL",A[A.ATTACHMENT=7]="ATTACHMENT",A[A.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",A))(L||{}),R=(A=>(A[A.PUBLIC=0]="PUBLIC",A[A.PRIVATE=1]="PRIVATE",A[A.FRIEND=2]="FRIEND",A[A.Following=3]="Following",A))(R||{}),U=(A=>(A[A.NO=0]="NO",A[A.YES=1]="YES",A))(U||{});export{L as P,R as V,U as Y};
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
.message-item[data-v-2e510758]{padding:16px}.message-item.unread[data-v-2e510758]{background:#fcfffc}.message-item .sender-wrap[data-v-2e510758]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-2e510758]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-2e510758]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-2e510758]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-2e510758]{margin-left:6px}.message-item .brief-wrap[data-v-2e510758]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-2e510758],.message-item .brief-wrap .whisper-content-wrap[data-v-2e510758],.message-item .brief-wrap .requesting-friend-wrap[data-v-2e510758]{display:flex;width:100%}.message-item .view-link[data-v-2e510758]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-2e510758]{margin-left:8px;align-items:center}.dark .message-item[data-v-2e510758]{background-color:#101014bf}.dark .message-item.unread[data-v-2e510758]{background:#0f180b}.dark .message-item .brief-wrap[data-v-2e510758]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-b40dcbaf]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-b40dcbaf],.dark .messages-wrap[data-v-b40dcbaf],.dark .pagination-wrap[data-v-b40dcbaf]{background-color:#101014bf}
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
.message-item[data-v-07fc447f]{padding:16px}.message-item.unread[data-v-07fc447f]{background:#fcfffc}.message-item .sender-wrap[data-v-07fc447f]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-07fc447f]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-07fc447f]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-07fc447f]{margin-left:6px}.message-item .brief-wrap[data-v-07fc447f]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-07fc447f],.message-item .brief-wrap .whisper-content-wrap[data-v-07fc447f],.message-item .brief-wrap .requesting-friend-wrap[data-v-07fc447f]{display:flex;width:100%}.message-item .view-link[data-v-07fc447f]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-07fc447f]{margin-left:8px;align-items:center}.dark .message-item[data-v-07fc447f]{background-color:#101014bf}.dark .message-item.unread[data-v-07fc447f]{background:#0f180b}.dark .message-item .brief-wrap[data-v-07fc447f]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{background-color:#101014bf}
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
.profile-baseinfo[data-v-756dadd0]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-756dadd0]{width:72px}.profile-baseinfo .base-info[data-v-756dadd0]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-756dadd0]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-756dadd0]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-756dadd0]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-756dadd0]{transform:scale(.75)}.profile-tabs-wrap[data-v-756dadd0]{padding:0 16px}.load-more[data-v-756dadd0]{margin:20px}.load-more .load-more-wrap[data-v-756dadd0]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-756dadd0]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-756dadd0],.dark .pagination-wrap[data-v-756dadd0]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
|||||||
.profile-baseinfo[data-v-0542f078]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-0542f078]{width:72px}.profile-baseinfo .base-info[data-v-0542f078]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-0542f078]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-0542f078]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-0542f078]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-0542f078]{transform:scale(.75)}.profile-tabs-wrap[data-v-0542f078]{padding:0 16px}.load-more[data-v-0542f078]{margin:20px}.load-more .load-more-wrap[data-v-0542f078]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-0542f078]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-0542f078],.dark .pagination-wrap[data-v-0542f078]{background-color:#101014bf}
|
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
import{z as $,A as I,B as M,C as O,_ as x}from"./index-d9671de1.js";import{x as U}from"./@vicons-7a4ef312.js";import{d as F,H as i,c as A,b as q,r as j,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as p,bf as h,E as D,al as H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-5497f713.js";import{u as ne}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=j("router-link"),g=J,k=C,a=K,d=P,v=Q,u=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(u,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?p("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):p("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):p("",!0)]),_:1})])):p("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,u=X,L=C,V=Z,N=ie,S=ee,z=oe,E=W;return c(),_("div",null,[n(v,{title:"话题"}),n(E,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({default:s(()=>[n(u,{name:"hot",tab:"热门"}),n(u,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(u,{key:0,name:"follow",tab:"关注"})):p("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=x(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default};
|
@ -1 +0,0 @@
|
|||||||
import{x as $,y as z,z as I,A as j,_ as E}from"./index-b4b0f710.js";import{v as U}from"./@vicons-b98681e0.js";import{d as F,r as i,n as A,j as q,a4 as x,o as c,c as _,V as n,a2 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a8 as Q,F as G,a5 as H}from"./@vue-7e1ab0af.js";import{o as J,M as B,j as K,e as P,O as R,L as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-702193c2.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as ne}from"./vuex-f1ee712f.js";import"./vue-router-edf90322.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./evtd-b614532e.js";import"./@css-render-16be7445.js";import"./vooks-e23078ea.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=J,k=B,a=K,d=P,v=R,p=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[V(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,j({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,p=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},Q({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(G,null,H(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Me as default};
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-ebc19734]{padding:0 16px}.profile-baseinfo[data-v-ebc19734]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-ebc19734]{width:72px}.profile-baseinfo .base-info[data-v-ebc19734]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-ebc19734]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-ebc19734]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-ebc19734]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-ebc19734]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-ebc19734]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-ebc19734]{margin:20px}.load-more .load-more-wrap[data-v-ebc19734]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-ebc19734]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-ebc19734],.dark .pagination-wrap[data-v-ebc19734]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
|||||||
.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-17f0dc61]{padding:0 16px}.profile-baseinfo[data-v-17f0dc61]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-17f0dc61]{width:72px}.profile-baseinfo .base-info[data-v-17f0dc61]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-17f0dc61]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-17f0dc61]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-17f0dc61]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-17f0dc61]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-17f0dc61]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-17f0dc61]{margin:20px}.load-more .load-more-wrap[data-v-17f0dc61]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-17f0dc61]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-17f0dc61],.dark .pagination-wrap[data-v-17f0dc61]{background-color:#101014bf}
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 20 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue