diff --git a/src/apis/blog.ts b/src/apis/blog.ts index ad39101..12b97e6 100644 --- a/src/apis/blog.ts +++ b/src/apis/blog.ts @@ -3,6 +3,18 @@ import { IBlog, IBlogCategory, IBlogComment, IBlogStats, IBlogVisit, INewBlog } import { IPageRecord } from '@/types' +export const uploadBlogImageApi = (md5: string, form: FormData): Promise => + cloudService({ + url: '/blog-api/blog/file/upload', + timeout: 10000, + headers: { + 'Content-Type': 'multipart/form-data' + }, + method: 'post', + params: { md5 }, + data: form + }) + export const queryBlogApi = (currentPage: number, pageSize: number): Promise> => cloudService({ url: '/blog-api/blog/all/page', diff --git a/src/utils/index.ts b/src/utils/index.ts index 96fb8be..fbe44eb 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -18,16 +18,6 @@ export const setActiveClass = (parentClassName: string, elementTag: string, currentElement.setAttribute('class', activeClassName) } -/** - * 文件服务器地址 - */ -export const fileServiceUrl = '/home-service/file' - -/** - * 服务器文件路径根地址 - */ -export const serviceFileRootPath = '/home-service/' - /** * 获取assets静态资源 * @param url 路径 diff --git a/src/views/blog/detail[id].vue b/src/views/blog/detail[id].vue index ffe5482..d3091e4 100644 --- a/src/views/blog/detail[id].vue +++ b/src/views/blog/detail[id].vue @@ -43,16 +43,16 @@