In the past two days, extjs permissions are resolved. Require control of the object is menu, button, URL solution ideas 1: https://www.php1.cn/wiki/197.html "target =" _ blank "> heavy Connection class
Because the interaction between extjs and the server is in json format, the server does not control the page Jump, page Jump, and the prompt function is completed by extjs.
The interaction methods between extjs and server are all inherited from Ext. data. Connection. This class can intercept all the interaction methods with the server.
If acegi is not verified, 403.jspis will be returned. login. jsp will be returned if you need to log on again.
Therefore, reload the Connection class and rewrite the handleResponse method to determine whether the returned result is 403.jsp, login. jsp. If yes, control the returned result accordingly. If yes, continue to execute the data normally.
I personally added the annotation code in the first line of 403.jsp and login. jsp. This keyword is used to work.
The Code is as follows:
// The Cunnection method is reloaded here to intercept the interaction between the client and the Server. // After the backend acegi intercepts the user request, if there is no permission, 403.jspis is returned. If no logon is performed, login is returned. jsp; // The Json result Ext. override (Ext. data. connection, {handleResponse: Ext. data. connection. prototype. handleResponse. createInterceptor (function (response) {var resText = response. responseText; if (resText. length> 10) {resText = resText. substr (0, 9);} if (resText ='