Return to the corresponding status. When the front-end determines the status, if the session fails, a prompt box will pop up. When the user presses OK, the login interface will be redirected
Every time you make a request, you must determine whether the session has expired, that is, determine the user's login status. If it expires, return a custom error code, such as returning 400, illegal user request, etc.
I don’t know what you mean? Are you saying that information can be obtained even if the user is not logged in?
The PHP interface returns the corresponding status value, success is 1, failure is 0 and carries an error message. The previous ajax process is based on the return value. When the status is 1, the data is rendered. Otherwise, the corresponding error message pops up and the corresponding jump login is performed. page operations.
The session expired return html code can be customized. Determine whether the session has expired before returning html
Return to json, the front-end will prompt to log in after global interception
Return to the corresponding status. When the front-end determines the status, if the session fails, a prompt box will pop up. When the user presses OK, the login interface will be redirected
Every time you make a request, you must determine whether the session has expired, that is, determine the user's login status. If it expires, return a custom error code, such as returning 400, illegal user request, etc.
I don’t know what you mean? Are you saying that information can be obtained even if the user is not logged in?
The PHP interface returns the corresponding status value, success is 1, failure is 0 and carries an error message. The previous ajax process is based on the return value. When the status is 1, the data is rendered. Otherwise, the corresponding error message pops up and the corresponding jump login is performed. page operations.