Merge pull request #45 from jianxcao/feature-url-307

feat: 修改url地址,防止307成错误的url地址
This commit is contained in:
jxxghp
2023-09-22 15:34:14 +08:00
committed by GitHub
13 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ async function addSubscribe(season = 0) {
// 全部存在时洗版 // 全部存在时洗版
best_version = !seasonsNotExisted.value[season] ? 1 : 0 best_version = !seasonsNotExisted.value[season] ? 1 : 0
// 请求API // 请求API
const result: { [key: string]: any } = await api.post('subscribe', { const result: { [key: string]: any } = await api.post('subscribe/', {
name: props.media?.title, name: props.media?.title,
type: props.media?.type, type: props.media?.type,
year: props.media?.year, year: props.media?.year,
+1 -1
View File
@@ -212,7 +212,7 @@ async function updateSiteInfo() {
// 更新按钮状态 // 更新按钮状态
siteInfoDialog.value = false siteInfoDialog.value = false
const result: { [key: string]: any } = await api.put('site', siteForm) const result: { [key: string]: any } = await api.put('site/', siteForm)
if (result.success) { if (result.success) {
$toast.success(`${cardProps.site?.name} 更新成功!`) $toast.success(`${cardProps.site?.name} 更新成功!`)
emit('update') emit('update')
+1 -1
View File
@@ -118,7 +118,7 @@ async function searchSubscribe() {
async function updateSubscribeInfo() { async function updateSubscribeInfo() {
subscribeInfoDialog.value = false subscribeInfoDialog.value = false
try { try {
const result: { [key: string]: any } = await api.put('subscribe', subscribeForm) const result: { [key: string]: any } = await api.put('subscribe/', subscribeForm)
// 提示 // 提示
if (result.success) { if (result.success) {
+1 -1
View File
@@ -76,7 +76,7 @@ async function handleAddDownload(_site: any = undefined,
async function addDownload(_media: any, _torrent: any) { async function addDownload(_media: any, _torrent: any) {
startNProgress() startNProgress()
try { try {
const result: { [key: string]: any } = await api.post('download', { const result: { [key: string]: any } = await api.post('download/', {
media_in: _media, media_in: _media,
torrent_in: _torrent, torrent_in: _torrent,
}) })
+1 -1
View File
@@ -185,7 +185,7 @@ async function addSubscribe(season = 0) {
// 全部存在时洗版 // 全部存在时洗版
best_version = !seasonsNotExisted.value[season] ? 1 : 0 best_version = !seasonsNotExisted.value[season] ? 1 : 0
// 请求API // 请求API
const result: { [key: string]: any } = await api.post('subscribe', { const result: { [key: string]: any } = await api.post('subscribe/', {
name: mediaDetail.value?.title, name: mediaDetail.value?.title,
type: mediaDetail.value?.type, type: mediaDetail.value?.type,
year: mediaDetail.value?.year, year: mediaDetail.value?.year,
+1 -1
View File
@@ -38,7 +38,7 @@ function pluginInstalled() {
// 获取插件列表数据 // 获取插件列表数据
async function fetchData() { async function fetchData() {
try { try {
dataList.value = await api.get('plugin') dataList.value = await api.get('plugin/')
isRefreshed.value = true isRefreshed.value = true
} }
catch (error) { catch (error) {
+1 -1
View File
@@ -17,7 +17,7 @@ const isRefreshed = ref(false)
// 获取订阅列表数据 // 获取订阅列表数据
async function fetchData() { async function fetchData() {
try { try {
dataList.value = await api.get('download') dataList.value = await api.get('download/')
isRefreshed.value = true isRefreshed.value = true
} }
catch (error) { catch (error) {
+3 -3
View File
@@ -86,7 +86,7 @@ async function saveAccountInfo() {
accountInfo.value.password = newPassword.value accountInfo.value.password = newPassword.value
} }
try { try {
const result: { [key: string]: any } = await api.put('user', accountInfo.value) const result: { [key: string]: any } = await api.put('user/', accountInfo.value)
if (result.success) if (result.success)
$toast.success('用户信息保存成功!') $toast.success('用户信息保存成功!')
else else
@@ -100,7 +100,7 @@ async function saveAccountInfo() {
// 调用API,查询所有用户 // 调用API,查询所有用户
async function loadAllUsers() { async function loadAllUsers() {
try { try {
const result: User[] = await api.get('/user') const result: User[] = await api.get('/user/')
allUsers.value = result allUsers.value = result
} }
@@ -131,7 +131,7 @@ async function deactivateUser(user: User) {
try { try {
user.is_active = !user.is_active user.is_active = !user.is_active
const result: { [key: string]: any } = await api.put('user', user) const result: { [key: string]: any } = await api.put('user/', user)
if (result.success) { if (result.success) {
$toast.success('用户冻结成功!') $toast.success('用户冻结成功!')
loadAllUsers() loadAllUsers()
+1 -1
View File
@@ -109,7 +109,7 @@ function addFilterCard() {
// 查询所有站点 // 查询所有站点
async function querySites() { async function querySites() {
try { try {
const data: Site[] = await api.get('site') const data: Site[] = await api.get('site/')
// 过滤站点,只有启用的站点才显示 // 过滤站点,只有启用的站点才显示
allSites.value = data.filter(item => item.is_active) allSites.value = data.filter(item => item.is_active)
@@ -57,7 +57,7 @@ async function saveSelectedRssSites() {
// 查询所有站点 // 查询所有站点
async function querySites() { async function querySites() {
try { try {
const data: Site[] = await api.get('site') const data: Site[] = await api.get('site/')
// 过滤站点,只有启用的站点才显示 // 过滤站点,只有启用的站点才显示
allSites.value = data.filter(item => item.is_active) allSites.value = data.filter(item => item.is_active)
+2 -2
View File
@@ -58,7 +58,7 @@ const siteForm = reactive<Site>({
// 获取站点列表数据 // 获取站点列表数据
async function fetchData() { async function fetchData() {
try { try {
dataList.value = await api.get('site') dataList.value = await api.get('site/')
isRefreshed.value = true isRefreshed.value = true
} }
catch (error) { catch (error) {
@@ -77,7 +77,7 @@ async function addSite() {
addBtnState.value = true addBtnState.value = true
try { try {
const result: { [key: string]: string } = await api.post('site', siteForm) const result: { [key: string]: string } = await api.post('site/', siteForm)
if (result.success) { if (result.success) {
$toast.success('新增站点成功') $toast.success('新增站点成功')
+1 -1
View File
@@ -73,7 +73,7 @@ async function eventsHander(subscribe: Subscribe | Rss) {
async function getSubscribes() { async function getSubscribes() {
try { try {
// 订阅 // 订阅
const subscribes: Subscribe[] = await api.get('subscribe') const subscribes: Subscribe[] = await api.get('subscribe/')
const subEvents = await Promise.all( const subEvents = await Promise.all(
subscribes.map(async sub => eventsHander(sub)), subscribes.map(async sub => eventsHander(sub)),
+1 -1
View File
@@ -19,7 +19,7 @@ const dataList = ref<Subscribe[]>([])
// 获取订阅列表数据 // 获取订阅列表数据
async function fetchData() { async function fetchData() {
try { try {
dataList.value = await api.get('subscribe') dataList.value = await api.get('subscribe/')
isRefreshed.value = true isRefreshed.value = true
} }
catch (error) { catch (error) {