import { minioBaseUrl } from "./setting.js" /** * @description 设置图片回显路径 * @param {String} str 路径 * @param {Number} type 回显类型 1普通回显 2上传回显 */ export const setImageUrl = (str, type = 1) => { if (str) { let strArr = str.split(",") let urls = []; if (type == 1) { for (let i of strArr) { urls.push(`${minioBaseUrl}${i}`) } } else { for (let i of strArr) { urls.push({ name: i, url: `${minioBaseUrl}${i}` }) } } return urls; } else { return [] } } export const showTips = (text, icon) => { uni.showToast({ title: text, icon: icon ? icon : 'none' }) }