@GetMapping("/getLoginStatus")
    public DataResult<QrCodeResponse> getLoginStatus(@RequestParam(required = false) String token) {
        LoginUser loginUser = ContextUtils.getLoginUser();
        if (RoleCodeEnum.USER.getCode().equals(loginUser.getRoleCode())) {
            return DataResult.of(QrCodeResponse.builder().build());
        }
        DataResult<QrCodeResponse> dataResult = gatewayClientService.getLoginStatus(token);
        QrCodeResponse qrCodeResponse = dataResult.getData();
        // Representative successfully logged in
        if (StringUtils.isNotBlank(qrCodeResponse.getApiKey())) {
            SystemConfigParam sqlSourceParam = SystemConfigParam.builder().code(RestAIClient.AI_SQL_SOURCE)
                .content(AiSqlSourceEnum.CHAT2DBAI.getCode()).build();
            configService.createOrUpdate(sqlSourceParam);
            SystemConfigParam param = SystemConfigParam.builder()
                .code(Chat2dbAIClient.CHAT2DB_OPENAI_KEY).content(qrCodeResponse.getApiKey())
                .build();
            configService.createOrUpdate(param);
            SystemConfigParam hostParam = SystemConfigParam.builder()
                .code(Chat2dbAIClient.CHAT2DB_OPENAI_HOST)
                .content(chat2dbProperties.getGateway().getModelBaseUrl() + "/model")
                .build();
            configService.createOrUpdate(hostParam);
            Chat2dbAIClient.refresh();
        }
        return dataResult;
    }
Query login status

@param token
@return
chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/AiConfigController.java