The new Java project studies online notes -day17 (V)

1.3.5 Click on the login page
click on the portal page head "Login | Register" Connecting to the login page user-centric, and carry returnUrl.
Modify portal header.html, code is as follows:
[mw_shl_code = AppleScript, to true] <a href="javascript:;" @click="showlogin" v-if="logined == false"> Login | Register </a>
showLogin: function () {= //this.loginFormVisible to true;
the window.location = " http://ucenter.xuecheng.com/#/login?returnUrl =" + Base64.encode (the window.location)
}
[/ mw_shl_code]
1.3.6 test
before testing and certification services to modify the configuration:
modify application.yml the cookie domain name

[mw_shl_code = applescript, true] cookieDomain : xuecheng.com [/ mw_shl_code]
Test procedure is as follows:
1, input into the system www.xuecheng.com (need to configure the hosts file)
1, and enter the correct password account, submit 2, input wrong account number and password, and submit
the login is successful, observe whether the cookie store success:
The new Java project studies online notes -day17 (V)

2.1 Requirements Analysis
successful login displays the user name of the currently logged-in page header.

FIG data flow is as follows:
The new Java project studies online notes -day17 (V)

1, the user requests authentication service, the login is successful.
2, the user login is successful, the authentication service writes to the cookie identity token, write user_token (identity tokens and authorization jwt authorization token) to Redis
3, the client carries a cookie identity token authentication service request token acquiring jwt .
4, client parses jwt token and user information stored in the sessionStorage resolved.
jwt token includes the basic information of the user, the client can obtain the token parsing jwt user information.
5, the client user information is read from sessionStorage and displayed in the header.
sessionStorage: sessionStorage is a session storage object H5, the data stored in SessionStorage only valid in the same window or in the same tab, the data will be deleted after closing SessionStorage in the window.
seesionStorage using the storage key / value way, data can be stored about 5M (will be different in different browsers).

Guess you like

Origin blog.51cto.com/13517854/2425669