Przeglądaj źródła

更新 指令逻辑

wzh 3 lat temu
rodzic
commit
ace190c37e
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/main.js

+ 1 - 1
src/main.js

@@ -50,7 +50,7 @@ router.afterEach((to, from) => {
 
 app.directive("auth", {
   mounted(el, bind) {
-    let permissions = localStorage.rolePermission?.split(",");
+    let permissions = localStorage.rolePermission?.split(",") || [];
     if (permissions.indexOf(bind.value) == -1) {
       el.parentNode.removeChild(el);
     }