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'
|
import httpClient from '@/api/httpClient'
|
||||||
|
|
||||||
function getCarousalList() {
|
function getCarousalList() {
|
||||||
return httpClient.get('/carousals/active-list')
|
return httpClient.get<CreateCarousalsRequest[]>('/carousals/active-list')
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export interface CreateCarousalsRequest {
|
export interface CreateCarousalsRequest {
|
||||||
imageUrl: string
|
imageUrl: string
|
||||||
targetType: string
|
targetType: string
|
||||||
targetUrl?: string
|
targetUrl: string
|
||||||
targetId?: string
|
targetId?: string
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ const listModel = ref<ListItem[]>([
|
|||||||
const safeHeight = ToolApi.getSafeHeight()
|
const safeHeight = ToolApi.getSafeHeight()
|
||||||
const searchValue = ref<string>('')
|
const searchValue = ref<string>('')
|
||||||
|
|
||||||
const info = ref<CreateCarousalsRequest[] | null>([
|
const info = ref<CreateCarousalsRequest[]>([
|
||||||
{
|
{
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
targetId: '',
|
targetId: '',
|
||||||
@@ -126,8 +126,7 @@ const findList = ref<{ name: string }[]>([
|
|||||||
{ name: '猫咪尿闭怎么办' },
|
{ name: '猫咪尿闭怎么办' },
|
||||||
])
|
])
|
||||||
async function onLoad() {
|
async function onLoad() {
|
||||||
const getCarousalListApi = await carousalApi.getCarousalList()
|
info.value = await carousalApi.getCarousalList()
|
||||||
info.value = getCarousalListApi
|
|
||||||
}
|
}
|
||||||
function handleJumpUrl(item: CreateCarousalsRequest) {
|
function handleJumpUrl(item: CreateCarousalsRequest) {
|
||||||
if (item.targetType === 'url') {
|
if (item.targetType === 'url') {
|
||||||
|
|||||||
Reference in new issue
Block a user