Merge branch 'alpha' into beta

pull/398/head
Michael Li 1 year ago
commit 5eb1098616
No known key found for this signature in database

@ -158,6 +158,7 @@ All notable changes to paopao-ce are documented in this file.
UNION UNION
SELECT user_id, follow_id he_uid, 10 AS style SELECT user_id, follow_id he_uid, 10 AS style
FROM p_following WHERE is_del=0; FROM p_following WHERE is_del=0;
- add tweets count info in Home/Profile page.
``` ```
## 0.4.2 ## 0.4.2

@ -31,9 +31,11 @@ const (
PrefixIdxTweetsFollowing = "paopao:index:tweets:following:" PrefixIdxTweetsFollowing = "paopao:index:tweets:following:"
PrefixIdxTrends = "paopao:index:trends:" PrefixIdxTrends = "paopao:index:trends:"
PrefixMessages = "paopao:messages:" PrefixMessages = "paopao:messages:"
PrefixUserInfo = "paopao:userinfo:" PrefixUserInfo = "paopao:user:info:"
PrefixUserInfoById = "paopao:userinfo:id:" PrefixUserProfile = "paopao:user:profile:"
PrefixUserInfoByName = "paopao:userinfo:name:" PrefixUserInfoById = "paopao:user:info:id:"
PrefixUserInfoByName = "paopao:user:info:name:"
prefixUserProfileByName = "paopao:user:profile:name:"
PrefixMyFriendIds = "paopao:myfriendids:" PrefixMyFriendIds = "paopao:myfriendids:"
PrefixMyFollowIds = "paopao:myfollowids:" PrefixMyFollowIds = "paopao:myfollowids:"
PrefixTweetComment = "paopao:comment:" PrefixTweetComment = "paopao:comment:"
@ -43,15 +45,16 @@ const (
// 以下包含一些在cache中会用到的池化后的key // 以下包含一些在cache中会用到的池化后的key
var ( var (
KeyNewestTweets cache.KeyPool[int] KeyNewestTweets cache.KeyPool[int]
KeyHotsTweets cache.KeyPool[int] KeyHotsTweets cache.KeyPool[int]
KeyFollowingTweets cache.KeyPool[string] KeyFollowingTweets cache.KeyPool[string]
KeyUnreadMsg cache.KeyPool[int64] KeyUnreadMsg cache.KeyPool[int64]
KeyOnlineUser cache.KeyPool[int64] KeyOnlineUser cache.KeyPool[int64]
KeyUserInfoById cache.KeyPool[int64] KeyUserInfoById cache.KeyPool[int64]
KeyUserInfoByName cache.KeyPool[string] KeyUserInfoByName cache.KeyPool[string]
KeyMyFriendIds cache.KeyPool[int64] KeyUserProfileByName cache.KeyPool[string]
KeyMyFollowIds cache.KeyPool[int64] KeyMyFriendIds cache.KeyPool[int64]
KeyMyFollowIds cache.KeyPool[int64]
) )
func initCacheKeyPool() { func initCacheKeyPool() {
@ -66,6 +69,7 @@ func initCacheKeyPool() {
KeyOnlineUser = intKeyPool[int64](poolSize, PrefixOnlineUser) KeyOnlineUser = intKeyPool[int64](poolSize, PrefixOnlineUser)
KeyUserInfoById = intKeyPool[int64](poolSize, PrefixUserInfoById) KeyUserInfoById = intKeyPool[int64](poolSize, PrefixUserInfoById)
KeyUserInfoByName = strKeyPool(poolSize, PrefixUserInfoById) KeyUserInfoByName = strKeyPool(poolSize, PrefixUserInfoById)
KeyUserProfileByName = strKeyPool(poolSize, prefixUserProfileByName)
KeyMyFriendIds = intKeyPool[int64](poolSize, PrefixMyFriendIds) KeyMyFriendIds = intKeyPool[int64](poolSize, PrefixMyFriendIds)
KeyMyFollowIds = intKeyPool[int64](poolSize, PrefixMyFollowIds) KeyMyFollowIds = intKeyPool[int64](poolSize, PrefixMyFollowIds)
} }

@ -17,6 +17,7 @@ Cache:
IndexTrendsExpire: 300 # 获取广场动态信息过期时间,单位秒, 默认300s IndexTrendsExpire: 300 # 获取广场动态信息过期时间,单位秒, 默认300s
OnlineUserExpire: 300 # 标记在线用户 过期时间,单位秒, 默认300s OnlineUserExpire: 300 # 标记在线用户 过期时间,单位秒, 默认300s
UserInfoExpire: 300 # 获取用户信息过期时间,单位秒, 默认300s UserInfoExpire: 300 # 获取用户信息过期时间,单位秒, 默认300s
UserProfileExpire: 180 # 获取用户概要过期时间,单位秒, 默认180s
UserRelationExpire: 600 # 用户关系信息过期时间,单位秒, 默认600s UserRelationExpire: 600 # 用户关系信息过期时间,单位秒, 默认600s
MessagesExpire: 60 # 消息列表过期时间,单位秒, 默认60s MessagesExpire: 60 # 消息列表过期时间,单位秒, 默认60s
EventManager: # 事件管理器的配置参数 EventManager: # 事件管理器的配置参数

@ -109,6 +109,7 @@ type cacheConf struct {
TweetCommentsExpire int64 TweetCommentsExpire int64
OnlineUserExpire int64 OnlineUserExpire int64
UserInfoExpire int64 UserInfoExpire int64
UserProfileExpire int64
UserRelationExpire int64 UserRelationExpire int64
} }

@ -39,6 +39,19 @@ type UserInfo struct {
CreatedOn int64 `json:"created_on"` CreatedOn int64 `json:"created_on"`
} }
type UserProfile struct {
ID int64 `json:"id" db:"id"`
Nickname string `json:"nickname"`
Username string `json:"username"`
Phone string `json:"phone"`
Status int `json:"status"`
Avatar string `json:"avatar"`
Balance int64 `json:"balance"`
IsAdmin bool `json:"is_admin"`
CreatedOn int64 `json:"created_on"`
TweetsCount int `json:"tweets_count"`
}
func (t RelationTyp) String() string { func (t RelationTyp) String() string {
switch t { switch t {
case RelationSelf: case RelationSelf:

@ -5,6 +5,7 @@
package core package core
import ( import (
"github.com/rocboss/paopao-ce/internal/core/cs"
"github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/core/ms"
) )
@ -15,6 +16,7 @@ type UserManageService interface {
GetUserByPhone(phone string) (*ms.User, error) GetUserByPhone(phone string) (*ms.User, error)
GetUsersByIDs(ids []int64) ([]*ms.User, error) GetUsersByIDs(ids []int64) ([]*ms.User, error)
GetUsersByKeyword(keyword string) ([]*ms.User, error) GetUsersByKeyword(keyword string) ([]*ms.User, error)
UserProfileByName(username string) (*cs.UserProfile, error)
CreateUser(user *ms.User) (*ms.User, error) CreateUser(user *ms.User) (*ms.User, error)
UpdateUser(user *ms.User) error UpdateUser(user *ms.User) error
GetRegisterUserCount() (int64, error) GetRegisterUserCount() (int64, error)

@ -11,6 +11,7 @@ import (
"github.com/RoaringBitmap/roaring/roaring64" "github.com/RoaringBitmap/roaring/roaring64"
"github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/conf"
"github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core"
"github.com/rocboss/paopao-ce/internal/core/cs"
"github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/core/ms"
) )
@ -61,6 +62,23 @@ func (s *cacheDataService) GetUserByUsername(username string) (res *ms.User, err
return return
} }
func (s *cacheDataService) UserProfileByName(username string) (res *cs.UserProfile, err error) {
// 先从缓存获取, 不处理错误
key := conf.KeyUserProfileByName.Get(username)
if data, xerr := s.ac.Get(key); xerr == nil {
buf := bytes.NewBuffer(data)
res = &cs.UserProfile{}
err = gob.NewDecoder(buf).Decode(res)
return
}
// 最后查库
if res, err = s.DataService.UserProfileByName(username); err == nil {
// 更新缓存
onCacheObjectEvent(key, res, conf.CacheSetting.UserProfileExpire)
}
return
}
func (s *cacheDataService) IsMyFriend(userId int64, friendIds ...int64) (res map[int64]bool, err error) { func (s *cacheDataService) IsMyFriend(userId int64, friendIds ...int64) (res map[int64]bool, err error) {
size := len(friendIds) size := len(friendIds)
res = make(map[int64]bool, size) res = make(map[int64]bool, size)

@ -37,9 +37,16 @@ type expireFollowTweetsEvent struct {
keyPattern string keyPattern string
} }
type cacheObjectEvent struct {
event.UnimplementedEvent
ac core.AppCache
key string
data any
expire int64
}
type cacheUserInfoEvent struct { type cacheUserInfoEvent struct {
event.UnimplementedEvent event.UnimplementedEvent
tweet *ms.Post
ac core.AppCache ac core.AppCache
key string key string
data *ms.User data *ms.User
@ -100,6 +107,15 @@ func onCacheUserInfoEvent(key string, data *ms.User) {
}) })
} }
func onCacheObjectEvent(key string, data any, expire int64) {
events.OnEvent(&cacheObjectEvent{
key: key,
data: data,
ac: _appCache,
expire: expire,
})
}
func OnCacheMyFriendIdsEvent(urs core.UserRelationService, userIds ...int64) { func OnCacheMyFriendIdsEvent(urs core.UserRelationService, userIds ...int64) {
if len(userIds) == 0 { if len(userIds) == 0 {
return return
@ -173,6 +189,19 @@ func (e *cacheUserInfoEvent) Action() (err error) {
return return
} }
func (e *cacheObjectEvent) Name() string {
return "cacheObjectEvent"
}
func (e *cacheObjectEvent) Action() (err error) {
buffer := &bytes.Buffer{}
ge := gob.NewEncoder(buffer)
if err = ge.Encode(e.data); err == nil {
e.ac.Set(e.key, buffer.Bytes(), e.expire)
}
return
}
func (e *cacheMyFriendIdsEvent) Name() string { func (e *cacheMyFriendIdsEvent) Name() string {
return "cacheMyFriendIdsEvent" return "cacheMyFriendIdsEvent"
} }

@ -5,9 +5,11 @@
package jinzhu package jinzhu
import ( import (
"fmt"
"strings" "strings"
"github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core"
"github.com/rocboss/paopao-ce/internal/core/cs"
"github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
"gorm.io/gorm" "gorm.io/gorm"
@ -20,6 +22,10 @@ var (
type userManageSrv struct { type userManageSrv struct {
db *gorm.DB db *gorm.DB
ums core.UserMetricServantA ums core.UserMetricServantA
_userProfileJoins string
_userProfileWhere string
_userProfileColoumns []string
} }
type userRelationSrv struct { type userRelationSrv struct {
@ -28,8 +34,22 @@ type userRelationSrv struct {
func newUserManageService(db *gorm.DB, ums core.UserMetricServantA) core.UserManageService { func newUserManageService(db *gorm.DB, ums core.UserMetricServantA) core.UserManageService {
return &userManageSrv{ return &userManageSrv{
db: db, db: db,
ums: ums, ums: ums,
_userProfileJoins: fmt.Sprintf("JOIN %s m ON %s.id=m.user_id", _userMetric_, _user_),
_userProfileWhere: fmt.Sprintf("%s.username=? AND %s.is_del=0", _user_, _user_),
_userProfileColoumns: []string{
fmt.Sprintf("%s.id", _user_),
fmt.Sprintf("%s.username", _user_),
fmt.Sprintf("%s.nickname", _user_),
fmt.Sprintf("%s.phone", _user_),
fmt.Sprintf("%s.status", _user_),
fmt.Sprintf("%s.avatar", _user_),
fmt.Sprintf("%s.balance", _user_),
fmt.Sprintf("%s.is_admin", _user_),
fmt.Sprintf("%s.created_on", _user_),
"m.tweets_count",
},
} }
} }
@ -55,6 +75,14 @@ func (s *userManageSrv) GetUserByUsername(username string) (*ms.User, error) {
return user.Get(s.db) return user.Get(s.db)
} }
func (s *userManageSrv) UserProfileByName(username string) (res *cs.UserProfile, err error) {
err = s.db.Table(_user_).Joins(s._userProfileJoins).
Where(s._userProfileWhere, username).
Select(s._userProfileColoumns).
First(&res).Error
return
}
func (s *userManageSrv) GetUserByPhone(phone string) (*ms.User, error) { func (s *userManageSrv) GetUserByPhone(phone string) (*ms.User, error) {
user := &dbr.User{ user := &dbr.User{
Phone: phone, Phone: phone,

@ -31,17 +31,18 @@ type UserInfoReq struct {
} }
type UserInfoResp struct { type UserInfoResp struct {
Id int64 `json:"id"` Id int64 `json:"id"`
Nickname string `json:"nickname"` Nickname string `json:"nickname"`
Username string `json:"username"` Username string `json:"username"`
Status int `json:"status"` Status int `json:"status"`
Avatar string `json:"avatar"` Avatar string `json:"avatar"`
Balance int64 `json:"balance"` Balance int64 `json:"balance"`
Phone string `json:"phone"` Phone string `json:"phone"`
IsAdmin bool `json:"is_admin"` IsAdmin bool `json:"is_admin"`
CreatedOn int64 `json:"created_on"` CreatedOn int64 `json:"created_on"`
Follows int64 `json:"follows"` Follows int64 `json:"follows"`
Followings int64 `json:"followings"` Followings int64 `json:"followings"`
TweetsCount int `json:"tweets_count"`
} }
type GetMessagesReq struct { type GetMessagesReq struct {

@ -94,6 +94,7 @@ type GetUserProfileResp struct {
CreatedOn int64 `json:"created_on"` CreatedOn int64 `json:"created_on"`
Follows int64 `json:"follows"` Follows int64 `json:"follows"`
Followings int64 `json:"followings"` Followings int64 `json:"followings"`
TweetsCount int `json:"tweets_count"`
} }
type TopicListReq struct { type TopicListReq struct {

@ -31,6 +31,6 @@ func (m *OnlineUserMetric) Name() string {
func (m *OnlineUserMetric) Action() (err error) { func (m *OnlineUserMetric) Action() (err error) {
// 暂时仅做标记,不存储其他相关信息 // 暂时仅做标记,不存储其他相关信息
m.ac.Set(conf.KeyOnlineUser.Get(m.uid), []byte{}, m.expire) m.ac.SetNx(conf.KeyOnlineUser.Get(m.uid), []byte{}, m.expire)
return return
} }

@ -58,11 +58,9 @@ func (s *coreSrv) SyncSearchIndex(req *web.SyncSearchIndexReq) mir.Error {
} }
func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Error) { func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Error) {
user, err := s.Ds.GetUserByUsername(req.Username) user, err := s.Ds.UserProfileByName(req.Username)
if err != nil { if err != nil {
return nil, xerror.UnauthorizedAuthNotExist logrus.Errorf("coreSrv.GetUserInfo occurs error[1]: %s", err)
}
if user.Model == nil || user.ID < 0 {
return nil, xerror.UnauthorizedAuthNotExist return nil, xerror.UnauthorizedAuthNotExist
} }
follows, followings, err := s.Ds.GetFollowCount(user.ID) follows, followings, err := s.Ds.GetFollowCount(user.ID)
@ -70,16 +68,17 @@ func (s *coreSrv) GetUserInfo(req *web.UserInfoReq) (*web.UserInfoResp, mir.Erro
return nil, web.ErrGetFollowCountFailed return nil, web.ErrGetFollowCountFailed
} }
resp := &web.UserInfoResp{ resp := &web.UserInfoResp{
Id: user.ID, Id: user.ID,
Nickname: user.Nickname, Nickname: user.Nickname,
Username: user.Username, Username: user.Username,
Status: user.Status, Status: user.Status,
Avatar: user.Avatar, Avatar: user.Avatar,
Balance: user.Balance, Balance: user.Balance,
IsAdmin: user.IsAdmin, IsAdmin: user.IsAdmin,
CreatedOn: user.CreatedOn, CreatedOn: user.CreatedOn,
Follows: follows, Follows: follows,
Followings: followings, Followings: followings,
TweetsCount: user.TweetsCount,
} }
if user.Phone != "" && len(user.Phone) == 11 { if user.Phone != "" && len(user.Phone) == 11 {
resp.Phone = user.Phone[0:3] + "****" + user.Phone[7:] resp.Phone = user.Phone[0:3] + "****" + user.Phone[7:]

@ -19,6 +19,11 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
const (
_tweetActionCreate uint8 = iota
_tweetActionDelete
)
const ( const (
_commentActionCreate uint8 = iota _commentActionCreate uint8 = iota
_commentActionDelete _commentActionDelete
@ -61,6 +66,14 @@ type createMessageEvent struct {
message *ms.Message message *ms.Message
} }
type tweetActionEvent struct {
event.UnimplementedEvent
ac core.AppCache
userId int64
username string
action uint8
}
type commentActionEvent struct { type commentActionEvent struct {
event.UnimplementedEvent event.UnimplementedEvent
ds core.DataService ds core.DataService
@ -94,6 +107,15 @@ func onTrendsActionEvent(action uint8, userIds ...int64) {
}) })
} }
func onTweetActionEvent(action uint8, userId int64, username string) {
events.OnEvent(&tweetActionEvent{
ac: _ac,
action: action,
userId: userId,
username: username,
})
}
func onMessageActionEvent(action uint8, userIds ...int64) { func onMessageActionEvent(action uint8, userIds ...int64) {
events.OnEvent(&messageActionEvent{ events.OnEvent(&messageActionEvent{
wc: _wc, wc: _wc,
@ -286,3 +308,17 @@ func (e *trendsActionEvent) expireMyTrends() {
e.ac.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixIdxTrends, userId)) e.ac.DelAny(fmt.Sprintf("%s%d:*", conf.PrefixIdxTrends, userId))
} }
} }
func (e *tweetActionEvent) Name() string {
return "tweetActionEvent"
}
func (e *tweetActionEvent) Action() (err error) {
switch e.action {
case _tweetActionCreate, _tweetActionDelete:
e.ac.Delete(conf.KeyUserProfileByName.Get(e.username))
default:
// nothing
}
return
}

@ -338,12 +338,9 @@ func (s *looseSrv) getUserPostTweets(req *web.GetUserTweetsReq, user *cs.VistUse
} }
func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) { func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) {
he, err := s.Ds.GetUserByUsername(req.Username) he, err := s.Ds.UserProfileByName(req.Username)
if err != nil { if err != nil {
logrus.Errorf("Ds.GetUserByUsername err: %s", err) logrus.Errorf("looseSrv.GetUserProfile occurs error[1]: %s", err)
return nil, web.ErrNoExistUsername
}
if he.Model == nil && he.ID <= 0 {
return nil, web.ErrNoExistUsername return nil, web.ErrNoExistUsername
} }
// 设定自己不是自己的朋友 // 设定自己不是自己的朋友
@ -371,6 +368,7 @@ func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfi
CreatedOn: he.CreatedOn, CreatedOn: he.CreatedOn,
Follows: follows, Follows: follows,
Followings: followings, Followings: followings,
TweetsCount: he.TweetsCount,
}, nil }, nil
} }

@ -314,7 +314,9 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp,
return nil, web.ErrCreatePostFailed return nil, web.ErrCreatePostFailed
} }
// 缓存处理 // 缓存处理
// TODO: 缓存逻辑合并处理
onTrendsActionEvent(_trendsActionCreateTweet, req.User.ID) onTrendsActionEvent(_trendsActionCreateTweet, req.User.ID)
onTweetActionEvent(_tweetActionCreate, req.User.ID, req.User.Username)
return (*web.CreateTweetResp)(formatedPosts[0]), nil return (*web.CreateTweetResp)(formatedPosts[0]), nil
} }
@ -344,7 +346,9 @@ func (s *privSrv) DeleteTweet(req *web.DeleteTweetReq) mir.Error {
return web.ErrDeletePostFailed return web.ErrDeletePostFailed
} }
// 缓存处理 // 缓存处理
// TODO: 缓存逻辑合并处理
onTrendsActionEvent(_trendsActionDeleteTweet, req.User.ID) onTrendsActionEvent(_trendsActionDeleteTweet, req.User.ID)
onTweetActionEvent(_tweetActionDelete, req.User.ID, req.User.Username)
return nil return nil
} }

@ -1 +1 @@
import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-b99ada21.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-632f0e92.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-57d1eaed.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-2af3a836.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default};

@ -1 +1 @@
import{_ as N}from"./post-skeleton-06353fe4.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-b99ada21.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-632f0e92.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-d9166350.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-2af3a836.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default};

@ -1 +1 @@
import{_ as q}from"./whisper-0918fca1.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-62423795.js";import{_ as U}from"./post-skeleton-06353fe4.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-b99ada21.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-632f0e92.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-a18cbbe2.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<p.value||p.value==0?(_.value=!1,l.value++,b()):_.value=!0};return ee(()=>{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-694050d3.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-b0fbffc8.js";import{_ as U}from"./post-skeleton-d9166350.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as G}from"./vuex-44de225f.js";import{b as J}from"./vue-router-e5a2430e.js";import{W as L}from"./v3-infinite-loading-2c58ec2f.js";import{T as Y,u as K,f as Q,_ as X}from"./index-2af3a836.js";import{d as Z,H as t,b as ee,f as n,k as a,w as u,q as d,Y as h,e as o,bf as f,F as S,u as $,j as z,x as oe}from"./@vue-a481fc63.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-eecf2ec3.js";import"./content-845a2453.js";import"./@vicons-f0266f88.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},pe={key:2},me={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Z({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),p=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let m in s.value)s.value[m].user_id==e&&(s.value[m].user.is_following=r)}const b=()=>{c.value=!0,Y({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),p.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value<p.value||p.value==0?(_.value=!1,l.value++,b()):_.value=!0};return ee(()=>{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};

@ -1 +1 @@
import{_ as W}from"./whisper-0918fca1.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-632f0e92.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-06353fe4.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-b99ada21.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value<a.value||a.value==0?(r.value=!1,i.value++,z()):r.value=!0};J(()=>{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-694050d3.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,X as U}from"./index-2af3a836.js";import{k as X,r as Y}from"./@vicons-f0266f88.js";import{j as M,o as Q,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-d9166350.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=Q,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(X))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value<a.value||a.value==0?(r.value=!1,i.value++,z()):r.value=!0};J(()=>{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};

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-8cfd09d6]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-8cfd09d6]{width:72px}.profile-baseinfo .base-info[data-v-8cfd09d6]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-8cfd09d6]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-8cfd09d6]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-8cfd09d6]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-8cfd09d6]{transform:scale(.75)}.profile-tabs-wrap[data-v-8cfd09d6]{padding:0 16px}.load-more[data-v-8cfd09d6]{margin:20px}.load-more .load-more-wrap[data-v-8cfd09d6]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-8cfd09d6]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-8cfd09d6],.dark .pagination-wrap[data-v-8cfd09d6]{background-color:#101014bf}

@ -1 +0,0 @@
.profile-baseinfo[data-v-b44eae22]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-b44eae22]{width:72px}.profile-baseinfo .base-info[data-v-b44eae22]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-b44eae22]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-b44eae22]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-b44eae22]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-b44eae22]{transform:scale(.75)}.profile-tabs-wrap[data-v-b44eae22]{padding:0 16px}.load-more[data-v-b44eae22]{margin:20px}.load-more .load-more-wrap[data-v-b44eae22]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-b44eae22]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-b44eae22],.dark .pagination-wrap[data-v-b44eae22]{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

@ -1 +1 @@
import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-632f0e92.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-b99ada21.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-2af3a836.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-57d1eaed.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default};

