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);