forked from cmzalvin/giit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountController.java
More file actions
36 lines (29 loc) · 1.01 KB
/
AccountController.java
File metadata and controls
36 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.giit.www.system.controller;
import com.giit.www.system.service.AccountBiz;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
/**
* Created by c0de8ug on 16-2-16.
*/
@Controller
@RequestMapping("account.do")
public class AccountController {
@Resource(name = "accountBizImpl")
private AccountBiz accountBiz;
@RequiresAuthentication
@RequestMapping("profile.view")
public String profileView() {
return "/admin/system/account/profile";
}
@RequiresAuthentication
@RequestMapping("update")
public String update(HttpSession session, String password) {
String id = (String) session.getAttribute("username");
accountBiz.updatePassword(id, password);
return "redirect:/account.do/profile.view";
}
}