Skip to content

Commit

Permalink
refactor: csrftoken名称改为动态获取 --story=119912007
Browse files Browse the repository at this point in the history
  • Loading branch information
luofann committed Sep 29, 2024
1 parent d2038f9 commit 1927a33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/pc/src/utils/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const instance = axios.create({
// `headers` are custom headers to be sent
headers: { 'X-Requested-With': 'XMLHttpRequest' },
// csrftoken变量名
xsrfCookieName: `${BKAPP_CSRF_COOKIE_NAME}_csrftoken`,
xsrfCookieName: `${window.BKAPP_CSRF_COOKIE_NAME}_csrftoken`,
// cookie中的csrftoken信息名称
xsrfHeaderName: 'X-CSRFToken',
withCredentials: true,
Expand Down

0 comments on commit 1927a33

Please sign in to comment.