|
@@ -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());
|