web
2025-03-26 98247bb0b4da9a322c97867262c1a76c53ace520
src/utils/validate.js
@@ -93,12 +93,12 @@
}
//设置图片路径
import { PREURL } from '@/config/index'
const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀
export const getImage = (imgList) =>{
  if(imgList != null){
    return imgList.split(',').map((image) => {
      if(image.indexOf('http') == -1 && image != ''){
        return PREURL + image
        return imgBaseUrl + image
      }else {
        return image
      }
@@ -107,8 +107,8 @@
}
export const setImage = (imgList) =>{
  return imgList.map((image) => {
    if(image.indexOf(PREURL) != -1){
      return image.replace(PREURL,'')
    if(image.indexOf(imgBaseUrl) != -1){
      return image.replace(imgBaseUrl,'')
    }else {
      return image
    }