接口地址修改

This commit is contained in:
2022-02-02 01:54:57 +08:00
parent 3dfb60c13d
commit e5947754ea
12 changed files with 40 additions and 40 deletions
+4 -4
View File
@@ -88,7 +88,7 @@ export default class Hitokoto extends BaseList<HitokotoPage> {
async loadData() {
this.loading = true
const data = await this.$http.get<HitokotoPage, any>('/api/hitokoto/list', {params:this.search})
const data = await this.$http.get<HitokotoPage, any>('/api/v1/hitokoto/list', {params:this.search})
selectedData = []
this.loading = false
this.total = data.total
@@ -98,7 +98,7 @@ export default class Hitokoto extends BaseList<HitokotoPage> {
((this.$refs.addForm as Vue).$refs.hitokotoForm as VForm).validate(async (valid: boolean) => {
if (!valid) return
this.modalLoading = true
const data = await this.$http.post<any, any>('/api/hitokoto/save', this.formData)
const data = await this.$http.post<any, any>('/api/v1/hitokoto/save', this.formData)
this.modalLoading = false
this.addModal = false
ElMessage.success(data.message)
@@ -113,7 +113,7 @@ export default class Hitokoto extends BaseList<HitokotoPage> {
return
}
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
const data = await this.$http.delete<any, any>('/api/hitokoto/delete', {params:{_ids: selectedData}})
const data = await this.$http.delete<any, any>('/api/v1/hitokoto/delete', {params:{_ids: selectedData}})
ElMessage.success(data.message)
this.loadData()
}).catch(() => {})
@@ -123,7 +123,7 @@ export default class Hitokoto extends BaseList<HitokotoPage> {
}
created() {
this.loadData()
this.$http.get<never, any>('/api/common/config/hitokoto_type').then(data => {
this.$http.get<never, any>('/api/v1/common/config/hitokoto_type').then(data => {
this.typeList = data
})
}
+5 -5
View File
@@ -184,17 +184,17 @@ export default class Music extends BaseList<MusicPage> {
musicPlaying: boolean = false
musicList: MusicPlayerItem[] = []
created() {
this.$http.get<never, any>('/api/music/listLibs').then(data => {
this.$http.get<never, any>('/api/v1/music/listLibs').then(data => {
this.musicLibs = data
this.loadData()
})
this.$http.get<never, any>('/api/music/listExts').then(data => {
this.$http.get<never, any>('/api/v1/music/listExts').then(data => {
this.exts = data
})
}
async loadData() {
this.loading = true
const data = await this.$http.get<MusicPage, any>('/api/music/list', {params: this.search})
const data = await this.$http.get<MusicPage, any>('/api/v1/music/list', {params: this.search})
selectedIds = []
this.loading = false
this.total = data.total
@@ -210,7 +210,7 @@ export default class Music extends BaseList<MusicPage> {
// 根据当前搜索条件播放音乐
async playMusic() {
try {
const data = await this.$http.get<any, any>('/api/music/list/all', {params: selectedIds.length ? {ids: selectedIds} : this.search})
const data = await this.$http.get<any, any>('/api/v1/music/list/all', {params: selectedIds.length ? {ids: selectedIds} : this.search})
this.musicList = data.map((item: MusicModel) => {
return {
name: item.title || item.name,
@@ -246,7 +246,7 @@ export default class Music extends BaseList<MusicPage> {
this.currentRow = { ...row }
this.modifyLyricModal = true
if (row.lyric_id) {
const data = (await this.$http.get<any, any>('/api/music/lyric/get', {params: {lyricId: row.lyric_id}}))
const data = (await this.$http.get<any, any>('/api/v1/music/lyric/get', {params: {lyricId: row.lyric_id}}))
data.cloud_id = data.cloud_id ? data.cloud_id.toString() : null
this.lyricFormData = data
} else {
+3 -3
View File
@@ -96,7 +96,7 @@ export default class PhotoWall extends BaseList<PhotoWallPage> {
isUploading: boolean = false
async loadData() {
this.loading = true
const data = await this.$http.get<PhotoWallPage, any>('/api/photowall/list', {params:this.search})
const data = await this.$http.get<PhotoWallPage, any>('/api/v1/photowall/list', {params:this.search})
selectedData = []
this.loading = false
this.total = data.total
@@ -108,7 +108,7 @@ export default class PhotoWall extends BaseList<PhotoWallPage> {
return
}
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
await this.$http.delete('/api/photowall/delete', {params:{_ids: selectedData}})
await this.$http.delete('/api/v1/photowall/delete', {params:{_ids: selectedData}})
ElMessage.success('删除成功')
this.loadData()
}).catch(() => {})
@@ -139,7 +139,7 @@ export default class PhotoWall extends BaseList<PhotoWallPage> {
}
async preview(row: PhotoWallModel) {
const previewHeight = Math.floor(row.height * (500 / row.width))
const pictureCdn = await this.$http.get('/api/common/config/picture_cdn')
const pictureCdn = await this.$http.get('/api/v1/common/config/picture_cdn')
ElMessageBox({
title: '图片预览',
message: h('img', { style: `width:500px;height:${previewHeight}px;`, src: `${pictureCdn}/${row.name}` }, ''),
+4 -4
View File
@@ -107,7 +107,7 @@ export default class SourceImage extends BaseList<Page> {
}
async loadData(): Promise<void> {
this.loading = true
const data = await this.$http.get<Page, any>('/api/source-image/list', {params:this.search})
const data = await this.$http.get<Page, any>('/api/v1/source-image/list', {params:this.search})
selectedData = []
this.loading = false
this.total = data.total
@@ -119,7 +119,7 @@ export default class SourceImage extends BaseList<Page> {
return
}
ElMessageBox.confirm(`是否确认删除选中的${selectedData.length}条数据?`, '确认删除', {type: 'warning'}).then(async () => {
await this.$http.delete('/api/source-image/delete', {params:{_ids: selectedData}})
await this.$http.delete('/api/v1/source-image/delete', {params:{_ids: selectedData}})
ElMessage.success('删除成功')
this.loadData()
}).catch(() => {})
@@ -166,10 +166,10 @@ export default class SourceImage extends BaseList<Page> {
this.modifyModal = true
}
async tarnsferChange(newTargetKeys: string[], direction: 'right' | 'left', moveKeys: string[]) {
await this.$http.post('/api/source-image/updateLabel', {id: this.curId, labels: newTargetKeys})
await this.$http.post('/api/v1/source-image/updateLabel', {id: this.curId, labels: newTargetKeys})
}
created() {
this.$http.get<never, any>('/api/common/config/image_label').then(data => {
this.$http.get<never, any>('/api/v1/common/config/image_label').then(data => {
this.labelList.push(...data)
this.loadData()
})