8000 change base url to /api · pycoder404/blog-vue@41cde61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41cde61

Browse files
committed
change base url to /api
1 parent 51efe19 commit 41cde61

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

src/api/article.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ import request from '@/utils/request'
22

33
export function getArticleList(queryParams) {
44
return request({
5-
url: '/article/list/',
5+
url: '/api/article/list/',
66
method: 'get',
77
params: queryParams
88
})
99
}
1010

1111
export function getArticleDetail(articleId, queryParams) {
1212
return request({
13-
url: '/article/detail/' + articleId + '/',
13+
url: '/api/article/detail/' + articleId + '/',
1414
method: 'get',
1515
params: queryParams
1616
})
1717
}
1818

1919
export function createArticle(data) {
2020
return request({
21-
url: '/article/create/',
21+
url: '/api/article/create/',
2222
method: 'post',
2323
data: data
2424
})
2525
}
2626

2727
export function UpdateArticle(articleId, data) {
2828
return request({
29-
url: '/article/update/' + articleId + '/',
29+
url: '/api/article/update/' + articleId + '/',
3030
method: 'put',
3131
data: data
3232
})
@@ -35,15 +35,15 @@ export function UpdateArticle(articleId, data) {
3535

3636
export function getTagList(queryParams) {
3737
return request({
38-
url: '/tag/',
38+
url: '/api/tag/',
3939
method: 'get',
4040
params: queryParams
4141
})
4242
}
4343

4444
export function getCategoryList(queryParams) {
4545
return request({
46-
url: '/category/',
46+
url: '/api/category/'< 10000 /span>,
4747
method: 'get',
4848
params: queryParams
4949
})

src/api/user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import request from '@/utils/request'
22

33
export function login(data) {
44
return request({
5-
url: '/user/login/',
5+
url: '/api/user/login/',
66
method: 'post',
77
data
88
})
99
}
1010

1111
export function getInfo() {
1212
return request({
13-
url: '/user/info/',
13+
url: '/api/user/info/',
1414
method: 'get',
1515
})
1616
}
1717

1818
export function logout() {
1919
return request({
20-
url: '/user/logout/',
20+
url: '/api/user/logout/',
2121
method: 'post'
2222
})
2323
}

src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import store from './store'
1010
import ElementPlus from 'element-plus'
1111
import 'element-plus/dist/index.css'
1212

13-
import {DeleteFilled, EditPen,CaretBottom,Search} from '@element-plus/icons-vue'
13+
import {CaretBottom, DeleteFilled, EditPen, Search, Plus} from '@element-plus/icons-vue'
1414

1515

1616
import h 57AE ljs from 'highlight.js'
@@ -45,6 +45,7 @@ app.component('DeleteFilled', DeleteFilled)
4545
app.component('EditPen', EditPen)
4646
app.component('CaretBottom', CaretBottom)
4747
app.component('SearchIcon', Search)
48+
app.component('PlusIcon', Plus)
4849
app.use(router).use(store).use(hljsVuePlugin).use(ElementPlus).use(mavonEditor).mount('#app')
4950
// app.use(ElementPlus, { size: 'small', zIndex: 5000 })
5051
// app.mount('#app')

src/views/article/create.vue

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,30 @@
2121
<!-- <markdown-editor v-model="postForm.content" height="600px" />-->
2222
</el-form-item>
2323
</div>
24-
<el-form-item prop="category">
24+
<el-form-item label="分类" prop="category">
2525
<el-radio-group v-model="postForm.category">
2626
<el-radio-button
27-
v-for="category in articleCategory"
27+
v-for="category in articleCategories"
2828
:key="category['id']"
2929
:label="category['id']"
3030
>
3131
{{category['title']}}
3232
</el-radio-button>
33+
<el-button icon="PlusIcon">新建分类</el-button>
3334
</el-radio-group>
3435
</el-form-item>
35-
<el-form-item prop="tags">
36-
<el-select
36+
<el-form-item label='标签' prop="tags">
37+
<el-checkbox-group
3738
v-model="postForm.tags"
38-
placeholder="Select Article Tag"
39-
:reserve-keyword="false"
40-
multiple
41-
filterable
42-
default-first-option
43-
allow-create
44-
size="small">
45-
<el-option
39+
>
40+
<el-checkbox
4641
v-for="tag in articleTags"
4742
:key="tag['text']"
4843
:label="tag['text']"
4944
:value="tag['text']"
5045
/>
51-
</el-select>
46+
<el-button icon="PlusIcon">新建标签</el-button>
47+
</el-checkbox-group>
5248
</el-form-item>
5349

5450
</el-form>
@@ -69,7 +65,7 @@
6965
// import Upload from '@/components/UploadFile/index'
7066
import StickyNav from '@/components/StickyNav' // 粘性header组件
7167
// import { validURL } from '@/utils/validate'
72-
import {getArticleDetail, createArticle, UpdateArticle,getTagList,getCategoryList} from '@/api/article'
68+
import {getArticleDetail, createArticle, UpdateArticle, getTagList, getCategoryList} from '@/api/article'
7369
7470
// import { searchUser } from '@/api/remote-search'
7571
// import Warning from './Warning'
@@ -143,7 +139,7 @@
143139
},
144140
tempRoute: {},
145141
articleTags: [],
146-
articleCategory: [],
142+
articleCategories: [],
147143
}
148144
},
149145
computed: {
@@ -204,7 +200,7 @@
204200
},
205201
fetchArticleCategory(queryParam) {
206202
getCategoryList(queryParam).then(response => {
207-
this.articleCategory = response.data
203+
this.articleCategories = response.data
208204
// just for test
209205
// this.postForm.title += ` Article Id:${this.postForm.id}`
210206
// this.postForm.content_short += ` Article Id:${this.postForm.id}`

0 commit comments

Comments
 (0)
0