Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jobmission committed Aug 27, 2018
1 parent ff23430 commit 53b28c1
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 30 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.4</version>
</dependency>

<dependency>
<groupId>net.sf.dozer</groupId>
<artifactId>dozer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.revengemission.sso.oauth2.server.domain.UserAccount;
import com.revengemission.sso.oauth2.server.service.UserAccountService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -81,13 +82,13 @@ public String handleProfile(Principal principal,

try {
UserAccount userAccount = userAccountService.findByUsername(principal.getName());
userAccount.setNickName(nickName);
userAccount.setAvatarUrl(avatarUrl);
userAccount.setEmail(email);
userAccount.setMobile(mobile);
userAccount.setProvince(province);
userAccount.setCity(city);
userAccount.setAddress(address);
userAccount.setNickName(StringEscapeUtils.escapeHtml4(nickName));
userAccount.setAvatarUrl(StringEscapeUtils.escapeHtml4(avatarUrl));
userAccount.setEmail(StringEscapeUtils.escapeHtml4(email));
userAccount.setMobile(StringEscapeUtils.escapeHtml4(mobile));
userAccount.setProvince(StringEscapeUtils.escapeHtml4(province));
userAccount.setCity(StringEscapeUtils.escapeHtml4(city));
userAccount.setAddress(StringEscapeUtils.escapeHtml4(address));
userAccount.setBirthday(birthday);
userAccountService.updateById(userAccount);
} catch (EntityNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.revengemission.sso.oauth2.server.domain.*;
import com.revengemission.sso.oauth2.server.service.UserAccountService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -67,7 +68,7 @@ public ResponseResult handleSignUp(HttpServletRequest request,
}
UserAccount userAccount = new UserAccount();
userAccount.setRole(RoleEnum.ROLE_USER.name());
userAccount.setUsername(username);
userAccount.setUsername(StringEscapeUtils.escapeHtml4(username));
userAccount.setPassword(passwordEncoder.encode(password));
try {
userAccount = userAccountService.create(userAccount);
Expand Down
30 changes: 20 additions & 10 deletions src/main/resources/templates/client/master.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<th>webServerRedirectUri</th>
<th>authorities</th>
<th>remarks</th>
<th>加入时间</th>
<th>时间</th>
<th>操作</th>
</tr>
</thead>
Expand Down Expand Up @@ -225,19 +225,29 @@
{data: 'id'},
{data: 'clientId'},
{data: 'scope', bSortable: false},
{data: 'authorizedGrantTypes', bSortable: false, width: '10%'},
{
data: 'authorizedGrantTypes',
bSortable: false,
render: function (data, type, row) {
var gts = data.split(",");
var result = "";
for (j = 0; j < gts.length; j++) {
result = result + gts[j] + "\n";
}
return result;
}
},
{data: 'webServerRedirectUri', bSortable: false},
{data: 'authorities', bSortable: false},
{data: 'remarks', defaultContent: "", bSortable: false}
],
columnDefs: [
{data: 'remarks', defaultContent: "", bSortable: false},
{
"targets": [7],
"data": "id",
"render": function (data, type, row, meta) {
return formatDate(row.dateCreated);
data: 'dateCreated',
render: function (data, type, row) {
return formatDate(data);
}
},
}
],
columnDefs: [
{
"targets": [8],
"data": "id",
Expand Down
31 changes: 19 additions & 12 deletions src/main/resources/templates/user/master.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
<thead>
<tr>
<th>id</th>
<th>username</th>
<th>role</th>
<th>nickName</th>
<th>登录名</th>
<th>角色</th>
<th>昵称</th>
<th>加入时间</th>
<th>操作</th>
</tr>
Expand Down Expand Up @@ -186,18 +186,25 @@
},
columns: [
{data: 'id'},
{data: 'username'},
{
data: 'username',
render: $.fn.dataTable.render.text()
},
{data: 'role', bSortable: false},
{data: 'nickName', defaultContent: "", bSortable: false}
],
columnDefs: [
{
"targets": [4],
"data": "id",
"render": function (data, type, row, meta) {
return formatDate(row.dateCreated);
}
data: 'nickName',
defaultContent: '',
bSortable: false,
render: $.fn.dataTable.render.text()
},
{
data: 'dateCreated',
render: function (data, type, row) {
return formatDate(data);
}
}
],
columnDefs: [
{
"targets": [5],
"data": "id",
Expand Down
Binary file added src/test/resources/static/imgs/clients.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/test/resources/static/imgs/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/test/resources/static/imgs/users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 53b28c1

Please sign in to comment.