From 8f1383cbe4cd135fd88198d92ef36e2f2bb4b058 Mon Sep 17 00:00:00 2001 From: qiufeng Date: Fri, 6 Jan 2023 21:36:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 -- .env.production | 5 +--- .env.test | 5 +--- src/hooks/setting/index.ts | 2 -- .../header/components/lock/LockModal.vue | 3 +- .../header/components/user-dropdown/index.vue | 7 +++-- src/utils/Env.ts | 2 -- src/utils/http/axios/Axios.ts | 1 - src/utils/http/axios/index.ts | 9 +----- src/utils/http/image/ImageRequest.ts | 29 +++++++++++++++++++ src/views/sys/account/setting/BaseSetting.vue | 7 +++-- types/axios.d.ts | 4 --- types/config.d.ts | 4 --- 13 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 src/utils/http/image/ImageRequest.ts diff --git a/.env.development b/.env.development index 44f61f6b..bd531c09 100644 --- a/.env.development +++ b/.env.development @@ -17,6 +17,3 @@ VITE_GLOB_API_URL=/api # File upload address, optional VITE_GLOB_UPLOAD_URL=/storage/file - -# Interface prefix -VITE_GLOB_API_URL_PREFIX= diff --git a/.env.production b/.env.production index 9c17dbb8..d42a573b 100644 --- a/.env.production +++ b/.env.production @@ -22,9 +22,6 @@ VITE_GLOB_API_URL=/api # It can be forwarded by nginx or write the actual address directly VITE_GLOB_UPLOAD_URL=/storage/file -# Interface prefix -VITE_GLOB_API_URL_PREFIX= - # Whether to enable image compression VITE_USE_IMAGEMIN= true @@ -32,4 +29,4 @@ VITE_USE_IMAGEMIN= true VITE_USE_PWA = false # Is it compatible with older browsers -VITE_LEGACY = false +VITE_LEGACY = false \ No newline at end of file diff --git a/.env.test b/.env.test index 74e29328..17a8ee6f 100644 --- a/.env.test +++ b/.env.test @@ -23,9 +23,6 @@ VITE_GLOB_API_URL=/api # It can be forwarded by nginx or write the actual address directly VITE_GLOB_UPLOAD_URL=/storage/file -# Interface prefix -VITE_GLOB_API_URL_PREFIX= - # Whether to enable image compression VITE_USE_IMAGEMIN= true @@ -33,4 +30,4 @@ VITE_USE_IMAGEMIN= true VITE_USE_PWA = false # Is it compatible with older browsers -VITE_LEGACY = false +VITE_LEGACY = false \ No newline at end of file diff --git a/src/hooks/setting/index.ts b/src/hooks/setting/index.ts index 025445f0..016fe67f 100644 --- a/src/hooks/setting/index.ts +++ b/src/hooks/setting/index.ts @@ -8,7 +8,6 @@ export const useGlobSetting = (): Readonly => { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, - VITE_GLOB_API_URL_PREFIX, VITE_GLOB_UPLOAD_URL } = getAppEnvConfig(); @@ -23,7 +22,6 @@ export const useGlobSetting = (): Readonly => { title: VITE_GLOB_APP_TITLE, apiUrl: VITE_GLOB_API_URL, shortName: VITE_GLOB_APP_SHORT_NAME, - urlPrefix: VITE_GLOB_API_URL_PREFIX, uploadUrl: VITE_GLOB_UPLOAD_URL }; return glob as Readonly; diff --git a/src/layouts/default/header/components/lock/LockModal.vue b/src/layouts/default/header/components/lock/LockModal.vue index c18e5b2f..9a31fa93 100644 --- a/src/layouts/default/header/components/lock/LockModal.vue +++ b/src/layouts/default/header/components/lock/LockModal.vue @@ -33,6 +33,7 @@ import { BasicForm, useForm } from "/@/components/Form/index"; import { useUserStore } from "/@/store/modules/User"; import { useLockStore } from "/@/store/modules/Lock"; import headerImg from "/@/assets/images/header.png"; +import { imageUrl } from "/@/utils/http/image/ImageRequest"; export default defineComponent({ name: "LockModal", @@ -75,7 +76,7 @@ export default defineComponent({ } const avatar = computed(() => { - return userStore.getUserInfo?.headImgUrl || headerImg; + return imageUrl("/storage/file/" + userStore.getUserInfo?.headImgUrl) || headerImg; }); return { diff --git a/src/layouts/default/header/components/user-dropdown/index.vue b/src/layouts/default/header/components/user-dropdown/index.vue index 0e9773ee..9c0a9a38 100644 --- a/src/layouts/default/header/components/user-dropdown/index.vue +++ b/src/layouts/default/header/components/user-dropdown/index.vue @@ -48,7 +48,7 @@