feat: 添加三个 service 文件和 RoleGuard 组件
This commit is contained in:
@@ -13,4 +13,6 @@ export async function logout() {
|
||||
export async function me() {
|
||||
const response = await http.get('/auth/me')
|
||||
return response.data
|
||||
}
|
||||
}
|
||||
|
||||
export default { login, logout, me }
|
||||
@@ -0,0 +1,21 @@
|
||||
import http from './http'
|
||||
|
||||
export async function listEpisodes(limit = 50, offset = 0) {
|
||||
const response = await http.get('/episodes', { params: { limit, offset } })
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function createEpisode(data) {
|
||||
const response = await http.post('/episodes', data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function updateEpisode(id, data) {
|
||||
const response = await http.patch(`/episodes/${id}`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function deleteEpisode(id) {
|
||||
const response = await http.delete(`/episodes/${id}`)
|
||||
return response.data
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import http from './http'
|
||||
|
||||
export async function listUsers() {
|
||||
const response = await http.get('/users')
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function createUser(data) {
|
||||
const response = await http.post('/users', data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function updateUser(id, data) {
|
||||
const response = await http.patch(`/users/${id}`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function deactivateUser(id) {
|
||||
const response = await http.delete(`/users/${id}`)
|
||||
return response.data
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import http from './http'
|
||||
|
||||
export async function listTargets() {
|
||||
const response = await http.get('/yearly_targets')
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function createTarget(data) {
|
||||
const response = await http.post('/yearly_targets', data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function updateTarget(id, data) {
|
||||
const response = await http.patch(`/yearly_targets/${id}`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function deleteTarget(id) {
|
||||
const response = await http.delete(`/yearly_targets/${id}`)
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user