只能保存JSON字符串 不能保存字符串数组 所以
var storage = window.sessionStorage;
storage.setItem('user',JSON.stringify(result['data']['permissions']));
取的时候
var storage = window.sessionStorage;
let _this = this;
setTimeout(function (){
let _theme = theme;
for(var i=0; i< JSON.parse(storage["user"]).length; i++){
if(JSON.parse(storage["user"]).indexOf('admin') !== -1){
_this.statusCards = _this.statusCardsByThemes[_theme.name];
}else{
_this.statusCards = _this.statusCardsByThemes[_theme.name].slice(1,2);
}
}
}, 200);