Skip to content

Commit 52d4a21

Browse files
committed
fix: 更新分享管理删除接口参数
1 parent 3b86c4a commit 52d4a21

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.15.75",
3+
"version": "2.15.76",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/api/share/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export function useShareApi() {
1111
data,
1212
});
1313
},
14-
deleteShare: (token: string): AxiosPromise<MyAxiosRes> => {
14+
deleteShare: (token: string, type: string, name: string): AxiosPromise<MyAxiosRes> => {
1515
return request({
1616
url: `/api/token/${encodeURIComponent(token)}`,
1717
method: "delete",
18+
params: { type, name },
1819
});
1920
},
2021
getShares: (type?: string, name?: string): AxiosPromise<MyAxiosRes> => {

src/components/ShareListItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const swipeController = () => {
247247
};
248248
249249
const onDeleteConfirm = async () => {
250-
await subsStore.deleteShare(token.value);
250+
await subsStore.deleteShare(token.value, type.value, name.value);
251251
};
252252
253253
const onClickEdit = () => {

src/store/subs.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ export const useSubsStore = defineStore('subsStore', {
376376
console.log('fetchShareData err', err);
377377
});
378378
},
379-
async deleteShare(token: string, isShowNotify: boolean = true) {
379+
async deleteShare(token: string, type: string, name: string, isShowNotify: boolean = true) {
380380
try {
381381
const { showNotify } = useAppNotifyStore();
382382

383-
const { data } = await shareApi.deleteShare(token);
383+
const { data } = await shareApi.deleteShare(token, type, name);
384384
if (data.status === "success") {
385385
await this.fetchShareData();
386386
isShowNotify && showNotify({
@@ -392,11 +392,11 @@ export const useSubsStore = defineStore('subsStore', {
392392
console.log('deleteShare error', error);
393393
}
394394
},
395-
async updateShare(token: string, data: ShareToken) {
395+
async updateShare(token: string, type: string, name:string, data: ShareToken) {
396396
const { showNotify } = useAppNotifyStore();
397397
try {
398-
await shareApi.deleteShare(token);
399-
await shareApi.createShare(data);
398+
await shareApi.deleteShare(token, type, name);
399+
await shareApi.createShare(data);
400400
await this.fetchShareData();
401401
} catch (error) {
402402
console.log('updateShare error', error);

src/views/share/SharePopup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ const handleCreateShare = async () => {
565565
};
566566
567567
const confirmUpdateShare = async () => {
568-
await subsStore.deleteShare(props.data?.token, false);
568+
await subsStore.deleteShare(props.data?.token, props.data?.type, props.data?.name, false);
569569
await handleCreateShare();
570570
};
571571

0 commit comments

Comments
 (0)