feat:对接虚拟机实例接口

This commit is contained in:
2025-08-14 11:31:13 +08:00
parent d636050aac
commit 67ce6f66ac
9 changed files with 4941 additions and 105 deletions
+16
View File
@@ -83,6 +83,13 @@ export const getContainer = data => {
`/v1/admin/container/get_container_list?server_id=${data.server_id}&user_id=${data.user_id}&page=${data.page}&count=${data.count}&key=${data.key}`
);
};
/**获取虚拟机列表 */
export const getInstanceList = data => {
return http2.get(
`/v1/admin/instance/list?server_id=${data.server_id}&user_id=${data.user_id}&page=${data.page}&count=${data.count}&key=${data.key}`
);
};
/**获取单个指定容器 */
export const getOneContainer = data => {
return http2.post("/v1/admin/container/get_container_detail", data, {
@@ -453,3 +460,12 @@ export const changeInstancePasswordUser = (id, data) => {
}
});
};
/**删除端口 */
export const deletePort = data => {
return http2.post("/v1/admin/instance_port/delete", data, {
headers: {
"Content-Type": "multipart/form-data"
}
});
};
+3 -2
View File
@@ -4,6 +4,7 @@ import router from '@/router'
// 基础URL
const baseUrl = 'https://apiservertest.s1f.ren'
// const baseUrl = 'https://cloudapi.007yjs.com'
// 检查URL是否需要认证
const urlNeedAuth = (url) => {
@@ -105,7 +106,7 @@ class Request {
// 创建默认实例
const request = new Request({
baseURL: baseUrl,
timeout: 5000,
timeout: 30000,
headers: {
'Content-Type': 'multipart/form-data'
}
@@ -115,7 +116,7 @@ export const mainUrl = baseUrl + "/acs"
export const http2 = axios.create({
baseURL: baseUrl,
timeout: 5000,
timeout: 30000,
headers: {},
});