@ -0,0 +1 @@
.profile-tabs-wrap[data-v-a3099af3]{padding:0 16px}.profile-baseinfo[data-v-a3099af3]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-a3099af3]{width:72px}.profile-baseinfo .base-info[data-v-a3099af3]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-a3099af3]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-a3099af3]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-a3099af3]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-a3099af3]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-a3099af3]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-a3099af3]{margin:20px}.load-more .load-more-wrap[data-v-a3099af3]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-a3099af3]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-a3099af3],.dark .pagination-wrap[data-v-a3099af3]{background-color:#101014bf}

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.profile-tabs-wrap[data-v-51b5b20a]{padding:0 16px}.profile-baseinfo[data-v-51b5b20a]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-51b5b20a]{width:72px}.profile-baseinfo .base-info[data-v-51b5b20a]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-51b5b20a]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-51b5b20a]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-51b5b20a]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-51b5b20a]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-51b5b20a]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-51b5b20a]{margin:20px}.load-more .load-more-wrap[data-v-51b5b20a]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-51b5b20a]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-51b5b20a],.dark .pagination-wrap[data-v-51b5b20a]{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

@ -1 +1 @@
import{ab as A}from"./index-632f0e92.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-2af3a836.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _};

@ -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-632f0e92.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-2af3a836.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _};

