Skip to content

Commit 59eb2c4

Browse files
committed
fix: Resolve wireless redirection issues
1 parent 7366603 commit 59eb2c4

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

chat2db-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"start": "concurrently \"npm run start:web\" \"npm run start:main\"",
2323
"start:main": "cross-env NODE_ENV=development electron .",
2424
"start:main:prod": "cross-env NODE_ENV=production electron .",
25-
"start:web": "cross-env UMI_ENV=local cross-env APP_VERSION=${npm_config_app_version} umi dev"
25+
"start:web": "cross-env UMI_ENV=local HMR=none cross-env APP_VERSION=${npm_config_app_version} umi dev"
2626
},
2727
"dependencies": {
2828
"ahooks": "^3.7.7",

chat2db-client/src/utils/eventSource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const connectToEventSource = (params: { url: string; uid: string; onMessage: Fun
1515
},
1616
};
1717
const eventSource = new EventSourcePolyfill(`${window._BaseURL}${url}`, p);
18+
// const eventSource = new EventSource(`${window._BaseURL}${url}`, p)
1819

1920
eventSource.onmessage = (event) => {
2021
// console.log('onmessage', event);

chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/config/config/Chat2dbWebMvcConfigurer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Chat2dbWebMvcConfigurer implements WebMvcConfigurer {
5656
* 全局放行的url
5757
*/
5858
private static final String[] FRONT_PERMIT_ALL = new String[] {"/favicon.ico", "/error", "/static/**",
59-
"/api/system"};
59+
"/api/system", "/login"};
6060

6161
@Resource
6262
private UserService userService;
@@ -138,14 +138,17 @@ public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServl
138138
log.info("访问{},{}需要登录", buildHeaderString(request), SaHolder.getRequest().getUrl());
139139

140140
String path = SaHolder.getRequest().getRequestPath();
141+
// if(path.startsWith("/login")){
142+
// return true;
143+
// }
141144
if (path.startsWith(API_PREFIX)) {
142145
response.getWriter().println(JSON.toJSONString(
143146
ActionResult.fail("common.needLoggedIn", I18nUtils.getMessage("common.needLoggedIn"),
144147
"")));
145148
return false;
146149
} else {
147150
throw new RedirectBusinessException(
148-
"/login-a#/login?callback=" + SaFoxUtil.joinParam(request.getRequestURI(),
151+
"/login?callback=" + SaFoxUtil.joinParam(request.getRequestURI(),
149152
request.getQueryString()));
150153
}
151154
}

chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ThymeleafController {
2222
*
2323
* @return
2424
*/
25-
@GetMapping(value = {"/", "/web/", "/web/**","login-a"})
25+
@GetMapping(value = {"/", "/web/", "/web/**","/login"})
2626
public String index() {
2727
return "index";
2828
}

0 commit comments

Comments
 (0)