From 038ec62ca68a9ec48b653ef5b5139bb54f03edd6 Mon Sep 17 00:00:00 2001 From: hsingyin Date: Tue, 5 Nov 2024 00:13:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=AE=80=E6=B4=81?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=A4=87=E6=B3=A8=E5=B1=95=E7=A4=BA=E5=BC=80?= =?UTF-8?q?=E5=85=B3=EF=BC=8C=E9=A2=84=E5=A4=87=E5=88=86=E4=BA=AB=E7=AE=A1?= =?UTF-8?q?=E7=90=86API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/subs/index.ts | 15 ++++++++++++++- src/components/FileListItem.vue | 6 ++++++ src/components/SubListItem.vue | 6 ++++++ src/locales/en.ts | 1 + src/locales/zh.ts | 1 + src/store/settings.ts | 2 ++ src/types/store/settings.d.ts | 1 + src/views/settings/moreSetting.vue | 24 ++++++++++++++++++++++++ src/views/share/SharePopup.vue | 2 +- 10 files changed, 57 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ffebdc87c..2d0d861b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.285", + "version": "2.14.286", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/api/subs/index.ts b/src/api/subs/index.ts index 17216db7c..3849ad242 100644 --- a/src/api/subs/index.ts +++ b/src/api/subs/index.ts @@ -91,12 +91,25 @@ export function useSubsApi() { data, }); }, - shareSub: (data: ShareToken): AxiosPromise => { + shareCreate: (data: ShareToken): AxiosPromise => { return request({ url: `/api/token`, method: 'post', data, }); }, + shareDelete: (token: string): AxiosPromise => { + return request({ + url: `/api/token/${encodeURIComponent(token)}`, + method: 'delete', + }); + }, + shareQuery: (type: string, name: string): AxiosPromise => { + return request({ + url: `/api/tokens`, + method: 'get', + params: { type, name }, + }); + }, }; } diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index a51aa4876..af621e43d 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -106,6 +106,12 @@

+

+ {{ remarkText }} +

diff --git a/src/components/SubListItem.vue b/src/components/SubListItem.vue index eb718f258..b6ed88dc6 100644 --- a/src/components/SubListItem.vue +++ b/src/components/SubListItem.vue @@ -162,6 +162,12 @@

{{ collectionDetail }}

+

+ {{ remarkText }} +

diff --git a/src/locales/en.ts b/src/locales/en.ts index 8ac20d236..13d8b876b 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -825,6 +825,7 @@ export default { isShowIcon: 'Show icon', isEditorCommon: "Show editor common settings", isSimpleReicon: "Show items refresh button", + isSimpleShowRemarks: "Simple Mode Show items remarks", showFloatingRefreshButton: "Show floating refresh button", tabBar: 'Hide "Sync" Page', tabBar2: 'Hide "File" Page', diff --git a/src/locales/zh.ts b/src/locales/zh.ts index ac2782f58..a9be89893 100644 --- a/src/locales/zh.ts +++ b/src/locales/zh.ts @@ -786,6 +786,7 @@ export default { isShowIcon: '展示图标', isEditorCommon: '展示编辑页常用配置', isSimpleReicon: '简洁模式展示订阅刷新按钮', + isSimpleShowRemarks: '简洁模式列表展示备注', showFloatingRefreshButton: '显示悬浮刷新按钮', tabBar: '隐藏 "Gist 同步" 页', tabBar2: '隐藏 "文件" 页', diff --git a/src/store/settings.ts b/src/store/settings.ts index f6a5dad50..20a6e2270 100644 --- a/src/store/settings.ts +++ b/src/store/settings.ts @@ -33,6 +33,7 @@ export const useSettingsStore = defineStore("settingsStore", { isDefaultIcon: false, isIconColor: false, isShowIcon: true, + isSimpleShowRemark: false, isEditorCommon: true, isSimpleReicon: false, showFloatingRefreshButton: false, @@ -74,6 +75,7 @@ export const useSettingsStore = defineStore("settingsStore", { this.appearanceSetting.isDefaultIcon = res.data.data.appearanceSetting?.isDefaultIcon ?? ""; this.appearanceSetting.isIconColor = res.data.data.appearanceSetting?.isIconColor ?? ""; this.appearanceSetting.isShowIcon = res.data.data.appearanceSetting?.isShowIcon ?? true; + this.appearanceSetting.isSimpleShowRemark = res.data.data.appearanceSetting?.isSimpleShowRemark ?? ""; this.appearanceSetting.isEditorCommon = res.data.data.appearanceSetting?.isEditorCommon ?? true; this.appearanceSetting.isSimpleReicon = res.data.data.appearanceSetting?.isSimpleReicon ?? ""; this.appearanceSetting.showFloatingRefreshButton = res.data.data.appearanceSetting?.showFloatingRefreshButton ?? ""; diff --git a/src/types/store/settings.d.ts b/src/types/store/settings.d.ts index 9a22b602c..48eb83267 100644 --- a/src/types/store/settings.d.ts +++ b/src/types/store/settings.d.ts @@ -30,6 +30,7 @@ interface SettingsPostData { isIconColor?: boolean; // 自定义图标使用原始颜色 isEditorCommon?: boolean; // 展示编辑页常用配置 isSimpleReicon?: boolean; // 展示订阅刷新按钮 + isSimpleShowRemark?: boolean; // 展示简洁模式下的备注 showFloatingRefreshButton?: boolean; // 显示悬浮刷新按钮 istabBar?: boolean; // 隐藏 "Gist 同步" 页 istabBar2?: boolean; // 隐藏 "文件" 页 diff --git a/src/views/settings/moreSetting.vue b/src/views/settings/moreSetting.vue index 035bcf241..ce19c10b9 100644 --- a/src/views/settings/moreSetting.vue +++ b/src/views/settings/moreSetting.vue @@ -79,6 +79,19 @@ /> + + +