闫增涛
2024-04-15 cb6bb8bda31df75afe5a5bd50fe8e3ff6a3d34e2
packageBookService/pages/bookServices/examination/examination.js
@@ -202,14 +202,15 @@
    // 正则表达式匹配<source>标签中的src属性值  
    var srcRegex = /<source\s+src="([^"]+)"/i;
    var srcTwo = /<audio\s+src="([^"]+)"/i;
    // 执行正则匹配  
    var match = srcRegex.exec(htmlString);
    const local = srcTwo.exec(htmlString)
    // 如果匹配成功,返回第一个捕获组的内容(src属性的值)  
    if (match && match[1]) {
      return match[1];
      return match[1].replace( '../file', app.config.requestCtx + '/file');
    } else if (local && local[1]) {
      return local[1]
      return local[1].replace( '../file', app.config.requestCtx + '/file')
    } else {
      // 如果没有匹配到,返回null  
      return null;