فهرست منبع

图片上传api更换

Xiao_123 6 ماه پیش
والد
کامیت
296714a861

+ 5 - 0
src/api/common/index.js

@@ -219,6 +219,11 @@ export const uploadFile = async (data) => {
   return await request.upload({ url: '/app-api/menduner/system/file/upload', data })
 }
 
+// 图片上传
+export const uploadImage = async (data) => {
+  return await request.upload({ url: '/app-api/infra/file/upload', data })
+}
+
 // 获取当前登录的企业用户信息
 export const getEnterprisingUserInfo = async (params) => {
   return await request.get({

+ 2 - 2
src/components/Upload/img.vue

@@ -21,7 +21,7 @@
 // 图片上传
 defineOptions({ name: 'upload-img'})
 import { ref, watch } from 'vue'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 import Snackbar from '@/plugins/snackbar'
 
@@ -63,7 +63,7 @@ const handleUploadFile = async (e) => {
   }
   const formData = new FormData()
   formData.append('file', file)
-  const { data } = await uploadFile(formData)
+  const { data } = await uploadImage(formData)
   if (!data) return Snackbar.error('上传失败')
   src.value = data
   if (props.showSnackbar) Snackbar.success(t('common.uploadSucMsg'))

+ 1 - 1
src/views/recruit/entRegister/register.vue

@@ -42,7 +42,7 @@
                   :value="licenseUrl"
                   :showSnackbar="false" 
                   @imgClick="showPreview = !showPreview" 
-                  :showCursor="true" 
+                  :showCursor="true"
                   @success="handleUploadImg" 
                   @delete="handleDeleteImg"
                 ></Img>

+ 2 - 2
src/views/recruit/enterprise/entInfoSetting/informationSettingsComponents/enterpriseAlbum.vue

@@ -42,7 +42,7 @@
 defineOptions({name: 'informationSettingsComponents-enterpriseAlbum'})
 import { ref } from 'vue'
 import { checkIsImage } from '@/utils'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 import { getEnterpriseBaseInfo, updateEnterpriseAlbum } from '@/api/enterprise'
 import Snackbar from '@/plugins/snackbar'
@@ -111,7 +111,7 @@ const handleUploadFile = async (e) => {
   }
   const formData = new FormData()
   formData.append('file', file)
-  const { data } = await uploadFile(formData)
+  const { data } = await uploadImage(formData)
   if (!data) return
   Snackbar.success(t('common.uploadSucMsg'))
   imgList.value.push(data)

+ 3 - 3
src/views/recruit/enterprise/entInfoSetting/informationSettingsComponents/enterpriseLogo.vue

@@ -45,7 +45,7 @@
 defineOptions({name: 'informationSettingsComponents-enterpriseLogo'})
 import { useUserStore } from '@/store/user'; const userStore = useUserStore()
 import { ref } from 'vue'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 import { updateEnterpriseLogo, getEnterpriseBaseInfo } from '@/api/enterprise'
 import Snackbar from '@/plugins/snackbar'
@@ -90,7 +90,7 @@ const handleHideCopper = (data) => {
 
     const formData = new FormData()
     formData.append('file', file)
-    uploadFile(formData).then(async ({ data }) => {
+    uploadImage(formData).then(async ({ data }) => {
       if (!data) return
       Snackbar.success(t('common.uploadSucMsg'))
       await updateEnterpriseLogo(data)
@@ -128,7 +128,7 @@ const handleUploadFile = async (e) => {
       // 大小符合直接上传logo
       const formData = new FormData()
       formData.append('file', file)
-      const { data } = await uploadFile(formData)
+      const { data } = await uploadImage(formData)
       if (!data) return
       Snackbar.success(t('common.uploadSucMsg'))
       await updateEnterpriseLogo(data)

+ 2 - 2
src/views/recruit/enterprise/staffInfoSetting/index.vue

@@ -30,7 +30,7 @@
 defineOptions({ name: 'information-setting'})
 import { ref } from 'vue'
 import { saveUserInfo } from '@/api/enterprise'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 // import { getDict } from '@/hooks/web/useDictionaries'
 import { useUserStore } from '@/store/user'
@@ -161,7 +161,7 @@ const handleHideCopper = (data) => {
 
     const formData = new FormData()
     formData.append('file', file)
-    uploadFile(formData).then(async ({ data }) => {
+    uploadImage(formData).then(async ({ data }) => {
       if (!data) return
       formItems.value.options.find(e => e.key === 'avatar').value = data
     })

+ 2 - 2
src/views/recruit/enterprise/systemManagement/groupAccount/index.vue

@@ -109,7 +109,7 @@ import { checkEmail } from '@/utils/validate'
 import { updateGroupUserAccount } from '@/api/enterprise'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { getUserAvatar } from '@/utils/avatar'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { getToken } from '@/utils/auth'
 
 const { t } = useI18n()
@@ -312,7 +312,7 @@ const handleHideCopper = (data) => {
 
     const formData = new FormData()
     formData.append('file', file)
-    uploadFile(formData).then(async ({ data }) => {
+    uploadImage(formData).then(async ({ data }) => {
       if (!data) return
       formItems.value.options.find(e => e.key === 'avatar').value = data
     })

+ 2 - 2
src/views/recruit/personal/PersonalCenter/resume/online/components/basicInfo.vue

@@ -118,7 +118,7 @@ import { getDict } from '@/hooks/web/useDictionaries'
 // import { timesTampChange } from '@/utils/date'
 import { updatePersonAvatar, saveResumeBasicInfo } from '@/api/recruit/personal/resume'
 import { useUserStore } from '@/store/user'
-import { uploadFile } from '@/api/common'
+import { uploadImage } from '@/api/common'
 import { getUserAvatar } from '@/utils/avatar'
 import { useI18n } from '@/hooks/web/useI18n'
 import portrait from './portrait.vue'
@@ -180,7 +180,7 @@ const handleHideCopper = (data) => {
     const formData = new FormData()
     formData.append('file', file)
     overlay.value = true
-    uploadFile(formData).then(async ({data}) => {
+    uploadImage(formData).then(async ({data}) => {
       if (!data) return
       await updatePersonAvatar(data)
       setTimeout(async () => {