feat: 数据库迁移

This commit is contained in:
橙子
2023-10-07 17:51:05 +08:00
parent ca5697fb9c
commit c271f3005a
68 changed files with 222 additions and 18 deletions

View File

@@ -0,0 +1,11 @@
import myaxios from '@/utils/myaxios'
export default {
operate(data:any) {
return myaxios({
url: `/agree/operate`,
method: 'get',
params: {articleId:data}
})
},
}

View File

@@ -0,0 +1,19 @@
import myaxios from '@/utils/myaxios'
import { ArticleEntity } from '@/type/interface/ArticleEntity'
export default {
add(data:any) {
return myaxios({
url: `/article/add`,
method: 'post',
data: data
})
},
pageList(data:any) {
return myaxios({
url: '/article/pageList',
method: 'get',
params: data
})
}
}

View File

@@ -0,0 +1,17 @@
import myaxios from '@/utils/myaxios'
export default {
add(data:any) {
return myaxios({
url: `/comment/add`,
method: 'post',
data: data
})
},
getListByArticleId(articleId:any) {
return myaxios({
url: `/comment/GetListByArticleId/${articleId}`,
method: 'get',
})
}
}

View File

@@ -0,0 +1,12 @@
import myaxios from '@/utils/myaxios'
export default{
upload(type:string,data:any){
return myaxios({
url: `/file/upload/${type}`,
headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
method: 'POST',
data:data
});
}
}

View File

@@ -0,0 +1,59 @@
import myaxios from '@/utils/myaxios'
// 登录方法
export function login(username:string, password:string, code:string, uuid:string) {
const data = {
username,
password,
code,
uuid
}
return myaxios({
url: '/account/login',
headers: {
isToken: false
},
method: 'post',
data: data
})
}
// 注册方法
export function register(data:any) {
return myaxios({
url: '/register',
headers: {
isToken: false
},
method: 'post',
data: data
})
}
// 获取用户详细信息
export function getInfo() {
return myaxios({
url: '/account/getUserAllInfo',
method: 'get'
})
}
// 退出方法
export function logout() {
return myaxios({
url: '/account/logout',
method: 'post'
})
}
// 获取验证码
export function getCodeImg() {
return myaxios({
url: '/account/captchaImage',
headers: {
isToken: false
},
method: 'get',
timeout: 20000
})
}

View File

@@ -0,0 +1,18 @@
import myaxios from '@/utils/myaxios'
export default {
add(data:any) {
return myaxios({
url: `/sku/add`,
method: 'post',
data: data
})
},
pageList(data:any) {
return myaxios({
url: '/sku/pageList',
method: 'get',
params: data
})
}
}

View File

@@ -0,0 +1,25 @@
import myaxios from '@/utils/myaxios'
export default {
add(data: any) {
return myaxios({
url: `/spu/add`,
method: 'post',
data: data
})
},
pageList(data: any) {
return myaxios({
url: '/spu/pageList',
method: 'get',
params: data
})
},
getById(id: any) {
return myaxios({
url: `/spu/GetById/${id}`,
method: 'get',
})
},
}