@ -1 +1 @@
import{$ as b,_ as k}from"./index-632f0e92.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-2af3a836.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as $,b as z,e as I,i as R}from"./naive-ui-eecf2ec3.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},W={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=$,v=z,g=I,y=R;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",W,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _};

@ -1 +1 @@
import{N as b,_ as k}from"./index-632f0e92.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-2af3a836.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W};

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<title></title> <title></title>
<script type="module" crossorigin src="/assets/index-632f0e92.js"></script> <script type="module" crossorigin src="/assets/index-2af3a836.js"></script>
<link rel="modulepreload" crossorigin href="/assets/@vue-a481fc63.js"> <link rel="modulepreload" crossorigin href="/assets/@vue-a481fc63.js">
<link rel="modulepreload" crossorigin href="/assets/vue-router-e5a2430e.js"> <link rel="modulepreload" crossorigin href="/assets/vue-router-e5a2430e.js">
<link rel="modulepreload" crossorigin href="/assets/vuex-44de225f.js"> <link rel="modulepreload" crossorigin href="/assets/vuex-44de225f.js">

@ -20,6 +20,7 @@ export default createStore({
created_on: 0, created_on: 0,
follows: 0, follows: 0,
followings: 0, followings: 0,
tweets_count: 0,
is_admin: false, is_admin: false,
}, },
}, },
@ -65,6 +66,7 @@ export default createStore({
created_on: 0, created_on: 0,
follows: 0, follows: 0,
followings: 0, followings: 0,
tweets_count: 0,
is_admin: false, is_admin: false,
}; };
state.userLogined = false; state.userLogined = false;

