From 351511a2dbfdaca0e943d4b39e342bee6607635e Mon Sep 17 00:00:00 2001 From: chen <1443977802@qq.com> Date: Tue, 19 Nov 2024 23:19:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(/pages/common):=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=99=BB=E9=99=86=E9=A1=B5=E6=96=87=E6=A1=88=E3=80=81=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=E3=80=81=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- components.d.ts | 5 ----- index.html | 2 +- pnpm-lock.yaml | 9 +++++++++ src/layouts/components/AppLogo.vue | 10 +++------- src/layouts/components/Header.vue | 22 ++++------------------ src/layouts/components/UserArea.vue | 9 ++++----- src/model/base.ts | 11 +++++++++-- src/model/token.ts | 2 +- src/model/user.ts | 15 ++++++--------- src/pages/common/login.vue | 20 ++++---------------- src/router/index.ts | 2 +- 12 files changed, 43 insertions(+), 66 deletions(-) diff --git a/.env b/.env index da5b2cc..0f0928f 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ VITE_ENABLE_MOCK=false VITE_API_PREFIX=/api -VITE_PROXY_ENDPOINT=http://localhost:8000 +VITE_PROXY_ENDPOINT=https://bright.yilibili.com/api diff --git a/components.d.ts b/components.d.ts index cf28278..bbec505 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,7 +8,6 @@ export {} declare module 'vue' { export interface GlobalComponents { Copyright: typeof import('./src/components/Copyright.vue')['default'] - Dialog: typeof import('./src/components/Dialog.vue')['default'] RegularPage: typeof import('./src/components/RegularPage.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -17,7 +16,6 @@ declare module 'vue' { TButton: typeof import('tdesign-vue-next')['Button'] TCard: typeof import('tdesign-vue-next')['Card'] TCheckbox: typeof import('tdesign-vue-next')['Checkbox'] - TCol: typeof import('tdesign-vue-next')['Col'] TDialog: typeof import('tdesign-vue-next')['Dialog'] TDropdown: typeof import('tdesign-vue-next')['Dropdown'] TForm: typeof import('tdesign-vue-next')['Form'] @@ -29,9 +27,6 @@ declare module 'vue' { TLink: typeof import('tdesign-vue-next')['Link'] TMenu: typeof import('tdesign-vue-next')['Menu'] TMenuItem: typeof import('tdesign-vue-next')['MenuItem'] - TPagination: typeof import('tdesign-vue-next')['Pagination'] - TRow: typeof import('tdesign-vue-next')['Row'] - TSelect: typeof import('tdesign-vue-next')['Select'] TSpace: typeof import('tdesign-vue-next')['Space'] TTable: typeof import('tdesign-vue-next')['Table'] TTag: typeof import('tdesign-vue-next')['Tag'] diff --git a/index.html b/index.html index 0cea6cc..d4b4ce4 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Yili Admin + 布兰德后台管理
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bcd8208..a26db71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -557,46 +557,55 @@ packages: resolution: {integrity: sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.22.4': resolution: {integrity: sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.22.4': resolution: {integrity: sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.22.4': resolution: {integrity: sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': resolution: {integrity: sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.22.4': resolution: {integrity: sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.22.4': resolution: {integrity: sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.22.4': resolution: {integrity: sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.22.4': resolution: {integrity: sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.22.4': resolution: {integrity: sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==} diff --git a/src/layouts/components/AppLogo.vue b/src/layouts/components/AppLogo.vue index 1a39a53..b8cb384 100644 --- a/src/layouts/components/AppLogo.vue +++ b/src/layouts/components/AppLogo.vue @@ -1,14 +1,10 @@ - + - + diff --git a/src/layouts/components/Header.vue b/src/layouts/components/Header.vue index 668297a..46a901f 100644 --- a/src/layouts/components/Header.vue +++ b/src/layouts/components/Header.vue @@ -1,25 +1,11 @@ - + diff --git a/src/layouts/components/UserArea.vue b/src/layouts/components/UserArea.vue index 857ab9c..75352cf 100644 --- a/src/layouts/components/UserArea.vue +++ b/src/layouts/components/UserArea.vue @@ -1,9 +1,10 @@ -
- 记住账号 - 忘记密码? -
{{ loading ? '登录中' : '登录' }} - diff --git a/src/router/index.ts b/src/router/index.ts index ddbf593..c1a3dd8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -24,7 +24,7 @@ const router = createRouter({ component: Layout, path: '/', redirect: { - name: 'dashboard' + name: 'classify' }, children: asyncRoutes }, From b45593079861772159530425271120e776eb0dcd Mon Sep 17 00:00:00 2001 From: zlong <953829746@qq.com> Date: Tue, 19 Nov 2024 23:43:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?add:=E4=B8=8A=E4=BC=A0banner=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- .env.development | 2 +- components.d.ts | 5 - src/api/carousal.ts | 30 ++++ src/model/carousals.ts | 12 ++ src/model/token.ts | 2 +- .../carousal/components/CarousalDialog.vue | 148 ++++++++++++++++++ src/pages/carousal/index.vue | 105 +++++++++++++ src/pages/common/login.vue | 8 +- src/router/index.ts | 25 ++- 10 files changed, 319 insertions(+), 20 deletions(-) create mode 100644 src/api/carousal.ts create mode 100644 src/model/carousals.ts create mode 100644 src/pages/carousal/components/CarousalDialog.vue create mode 100644 src/pages/carousal/index.vue diff --git a/.env b/.env index da5b2cc..cb3b622 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ VITE_ENABLE_MOCK=false VITE_API_PREFIX=/api -VITE_PROXY_ENDPOINT=http://localhost:8000 +VITE_PROXY_ENDPOINT=https://bright.yilibili.com/api/ diff --git a/.env.development b/.env.development index 92b86ee..9817c86 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -VITE_ENABLE_MOCK=true +VITE_ENABLE_MOCK=false diff --git a/components.d.ts b/components.d.ts index cf28278..bbec505 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,7 +8,6 @@ export {} declare module 'vue' { export interface GlobalComponents { Copyright: typeof import('./src/components/Copyright.vue')['default'] - Dialog: typeof import('./src/components/Dialog.vue')['default'] RegularPage: typeof import('./src/components/RegularPage.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -17,7 +16,6 @@ declare module 'vue' { TButton: typeof import('tdesign-vue-next')['Button'] TCard: typeof import('tdesign-vue-next')['Card'] TCheckbox: typeof import('tdesign-vue-next')['Checkbox'] - TCol: typeof import('tdesign-vue-next')['Col'] TDialog: typeof import('tdesign-vue-next')['Dialog'] TDropdown: typeof import('tdesign-vue-next')['Dropdown'] TForm: typeof import('tdesign-vue-next')['Form'] @@ -29,9 +27,6 @@ declare module 'vue' { TLink: typeof import('tdesign-vue-next')['Link'] TMenu: typeof import('tdesign-vue-next')['Menu'] TMenuItem: typeof import('tdesign-vue-next')['MenuItem'] - TPagination: typeof import('tdesign-vue-next')['Pagination'] - TRow: typeof import('tdesign-vue-next')['Row'] - TSelect: typeof import('tdesign-vue-next')['Select'] TSpace: typeof import('tdesign-vue-next')['Space'] TTable: typeof import('tdesign-vue-next')['Table'] TTag: typeof import('tdesign-vue-next')['Tag'] diff --git a/src/api/carousal.ts b/src/api/carousal.ts new file mode 100644 index 0000000..09f3ca6 --- /dev/null +++ b/src/api/carousal.ts @@ -0,0 +1,30 @@ +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 }> & {}) => { + return httpClient.post('/carousals', createCarousalsRequest) +} + +export const getCarousalList = (getCarousalsRequest:GetCarousalsRequest) => { + return httpClient.get('/carousals',getCarousalsRequest) +} +export const getCarousalItem = (id:string) => { + return httpClient.get(`/carousals/${id}`) +} + +export const updateCarousalItem = (id:number,updateCarousalsRequest: CreateCarousalsRequest) => { + return httpClient.put(`/carousals/${id}`,updateCarousalsRequest) +} + +export const deleteCarousal = (id:number) => { + return httpClient.delete(`/carousals/${id}`) +} + +export const activeCarousal = (id:number) => { + return httpClient.put(`/carousals/${id}/active`) +} + +export const inactiveCarousal = (id:number) => { + return httpClient.put(`/carousals/${id}/inactive`) +} \ No newline at end of file diff --git a/src/model/carousals.ts b/src/model/carousals.ts new file mode 100644 index 0000000..1c132ea --- /dev/null +++ b/src/model/carousals.ts @@ -0,0 +1,12 @@ +export interface CreateCarousalsRequest { + imageUrl:string, + targetType:string, + targetUrl:string, + targetId:string +} +export interface GetCarousalsRequest { + page:string, + size:string, + order?:string +} + diff --git a/src/model/token.ts b/src/model/token.ts index 2624a83..2302162 100644 --- a/src/model/token.ts +++ b/src/model/token.ts @@ -1,4 +1,4 @@ export interface CreateTokenRequest { - email: string + username: string password: string } diff --git a/src/pages/carousal/components/CarousalDialog.vue b/src/pages/carousal/components/CarousalDialog.vue new file mode 100644 index 0000000..8d6e8d1 --- /dev/null +++ b/src/pages/carousal/components/CarousalDialog.vue @@ -0,0 +1,148 @@ + + diff --git a/src/pages/carousal/index.vue b/src/pages/carousal/index.vue new file mode 100644 index 0000000..e3dc60b --- /dev/null +++ b/src/pages/carousal/index.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/pages/common/login.vue b/src/pages/common/login.vue index 04e42d2..11145c6 100644 --- a/src/pages/common/login.vue +++ b/src/pages/common/login.vue @@ -8,8 +8,8 @@ import { MessagePlugin } from 'tdesign-vue-next' import { useAppStore } from '@/stores/app' const loginForm = reactive({ - password: '', - email: '' + username: 'admin', + password: 'admin123' }) const canRegister = ref(false) @@ -18,7 +18,7 @@ const loading = ref(false) const appStore = useAppStore() const handleLogin = async () => { - if (!loginForm.email || !loginForm.password) { + if (!loginForm.username || !loginForm.password) { MessagePlugin.error('用户名或密码不能为空') return } @@ -40,7 +40,7 @@ const handleLogin = async () => { 买有账号?注册新账号
- + diff --git a/src/router/index.ts b/src/router/index.ts index ddbf593..595be79 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -14,6 +14,15 @@ export const asyncRoutes: RouteRecordRaw[] = [ icon: 'system-3' } }, + { + name: 'carousal', + path: 'carousal', + component: () => import('@/pages/carousal/index.vue'), + meta: { + title: '轮播图管理', + icon: 'system-3' + } + }, ] const router = createRouter({ @@ -36,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 From d28fe21a3df72f2cd32efab8a6bf1e458aad6061 Mon Sep 17 00:00:00 2001 From: zlong <953829746@qq.com> Date: Wed, 20 Nov 2024 11:17:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index c3ed3e9..158c544 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,6 +14,10 @@ export default defineConfig(({ command, mode }) => { return { plugins: [ vue(), + AutoImport({ + imports:['vue'], + dts:"src/auto-import.d.ts" // 会自动生成此文件 + }), vueDevTools(), AutoImport({ resolvers: [