调整api, 清理无用代码, 更新打包文件

This commit is contained in:
Rewrite0
2022-08-24 21:03:28 +08:00
parent 9eda45852c
commit e4e6542317
5 changed files with 8 additions and 13 deletions

Binary file not shown.

View File

@@ -8,9 +8,9 @@ import axios from "axios";
*/
const addBangumi = (type: string, rss_link: string) => {
if(type === 'new') {
return axios.post('/api/v1/subscribe', { rss_link });
return axios.post('api/v1/subscribe', { rss_link });
} else if(type === 'old') {
return axios.post('/api/v1/collection', { rss_link });
return axios.post('api/v1/collection', { rss_link });
} else {
console.error('type错误, type应为 new 或 old');
return false;
@@ -20,13 +20,13 @@ const addBangumi = (type: string, rss_link: string) => {
/**
* 获取AB存储的数据
*/
const getABData = () => axios.get('/api/v1/data');
const getABData = () => axios.get('api/v1/data');
/**
* 删除番剧规则
* @param {string} name 番名 (title_raw)
*/
const removeRule = (name: string) => axios.get(`/api/v1/removeRule/${name}`);
const removeRule = (name: string) => axios.get(`api/v1/removeRule/${name}`);
export {
addBangumi,

View File

@@ -3,12 +3,12 @@ import axios from 'axios'
/**
* 获取AB的日志
*/
const getABLog = () => axios.get('/api/v1/log');
const getABLog = () => axios.get('api/v1/log');
/**
* 重置 AB 的数据,程序会在下一轮检索中重新添加 RSS 订阅信息。
*/
const resetRule = () => axios.get('/api/v1/resetRule');
const resetRule = () => axios.get('api/v1/resetRule');
export {
getABLog,

View File

@@ -1,10 +1,9 @@
<script setup lang="ts">
import ShowResults from '@/components/ShowResults.vue';
import { getABData, removeRule } from '@/api/bangumi';
import { getABData } from '@/api/bangumi';
const res = await getABData();
const bangumiData = ref(res.data);
console.log(res);
const activeName = ref('1');
const dialogData = ref(null);

View File

@@ -26,11 +26,7 @@ export default defineConfig({
server: {
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://127.0.0.1:7892',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '/api')
}
'/api': 'http://192.168.0.2:7892'
}
}
})