diff --git a/src/api/blog.ts b/src/api/blog.ts index a11f8f1..95c32c7 100644 --- a/src/api/blog.ts +++ b/src/api/blog.ts @@ -1,9 +1,13 @@ import request from '../utils/request' import Qs from 'qs' + +const headers = { + 'Content-Type': 'application/json;charsetset=UTF-8' +} const get_blogs = (params: Object) => { return request({ url: '/blog', - method: 'get', + method: 'GET', params: params, paramsSerializer: (params) => { return Qs.stringify(params, { arrayFormat: 'repeat' }) @@ -11,83 +15,64 @@ const get_blogs = (params: Object) => { }) } -const get_blog = (params: any) => { - return request({ - url: '/blog/' + params.blog_id, - method: 'get' - }) -} - const listAll = () => { return request({ url: '/author/blog/list', - method: 'get' + method: 'GET' }) } -const updateBtName = (params: Object) => { +const updateBtName = (data: Object) => { return request({ - url: '/author/blog/update_blog_type', - method: 'post', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - }, - data: params + url: '/author/blog_type', + method: 'POST', + headers: headers, + data: data }) } -const insert_blog_type = (params: Object) => { +const putBlogType = (data: Object) => { return request({ - url: '/blog/insert_blog_type', - method: 'put', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - }, - data: params + url: '/author/blog_type', + method: 'PUT', + headers: headers, + data: data }) } const getContent = (id: string) => { return request({ - url: '/author/blog/' + id + '/content', - method: 'get', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - } + url: '/author/blog/content/' + id, + method: 'GET', + headers: headers, }) } -const newBlog = (postData: Object) => { +const putBlog = (postData: Object) => { return request({ - url: '/author/blog/createContent', - method: 'post', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - }, + url: '/author/blog/content', + method: 'PUT', + headers: headers, data: postData }) } -const updateContent = (params: Object) => { +const updateContent = (postData: Object) => { return request({ - url: '/author/blog/updateContent', - method: 'post', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - }, - data: params + url: '/author/blog/content', + method: 'POST', + headers: headers, + data: postData }) } -const deleteContent = (params: string) => { +const deleteContent = (bid: string) => { return request({ - url: '/author/blog/delete/' + params, - method: 'get', - headers: { - 'Content-Type': 'application/json;charsetset=UTF-8' - } + url: '/author/blog/content/' + bid, + method: 'DELETE', + headers: headers, }) } -export { get_blogs, get_blog, listAll, updateBtName, insert_blog_type, getContent, newBlog, updateContent, deleteContent } \ No newline at end of file +export { get_blogs, listAll, updateBtName, putBlogType, getContent, putBlog, updateContent, deleteContent } \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index a9697b6..6ae3377 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -1,7 +1,7 @@ import request from '../utils/request' const authorize = (params: any) => { return request({ - url: '/api/vi/authorize', + url: '/authorize', method: 'post', data: params }) diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue index 6a73509..2116ccd 100644 --- a/src/components/layout/Layout.vue +++ b/src/components/layout/Layout.vue @@ -14,8 +14,10 @@ - 小管设计8 - 一个执着于小提琴学习的垃圾程序员1 + 本网站不涉及色情,赌博,毒品和政治宗教等内容,暂时为个人学习用途。 + 考虑到法律风险,针对有敏感词汇还设有过滤功能,所以暂时不对外提供一切功能。 + + 再次重申,本网站只作为学习网站。。。。。。 diff --git a/src/view/blog/createBlog.vue b/src/view/blog/createBlog.vue index 05372b0..69d0c29 100644 --- a/src/view/blog/createBlog.vue +++ b/src/view/blog/createBlog.vue @@ -1,15 +1,16 @@ - 增加 - + 增加 + - + - 修改 + 修改 + 删除 退出 @@ -18,32 +19,51 @@ - 增加 - + 增加 + {{ blog[1].title }} - - + + + + + + + + - + - Cancel - Confirm + 取消 + 确认 - - + + - Cancel - Confirm + 取消 + 确认 + + + + + 你正在对 {{ (blogTypes.get(checkedBlogIndex) as BlogType).btName }} + + + + + 取消 + 确认 @@ -51,18 +71,13 @@ \ No newline at end of file