新增权限域名限制和链接背景上传
This commit is contained in:
@@ -27,7 +27,7 @@ const fileUtils = {
|
||||
* @returns {File} File 对象
|
||||
*/
|
||||
base64ToFile(base64Data, customFilename) {
|
||||
const match = base64Data.match(/^data:(image|video)\/([a-zA-Z0-9.+-]+);base64,/);
|
||||
const match = base64Data.match(/^data:(image|jpeg|video)\/([a-zA-Z0-9.+-]+);base64,/);
|
||||
if (!match) {
|
||||
throw new Error('Invalid base64 data format');
|
||||
}
|
||||
@@ -35,7 +35,7 @@ const fileUtils = {
|
||||
const type = match[1]; // image 或 video
|
||||
const ext = match[2]; // jpg, png, mp4 等
|
||||
const mimeType = `${type}/${ext}`;
|
||||
const cleanBase64 = base64Data.replace(/^data:(image|video)\/[a-zA-Z0-9.+-]+;base64,/, '');
|
||||
const cleanBase64 = base64Data.replace(/^data:(image|jpeg|video)\/[a-zA-Z0-9.+-]+;base64,/, '');
|
||||
|
||||
const byteCharacters = atob(cleanBase64);
|
||||
const byteArrays = [];
|
||||
|
||||
Reference in New Issue
Block a user