This commit is contained in:
MaxKey
2023-08-15 14:05:39 +08:00
parent 79795a3b71
commit bf21605072
11 changed files with 13 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ import org.dromara.maxkey.entity.apps.UserApps;
import org.dromara.maxkey.persistence.service.AccountsService;
import org.dromara.maxkey.persistence.service.AppsService;
import org.dromara.maxkey.persistence.service.UserInfoService;
import org.dromara.mybatis.jpa.query.Query;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -92,7 +93,7 @@ public class AppListController {
Accounts account = null ;
if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) {
account = accountsService.load(new Accounts(currentUser.getId(), appId));
account = accountsService.load(Query.builder().eq("appId", appId).eq("userid", currentUser.getId()));
account.setRelatedPassword(
PasswordReciprocal.getInstance().decoder(
account.getRelatedPassword()));
@@ -115,7 +116,7 @@ public class AppListController {
@CurrentUser UserInfo currentUser) {
Accounts appUsers = new Accounts();
if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) {
appUsers = accountsService.load(new Accounts(currentUser.getId(), account.getAppId()));
appUsers = accountsService.load(Query.builder().eq("appId", account.getAppId()).eq("userid", currentUser.getId()));
if (appUsers == null) {
appUsers = new Accounts();
appUsers.setId(appUsers.generateId());