diff --git a/web/src/components/compose.vue b/web/src/components/compose.vue index 74811c15..0ab60c9f 100644 --- a/web/src/components/compose.vue +++ b/web/src/components/compose.vue @@ -297,7 +297,7 @@ const fileQueue = ref([]); const imageContents = ref([]); const videoContents = ref([]); const attachmentContents = ref([]); -const visitType = ref<0 | 1 | 2>(0) +const visitType = ref(0) const visibilities = [{value: 0, label: "公开"}, {value: 1, label: "私密"}, {value: 2, label: "好友可见"}] const uploadGateway = import.meta.env.VITE_HOST + '/v1/attachment'; diff --git a/web/src/components/post-detail.vue b/web/src/components/post-detail.vue index 69e8216b..c8879d45 100644 --- a/web/src/components/post-detail.vue +++ b/web/src/components/post-detail.vue @@ -235,7 +235,7 @@ const showLockModal = ref(false); const showStickModal = ref(false); const showVisibilityModal = ref(false); const loading = ref(false); -const tempVisibility = ref<0 | 1 | 2>(0); +const tempVisibility = ref(0); const emit = defineEmits<{ (e: 'reload'): void; diff --git a/web/src/types/NetParams.d.ts b/web/src/types/NetParams.d.ts index b6371564..fb507498 100644 --- a/web/src/types/NetParams.d.ts +++ b/web/src/types/NetParams.d.ts @@ -126,8 +126,8 @@ declare module NetParams { interface PostVisibilityPost { id: number, - /** 可见性 0公开 1私密 2好友可见 */ - visibility: 0 | 1 | 2 + /** 可见性:0为公开,1为私密,2为好友可见 */ + visibility: Item.VisibilityStatus } interface PostGetPostStar { @@ -164,8 +164,8 @@ declare module NetParams { users: string[], /** 附件价格 */ attachment_price: number, - /** 可见性 0公开 1私密 2好友可见 */ - visibility: 0 | 1 | 2 + /** 可见性:0为公开,1为私密,2为好友可见 */ + visibility: Item.VisibilityStatus } interface PostDeletePost { diff --git a/web/src/types/NetReq.d.ts b/web/src/types/NetReq.d.ts index ffc6c55d..bc5b4fcf 100644 --- a/web/src/types/NetReq.d.ts +++ b/web/src/types/NetReq.d.ts @@ -117,8 +117,8 @@ declare module NetReq { } interface PostVisibilityPost { - /** 可见性 0公开 1私密 2好友可见 */ - visibility_status: 0 | 1 | 2 + /** 可见性:0为公开,1为私密,2为好友可见 */ + visibility_status: Item.VisibilityStatus } interface PostGetPostStar { diff --git a/web/src/types/item.d.ts b/web/src/types/item.d.ts index bc369592..5a4a18e8 100644 --- a/web/src/types/item.d.ts +++ b/web/src/types/item.d.ts @@ -1,5 +1,8 @@ declare module Item { + /** 可见性:0为公开,1为私密,2为好友可见 */ + type VisibilityStatus = 0 | 1 | 2; + interface UserInfo { /** 用户UID */ id: number, @@ -161,8 +164,8 @@ declare module Item { contents: PostItemProps[], /** 标签列表 */ tags: { [key: string]: number } | string, - /** 可见性 0公开 1私密 2好友可见 */ - visibility: 0 | 1 | 2, + /** 可见性:0为公开,1为私密,2为好友可见 */ + visibility: VisibilityStatus, /** 是否锁定 */ is_lock: number, /** 是否置顶 */