Browse Source

无JIRA任务, 屏蔽论坛消息 Patch到release.

master
neil 8 years ago
parent
commit
105af44f3d
  1. 40
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  2. 3
      designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java

40
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -115,49 +115,9 @@ public class LoginWebBridge {
if(StringUtils.isEmpty(userName)){ if(StringUtils.isEmpty(userName)){
return; return;
} }
if(!StringUtils.isEmpty(this.userName)){
updateMessageCount();
}
this.userName = userName; this.userName = userName;
} }
/**
* 定时取后台论坛消息
*/
public void updateMessageCount(){
//启动获取消息更新的线程
//登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数.
Thread updateMessageThread = new Thread(new Runnable() {
@Override
public void run() {
sleep(CHECK_MESSAGE_TIME);
while(StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())){
HashMap<String, String> para = new HashMap<>();
int uid = DesignerEnvManager.getEnvManager().getBbsUid();
para.put("uid", String.valueOf(uid));
HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet();
if(getMessage.isServerAlive()){
try {
String res = getMessage.getResponseText();
if (res.equals(FAILED_MESSAGE_STATUS)) {
}else {
JSONObject jo = new JSONObject(res);
if (jo.getString("status").equals(SUCCESS_MESSAGE_STATUS)) {
setMessageCount(Integer.parseInt(jo.getString("message")));
}
}
} catch (Exception e) {
FRContext.getLogger().info(e.getMessage());
}
}
sleep(CHECK_MESSAGE_TIME);
}
}
});
updateMessageThread.start();
}
/** /**
* 设置获取的消息长度并设置显示 * 设置获取的消息长度并设置显示
* @param count * @param count

3
designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java

@ -38,9 +38,6 @@ public class PluginLoginExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel); String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel);
if (Integer.valueOf(loginResult) == 0) {
LoginWebBridge.getHelper().updateMessageCount();
}
result = loginResult; result = loginResult;
} }
} }

Loading…
Cancel
Save