gpt4 book ai didi

javascript - 如何从 json.stringify : ionic 读取特定值

转载 作者:行者123 更新时间:2023-11-30 14:24:45 27 4
gpt4 key购买 nike

从帖子中我得到了一个资源

.subscribe( res => {
let result = JSON.stringify(res);
alert(result)
})

& 作为 alert(result) 的响应我得到了

{"access_token": "hjhdshJHUHYI67HUjhhk98BJ_BJHBBHbnbhbhbjh_jmnhghmghgfffgxcgfcf98hujh",
"expires_in":"518399"}

我想读取 access_token 值并将其保存在一个变量中,我该怎么做?

最佳答案

您不必进行字符串化,只需将其作为 res.access_token 访问即可

.subscribe((res:any) => {
let result = res.access_token;
alert(result)
})

关于javascript - 如何从 json.stringify : ionic 读取特定值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52130257/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com