Skip to content

Commit

Permalink
feat: 文件功能(后端 > 2.14.143)
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 11, 2024
1 parent 674a1f1 commit e330044
Show file tree
Hide file tree
Showing 15 changed files with 1,460 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.33",
"version": "2.14.34",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
8 changes: 4 additions & 4 deletions src/api/artifacts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export function useArtifactsApi() {
},
getOneArtifact: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/artifact/${name}`,
url: `/api/artifact/${encodeURIComponent(name)}`,
method: 'get',
});
},
syncOneArtifact: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/sync/artifact/${name}`,
url: `/api/sync/artifact/${encodeURIComponent(name)}`,
method: 'get',
});
},
Expand All @@ -30,14 +30,14 @@ export function useArtifactsApi() {
},
editArtifact: (name: string, data: Artifact): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/artifact/${name}`,
url: `/api/artifact/${encodeURIComponent(name)}`,
method: 'patch',
data,
});
},
deleteArtifact: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/artifact/${name}`,
url: `/api/artifact/${encodeURIComponent(name)}`,
method: 'delete',
});
},
Expand Down
51 changes: 51 additions & 0 deletions src/api/files/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import request from '@/api';
import { AxiosPromise } from 'axios';

export function useFilesApi() {
return {
getFiles: (): AxiosPromise<MyAxiosRes> => {
return request({
url: '/api/files',
method: 'get',
});
},
getWholeFiles: (): AxiosPromise<MyAxiosRes> => {
return request({
url: '/api/wholeFiles',
method: 'get',
});
},
getOneFile: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/file/${encodeURIComponent(name)}`,
method: 'get',
});
},
getWholeFile: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/wholeFile/${encodeURIComponent(name)}`,
method: 'get',
});
},
createFile: (data: any): AxiosPromise<MyAxiosRes> => {
return request({
url: '/api/files',
method: 'post',
data,
});
},
editFile: (name: string, data: any): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/file/${encodeURIComponent(name)}`,
method: 'patch',
data,
});
},
deleteFile: (name: string): AxiosPromise<MyAxiosRes> => {
return request({
url: `/api/file/${encodeURIComponent(name)}`,
method: 'delete',
});
},
};
}
12 changes: 12 additions & 0 deletions src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ img {
font-weight: bold;
line-height: 2;
}
// .nut-icon-order:before {
// content: "\e697";
// }
// .nut-icon-edit:before {
// content: "\e667";
// }
// .nut-icon-find:before {
// content: "\e661";
// }
.nut-icon-category:before {
content: "\e662";
}
.nut-icon-issue:before {
content: '\e6b1';
}
Expand Down
Loading

0 comments on commit e330044

Please sign in to comment.