mirror of https://github.com/rocboss/paopao-ce
parent
cd686e4080
commit
8183c8ebdd
@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space"
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single"
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"parser": {
|
||||
"cssModules": true
|
||||
}
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,9 @@
|
||||
self.addEventListener("install", (event) => {
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil((async () => {})());
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
self.addEventListener('activate', (event) => {
|
||||
event.waitUntil((async () => {})());
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {});
|
||||
|
||||
self.addEventListener('fetch', (event) => {});
|
||||
|
||||
@ -1,320 +1,320 @@
|
||||
import { request } from "@/utils/request";
|
||||
import { request } from '@/utils/request';
|
||||
|
||||
/** 获取动态列表 */
|
||||
export const getPosts = (
|
||||
params: NetParams.PostGetPosts
|
||||
params: NetParams.PostGetPosts,
|
||||
): Promise<NetReq.PostGetPosts> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/posts",
|
||||
method: 'get',
|
||||
url: '/v1/posts',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取标签列表 */
|
||||
export const getTags = (
|
||||
params: NetParams.PostGetTags
|
||||
params: NetParams.PostGetTags,
|
||||
): Promise<NetReq.PostGetTags> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/tags",
|
||||
method: 'get',
|
||||
url: '/v1/tags',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取动态详情 */
|
||||
export const getPost = (
|
||||
params: NetParams.PostGetPost
|
||||
params: NetParams.PostGetPost,
|
||||
): Promise<NetReq.PostGetPost> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/post",
|
||||
method: 'get',
|
||||
url: '/v1/post',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取动态点赞状态 */
|
||||
export const getPostStar = (
|
||||
params: NetParams.PostPostStar
|
||||
params: NetParams.PostPostStar,
|
||||
): Promise<NetReq.PostGetPostStar> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/post/star",
|
||||
method: 'get',
|
||||
url: '/v1/post/star',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 动态点赞 */
|
||||
export const postStar = (
|
||||
data: NetParams.PostPostStar
|
||||
data: NetParams.PostPostStar,
|
||||
): Promise<NetReq.PostPostStar> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/star",
|
||||
method: 'post',
|
||||
url: '/v1/post/star',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取动态收藏状态 */
|
||||
export const getPostCollection = (
|
||||
params: NetParams.PostGetPostCollection
|
||||
params: NetParams.PostGetPostCollection,
|
||||
): Promise<NetReq.PostGetPostCollection> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/post/collection",
|
||||
method: 'get',
|
||||
url: '/v1/post/collection',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 动态收藏 */
|
||||
export const postCollection = (
|
||||
data: NetParams.PostPostCollection
|
||||
data: NetParams.PostPostCollection,
|
||||
): Promise<NetReq.PostPostCollection> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/collection",
|
||||
method: 'post',
|
||||
url: '/v1/post/collection',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取动态评论列表 */
|
||||
export const getPostComments = (
|
||||
params: NetParams.PostGetPostComments
|
||||
params: NetParams.PostGetPostComments,
|
||||
): Promise<NetReq.PostGetPostComments> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/post/comments",
|
||||
method: 'get',
|
||||
url: '/v1/post/comments',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取联系人列表 */
|
||||
export const getContacts = (
|
||||
params: NetParams.GetContacts
|
||||
params: NetParams.GetContacts,
|
||||
): Promise<NetReq.GetContacts> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/user/contacts",
|
||||
method: 'get',
|
||||
url: '/v1/user/contacts',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取联系人列表 */
|
||||
export const getIndexTrends = (
|
||||
params: NetParams.IndexTrendsReq
|
||||
params: NetParams.IndexTrendsReq,
|
||||
): Promise<NetReq.IndexTrendsResp> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/trends/index",
|
||||
method: 'get',
|
||||
url: '/v1/trends/index',
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
/** 发布动态 */
|
||||
export const createPost = (
|
||||
data: NetParams.PostCreatePost
|
||||
data: NetParams.PostCreatePost,
|
||||
): Promise<NetReq.PostCreatePost> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post",
|
||||
method: 'post',
|
||||
url: '/v1/post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除动态 */
|
||||
export const deletePost = (
|
||||
data: NetParams.PostDeletePost
|
||||
data: NetParams.PostDeletePost,
|
||||
): Promise<NetReq.PostDeletePost> => {
|
||||
return request({
|
||||
method: "delete",
|
||||
url: "/v1/post",
|
||||
method: 'delete',
|
||||
url: '/v1/post',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 锁定/解锁动态 */
|
||||
export const lockPost = (
|
||||
data: NetParams.PostLockPost
|
||||
data: NetParams.PostLockPost,
|
||||
): Promise<NetReq.PostLockPost> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/lock",
|
||||
method: 'post',
|
||||
url: '/v1/post/lock',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 置顶/取消置顶动态 */
|
||||
export const stickPost = (
|
||||
data: NetParams.PostStickPost
|
||||
data: NetParams.PostStickPost,
|
||||
): Promise<NetReq.PostStickPost> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/stick",
|
||||
method: 'post',
|
||||
url: '/v1/post/stick',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 设为亮点/取消亮点动态 */
|
||||
export const highlightPost = (
|
||||
data: NetParams.PostHighlightPost
|
||||
data: NetParams.PostHighlightPost,
|
||||
): Promise<NetReq.PostHighlightPost> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/highlight",
|
||||
method: 'post',
|
||||
url: '/v1/post/highlight',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 置顶/取消置顶动态 */
|
||||
export const visibilityPost = (
|
||||
data: NetParams.PostVisibilityPost
|
||||
data: NetParams.PostVisibilityPost,
|
||||
): Promise<NetReq.PostVisibilityPost> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/visibility",
|
||||
method: 'post',
|
||||
url: '/v1/post/visibility',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 点赞评论 */
|
||||
export const thumbsUpTweetComment = (
|
||||
data: NetParams.PostTweetCommentThumbs
|
||||
data: NetParams.PostTweetCommentThumbs,
|
||||
): Promise<NetReq.PostTweetCommentThumbs> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/tweet/comment/thumbsup",
|
||||
method: 'post',
|
||||
url: '/v1/tweet/comment/thumbsup',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 点踩评论 */
|
||||
export const thumbsDownTweetComment = (
|
||||
data: NetParams.PostTweetCommentThumbs
|
||||
data: NetParams.PostTweetCommentThumbs,
|
||||
): Promise<NetReq.PostTweetCommentThumbs> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/tweet/comment/thumbsdown",
|
||||
method: 'post',
|
||||
url: '/v1/tweet/comment/thumbsdown',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 点赞评论回复 */
|
||||
export const thumbsUpTweetReply = (
|
||||
data: NetParams.PostTweetReplyThumbs
|
||||
data: NetParams.PostTweetReplyThumbs,
|
||||
): Promise<NetReq.PostTweetReplyThumbs> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/tweet/reply/thumbsup",
|
||||
method: 'post',
|
||||
url: '/v1/tweet/reply/thumbsup',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 点踩评论回复 */
|
||||
export const thumbsDownTweetReply = (
|
||||
data: NetParams.PostTweetReplyThumbs
|
||||
data: NetParams.PostTweetReplyThumbs,
|
||||
): Promise<NetReq.PostTweetReplyThumbs> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/tweet/reply/thumbsdown",
|
||||
method: 'post',
|
||||
url: '/v1/tweet/reply/thumbsdown',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 发布动态评论 */
|
||||
export const createComment = (
|
||||
data: NetParams.PostCreateComment
|
||||
data: NetParams.PostCreateComment,
|
||||
): Promise<NetReq.PostCreateComment> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/comment",
|
||||
method: 'post',
|
||||
url: '/v1/post/comment',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除评论 */
|
||||
export const deleteComment = (
|
||||
data: NetParams.PostDeleteComment
|
||||
data: NetParams.PostDeleteComment,
|
||||
): Promise<NetReq.PostDeleteComment> => {
|
||||
return request({
|
||||
method: "delete",
|
||||
url: "/v1/post/comment",
|
||||
method: 'delete',
|
||||
url: '/v1/post/comment',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 精选评论 */
|
||||
export const highlightComment = (
|
||||
data: NetParams.PostHighlightComment
|
||||
data: NetParams.PostHighlightComment,
|
||||
): Promise<NetReq.PostHighlightComment> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/comment/highlight",
|
||||
method: 'post',
|
||||
url: '/v1/post/comment/highlight',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 发布评论回复 */
|
||||
export const createCommentReply = (
|
||||
data: NetParams.PostCreateCommentReply
|
||||
data: NetParams.PostCreateCommentReply,
|
||||
): Promise<NetReq.PostCreateCommentReply> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/post/comment/reply",
|
||||
method: 'post',
|
||||
url: '/v1/post/comment/reply',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除评论回复 */
|
||||
export const deleteCommentReply = (
|
||||
data: NetParams.PostDeleteCommentReply
|
||||
data: NetParams.PostDeleteCommentReply,
|
||||
): Promise<NetReq.PostDeleteCommentReply> => {
|
||||
return request({
|
||||
method: "delete",
|
||||
url: "/v1/post/comment/reply",
|
||||
method: 'delete',
|
||||
url: '/v1/post/comment/reply',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 置顶/取消置顶话题 */
|
||||
export const stickTopic = (
|
||||
data: NetParams.PostStickTopic
|
||||
data: NetParams.PostStickTopic,
|
||||
): Promise<NetReq.PostStickTopic> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/topic/stick",
|
||||
method: 'post',
|
||||
url: '/v1/topic/stick',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 置顶/取消置顶话题 */
|
||||
export const pinTopic = (
|
||||
data: NetParams.PostPinTopic
|
||||
data: NetParams.PostPinTopic,
|
||||
): Promise<NetReq.PostPinTopic> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/topic/pin",
|
||||
method: 'post',
|
||||
url: '/v1/topic/pin',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 关注话题 */
|
||||
export const followTopic = (
|
||||
data: NetParams.PostFollowTopic
|
||||
data: NetParams.PostFollowTopic,
|
||||
): Promise<NetReq.PostFollowTopic> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/topic/follow",
|
||||
method: 'post',
|
||||
url: '/v1/topic/follow',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 取消关注话题 */
|
||||
export const unfollowTopic = (
|
||||
data: NetParams.PostUnfollowTopic
|
||||
data: NetParams.PostUnfollowTopic,
|
||||
): Promise<NetReq.PostUnfollowTopic> => {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/v1/topic/unfollow",
|
||||
method: 'post',
|
||||
url: '/v1/topic/unfollow',
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { request } from "@/utils/request";
|
||||
import { request } from '@/utils/request';
|
||||
|
||||
/** 获取站点概要信息 */
|
||||
export const getSiteProfile = (): Promise<NetReq.SiteProfile> => {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/v1/site/profile",
|
||||
method: 'get',
|
||||
url: '/v1/site/profile',
|
||||
});
|
||||
};
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import { createApp } from 'vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import App from './App.vue'
|
||||
import { createApp } from 'vue';
|
||||
import router from './router';
|
||||
import store from './store';
|
||||
import App from './App.vue';
|
||||
|
||||
import type { MessageApiInjection } from 'naive-ui/lib/message/src/MessageProvider'
|
||||
import type { MessageApiInjection } from 'naive-ui/lib/message/src/MessageProvider';
|
||||
|
||||
// 通用字体
|
||||
import 'vfonts/Lato.css'
|
||||
import 'vfonts/Lato.css';
|
||||
// 等宽字体
|
||||
import 'vfonts/FiraCode.css'
|
||||
import 'vfonts/FiraCode.css';
|
||||
|
||||
createApp(App).use(router).use(store).mount('#app')
|
||||
createApp(App).use(router).use(store).mount('#app');
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
$message: MessageApiInjection,
|
||||
$store: any
|
||||
$message: MessageApiInjection;
|
||||
$store: any;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module '*.svg'
|
||||
declare module '*.png'
|
||||
declare module '*.jpg'
|
||||
declare module '*.jpeg'
|
||||
declare module '*.gif'
|
||||
declare module '*.bmp'
|
||||
declare module '*.tiff'
|
||||
declare module '*.json'
|
||||
declare module 'paopao-video-player'
|
||||
declare module '*.svg';
|
||||
declare module '*.png';
|
||||
declare module '*.jpg';
|
||||
declare module '*.jpeg';
|
||||
declare module '*.gif';
|
||||
declare module '*.bmp';
|
||||
declare module '*.tiff';
|
||||
declare module '*.json';
|
||||
declare module 'paopao-video-player';
|
||||
|
||||
interface AnyObject {
|
||||
[key: string]: any
|
||||
[key: string]: any;
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
export const prettyQuoteNum = (num: number) => {
|
||||
if (num >= 1000) {
|
||||
return (num / 1000).toFixed(1) + "千";
|
||||
return (num / 1000).toFixed(1) + '千';
|
||||
} else if (num >= 10000) {
|
||||
return (num / 10000).toFixed(1) + "万";
|
||||
return (num / 10000).toFixed(1) + '万';
|
||||
}
|
||||
return num;
|
||||
};
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { ComponentCustomProperties } from 'vue'
|
||||
import { Store } from 'vuex'
|
||||
import { ComponentCustomProperties } from 'vue';
|
||||
import { Store } from 'vuex';
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
// 声明自己的 store state
|
||||
interface State {
|
||||
[key: string]: any
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
// 为 `this.$store` 提供类型声明
|
||||
interface ComponentCustomProperties {
|
||||
$store: Store<State>
|
||||
$store: Store<State>;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue