App credential to string type

This commit is contained in:
MaxKey
2022-11-04 21:13:31 +08:00
parent 9bf04827e0
commit 6bd2231a1c
7 changed files with 76 additions and 74 deletions
@@ -86,12 +86,12 @@ public class AppListController {
@RequestMapping(value = { "/account/get" })
@ResponseBody
public ResponseEntity<?> getAccount(
@RequestParam("credential") int credential,
@RequestParam("credential") String credential,
@RequestParam("appId") String appId,
@CurrentUser UserInfo currentUser) {
Accounts account = null ;
if (credential == Apps.CREDENTIALS.USER_DEFINED) {
if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) {
account = accountsService.load(new Accounts(currentUser.getId(), appId));
account.setRelatedPassword(
PasswordReciprocal.getInstance().decoder(
@@ -110,11 +110,11 @@ public class AppListController {
@RequestMapping(value = { "/account/update" })
@ResponseBody
public ResponseEntity<?> updateAccount(
@RequestParam("credential") int credential,
@RequestParam("credential") String credential,
@ModelAttribute Accounts account,
@CurrentUser UserInfo currentUser) {
Accounts appUsers = new Accounts();
if (credential == Apps.CREDENTIALS.USER_DEFINED) {
if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) {
appUsers = accountsService.load(new Accounts(currentUser.getId(), account.getAppId()));
if (appUsers == null) {
appUsers = new Accounts();
@@ -72,7 +72,7 @@ public class BaseAppContorller {
}
protected void encodeSharedPassword(Apps application){
if(application.getCredential()!=Apps.CREDENTIALS.SHARED){
if(!application.getCredential().equalsIgnoreCase(Apps.CREDENTIALS.SHARED)){
if(application.getProtocol().equals(ConstsProtocols.FORMBASED)){
if(StringUtils.isNotBlank(application.getSharedPassword())){
application.setSharedPassword(
@@ -83,7 +83,7 @@ public class BaseAppContorller {
}
protected void decoderSharedPassword(Apps application){
if(application.getCredential()!=Apps.CREDENTIALS.SHARED){
if(application.getCredential().equalsIgnoreCase(Apps.CREDENTIALS.SHARED)){
if(application.getProtocol().equals(ConstsProtocols.FORMBASED)){
if(StringUtils.isNotBlank(application.getSharedPassword())){
application.setSharedPassword(