mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-11-30 16:15:51 +08:00
api相对路径
This commit is contained in:
@@ -2,11 +2,11 @@ import axios from 'axios';
|
||||
import type { Config } from '#/config';
|
||||
|
||||
export async function setConfig(newConfig: Config) {
|
||||
const { data } = await axios.post('/api/v1/updateConfig', newConfig);
|
||||
const { data } = await axios.post('api/v1/updateConfig', newConfig);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getConfig() {
|
||||
const { data } = await axios.get<Config>('/api/v1/getConfig');
|
||||
const { data } = await axios.get<Config>('api/v1/getConfig');
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import axios from 'axios';
|
||||
|
||||
/** 重启 */
|
||||
export const appRestart = () => axios.get('/api/v1/restart');
|
||||
export const appRestart = () => axios.get('api/v1/restart');
|
||||
|
||||
/** 启动 */
|
||||
export const appStart = () => axios.get('/api/v1/start');
|
||||
export const appStart = () => axios.get('api/v1/start');
|
||||
|
||||
/** 停止 */
|
||||
export const appStop = () => axios.get('/api/v1/stop');
|
||||
export const appStop = () => axios.get('api/v1/stop');
|
||||
|
||||
/** 状态 */
|
||||
export async function appStatus() {
|
||||
const { data } = await axios.get('/api/v1/getStatus');
|
||||
const { data } = await axios.get('api/v1/getStatus');
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export default defineConfig({
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': 'http://127.0.0.1:7892',
|
||||
'^/api/.*': 'http://127.0.0.1:7892',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user