@ -24,6 +24,8 @@ declare module Item {
follows: number; follows: number;
/** 粉丝数 */ /** 粉丝数 */
followings: number; followings: number;
/** 推文数 */
tweets_count?: number;
/** 用户余额(分) */ /** 用户余额(分) */
balance?: number; balance?: number;
/** 用户状态 */ /** 用户状态 */

@ -57,6 +57,9 @@
&nbsp;&nbsp;{{ store.state.userInfo.followings }} &nbsp;&nbsp;{{ store.state.userInfo.followings }}
</router-link> </router-link>
</span> </span>
<span class="info-item">
&nbsp;&nbsp;{{ store.state.userInfo.tweets_count }}
</span>
</div> </div>
</div> </div>
</div> </div>

@ -64,6 +64,9 @@
&nbsp;&nbsp;{{ user.followings }} &nbsp;&nbsp;{{ user.followings }}
</router-link> </router-link>
</span> </span>
<span class="info-item">
&nbsp;&nbsp;{{ user.tweets_count }}
</span>
</div> </div>
</div> </div>
@ -251,6 +254,7 @@ const user = reactive<Item.UserInfo>({
created_on: 0, created_on: 0,
follows: 0, follows: 0,
followings: 0, followings: 0,
tweets_count: 0,
status: 1, status: 1,
}); });
const userLoading = ref(false); const userLoading = ref(false);
@ -582,6 +586,9 @@ const loadUser = () => {
user.follows = res.follows; user.follows = res.follows;
user.followings = res.followings; user.followings = res.followings;
user.status = res.status; user.status = res.status;
if (res.tweets_count) {
user.tweets_count = res.tweets_count;
}
loadPage(); loadPage();
}) })
.catch((err) => { .catch((err) => {

Loading…
Cancel
Save