When allowCredentials is true, allowedOrigins cannot contain the special value “*“since that cannot

淩亂°似流年 2024-04-06 15:41 170阅读 0赞

When allowCredentials is true, allowedOrigins cannot contain thespecial value “*“since that cannot be set on the “Access-Control-Allow-Origin” response header. To allow credentials to a set of origins, list them explicitly or consider using “allowedOriginPatterns” instead.

出现该问题是跨域问题,当allowCredentials为true时,allowingOrigins不能包含特殊值“ *”,因为无法在“ Access-Control-Allow-Origin”响应标头上设置。

处理方法是:首先找打你后端跨域设置文件,将方法中的addAllowedOrigin(““)替换成addAllowedOriginPattern(””)

发表评论

表情:
评论列表 (有 0 条评论,170人围观)

还没有评论,来说两句吧...

相关阅读