# 解决 Vue axios 跨域请求每次 sessionID 都不一样的问题

**URL:** <https://www.shiqidu.com/t/topic/668>\
**Category:** 开发调优\
**Tags:** Vue\
**Created:** [2019 年10 月 28 日 11:04 UTC](https://www.shiqidu.com/t/topic/668 "2019-10-28T11:04:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Leon](https://www.shiqidu.com/user_avatar/www.shiqidu.com/leon/32/5_2.png) [@Leon](https://www.shiqidu.com/u/Leon)\
发布日期： [2019 年10 月 28 日 11:04 UTC](https://www.shiqidu.com/t/topic/668/1 "2019-10-28T11:04:54Z")

</div>

后台设置 `Access-Control-Allow-Origin` 为当前域名，比如 **[http://localhost:8080](http://localhost:8080)** 、`Access-Control-Allow-Credentials` 设置为 **true** ；前台设置 `defaults.withCredentials = true`，即可。
