Explorar o código

修改session公共取值方法

liyanyan hai 1 mes
pai
achega
e75a935c51
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/mixins/index.js

+ 1 - 1
src/mixins/index.js

@@ -74,7 +74,7 @@ Vue.mixin({
     },
     // 取出
     storageGet(key) {
-      return JSON.parse(sessionStorage.getItem(key));
+      return JSON.parse(sessionStorage.getItem(key) == "undefined" ? null : sessionStorage.getItem(key));
     },
     // 删除
     storageRemove(key) {