Cors mvc configuration filtering to solve cross-domain problems

Just do the following configuration at the filter configuration location of mvc

<mvc:cors>

 
<mvc:mapping path="/api/**"

allowed-origins="http://twgfs.cn, http://twgfs.online"

allowed-methods="GET, PUT,POST"

allowed-headers="header1, header2, header3"

exposed-headers="header1, header2" allow-credentials="true"

max-age="1024" />

 
<mvc:mapping path="/resources/**"

allowed-origins="http://twgfs.cn" />
Published 19 original articles · won 7 · views 6623

Guess you like

Origin blog.csdn.net/William_TWG/article/details/104976180