Skip to content

Commit

Permalink
fix(frontend): 修复CSRF token 取值错误的问题 #2469
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Dec 11, 2023
1 parent b545e62 commit 64a95db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/backend/ticket/flow_manager/inner.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _status(self) -> str:

@property
def _url(self) -> str:
return f"/database/{self.ticket.bk_biz_id}/task-history/detail/{self.root_id}/"
return f"/{self.ticket.bk_biz_id}/task-history/detail/{self.root_id}"

def check_exclusive_operations(self):
"""判断执行互斥"""
Expand Down
6 changes: 3 additions & 3 deletions dbm-ui/frontend/src/services/http/lib/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ requestMiddleware(axios.interceptors.request);
responseMiddleware(axios.interceptors.response);

const { CancelToken } = axios;
const CRRF_TOKEN_KEY = 'dbm_csrftoken';
const CSRF_TOKEN_KEY = 'dbm_csrftoken';

const csrfHashCode = (key: string) => {
let hashCode = 5381;
Expand All @@ -56,7 +56,7 @@ const csrfHashCode = (key: string) => {
}
return hashCode & 0x7fffffff;
};
const CSRFToken = Cookie.get(CRRF_TOKEN_KEY);
const CSRFToken = Cookie.get(CSRF_TOKEN_KEY);

axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
if (CSRFToken !== undefined) {
Expand All @@ -69,7 +69,7 @@ const defaultConfig = {
headers: {},
withCredentials: true,
paramsSerializer,
xsrfCookieName: 'bk-audit_csrftoken',
xsrfCookieName: 'dbm_csrftoken',
xsrfHeaderName: 'X-CSRFToken',
};

Expand Down
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.3.0-alpha.17
appVersion: 1.3.0-alpha.17
version: 1.3.0-alpha.18
appVersion: 1.3.0-alpha.18
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-dns-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 0.0.1-alpha.3
appVersion: 0.0.1-alpha.9
description: A Helm chart for Kubernetes
name: db-dns-api
version: 0.1.4
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.3.0-alpha.110
appVersion: 1.3.0-alpha.121
description: A Helm chart for dbm
name: dbm
type: application
Expand Down

0 comments on commit 64a95db

Please sign in to comment.