adal getCachedToken始终为null

问题描述

我将使用react-adal api获取缓存令牌

CanExecute

令牌值始终为空,我指定了import { authContext,} from '../auth' const AvatarContainer = () => { getPersonPhoto(authContext) return ( <Avatar /> ) } async function getPersonPhoto(authContext) { const user = await authContext.getCachedUser(); const token = authContext.getCachedToken('https://graph.microsoft.com') console.log("the token",token) var photoUrl = "https://graph.microsoft.com/v1.0/users/" + user.profile.aud + "/photo/$value"; var Avatar = null; // try { // Avatar = await client // .api(photoUrl) // .get(); // return Avatar; // } catch (e) { return null; } } export default AvatarContainer ,但它不起作用。

我检查了本地存储中是否有令牌

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)