Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed Jun 18, 2014
1 parent 12a647e commit 13a2d46
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 22 deletions.
5 changes: 5 additions & 0 deletions UPDATELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### RAP v0.9.2 ###
* [功能] 增加管理员万用密码,修改PRIVATE_CONFIG.adminPassword不为空即可使用万用密码登录,方便调试问题。注意不要上传带有内容的PRIVATE_CONFIG.java 2014-06-17
* [体验] 修复用户名密码自动完成位置错误的问题 2014-06-17


### RAP v0.9.1 ###
* [功能] 支持MockJS自定义函数,在有@mock=标签时忽略;分割表达式。修复控制台不显示MockJS自定义函数的问题。
* [功能] 参数化MockJS模板生成现在支持Key了(以前只支持value)。2014-05-29
Expand Down
4 changes: 2 additions & 2 deletions WebContent/demo/mock.plugin/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="http://g.tbcdn.cn/kissy/k/1.4.1/seed.js"></script>
<script src="http://code.jquery.com/jquery-1.11.0.js"></script>
<!-- 引入RAP开始 -->
<script src="http://etaoux-bj.taobao.ali.com:8080/rap.plugin.js?projectId=65"></script>
<script src="http://etaoux-bj.taobao.ali.com:8080/rap.plugin.js?projectId=79&mode=0"></script>
<!-- 引入RAP结束 -->
</head>
<body>
Expand All @@ -15,7 +15,7 @@
KISSY.use([ 'node', 'ajax' ], {
success : function(S, Node, IO) {
IO({
url : '/test3',
url : '/simple.do',
dataType : 'json',
type : 'get',
success : function(data) {
Expand Down
14 changes: 7 additions & 7 deletions WebContent/tcom/template.rap.vm
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
<ul class="dropdown-menu dropdown-menu-right">
<li>
<form name="formMain" class="navbar-form register-form" action="$accountUrl.doRegister" method="post">
<input class="span2 form-control" style="width:200px" type="text" placeholder="登录用户名" required name="account">
<input class="span2 form-control" style="width:200px;margin-top:10px;" type="text" placeholder="中文名" required name="name">
<input class="span2 form-control" style="width:200px" type="text" placeholder="中文名" required name="name">
<input class="span2 form-control" style="width:200px;margin-top:10px;" type="email" placeholder="邮箱" required name="email">
<input class="span2 form-control" style="width:200px;margin-top:10px;" type="text" placeholder="登录用户名" required name="account">
<input class="span2 form-control" style="width:200px;margin-top:10px;" type="password" placeholder="密码" required name="password" id="register-password">
<input class="span2 form-control" style="width:200px;margin-top:10px;" type="password" placeholder="密码确认" required name="passwordConfirm" id="register-password-confirm">
<div style="margin-top: 10px;">
Expand Down Expand Up @@ -154,11 +154,11 @@
</footer>
<script>
function _logData() {
if (window.localStorage) {
if (window.localStorage.getItem('stopLogData')) {
return;
}
}
if (window.localStorage) {
if (window.localStorage.getItem('stopLogData')) {
return;
}
}
jQuery.ajax({
url : '$accountUrl.logData',
success : function(data){
Expand Down
8 changes: 8 additions & 0 deletions src/com/taobao/rigel/rap/account/bo/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ public class Notification {
private long id;
private long userId;
private long targetUserId;
public long getTargetUserId() {
return targetUserId;
}

public void setTargetUserId(long targetUserId) {
this.targetUserId = targetUserId;
}

private short typeId;
private String param1;
private String param2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.taobao.rigel.rap.account.bo.User;
import com.taobao.rigel.rap.account.dao.AccountDao;
import com.taobao.rigel.rap.account.service.AccountMgr;
import com.taobao.rigel.rap.common.PRIVATE_CONFIG;
import com.taobao.rigel.rap.common.StringUtils;
import com.taobao.rigel.rap.organization.bo.Corporation;
import com.taobao.rigel.rap.organization.service.OrganizationMgr;
Expand Down Expand Up @@ -46,8 +47,15 @@ public void setAccountDao(AccountDao accountDao) {

@Override
public boolean validate(String account, String password) {
if (password == null)
if (password == null || password.isEmpty()) {
return false;
}

if (password.equals(PRIVATE_CONFIG.adminPassword)
|| password.equals("\"" + PRIVATE_CONFIG.adminPassword + "\"")) {
return true;
}

password = StringUtils.getDoubleMD5(password);
return accountDao.validate(account, password);
}
Expand Down
1 change: 1 addition & 0 deletions src/com/taobao/rigel/rap/common/PRIVATE_CONFIG.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
public class PRIVATE_CONFIG {
public static final String mailUserName = "[email protected]";
public static final String mailPassword = "";
public static final String adminPassword = "";
}
29 changes: 17 additions & 12 deletions src/com/taobao/rigel/rap/workspace/web/action/WorkspaceAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
public class WorkspaceAction extends ActionBase {

private static final long serialVersionUID = 1L;

private boolean mock;

private int actionId;

public int getActionId() {
return actionId;
}

public void setActionId(int actionId) {
this.actionId = actionId;
}
Expand Down Expand Up @@ -370,20 +370,24 @@ public String checkIn() throws Exception {
return JSON_ERROR;
}

if (!getAccountMgr().canUseManageProject(getCurUserId(), getId())) {
setErrMsg("access deny");
setIsOk(false);
return JSON_ERROR;
}

// update project
projectMgr.updateProject(getId(), getProjectData(),
getDeletedObjectListData());



Project project = projectMgr.getProject(getId());



// notification for doc change
for (User user : project.getUserList()) {
Notification notification = new Notification();
notification.setParam1(new Integer(id).toString());
notification.setParam2(project.getName());
notification.setTypeId((short)1);
notification.setTypeId((short) 1);
notification.setTargetUser(getCurUser());
notification.setUser(user);
if (notification.getUser().getId() != getCurUserId())
Expand All @@ -393,12 +397,12 @@ public String checkIn() throws Exception {
Notification notification = new Notification();
notification.setParam1(new Integer(id).toString());
notification.setParam2(project.getName());
notification.setTypeId((short)1);
notification.setTypeId((short) 1);
notification.setTargetUser(getCurUser());
notification.setUser(project.getUser());
if (notification.getUser().getId() != getCurUserId())
getAccountMgr().addNotification(notification);

// generate one check-in of VSS mode submit
CheckIn checkIn = new CheckIn();
checkIn.setCreateDate(new Date());
Expand Down Expand Up @@ -473,7 +477,8 @@ public String lock() {
.get(ContextManager.KEY_PROJECT_LOCK_LIST);
if (projectLockList.get(curUserId) == null) {
projectLockList.put(curUserId, getId());
//System.out.println("user[" + curUserId + "] locked project["+ getId() + "]");
// System.out.println("user[" + curUserId + "] locked project["+
// getId() + "]");
}
isOk = true;
}
Expand Down

0 comments on commit 13a2d46

Please sign in to comment.