Browse Source

REPORT-7947 【10.0】在设计器上登录bbs的用户时,数据库无法生成对应的信息

master
kerry 6 years ago
parent
commit
bd3b69d0ed
  1. 33
      designer-base/src/com/fr/design/bbs/BBSLoginUtils.java

33
designer-base/src/com/fr/design/bbs/BBSLoginUtils.java

@ -1,5 +1,6 @@
package com.fr.design.bbs; package com.fr.design.bbs;
import com.fr.config.BBSAttr;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -15,12 +16,14 @@ import java.util.List;
public class BBSLoginUtils { public class BBSLoginUtils {
public static void bbsLogin(final String username, final String password) { public static void bbsLogin(final String username, final String password) {
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(username);
bbsAttr.setBbsPassword(password);
try { try {
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
MarketConfig.getInstance().setBbsUsername(username); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(password);
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public Class<? extends Configuration>[] targets() {
@ -35,16 +38,18 @@ public class BBSLoginUtils {
public static void bbsLogin(List<String> list) { public static void bbsLogin(List<String> list) {
try { try {
final String uid = list.get(0); String uid = list.get(0);
final String username = list.get(1); String username = list.get(1);
final String password = list.get(2); String password = list.get(2);
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(username);
bbsAttr.setBbsPassword(password);
bbsAttr.setBbsUid(Integer.parseInt(uid));
bbsAttr.setInShowBBsName(username);
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
MarketConfig.getInstance().setBbsUsername(username); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(password);
MarketConfig.getInstance().setBbsUid(Integer.parseInt(uid));
MarketConfig.getInstance().setInShowBBsName(username);
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public Class<? extends Configuration>[] targets() {
@ -58,11 +63,13 @@ public class BBSLoginUtils {
} }
public static void bbsLogout() { public static void bbsLogout() {
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(StringUtils.EMPTY);
bbsAttr.setBbsPassword(StringUtils.EMPTY);
bbsAttr.setBbsUid(0);
bbsAttr.setInShowBBsName(StringUtils.EMPTY);
try { try {
MarketConfig.getInstance().setBbsUsername(StringUtils.EMPTY); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(StringUtils.EMPTY);
MarketConfig.getInstance().setBbsUid(0);
MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage()); FineLoggerFactory.getLogger().error(e.getMessage());
} }

Loading…
Cancel
Save