egg icon indicating copy to clipboard operation
egg copied to clipboard

url中#(hash)过滤问题

Open ugvgylkm opened this issue 5 years ago • 2 comments

前台访问url:http://www.xxx.com/test/229/profile/#profile到后台获取url是http://www.xxx.com/test/229/profile/ 是哪个安全策略把url中的#hash给过滤了么?

ugvgylkm avatar Sep 15 '21 03:09 ugvgylkm

hash 本身就不会被发给服务端,这是 HTTP 知识。

如果你想发服务端,可以去了解下 h5mode

atian25 avatar Sep 15 '21 03:09 atian25

服务端不能获取到hash部分,但是:前端访问带有hash的url,服务端只是做重定向的话,url重定向时会带上hash哦

MossByte07 avatar Mar 01 '23 03:03 MossByte07