Compare commits

...

2 Commits

Author SHA1 Message Date
1613d3525d fix: 修复找不到表的问题 2025-08-07 18:57:59 +08:00
49b57ab04c fix: 修复找不到表的问题 2025-08-07 18:57:26 +08:00
22 changed files with 91 additions and 86 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

View File

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.8-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
@Data
@NoArgsConstructor
@TableName("JBX_FILE_STORAGE")
@TableName("jbx_file_storage")
public class FileStorage {
@TableId(type = IdType.ASSIGN_ID)

View File

@ -28,7 +28,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@TableName("JBX_INSTITUTIONS")
@TableName("jbx_institutions")
public class Institutions extends BaseEntity implements Serializable {
static final long serialVersionUID = -2375872012431214098L;

View File

@ -40,7 +40,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_SOCIALS_ASSOCIATE")
@TableName("jbx_socials_associate")
public class SocialsAssociate extends BaseEntity implements Serializable {
@Serial
private static final long serialVersionUID = -207734216183303782L;

View File

@ -35,7 +35,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@TableName("JBX_SOCIALS_PROVIDER")
@TableName("jbx_socials_provider")
public class SocialsProvider extends BaseEntity implements Serializable {
static final long serialVersionUID = 1636727203025187769L;

View File

@ -42,7 +42,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
@Data
@NoArgsConstructor
@TableName("JBX_SESSION_LIST")
@TableName("jbx_session_list")
public class SessionList implements Serializable{
@Serial
private static final long serialVersionUID = -1321470643357719383L;

View File

@ -42,7 +42,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_HISTORY_CONNECTOR")
@TableName("jbx_history_connector")
public class HistoryConnector extends BaseEntity implements Serializable{
@Serial
private static final long serialVersionUID = 3465459057253994386L;

View File

@ -44,7 +44,7 @@ import com.jinbooks.entity.client.ClientUserAgent;
@Data
@NoArgsConstructor
@TableName("JBX_HISTORY_LOGIN")
@TableName("jbx_history_login")
public class HistoryLogin implements Serializable{
@Serial
private static final long serialVersionUID = -1321470643357719383L;

View File

@ -43,7 +43,7 @@ import com.jinbooks.entity.BaseEntity;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_HISTORY_LOGIN_APPS")
@TableName("jbx_history_login_apps")
public class HistoryLoginApps extends BaseEntity implements Serializable {
@Serial
private static final long serialVersionUID = -1600208317188910376L;

View File

@ -42,7 +42,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_HISTORY_SYNCHRONIZER")
@TableName("jbx_history_synchronizer")
public class HistorySynchronizer extends BaseEntity implements Serializable{
@Serial
private static final long serialVersionUID = -1184644499009162756L;

View File

@ -43,7 +43,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@TableName("JBX_HISTORY_SYSTEM_LOGS")
@TableName("jbx_history_system_logs")
public class HistorySystemLogs implements Serializable {
@Serial

View File

@ -45,7 +45,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_ORGANIZATIONS")
@TableName("jbx_organizations")
public class Organizations extends BaseEntity implements Serializable {
@Serial

View File

@ -48,7 +48,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_USERINFO")
@TableName("jbx_userinfo")
public class UserInfo extends BaseEntity implements Serializable {
@Serial
private static final long serialVersionUID = 6402443942083382236L;

View File

@ -37,7 +37,7 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("JBX_USERINFO")
@TableName("jbx_userinfo")
public class UserInstInfo extends BaseEntity implements Serializable {
@Serial
private static final long serialVersionUID = 7092456146043154933L;

View File

@ -41,7 +41,7 @@ import com.jinbooks.web.WebContext;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_PERMISSION")
@TableName("jbx_permission")
public class Permission extends BaseEntity implements Serializable {
@Serial
private static final long serialVersionUID = -8783585691243853899L;

View File

@ -32,7 +32,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName("JBX_RESOURCES")
@TableName("jbx_resources")
public class Resources extends BaseEntity implements Serializable {
@Serial

View File

@ -37,7 +37,7 @@ import java.util.Date;
*/
@Data
@NoArgsConstructor
@TableName("JBX_ROLE_MEMBER")
@TableName("jbx_role_member")
public class RoleMember implements Serializable {
@Serial

View File

@ -42,7 +42,7 @@ import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@TableName( "JBX_ROLES")
@TableName( "jbx_roles")
public class Roles extends BaseEntity implements Serializable {
@Serial

View File

@ -262,4 +262,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
public boolean switchBook(UserInfo userInfo) {
return getMapper().switchBook(userInfo) > 0;
}
public String enPassword(String passwd){
return passwordEncoder.encode(passwd);
}
}

View File

@ -1,12 +1,12 @@
/*
* Copyright [2025] [JinBooks of copyright http://www.jinbooks.com]
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -14,10 +14,6 @@
* limitations under the License.
*
*/
package com.jinbooks.web.contorller;
@ -62,72 +58,74 @@ import org.springframework.http.MediaType;
* </p>
*
* @author Crystal.Sea
*
*/
@RestController
@RequestMapping(value = "/login")
public class LoginEndpoint {
private static final Logger logger = LoggerFactory.getLogger(LoginEndpoint.class);
private static final Logger logger = LoggerFactory.getLogger(LoginEndpoint.class);
@Autowired
AuthTokenService authTokenService;
@Autowired
AuthTokenService authTokenService;
@Autowired
ApplicationConfig applicationConfig;
@Autowired
ApplicationConfig applicationConfig;
@Autowired
LoginConfig loginConfig;
@Autowired
LoginConfig loginConfig;
@Autowired
AbstractAuthenticationProvider authenticationProvider ;
@Autowired
AbstractAuthenticationProvider authenticationProvider;
@Autowired
LoginService loginService;
@Autowired
LoginService loginService;
@Autowired
SecretKeyManager secretKeyManager;
@Autowired
SecretKeyManager secretKeyManager;
/**
* init login。登录界面初始化信息
* @return
*/
@GetMapping(value={"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<LoginConfigDto> get() {
logger.debug("/login.");
LoginConfigDto conf = new LoginConfigDto();
ConfigLoginPolicy loginPolicy = loginService.getConfigLoginPolicy();
Institutions inst = (Institutions)WebContext.getAttribute(WebConstants.CURRENT_INST);
conf.setInst(inst);
conf.setCaptcha(loginPolicy.getCaptchaMgt().toUpperCase());
conf.setState(authTokenService.genRandomJwt());
LoginSecretKey loginSecretKey = secretKeyManager.getSecretKey();
conf.setSecretKey(loginSecretKey.getSecretKey());
conf.setSecretPublicKey(loginSecretKey.getPublicKey());
return new Message<>(conf);
}
/**
* init login。登录界面初始化信息
*
* @return
*/
@GetMapping(value = {"/get"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<LoginConfigDto> get() {
logger.debug("/login.");
LoginConfigDto conf = new LoginConfigDto();
ConfigLoginPolicy loginPolicy = loginService.getConfigLoginPolicy();
Institutions inst = (Institutions) WebContext.getAttribute(WebConstants.CURRENT_INST);
conf.setInst(inst);
conf.setCaptcha(loginPolicy.getCaptchaMgt().toUpperCase());
conf.setState(authTokenService.genRandomJwt());
LoginSecretKey loginSecretKey = secretKeyManager.getSecretKey();
conf.setSecretKey(loginSecretKey.getSecretKey());
conf.setSecretPublicKey(loginSecretKey.getPublicKey());
return new Message<>(conf);
}
/**
* 常规用户名和密码登录
* @param credential
* @return
*/
@PostMapping(value={"/signin"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<AuthJwt> signin( @RequestBody LoginCredential credential) {
Message<AuthJwt> authJwtMessage = new Message<>(Message.FAIL);
secretKeyManager.decrypt(credential);
if(authTokenService.validateJwtToken(credential.getState())){
Authentication authentication = authenticationProvider.authenticate(credential);
if(authentication != null) {//success
AuthJwt authJwt = authTokenService.genAuthJwt(authentication);
authJwtMessage.setData(Message.SUCCESS,authJwt);
}else {//fail
String errorMsg = WebContext.getAttribute(WebConstants.LOGIN_ERROR_SESSION_MESSAGE) == null ?
"" : WebContext.getAttribute(WebConstants.LOGIN_ERROR_SESSION_MESSAGE).toString();
authJwtMessage.setMessage(errorMsg);
logger.debug("login fail , message {}",errorMsg);
}
}
return authJwtMessage;
}
/**
* 常规用户名和密码登录
*
* @param credential
* @return
*/
@PostMapping(value = {"/signin"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<AuthJwt> signin(@RequestBody LoginCredential credential) {
Message<AuthJwt> authJwtMessage = new Message<>(Message.FAIL);
secretKeyManager.decrypt(credential);
if (authTokenService.validateJwtToken(credential.getState())) {
Authentication authentication = authenticationProvider.authenticate(credential);
if (authentication != null) {
//success
AuthJwt authJwt = authTokenService.genAuthJwt(authentication);
authJwtMessage.setData(Message.SUCCESS, authJwt);
} else {//fail
String errorMsg = WebContext.getAttribute(WebConstants.LOGIN_ERROR_SESSION_MESSAGE) == null ?
"" : WebContext.getAttribute(WebConstants.LOGIN_ERROR_SESSION_MESSAGE).toString();
authJwtMessage.setMessage(errorMsg);
logger.debug("login fail , message {}", errorMsg);
}
}
return authJwtMessage;
}
}

View File

@ -4,7 +4,7 @@
#server port
server.port =${SERVER_PORT:2154}
#server context path
server.servlet.context-path =/jinbooks-api
#server.servlet.context-path =/jinbooks-api
############################################################################
#domain name configuration #
############################################################################
@ -40,9 +40,10 @@ spring.datasource.type =com.alibaba.druid.pool.DruidDat
#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#mysql
spring.datasource.driver-class-name =com.mysql.cj.jdbc.Driver
spring.datasource.url =jdbc:mysql://${DATABASE_HOST:192.168.31.233}:${DATABASE_PORT:3306}/${DATABASE_NAME:jinbooks}?allowPublicKeyRetrieval=true&autoReconnect=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.username =${DATABASE_USER:jinbooks}
spring.datasource.password =${DATABASE_PWD:Jinbooks321!}
#spring.datasource.url =jdbc:mysql://${DATABASE_HOST:www.xiaolanyu.cn}:${DATABASE_PORT:33060}/${DATABASE_NAME:jinbooks}?allowPublicKeyRetrieval=true&autoReconnect=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.url =jdbc:mysql://${DATABASE_HOST:192.168.1.210}:${DATABASE_PORT:33060}/${DATABASE_NAME:jinbooks}?allowPublicKeyRetrieval=true&autoReconnect=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
spring.datasource.username =${DATABASE_USER:root}
spring.datasource.password =${DATABASE_PWD:Xueqiang1230@}
#mybatis
mybatis-plus.dialect =mysql
@ -69,9 +70,9 @@ logging.level.org.apache.ibatis=DEBUG
#redis server configuration #
############################################################################
spring.redis.cluster.nodes =
spring.redis.host =${REDIS_HOST:localhost}
spring.redis.host =${REDIS_HOST:192.168.1.210}
spring.redis.port =${REDIS_PORT:6379}
spring.redis.password =${REDIS_PWD:Hlh967484.}
spring.redis.password =${REDIS_PWD:}
spring.redis.timeout =10000
spring.redis.jedis.pool.max-wait =1000
spring.redis.jedis.pool.max-idle =200