token的解码及 判断值不为空的方法

  token 的解码要使用插件:jwt-decode

  判断值不为空的方法:  

  function isEmpty(value){
      return (
        value === undefined ||
        value === null ||
        (typeof value === "object" && Object.keys(value).length === 0) ||
        (typeof value === "string" && value.trim().length === 0)
      )
    }
  var bool= isEmpty(a);

 

posted on 2019-11-05 17:16  Web引领者  阅读(1522)  评论(0编辑  收藏  举报