添加充值功能、优化内容
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import Decimal from 'decimal.js'
|
||||
import { allowedNodeEnvironmentFlags } from 'process'
|
||||
import { toast } from './toast'
|
||||
import { isArray } from 'wot-design-uni/components/common/util';
|
||||
|
||||
/**
|
||||
* 页面跳转方法
|
||||
@ -158,3 +159,20 @@ export function getCurrentDate() {
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化上传图片的URL,去除前缀
|
||||
* @param file 上传图片文件列表
|
||||
* @returns 去除前缀后的图片URL列表
|
||||
*/
|
||||
export function removeImageUrlPrefix(file: any) {
|
||||
const fileList = file.map(item => {
|
||||
if (item.response) {
|
||||
const response = JSON.parse(item.response)
|
||||
if (response.code) {
|
||||
return response.data.uri.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')
|
||||
}
|
||||
}
|
||||
return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')
|
||||
})
|
||||
return fileList
|
||||
}
|
||||
Reference in New Issue
Block a user