mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
5.0
This commit is contained in:
52
sop-admin/sop-admin-frontend/src/api/isvList.ts
Normal file
52
sop-admin/sop-admin-frontend/src/api/isvList.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { createUrl, http } from "@/utils/http";
|
||||
import type { PageResult, Result } from "@/model";
|
||||
|
||||
// 后端请求接口
|
||||
const apiUrl: any = createUrl({
|
||||
page: "/isv/page",
|
||||
add: "/isv/add",
|
||||
update: "/isv/update",
|
||||
del: "/isv/delete",
|
||||
getKeys: "/isv/getKeys"
|
||||
});
|
||||
|
||||
/**
|
||||
* 接口管理
|
||||
*/
|
||||
export const api: any = {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param params 查询参数
|
||||
*/
|
||||
page(params: object): Promise<PageResult> {
|
||||
return http.get<PageResult, any>(apiUrl.page, { params });
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
* @param data 表单内容
|
||||
*/
|
||||
add(data: object) {
|
||||
return http.post<Result, any>(apiUrl.add, { data });
|
||||
},
|
||||
/**
|
||||
* 修改
|
||||
* @param data 表单内容
|
||||
*/
|
||||
update(data: object) {
|
||||
return http.post<Result, any>(apiUrl.update, { data });
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
* @param data 表单内容
|
||||
*/
|
||||
del(data: object) {
|
||||
return http.post<Result, any>(apiUrl.del, { data });
|
||||
},
|
||||
/**
|
||||
* 查看秘钥
|
||||
* @param params
|
||||
*/
|
||||
viewKeys(params: object) {
|
||||
return http.get<Result, any>(apiUrl.getKeys, { params });
|
||||
}
|
||||
};
|
@@ -6,5 +6,5 @@ type Result = {
|
||||
};
|
||||
|
||||
export const getAsyncRoutes = () => {
|
||||
return http.request<Result>("get", "/mock/get-async-routes");
|
||||
return http.request<Result>("get", "/get-async-routes");
|
||||
};
|
||||
|
52
sop-admin/sop-admin-frontend/src/api/serveApi.ts
Normal file
52
sop-admin/sop-admin-frontend/src/api/serveApi.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { createUrl, http } from "@/utils/http";
|
||||
import type { PageResult, Result } from "@/model";
|
||||
|
||||
// 后端请求接口
|
||||
const apiUrl: any = createUrl({
|
||||
page: "/serve/api/page",
|
||||
add: "/serve/api/add",
|
||||
update: "/serve/api/update",
|
||||
del: "/serve/api/delete",
|
||||
updateStatus: "/serve/api/updateStatus"
|
||||
});
|
||||
|
||||
/**
|
||||
* 接口管理
|
||||
*/
|
||||
export const api: any = {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param params 查询参数
|
||||
*/
|
||||
page(params: object): Promise<PageResult> {
|
||||
return http.get<PageResult, any>(apiUrl.page, { params });
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
* @param data 表单内容
|
||||
*/
|
||||
add(data: object) {
|
||||
return http.post<Result, any>(apiUrl.add, { data });
|
||||
},
|
||||
/**
|
||||
* 修改
|
||||
* @param data 表单内容
|
||||
*/
|
||||
update(data: object) {
|
||||
return http.post<Result, any>(apiUrl.update, { data });
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
* @param data 表单内容
|
||||
*/
|
||||
del(data: object) {
|
||||
return http.post<Result, any>(apiUrl.del, { data });
|
||||
},
|
||||
/**
|
||||
* 修改状态
|
||||
* @param data 表单内容
|
||||
*/
|
||||
updateStatus(data: object) {
|
||||
return http.post<Result, any>(apiUrl.updateStatus, { data });
|
||||
}
|
||||
};
|
44
sop-admin/sop-admin-frontend/src/api/sysAdminUser.ts
Normal file
44
sop-admin/sop-admin-frontend/src/api/sysAdminUser.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { createUrl, http } from "@/utils/http";
|
||||
import type { PageResult, Result } from "@/model";
|
||||
|
||||
// 后端请求接口
|
||||
const apiUrl: any = createUrl({
|
||||
page: "/sys/adminuser/page",
|
||||
add: "/sys/adminuser/add",
|
||||
update: "/sys/adminuser/update",
|
||||
del: "/sys/adminuser/delete"
|
||||
});
|
||||
|
||||
/**
|
||||
* 接口管理
|
||||
*/
|
||||
export const api: any = {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param params 查询参数
|
||||
*/
|
||||
page(params: object): Promise<PageResult> {
|
||||
return http.get<PageResult, any>(apiUrl.page, { params });
|
||||
},
|
||||
/**
|
||||
* 新增
|
||||
* @param data 表单内容
|
||||
*/
|
||||
add(data: object) {
|
||||
return http.post<Result, any>(apiUrl.add, { data });
|
||||
},
|
||||
/**
|
||||
* 修改
|
||||
* @param data 表单内容
|
||||
*/
|
||||
update(data: object) {
|
||||
return http.post<Result, any>(apiUrl.update, { data });
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
* @param data 表单内容
|
||||
*/
|
||||
del(data: object) {
|
||||
return http.post<Result, any>(apiUrl.del, { data });
|
||||
}
|
||||
};
|
@@ -1,4 +1,4 @@
|
||||
import { http } from "@/utils/http";
|
||||
import { baseUrl, http } from "@/utils/http";
|
||||
|
||||
export type UserResult = {
|
||||
success: boolean;
|
||||
@@ -34,12 +34,19 @@ export type RefreshTokenResult = {
|
||||
};
|
||||
};
|
||||
|
||||
const apiUrl = {
|
||||
login: baseUrl("/sys/login"),
|
||||
refreshToken: baseUrl("/sys/refresh-token")
|
||||
};
|
||||
|
||||
/** 登录 */
|
||||
export const getLogin = (data?: object) => {
|
||||
return http.request<UserResult>("post", "/sys/login", { data });
|
||||
return http.request<UserResult>("post", apiUrl.login, { data });
|
||||
};
|
||||
|
||||
/** 刷新`token` */
|
||||
export const refreshTokenApi = (data?: object) => {
|
||||
return http.request<RefreshTokenResult>("post", "/refresh-token", { data });
|
||||
return http.request<RefreshTokenResult>("post", apiUrl.refreshToken, {
|
||||
data
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user