refactor:修复养宠手册部分类型问题
This commit is contained in:
1 parent
24814b7dee
commit
5ca4ef7522
3 files changed
+5
-5
No files matched your search
+2
-1
@@ -1,7 +1,8 @@
|
||||
import type { CreateCarousalsRequest } from '@/model/carousals'
|
||||
import httpClient from '@/api/httpClient'
|
||||
|
||||
function getCarousalList() {
|
||||
return httpClient.get('/carousals/active-list')
|
||||
return httpClient.get<CreateCarousalsRequest[]>('/carousals/active-list')
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export interface CreateCarousalsRequest {
|
||||
imageUrl: string
|
||||
targetType: string
|
||||
targetUrl?: string
|
||||
targetUrl: string
|
||||
targetId?: string
|
||||
}
|
||||
@@ -75,7 +75,7 @@ const listModel = ref<ListItem[]>([
|
||||
const safeHeight = ToolApi.getSafeHeight()
|
||||
const searchValue = ref<string>('')
|
||||
|
||||
const info = ref<CreateCarousalsRequest[] | null>([
|
||||
const info = ref<CreateCarousalsRequest[]>([
|
||||
{
|
||||
imageUrl: '',
|
||||
targetId: '',
|
||||
@@ -126,8 +126,7 @@ const findList = ref<{ name: string }[]>([
|
||||
{ name: '猫咪尿闭怎么办' },
|
||||
])
|
||||
async function onLoad() {
|
||||
const getCarousalListApi = await carousalApi.getCarousalList()
|
||||
info.value = getCarousalListApi
|
||||
info.value = await carousalApi.getCarousalList()
|
||||
}
|
||||
function handleJumpUrl(item: CreateCarousalsRequest) {
|
||||
if (item.targetType === 'url') {
|
||||
|
||||
Reference in new issue
Block a user