前端联调接口
This commit is contained in:
20
Yi.Vue3.x.Vant/src/api/articleApi.ts
Normal file
20
Yi.Vue3.x.Vant/src/api/articleApi.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import myaxios from '@/utils/myaxios.ts'
|
||||
import { ArticleEntity } from '@/type/interface/ArticleEntity'
|
||||
|
||||
export default {
|
||||
add(data: ArticleEntity) {
|
||||
console.log(data)
|
||||
return myaxios({
|
||||
url: `/article/add`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
},
|
||||
pageList(data:ArticleEntity) {
|
||||
return myaxios({
|
||||
url: '/article/pageList',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
}
|
||||
12
Yi.Vue3.x.Vant/src/api/fileApi.ts
Normal file
12
Yi.Vue3.x.Vant/src/api/fileApi.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import myaxios from '@/utils/myaxios.ts'
|
||||
|
||||
export default{
|
||||
upload(type:string,data:any){
|
||||
return myaxios({
|
||||
url: `/upload/${type}`,
|
||||
headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
|
||||
method: 'POST',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user