当前位置:网站首页>How to get page data

How to get page data

2022-08-01 08:15:00 Joy's sister is a rookie

How to get the user information on the login page?

(Backend method)

What I need to do now is

After successful login on the login page

The user name I am currently logged in can be displayed on the next jump page
The method of the backend is to obtain the user information of the successful login in the login method of the controller layer and add it to the session

(Be careful to make a judgment of the empty space, otherwise it may make an error)

Add a special method to get the user stored in the session, get it through get, and return it
[External link image transfer failed, the origin site may have anti-leech mechanism, it is recommended to save the image and upload it directly (img-sCkQJ0Wz-1659262066122) (C:\Users\pon18\AppData\Roaming\Typora\typora-user-images\image-20220731174425458.png)]

Front-end code:
This is the part that needs to display the user, use id=root to specify the current location, and in ajax, you can use .html to return it
(id use#Get the class using .)
insert image description here
insert image description here

How to get the user name verified on the previous page when changing the password?

(Front-end method)
insert image description here
on next page, first use the function to get the parameters of the address bar and get the value of user

Then call this function to get the username
insert image description here
insert image description here

原网站

版权声明
本文为[Joy's sister is a rookie]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/213/202208010758488243.html