The invention discloses a method for controlling real-time view permission of single-page application, which relates to the technical field of single-page application view permission control, and comprises the following steps that: a
server acquires a
client request, sets a custom header at a returned HTTP (
Hyper Text Transport Protocol) header, and returns the custom header to a
client; the
client compares the return value of the custom header returned by the client with a locally stored storage value, and judges whether the return value is consistent with the locally stored storage value ornot; if not, the client requests to obtain interfaces of all authorities of the
current user, and updates the authorities and views; if so, the client does not require to obtain interfaces of all authorities of the
current user, and the authorities and views are not updated. According to the invention, the value of the self-defined header of the HTTP protocol returned by the
server is compared with the previously stored data of the permission
list, whether the authority and the view need to be updated or not is determined, and after an administrator in the single-page application modifies theauthority of the user, the view of the client is updated in real time at the next request without quitting and re-login.