|
@@ -495,6 +495,11 @@
|
|
let errMsg = "";
|
|
let errMsg = "";
|
|
workSheetsFromBuffer[0].data.map((item, index) => {
|
|
workSheetsFromBuffer[0].data.map((item, index) => {
|
|
if(item.length > 0){
|
|
if(item.length > 0){
|
|
|
|
+ let ititle = item[0].toString().trim();
|
|
|
|
+ if(this.containsAnyChar(ititle.toString(), ['\\', '/', ':', '*', '?', '"', '<', '>', '|'])){ //判断是否含有特殊字符
|
|
|
|
+ errMsg += "第" + (index+1) + '行-名称不能包以下字符 \\ / : * ? " < > |';
|
|
|
|
+ ititle = ititle.replace(/[\\|/|:|*|?|"|<|>||]/g, "");
|
|
|
|
+ }
|
|
if(item[1] == undefined){
|
|
if(item[1] == undefined){
|
|
errMsg += "第" + (index+1) + "行格式有误</br>";
|
|
errMsg += "第" + (index+1) + "行格式有误</br>";
|
|
item[1] = '';
|
|
item[1] = '';
|
|
@@ -503,7 +508,7 @@
|
|
}else{
|
|
}else{
|
|
let info = {
|
|
let info = {
|
|
url: item[1],
|
|
url: item[1],
|
|
- title: item[0].toString().trim(),
|
|
|
|
|
|
+ title: ititle,
|
|
status: '1',
|
|
status: '1',
|
|
num: 0,
|
|
num: 0,
|
|
newPath: ''
|
|
newPath: ''
|
|
@@ -693,7 +698,7 @@
|
|
|
|
|
|
page.on('response', async(response) => {
|
|
page.on('response', async(response) => {
|
|
// 检查响应的 MIME 类型是否以 'image/' 开头
|
|
// 检查响应的 MIME 类型是否以 'image/' 开头
|
|
- if (response.headers()['content-type'] && response.headers()['content-type'].startsWith('image/')) {
|
|
|
|
|
|
+ if (response.headers()['content-type'] && response.headers()['content-type'].startsWith('image/') && response.headers()['content-length']) {
|
|
let imgArr = ['gif', 'jpeg', 'png', 'webp', 'svg', 'tiff', 'bmp', 'ico', 'avif'];
|
|
let imgArr = ['gif', 'jpeg', 'png', 'webp', 'svg', 'tiff', 'bmp', 'ico', 'avif'];
|
|
let imgType = 'jpg';
|
|
let imgType = 'jpg';
|
|
let isBase = false;
|
|
let isBase = false;
|
|
@@ -1636,12 +1641,14 @@
|
|
if (status < 200 || status >= 300) {
|
|
if (status < 200 || status >= 300) {
|
|
reject(false);
|
|
reject(false);
|
|
this.$notify.error({
|
|
this.$notify.error({
|
|
- title: '网络异常,请稍后重试!- 1 - ' + imageUrl
|
|
|
|
|
|
+ title: '网络图片访问异常!- 1',
|
|
|
|
+ message: imageUrl.slice(0,50)
|
|
});
|
|
});
|
|
}else if(isNaN(total_bytes)){
|
|
}else if(isNaN(total_bytes)){
|
|
reject(false);
|
|
reject(false);
|
|
this.$notify.error({
|
|
this.$notify.error({
|
|
- title: '网络异常,请稍后重试!- 2 - ' + imageUrl
|
|
|
|
|
|
+ title: '网络图片访问异常!- 2',
|
|
|
|
+ message: imageUrl.slice(0,50)
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
// console.log('下载中...')
|
|
// console.log('下载中...')
|