Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void list() {

// 排序
String orderBy = getBaseForm().getOrderBy();
if (StrUtils.isEmpty(orderBy)) {
if (StrUtils.isEmpty(orderBy) || orderBy.contains("(")) {
sql.append(" order by sort,id desc");
} else {
sql.append(" order by ").append(orderBy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import com.jflyfox.util.StrUtils;
import com.jflyfox.util.extend.HtmlUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* 个人信息
*
Expand Down Expand Up @@ -415,7 +418,12 @@ public void save() {
}
}

if (StrUtils.isNotEmpty(model.getStr("email")) && model.getStr("email").indexOf("@") < 0) {
String regEx1 = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
Pattern p;
Matcher m;
p = Pattern.compile(regEx1);
m = p.matcher(model.getStr("email"));
if(!m.matches()){
json.put("msg", "email格式错误!");
renderJson(json.toJSONString());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import com.jflyfox.system.user.UserCache;
import com.jflyfox.util.StrUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

@ControllerBind(controllerKey = "/front/regist")
public class RegistController extends BaseProjectController {

Expand Down Expand Up @@ -62,7 +65,12 @@ public void save() {
return;
}

if (StrUtils.isEmpty(key) || key.indexOf("@") < 0) {
String regEx1 = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
Pattern p;
Matcher m;
p = Pattern.compile(regEx1);
m = p.matcher(key);
if(!m.matches()) {
json.put("msg", "email格式错误!");
renderJson(json.toJSONString());
return;
Expand Down