v1改为v2
This commit is contained in:
@@ -101,7 +101,7 @@ let selectedData: string[] = []
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
const data = await http.get<HitokotoPage, any>('/api/v1/hitokoto/list', {params: search})
|
||||
const data = await http.get<HitokotoPage, any>('/api/v2/hitokoto/list', {params: search})
|
||||
selectedData = []
|
||||
loading.value = false
|
||||
total.value = data.total
|
||||
@@ -113,7 +113,7 @@ async function save() {
|
||||
addForm.value?.hitokotoForm?.validate(async (valid: boolean) => {
|
||||
if (!valid) return
|
||||
modalLoading.value = true
|
||||
const data = await http.post<any, any>('/api/v1/hitokoto/save', formData)
|
||||
const data = await http.post<any, any>('/api/v2/hitokoto/save', formData)
|
||||
modalLoading.value = false
|
||||
addModal.value = false
|
||||
ElMessage.success(data.message)
|
||||
@@ -127,7 +127,7 @@ function deleteAll() {
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
|
||||
const data = await http.delete<any, any>('/api/v1/hitokoto/delete', {params: {_ids: selectedData}})
|
||||
const data = await http.delete<any, any>('/api/v2/hitokoto/delete', {params: {_ids: selectedData}})
|
||||
ElMessage.success(data.message)
|
||||
loadData()
|
||||
}).catch(() => {})
|
||||
@@ -142,7 +142,7 @@ function findTypeText(value: string): string | null {
|
||||
|
||||
// created
|
||||
loadData()
|
||||
http.get<never, any>('/api/v1/common/config/hitokoto_type').then(data => {
|
||||
http.get<never, any>('/api/v2/common/config/hitokoto_type').then(data => {
|
||||
typeList.value = data
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -212,7 +212,7 @@ let selectedIds: string[] = []
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
const data = await http.get<MusicPage, any>('/api/v1/music/list', {params: search})
|
||||
const data = await http.get<MusicPage, any>('/api/v2/music/list', {params: search})
|
||||
selectedIds = []
|
||||
loading.value = false
|
||||
total.value = data.total
|
||||
@@ -229,7 +229,7 @@ function findMusicLib(value: string): string | null {
|
||||
}
|
||||
async function playMusic() {
|
||||
try {
|
||||
const data = await http.get<any, any>('/api/v1/music/list/all', {params: selectedIds.length ? {ids: selectedIds} : search})
|
||||
const data = await http.get<any, any>('/api/v2/music/list/all', {params: selectedIds.length ? {ids: selectedIds} : search})
|
||||
musicList.value = data.map((item: MusicModel, index: number) => {
|
||||
const musicItem: MusicPlayerItem = {
|
||||
id: index,
|
||||
@@ -273,7 +273,7 @@ async function updateLyric(row: MusicModel) {
|
||||
currentRow.value = { ...row }
|
||||
modifyLyricModal.value = true
|
||||
if (row.lyric_id) {
|
||||
const data = (await http.get<any, any>('/api/v1/music/lyric/get', {params: {lyricId: row.lyric_id}}))
|
||||
const data = (await http.get<any, any>('/api/v2/music/lyric/get', {params: {lyricId: row.lyric_id}}))
|
||||
data.cloud_id = data.cloud_id ? data.cloud_id.toString() : null
|
||||
lyricFormData.value = data
|
||||
} else {
|
||||
@@ -284,7 +284,7 @@ async function saveLyric() {
|
||||
lyricForm.value?.validate(async (valid: boolean) => {
|
||||
if (!valid) return
|
||||
modalLoading.value = true
|
||||
const data = await http.post<MusicLyricModel, any>(`/api/v1/music/lyric/save?musicId=${currentRow.value ? currentRow.value._id : ''}`, lyricFormData.value)
|
||||
const data = await http.post<MusicLyricModel, any>(`/api/v2/music/lyric/save?musicId=${currentRow.value ? currentRow.value._id : ''}`, lyricFormData.value)
|
||||
modalLoading.value = false
|
||||
modifyLyricModal.value = false
|
||||
ElMessage.success(data.message)
|
||||
@@ -356,11 +356,11 @@ function musicPlay() {
|
||||
}
|
||||
|
||||
// created
|
||||
http.get<never, any>('/api/v1/music/listLibs').then(data => {
|
||||
http.get<never, any>('/api/v2/music/listLibs').then(data => {
|
||||
musicLibs.value = data
|
||||
loadData()
|
||||
})
|
||||
http.get<never, any>('/api/v1/music/listExts').then(data => {
|
||||
http.get<never, any>('/api/v2/music/listExts').then(data => {
|
||||
exts.value = data
|
||||
})
|
||||
</script>
|
||||
@@ -113,7 +113,7 @@ let selectedData: string[] = []
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
const data = await http.get<PhotoWallPage, any>('/api/v1/photowall/list', {params: search})
|
||||
const data = await http.get<PhotoWallPage, any>('/api/v2/photoWall/list', {params: search})
|
||||
selectedData = []
|
||||
loading.value = false
|
||||
total.value = data.total
|
||||
@@ -127,7 +127,7 @@ function deleteAll() {
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
|
||||
await http.delete('/api/v1/photowall/delete', {params: {_ids: selectedData}})
|
||||
await http.delete('/api/v2/photoWall/delete', {params: {_ids: selectedData}})
|
||||
ElMessage.success('删除成功')
|
||||
loadData()
|
||||
}).catch(() => {})
|
||||
@@ -158,7 +158,7 @@ function uploadError(error: Error) {
|
||||
}
|
||||
async function preview(row: PhotoWallModel) {
|
||||
const previewHeight = Math.floor(row.height * (500 / row.width))
|
||||
const pictureCdn = await http.get('/api/v1/common/config/picture_cdn')
|
||||
const pictureCdn = await http.get('/api/v2/common/config/picture_cdn')
|
||||
ElMessageBox({
|
||||
title: '图片预览',
|
||||
message: h('img', { style: `width:500px;height:${previewHeight}px;`, src: `${pictureCdn}/${row.name}` }, ''),
|
||||
|
||||
@@ -108,7 +108,7 @@ let selectedData: string[] = []
|
||||
|
||||
async function loadData(): Promise<void> {
|
||||
loading.value = true
|
||||
const data = await http.get<Page, any>('/api/v1/source-image/list', {params: search})
|
||||
const data = await http.get<Page, any>('/api/v2/source-image/list', {params: search})
|
||||
selectedData = []
|
||||
loading.value = false
|
||||
total.value = data.total
|
||||
@@ -122,7 +122,7 @@ function deleteAll(): void {
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
|
||||
await http.delete('/api/v1/source-image/delete', {params: {_ids: selectedData}})
|
||||
await http.delete('/api/v2/source-image/delete', {params: {_ids: selectedData}})
|
||||
ElMessage.success('删除成功')
|
||||
loadData()
|
||||
}).catch(() => {})
|
||||
@@ -154,7 +154,7 @@ function uploadError(error: Error): void {
|
||||
function preview(row: SourceImageModel): void {
|
||||
ElMessageBox({
|
||||
title: '图片预览',
|
||||
message: h('img', { style: `width:500px`, src: `/api/v1/common/randomBg?id=${row._id}` }, ''),
|
||||
message: h('img', { style: `width:500px`, src: `/api/v2/common/randomBg?id=${row._id}` }, ''),
|
||||
showCancelButton: false,
|
||||
confirmButtonText: '关闭',
|
||||
customStyle: {width: '530px', maxWidth: 'unset'}
|
||||
@@ -169,11 +169,11 @@ function modifyTags(item: SourceImageModel): void {
|
||||
modifyModal.value = true
|
||||
}
|
||||
async function tarnsferChange(newTargetKeys: string[], direction: 'right' | 'left', moveKeys: string[]) {
|
||||
await http.post('/api/v1/source-image/updateLabel', {id: curId.value, labels: newTargetKeys})
|
||||
await http.post('/api/v2/source-image/updateLabel', {id: curId.value, labels: newTargetKeys})
|
||||
}
|
||||
|
||||
// created
|
||||
http.get<never, any>('/api/v1/common/config/image_label').then(data => {
|
||||
http.get<never, any>('/api/v2/common/config/image_label').then(data => {
|
||||
labelList.value.push(...data)
|
||||
loadData()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user