Эх сурвалжийг харах

Merge branch 'alt_04_15_liu' into pre

rkljw 4 өдөр өмнө
parent
commit
84357584f0

+ 10 - 0
src/components/edit/myEditor.vue

@@ -50,6 +50,16 @@ export default {
               return;
             }
             success(json.data.imgUrl);
+            // Listen for the NodeChange event to set the alt attribute
+            const editor = tinymce.activeEditor;
+            editor.on('NodeChange', function(e) {
+              const imgElm = e.element;
+              if (imgElm.nodeName === 'IMG' && imgElm.src === json.data.imgUrl) {
+                console.log("Setting alt attribute to:",  json.data.oldName || '全国政务信息一体化应用平台'); // Debugging: Check the alt value
+                editor.dom.setAttrib(imgElm, 'alt',json.data.oldName || '全国政务信息一体化应用平台'); // Use oldName or a default value
+                editor.off('NodeChange'); // Remove the event listener after setting the alt
+              }
+            });
           };
 
           formData = new FormData();

+ 4 - 1
src/permission.js

@@ -82,7 +82,10 @@ router.beforeEach(async(to, from, next) => {
     }
   } else {
     /* has no token*/
-
+    const userurl = hashParams();
+    if(userurl){
+      setUserUrl(userurl, 86400) 
+    }
     if (whiteList.indexOf(to.path) !== -1) {
       // in the free login whitelist, go directly
       next()