Commit 23d01735af2ae49cb75fd95cfd2c9302da21b663

Authored by muyulingshi
1 parent cbc3fbcc

添加判断

Showing 1 changed file with 4 additions and 0 deletions
... ... @@ -19,6 +19,10 @@
19 19 NODE_INIT_DATE = {};
20 20
21 21 function hasStorage(name, date) {
  22 + if (JSON.stringify(date) === '{}') {
  23 + return false;
  24 + }
  25 +
22 26 if (typeof localStorage.getItem(name) != 'string') {
23 27 localStorage.setItem(name, JSON.stringify(date));
24 28 }
... ...
Please register or login to post a comment