diff --git a/components.d.ts b/components.d.ts index bbec505..4b333bc 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,6 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { Copyright: typeof import('./src/components/Copyright.vue')['default'] + ImageUpload: typeof import('./src/components/ImageUpload.vue')['default'] RegularPage: typeof import('./src/components/RegularPage.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -15,7 +16,6 @@ declare module 'vue' { TAvatar: typeof import('tdesign-vue-next')['Avatar'] TButton: typeof import('tdesign-vue-next')['Button'] TCard: typeof import('tdesign-vue-next')['Card'] - TCheckbox: typeof import('tdesign-vue-next')['Checkbox'] TDialog: typeof import('tdesign-vue-next')['Dialog'] TDropdown: typeof import('tdesign-vue-next')['Dropdown'] TForm: typeof import('tdesign-vue-next')['Form'] @@ -24,11 +24,13 @@ declare module 'vue' { TIcon: typeof import('tdesign-vue-next')['Icon'] TInput: typeof import('tdesign-vue-next')['Input'] TLayout: typeof import('tdesign-vue-next')['Layout'] - TLink: typeof import('tdesign-vue-next')['Link'] TMenu: typeof import('tdesign-vue-next')['Menu'] TMenuItem: typeof import('tdesign-vue-next')['MenuItem'] + TRadioButton: typeof import('tdesign-vue-next')['RadioButton'] + TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup'] TSpace: typeof import('tdesign-vue-next')['Space'] TTable: typeof import('tdesign-vue-next')['Table'] TTag: typeof import('tdesign-vue-next')['Tag'] + TUpload: typeof import('tdesign-vue-next')['Upload'] } } diff --git a/src/api/carousal.ts b/src/api/carousal.ts index 09f3ca6..84aa263 100644 --- a/src/api/carousal.ts +++ b/src/api/carousal.ts @@ -1,8 +1,7 @@ import httpClient from './httpClient' import type { CreateCarousalsRequest, GetCarousalsRequest } from '@/model/carousals' -import type { UnwrapNestedRefs } from 'vue' -export const createCarousal = (createCarousalsRequest: UnwrapNestedRefs<{ size: number; page: number }> & {}) => { +export const createCarousal = (createCarousalsRequest: CreateCarousalsRequest) => { return httpClient.post('/carousals', createCarousalsRequest) } diff --git a/src/components/ImageUpload.vue b/src/components/ImageUpload.vue new file mode 100644 index 0000000..5522c8b --- /dev/null +++ b/src/components/ImageUpload.vue @@ -0,0 +1,67 @@ + + + + + \ No newline at end of file diff --git a/src/model/carousals.ts b/src/model/carousals.ts index 1c132ea..7bd74a5 100644 --- a/src/model/carousals.ts +++ b/src/model/carousals.ts @@ -1,12 +1,12 @@ export interface CreateCarousalsRequest { imageUrl:string, targetType:string, - targetUrl:string, - targetId:string + targetUrl?:string, + targetId?:string } export interface GetCarousalsRequest { - page:string, - size:string, - order?:string + page:number, + size:number, + order?:[string] } diff --git a/src/pages/carousal/components/CarousalDialog.vue b/src/pages/carousal/components/CarousalDialog.vue index 8d6e8d1..8a8e003 100644 --- a/src/pages/carousal/components/CarousalDialog.vue +++ b/src/pages/carousal/components/CarousalDialog.vue @@ -1,6 +1,6 @@ diff --git a/src/router/index.ts b/src/router/index.ts index 59dc447..cbe0493 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -45,13 +45,13 @@ const router = createRouter({ ] }) -// router.beforeEach((to, from, next) => { -// if (to.name !== 'login') { -// const appStore = useAppStore() -// appStore.isLogin ? next() : next({ name: 'login' }) -// return -// } -// next() -// }) +router.beforeEach((to, from, next) => { + if (to.name !== 'login') { + const appStore = useAppStore() + appStore.isLogin ? next() : next({ name: 'login' }) + return + } + next() +}) export default router