fix: 修复找不到表的问题
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 213 KiB |
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -37,7 +37,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName("JBX_ROLE_MEMBER")
|
||||
@TableName("jbx_role_member")
|
||||
public class RoleMember implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user