This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/test by this push:
new f73641ef fix: optimization askRedirect function
f73641ef is described below
commit f73641eff9574e86b082d0b0323a36f923b12dbb
Author: shuai <[email protected]>
AuthorDate: Thu Aug 28 16:56:58 2025 +0800
fix: optimization askRedirect function
---
ui/src/utils/guard.ts | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts
index 85ab5e69..91e2013b 100644
--- a/ui/src/utils/guard.ts
+++ b/ui/src/utils/guard.ts
@@ -410,14 +410,12 @@ export const googleSnapshotRedirect = () => {
};
export const askRedirect = () => {
- const searchStr = new URLSearchParams(window.location.search);
- const gr: TGuardResult = {
+ // 获取当前路径的查询参数部分
+ const queryString = window.location.search;
+ return {
ok: false,
- redirect: searchStr
- ? `/questions/add?${searchStr.toString()}`
- : '/questions/add',
+ redirect: `/questions/add${queryString}`,
};
- return gr;
};
let appInitialized = false;