Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.5k views
in Technique[技术] by (71.8m points)

小程序怎样获取response中头部的数据?

打印console.log(res.header['Set-Cookie'])的值 得到下面的数据
我怎么拿到laravel_session的值呢 字符串截取吗?

laravel_session=3uLUaE6S7Zn2Ti3lO0ymWWYfKAwVF5Exmo6QNHgH; expires=Wed, 18-Nov-2020 09:34:37 GMT; Max-Age=7200; path=/; HttpOnly,remember_admin_59ba36addc2b2f9401580f014c7f58ea4e30989d=1%7CkCaZYw2Zv7qzb13KrOJNarvSpVWEQHIUFYXonG0UNrLSA8nHxLWZ9s9Fpyv7; expires=Mon, 17-Nov-2025 07:34:37 GMT; Max-Age=157680000; path=/; HttpOnly

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你可以试试,res.cookies,2.10.0版本开始支持
image.png

不然你就得自己解析咯


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...