Add: register page, account info page
parent
cf0e05c918
commit
2728a0ca01
@ -0,0 +1,28 @@
|
|||||||
|
package ru.ulstu.user.controller;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import ru.ulstu.user.service.UserService;
|
||||||
|
import ru.ulstu.user.service.UserSessionService;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class UserMVCController {
|
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(UserMVCController.class);
|
||||||
|
|
||||||
|
private final UserService userService;
|
||||||
|
private final UserSessionService userSessionService;
|
||||||
|
|
||||||
|
public UserMVCController(UserService userService, UserSessionService userSessionService) {
|
||||||
|
this.userService = userService;
|
||||||
|
this.userSessionService = userSessionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/acc-info")
|
||||||
|
public String getAcc(){
|
||||||
|
return "acc-info";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
const {
|
||||||
|
LinearProgress,
|
||||||
|
CircularProgress,
|
||||||
|
Card,
|
||||||
|
CardHeader,
|
||||||
|
CardContent,
|
||||||
|
FormControl,
|
||||||
|
FormLabel,
|
||||||
|
TextField,
|
||||||
|
Button
|
||||||
|
} = window['material-ui'];
|
||||||
|
const { Component } = window['React'];
|
||||||
|
const React = window['React'];
|
||||||
|
|
||||||
|
class Account extends Component{
|
||||||
|
constructor(){
|
||||||
|
super();
|
||||||
|
|
||||||
|
const session_id = document.cookie.toLowerCase().match(/jsessionid=(.*?).node0/)[1];
|
||||||
|
$.getJSON("/api/1.0/users/account?session_id=" + session_id,
|
||||||
|
null, this.responseUserDto);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
userDto: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
responseUserDto = response => {
|
||||||
|
this.setState({
|
||||||
|
userDto: response.data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
render(){
|
||||||
|
return (
|
||||||
|
this.state.userDto != null ? (
|
||||||
|
<div style={{width: '75%', margin: 'auto'}}>
|
||||||
|
<Card>
|
||||||
|
<CardHeader title={this.state.userDto.firstName + " " + this.state.userDto.lastName}/>
|
||||||
|
<CardContent>
|
||||||
|
<p>Login: {this.state.userDto.login}</p>
|
||||||
|
<p>Email: {this.state.userDto.email}</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center">
|
||||||
|
<CircularProgress />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReactDOM.render(<Account/>, document.getElementById('react-account'));
|
Loading…
Reference in New Issue