File tree Expand file tree Collapse file tree
backend/framework/src/main/java/org/jumpserver/chen/framework/console Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,17 +83,18 @@ public void onConnect(Connect connect) {
8383 try {
8484 var currentContext = this .getSqlActuator ().getCurrentSchema ();
8585
86-
87- if (StringUtils .isEmpty (context )) {
88- context = currentContext ;
89- }
90-
91- if (currentContext != null && !currentContext .equals (context )) {
86+ if (StringUtils .isEmpty (currentContext ) && !StringUtils .isEmpty (context )) {
9287 this .getSqlActuator ().changeSchema (context );
88+ this .getState ().setCurrentContext (context );
89+ } else {
90+ if (!StringUtils .isEmpty (context ) && !currentContext .equals (context )) {
91+ this .getSqlActuator ().changeSchema (context );
92+ this .getState ().setCurrentContext (context );
93+ }
9394 }
95+
9496 var schemas = this .getSqlActuator ().getSchemas ();
9597 this .getState ().setContexts (schemas );
96- this .getState ().setCurrentContext (context );
9798
9899 } catch (SQLException e ) {
99100 this .getConsoleLogger ().error (MessageUtils .get ("msg.error.connect_error" ) + ": %s" , e .getMessage ());
You can’t perform that action at this time.
0 commit comments