diff --git a/src/api/blog.ts b/src/api/blog.ts index a404d13..107beac 100644 --- a/src/api/blog.ts +++ b/src/api/blog.ts @@ -18,4 +18,23 @@ const get_blog = (params: any) => { }) } -export { get_blogs, get_blog } \ No newline at end of file +const get_user_blogs = (params: Object) => { + return request({ + url: '/blog', + method: 'get', + params: params, + paramsSerializer: (params) => { + return Qs.stringify(params, { arrayFormat: 'repeat' }) + }, + }) +} + +const update_blog_type = (params: Object) => { + return request({ + url: '/blog/update_blog_type', + method: 'post', + data: params + }) +} + +export { get_blogs, get_blog, get_user_blogs, update_blog_type } \ No newline at end of file diff --git a/src/components/common/Tab.vue b/src/components/common/Tab.vue new file mode 100644 index 0000000..4c699eb --- /dev/null +++ b/src/components/common/Tab.vue @@ -0,0 +1,89 @@ + + + + + {{ tab_text }} + + + + + + \ No newline at end of file diff --git a/src/entity/index.ts b/src/entity/index.ts new file mode 100644 index 0000000..f42e7d4 --- /dev/null +++ b/src/entity/index.ts @@ -0,0 +1,15 @@ +type Blog = { + blog_id: string, + blog_type_id: string, + blog_type_name: string, + blog_title: string, + blog_prex: string +} + +type BlogType = { + blog_type_id: string, + blog_type_name: string, + blog_list: Blog[] +} + +export { Blog, BlogType } diff --git a/src/main.ts b/src/main.ts index 3de3999..30cbd98 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,14 +19,26 @@ import { getToken } from './utils/auth' const whiteList = ['/', '/blog'] let url = window.location.href console.log(url) -if (url != 'http://localhost:3000/' && url.search("blog=") != -1) { - let blog = { - blog_id: url.split("=")[1] +if (url != 'http://localhost:3000/') { + // if(url.search("blog=") != -1) { + // let blog = { + // blog_id: url.split("=")[1] + // } + // router.push({ + // path: '/feedback', + // query: blog + // }) + // } + if (url.search("edit_blog=") != -1) { + let blog = { + blog_id: url.split("=")[1] + } + router.push({ + path: '/BlogEditer', + query: blog + }) } - router.push({ - path: '/feedback', - query: blog - }) + } router.beforeEach((to, from, next) => { console.log(from.path, to.path) diff --git a/src/router/index.ts b/src/router/index.ts index cd165d4..f0199bb 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -74,6 +74,10 @@ const routes: Array = [ path: "/feedback", component: () => import('../view/blog/mdview.vue') }, + { + path: "/BlogEditer", + component: () => import('../view/blog/createBlog.vue') + }, { path: "/login", component: () => import('../components/login/login.vue') diff --git a/src/view/blog/createBlog.vue b/src/view/blog/createBlog.vue new file mode 100644 index 0000000..e774053 --- /dev/null +++ b/src/view/blog/createBlog.vue @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/view/blog/index.vue b/src/view/blog/index.vue index 9692dc2..413157a 100644 --- a/src/view/blog/index.vue +++ b/src/view/blog/index.vue @@ -1,7 +1,11 @@ + ++++++ {{ item.blog_title }} - {{ item.blog_prex }} + {{ item.blog_prex }} + + +