From 54ca339d896d92a6c0daf120c516a231ecb8f13d Mon Sep 17 00:00:00 2001 From: ZvonimirSun Date: Thu, 16 Nov 2023 15:20:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(urls):=20=E6=B7=BB=E5=8A=A0=E7=9F=AD?= =?UTF-8?q?=E7=BD=91=E5=9D=80=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 1 + package.json | 1 + src/components.d.ts | 4 + src/main.ts | 2 +- src/views/others/urls.vue | 249 ++++++++++++++++++++++++++++++++++++++ src/views/tools.json | 5 + 6 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 .env.test create mode 100644 src/views/others/urls.vue diff --git a/.env.test b/.env.test new file mode 100644 index 000000000..455836569 --- /dev/null +++ b/.env.test @@ -0,0 +1 @@ +VITE_API_BASE_URL=http://localhost:3001 diff --git a/package.json b/package.json index 712fd5796..b592460f5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "dev": "vite", + "dev:api": "vite --mode test", "build": "vue-tsc --noEmit && vite build", "serve": "vite preview", "lint": "eslint --fix src/**/*.{js,ts,vue}" diff --git a/src/components.d.ts b/src/components.d.ts index e0d3383c3..85e6ce571 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -47,6 +47,7 @@ declare module 'vue' { ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] + ElLink: typeof import('element-plus/es')['ElLink'] ElMain: typeof import('element-plus/es')['ElMain'] ElOption: typeof import('element-plus/es')['ElOption'] ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] @@ -79,4 +80,7 @@ declare module 'vue' { VanillaJsonEditor: typeof import('./components/VanillaJsonEditor.vue')['default'] VueCodemirror: typeof import('./components/vue-codemirror.vue')['default'] } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] + } } diff --git a/src/main.ts b/src/main.ts index de8e11fb2..725cd1376 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import axios from '@/plugins/Axios' import { createPiniaPersist } from '@/plugins/PiniaPersist' import 'element-plus/theme-chalk/dark/css-vars.css' -const $apiBase = 'https://api.iszy.xyz'; +const $apiBase = import.meta.env.PROD ? 'https://api.iszy.xyz' : import.meta.env.VITE_API_BASE_URL || 'https://api.iszy.xyz'; (async () => { const pinia = createPinia() diff --git a/src/views/others/urls.vue b/src/views/others/urls.vue new file mode 100644 index 000000000..27811319a --- /dev/null +++ b/src/views/others/urls.vue @@ -0,0 +1,249 @@ + + + + + diff --git a/src/views/tools.json b/src/views/tools.json index bff934216..19884c050 100644 --- a/src/views/tools.json +++ b/src/views/tools.json @@ -3,6 +3,11 @@ "type": "通用工具", "icon": "i-icon-park-outline-toolkit", "children": [ + { + "name": "短网址", + "link": "/urls", + "requiresAuth": true + }, { "name": "屏幕录制", "link": "/screenRecord"