CN114282204A - Method, device, equipment and medium for determining user access micro application authority - Google Patents

Method, device, equipment and medium for determining user access micro application authority Download PDF

Info

Publication number
CN114282204A
CN114282204A CN202111619171.9A CN202111619171A CN114282204A CN 114282204 A CN114282204 A CN 114282204A CN 202111619171 A CN202111619171 A CN 202111619171A CN 114282204 A CN114282204 A CN 114282204A
Authority
CN
China
Prior art keywords
information
micro
application
route
routing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111619171.9A
Other languages
Chinese (zh)
Inventor
陈银军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202111619171.9A priority Critical patent/CN114282204A/en
Publication of CN114282204A publication Critical patent/CN114282204A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a method, a device, equipment and a medium for determining the permission of a user to access a micro application, which relate to the field of micro front ends, and the method comprises the following steps: responding to a login operation aiming at a main application of a current user login micro front end, wherein the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and determining that the current user can access the plurality of micro applications based on the micro application information; acquiring at least one menu information based on a selected operation of the at least one menu information for at least one of the plurality of micro applications; determining routing information of a route corresponding to the menu information and routing meta information of the route corresponding to the button information in the menu information; judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.

Description

Method, device, equipment and medium for determining user access micro application authority
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for determining a user access permission to a micro application.
Background
In the prior art, after a single Web (World Wide Web) page is applied to a relatively long time span and common applications are evolved into a boulder application (front monolithic) due to the increase and the transition of participators and teams, the maintenance difficulty is huge, once the business requirements are changed, a whole set of front-end codes must be recompiled, the whole deployment is realized, and the unstable factors of the system are increased. The current mainstream micro front end solution comprises a micro front end framework (qiankun) which has the capability of loading micro applications and brings potential safety hazards; for example, under certain conditions, an unauthorized user may illegally load a micro-application without authorization by emulating the master application, using server nginx as a proxy.
Disclosure of Invention
The present application provides a method, an apparatus, a device, a computer readable storage medium, and a computer program product for determining a user's permission to access a micro application, which are used to solve the problem of how to prevent the micro application from being illegally loaded.
In a first aspect, the present application provides a method for determining a user's right to access a micro application, including:
responding to a login operation aiming at a main application of a current user login micro front end, wherein the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and determining that the current user can access the plurality of micro applications based on the micro application information;
acquiring at least one menu information based on a selected operation of the at least one menu information for at least one of the plurality of micro applications, each menu information of the at least one menu information including a plurality of button information;
determining the routing information of the route corresponding to the menu information and the routing meta information of the route corresponding to the button information in the menu information, wherein the routing meta information of the route is a meta field of a routing manager of an vue frame;
judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
In one embodiment, determining that a current user may access a plurality of micro-applications based on micro-application information includes:
based on the micro-application information, a function register micro apps is called by the main application to register a plurality of micro applications so that the current user can access the plurality of micro applications.
In one embodiment, determining whether page level access to the micro-application is available based on the routed routing information includes:
and registering the routing information of the route to a routing instance of any one of the at least one micro application through a preset function addRoutes to perform page-level authority control on the micro application, wherein the routing instance comprises the routing information of the route.
In one embodiment, the determining whether the current user can access the related information corresponding to the button according to the routing source information of the route includes:
and writing the routing meta-information into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of the route as a button.
In one embodiment, rendering routing meta information for a route as a button includes:
and rendering the routing meta information of the route into a button list through an instruction v-for of a preset vue framework, wherein the button list comprises a plurality of buttons, and the buttons are buttons which are authorized to be accessed by the current user.
In one embodiment, displaying the micro-application information of each micro-application in the micro-application set and the menu information of each micro-application in a preset configuration interface, wherein the menu information of each micro-application comprises button information;
responding to configuration operation of micro application information and menu information of at least one micro application in the micro application set, and updating the micro application information and the menu information of the at least one micro application in the micro application set to obtain updated micro application information and updated menu information; and authorizing the updated micro application information and the updated menu information to the current user.
In one embodiment, the micro-application information includes a micro-application name, a micro-application entry path, a document object model (dom) container assigned to the micro-application by the main application, whether the micro-application is available, and a micro-application activation rule; the menu information comprises button information, the name of the menu, an access path of a page corresponding to the menu and a relative path of the page corresponding to the menu in the micro application; the button information includes text displayed on the button, a button code, and an interface address of a method of button binding.
In a second aspect, the present application provides an apparatus for determining a user's right to access a micro application, including:
the first processing module is used for responding to login operation of a main application for a current user to login a micro front end, wherein the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and the micro applications can be accessed by the current user based on the micro application information;
the second processing module is used for acquiring at least one menu information based on the selected operation of the at least one menu information aiming at least one micro application in the plurality of micro applications, and each menu information in the at least one menu information comprises a plurality of button information;
a third processing module, configured to determine route information of a route corresponding to the menu information and route meta information of the route corresponding to the button information in the menu information, where the route meta information is a meta field of a route manager of an vue framework;
the fourth processing module is used for judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and a bus;
a bus for connecting the processor and the memory;
a memory for storing operating instructions;
and the processor is used for executing the method for determining the user access micro-application authority of the first aspect of the application by calling the operation instruction.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program for performing the method for determining user access rights to a micro-application of the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the method for determining user access to a micro-application of the first aspect of the present application.
The technical scheme provided by the embodiment of the application at least has the following beneficial effects:
in the micro application loading process, the micro application is automatically registered and the micro application information is authorized through the main application, so that the application level authority control of the micro application is realized; registering the routing information of one route to a routing instance of any one of the at least one micro application, thereby realizing page-level authority control on the micro application; writing the routing meta-information of one route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of one route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of one route into a button, thereby realizing button-level right control on the micro-application; therefore, the authority control of multiple granularity of the micro application is realized, the micro application can be prevented from being illegally loaded, and the safety of the micro application is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
FIG. 1 is a block diagram illustrating an architecture of a system for determining user access rights to a micro-application according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for determining user access rights to a micro application according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating another method for determining user access rights to a micro application according to an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of an apparatus for determining user access rights to a micro application according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" indicates either an implementation as "a", or an implementation as "B", or an implementation as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
For better understanding and description of the embodiments of the present application, some technical terms used in the embodiments of the present application will be briefly described below.
Token: token means a Token in computer authentication and can be used as a login system.
vue framework: the vue framework is a set of progressive front end frameworks that build user interfaces, the core library of Vue is only concerned with viewing layers.
Routing meta information of the route: the Vue Router is the routing manager of the Vue. js official, and during route configuration, the meta field, that is, the routing meta information of the route, can set some custom information in the meta for use in the page component or the routing hook function.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The scheme provided by the embodiment of the application can be suitable for any application scene in the field of micro front ends, wherein the user access permission needs to be determined.
In order to better understand the scheme provided by the embodiment of the present application, the scheme is described below with reference to a specific application scenario.
In an embodiment, fig. 1 is a schematic architecture diagram illustrating a system for determining a user's permission to access a micro application, to which an embodiment of the present application is applied.
In this example, as shown in fig. 1, the architecture of the system for determining the user access right to the micro application in this example may include, but is not limited to, the host application 10 and the micro application 20, wherein the host application 10 and the micro application 20 may be executed in a server. The host application 10 can interact with a plurality of micro applications 20, respectively, the host application 10 can serve as a portal for all micro applications 20, and all micro applications 20 can be accessed through the host application. In response to a login operation of a main application for a current user to login a micro front end, acquiring micro application information of a plurality of micro applications 20 of the current user through the main application 10; if a plurality of micro applications are registered through the main application 10 based on micro application information of the plurality of micro applications 20, acquiring at least one menu information through at least one micro application in response to a selection operation of the at least one menu information for at least one micro application of the plurality of micro applications 20, each menu information of the at least one menu information including a plurality of button information; determining, by at least one micro application, routing information of a route corresponding to each menu information and routing meta information of a route corresponding to a plurality of button information included in each menu information; if the routing information of one route is registered to a routing instance of any one of the at least one micro application, the routing meta-information of one route is written into a preset browser cache through a preset global routing hook function, the routing meta-information of one route is extracted from the browser cache through a preset life cycle hook function, and the routing meta-information of one route is rendered into a button.
It is understood that the above is only an example, and the present embodiment is not limited thereto.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server or a server cluster providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. The determination may also be based on the requirements of the actual application scenario, and is not limited herein.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a method for determining a user's right to access a micro application according to an embodiment of the present application, where the method may be executed by any electronic device, such as a server, as an alternative implementation, the method may be executed by the server, and for convenience of description, in the following description of some alternative embodiments, a server will be taken as an example of an execution subject of the method. As shown in fig. 2, the method for determining the user's right to access the micro application provided in the embodiment of the present application includes the following steps:
s201, responding to a login operation of a main application of a current user login micro front end, wherein the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and determining that the current user can access the plurality of micro applications based on the micro application information.
Specifically, a current user inputs a home page address of a main application at the micro front end in an address bar in a browser, the browser skips, a login page of the main application is displayed in the browser, the current user inputs an account and a password in the login page, identity authentication is performed, and the identity authentication is successful; the above process is a login operation for the current user to login the main application of the micro front end.
After the identity authentication is successful, the main application can acquire the micro-application information of a plurality of micro-applications of the current user from the back-end interface; the multiple micro applications are micro applications split according to page mechanism dimensions or business function dimensions, the micro application information is input through a main application visual interface and then authorized to a user, and the micro application information exists for the current user because the current user is authorized to the micro application information. The host application may also obtain a Token (Token) from the backend interface.
In one embodiment, in the micro application loading process, the main application can register a plurality of micro applications, and the micro applications and the micro application information authorization are automatically registered by the main application, so that the micro applications are subjected to application-level authority control.
S202, at least one menu information is obtained based on the selection operation of at least one menu information aiming at least one micro application in the plurality of micro applications, and each menu information in the at least one menu information comprises a plurality of button information.
In particular, the master application may pass a value to each of the plurality of micro-applications, i.e., the master application may transmit to each of the plurality of micro-applications a Token, a routing instance of the master application, etc.
The main application can obtain all menu information of one micro application in the plurality of micro applications from the back-end interface, the browser jumps, a main application homepage is displayed in the browser, and the main application homepage comprises a menu list corresponding to all the menu information of the micro applications. The current user may click on a menu (menu information) in the menu list, which is a selected operation for at least one menu information of at least one of the plurality of micro applications. After the current user clicks one menu (menu information) in the menu list, the main application starts to load the micro application, and the micro application acquires the Token transmitted by the main application. After the micro application acquires the Token transmitted by the main application, the micro application acquires the menu information through a backend interface, and the menu information may include at least one button information.
S203, determining the route information of the route corresponding to the menu information and the route meta information of the route corresponding to the button information in the menu information, wherein the route meta information is the meta field of the route manager of the vue framework.
Specifically, route information of a route corresponding to menu information and route meta information of a route corresponding to a plurality of pieces of button information included in the menu information are determined by a micro application. One menu information may arrange route information forming one route, and a plurality of button information included in one menu information may arrange route meta information forming one route. For example, the menu information: the page access path corresponding to the menu and the relative path of the page corresponding to the menu are arranged, and by arranging the access path (path field of the route) and the component (component field of the route) corresponding to the route, which respectively form the route, the button information: the characters on the buttons, the method names bound by the buttons and the button codes form routing meta information (meta fields of the routing) through sorting, and finally, the addRoutes () method injects the sorted information into the routing instance of the current micro application, one routing corresponds to one page, the corresponding page can be accessed only through the registered routing, and the page-level authority control is realized through the registration method of the routing.
S204, judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
Specifically, the routing information of one route is registered to a routing instance of any one of the at least one micro application, and only the registered route can be accessed, so that page-level authority control of the micro application is realized. For example, the menu information: the page access path corresponding to the menu and the relative path of the page corresponding to the menu are arranged, and by arranging the access path (path field of the route) and the component (component field of the route) corresponding to the route, which respectively form the route, the button information: the characters on the buttons, the method names bound by the buttons and the button codes form routing meta information (meta fields of the routing) through sorting, and finally, the addRoutes () method injects the sorted information into the routing instance of the current micro application, one routing corresponds to one page, the corresponding page can be accessed only through the registered routing, and the page-level authority control is realized through the registration method of the routing.
The method comprises the steps of writing routing meta-information of a route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, rendering the routing meta-information of the route into a button, and achieving button-level authority control of the micro-application.
In one embodiment, after the routing meta-information of a route is written into a preset browser cache through a preset global routing hook function, a page of a micro-application is displayed in a DOM container pre-allocated to the micro-application by a main application, the routing meta-information of the route is extracted from the browser cache through a preset life cycle hook function, and the routing meta-information of the route is rendered into a button.
In the embodiment of the application, in the micro application loading process, the micro application is automatically registered and the micro application information is authorized through the main application, so that the application-level authority control of the micro application is realized; registering the routing information of one route to a routing instance of any one of the at least one micro application, thereby realizing page-level authority control on the micro application; writing the routing meta-information of one route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of one route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of one route into a button, thereby realizing button-level right control on the micro-application; therefore, the authority control of multiple granularity of the micro application is realized, the micro application can be prevented from being illegally loaded, and the safety of the micro application is improved.
In one embodiment, determining that a current user may access a plurality of micro-applications based on micro-application information includes:
based on the micro-application information, a function register micro apps is called by the main application to register a plurality of micro applications so that the current user can access the plurality of micro applications.
In one embodiment, determining whether page level access to the micro-application is available based on the routed routing information includes:
and registering the routing information of the route to a routing instance of any one of the at least one micro application through a preset function addRoutes to perform page-level authority control on the micro application, wherein the routing instance comprises the routing information of the route.
Specifically, routes are dynamically registered through a function addRoutes () provided by the vue framework, for example, route information of one route is registered to a route instance of any one of at least one micro application through the function addRoutes (), only the registered route can be accessed, and page-level authority control on the micro application is realized.
In one embodiment, the determining whether the current user can access the related information corresponding to the button according to the routing source information of the route includes:
and writing the routing meta-information into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of the route as a button.
In one embodiment, rendering routing meta information for a route as a button includes:
and rendering the routing meta information of the route into a button list through an instruction v-for of a preset vue framework, wherein the button list comprises a plurality of buttons, and the buttons are buttons which are authorized to be accessed by the current user.
In one embodiment, the micro application information of the micro application and the menu information of the micro application are configured in the main application through a visual interface (preset configuration interface), wherein the menu information of the micro application comprises a plurality of button information, that is, the button information can be configured in the main application through the visual interface. And storing the micro-application information of the configured micro-application and the menu information of the micro-application in a server. Through visual interface operation, namely configuration of micro application information, menu information and button information, the micro application can be freely combined, and a function set meeting business requirements is quickly formed.
In one embodiment, the multiple micro applications are divided based on two preset dimensions, wherein the two preset dimensions comprise a page structure dimension and a business function dimension.
In one embodiment, the multiple micro applications are divided (split) based on the page structure dimension, for example, a web page is composed of three parts, i.e., a header, a footer, and a content area, and the three parts can be divided into three micro applications based on the page structure dimension, i.e., the header is divided into one micro application, the footer is divided into one micro application, and the content area is divided into one micro application.
In one embodiment, the predetermined global routing hook function is a function before each, and the predetermined lifecycle hook function is a function mount.
Specifically, the preset global routing hook function is a global routing hook function before each () of an vue framework, and the preset lifecycle hook function is a lifecycle hook function mounted ().
In one embodiment, the micro-application information includes a micro-application name, a micro-application entry path, a document object model (dom) container assigned to the micro-application by the main application, whether the micro-application is available, and a micro-application activation rule; the menu information comprises button information, the name of the menu, an access path of a page corresponding to the menu and a relative path of the page corresponding to the menu in the micro application; the button information includes text displayed on the button, a button code, and an interface address of a method of button binding.
In one embodiment, the configured micro-application information, menu information, and button information may be authorized to the user in the host application.
The application of the embodiment of the application has at least the following beneficial effects:
splitting the WEB application into a plurality of autonomous loosely-coupled micro applications according to a service function or a page structure; carrying out application level authority control, page level authority control and button level authority control on the split micro application and automatically registering the micro application; the split micro application is operated on a visual interface according to the service requirement, free combination is realized, and a function set required by the service is quickly formed; the safety of the micro-application is improved.
In order to better understand the method provided by the embodiment of the present application, the following further describes the scheme of the embodiment of the present application with reference to an example of a specific application scenario.
The scheme provided by the embodiment of the application can be suitable for any application scene in the field of micro front ends, wherein the user access permission needs to be determined.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another method for determining user access to a micro application according to an embodiment of the present application, where the method may be executed by any electronic device, such as a server, as an alternative embodiment, the method may be executed by the server, and for convenience of description, in the following description of some alternative embodiments, a server is taken as an example of an execution subject of the method. As shown in fig. 3, the method for determining the user's right to access the micro application provided in the embodiment of the present application includes the following steps:
s301, inputting a home page address of a main application at a micro front end in an address bar of a browser by a user; and the browser skips.
S302, a login page of the main application is displayed in the browser, and the user performs identity authentication on the login page, wherein the identity authentication is successful.
S303, the main application acquires micro-application information and a token of the micro-application of the user from the back-end interface; the master application registers the micro-application and transmits a token, a routing instance of the master application and the like to the micro-application; the main application acquires all menu information of the micro-application from the rear-end interface; and the browser skips.
S304, displaying a main page of the main application in the browser, wherein the main page of the main application comprises a menu list corresponding to all menu information of the micro-application; the user clicks on a menu in the menu list.
S305, the main application starts to load the micro application.
S306, the micro application acquires the token transmitted by the main application.
S307, the micro application acquires menu information and button information of the micro application through a rear-end interface; each menu information can be arranged to form routing information of a route, and the routing information of the route is registered to a routing instance of the micro application; the plurality of pieces of button information included in each menu information can be arranged to form route meta information of a route; and writing the routing meta-information of the route into a preset browser cache through a preset global routing hook function.
S308, displaying the page of the micro application in a micro application container pre-allocated by the main application for the micro application, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of the route as a button.
In particular, the micro-application container may be a DOM container.
S309, the micro application is loaded.
The application of the embodiment of the application has at least the following beneficial effects:
in the micro application loading process, the micro application is automatically registered and the micro application information is authorized through the main application, so that the application level authority control of the micro application is realized; registering the routing information of one route to a routing instance of any one of the at least one micro application, thereby realizing page-level authority control on the micro application; writing the routing meta-information of one route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of one route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of one route into a button, thereby realizing button-level right control on the micro-application; therefore, the authority control of multiple granularity of the micro application is realized, the micro application can be prevented from being illegally loaded, and the safety of the micro application is improved.
The embodiment of the present application further provides a device for determining a user's permission to access a micro application, and a schematic structural diagram of the device for determining a user's permission to access a micro application is shown in fig. 4, and the device 40 for determining a user's permission to access a micro application includes a first processing module 401, a second processing module 402, a third processing module 403, and a fourth processing module 404.
The first processing module 401 is configured to respond to a login operation of a main application of a current user login micro front end, where the login operation includes micro application information of multiple micro applications corresponding to a page to be accessed by the current user, and determine that the current user can access the multiple micro applications based on the micro application information;
a second processing module 402, configured to obtain at least one piece of menu information based on a selection operation of the at least one piece of menu information for at least one of the multiple micro applications, where each piece of menu information in the at least one piece of menu information includes multiple pieces of button information;
a third processing module 403, configured to determine route information of a route corresponding to the menu information, and route meta information of the route corresponding to the button information in the menu information, where the route meta information is a meta field of a route manager of the vue framework;
a fourth processing module 404, configured to determine whether page-level access to the micro application is available according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
In an embodiment, the first processing module 401 is specifically configured to:
based on the micro-application information, a function register micro apps is called by the main application to register a plurality of micro applications so that the current user can access the plurality of micro applications.
In an embodiment, the fourth processing module 404 is specifically configured to:
and registering the routing information of the route to a routing instance of any one of the at least one micro application through a preset function addRoutes to perform page-level authority control on the micro application, wherein the routing instance comprises the routing information of the route.
In an embodiment, the fourth processing module 404 is specifically configured to:
and writing the routing meta-information into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of the route as a button.
In an embodiment, the fourth processing module 404 is specifically configured to:
and rendering the routing meta information of the route into a button list through an instruction v-for of a preset vue framework, wherein the button list comprises a plurality of buttons, and the buttons are buttons which are authorized to be accessed by the current user.
In one embodiment, the first processing module 401 is further configured to:
displaying the micro-application information of each micro-application in the micro-application set and the menu information of each micro-application in a preset configuration interface, wherein the menu information of each micro-application comprises button information;
responding to configuration operation of micro application information and menu information of at least one micro application in the micro application set, and updating the micro application information and the menu information of the at least one micro application in the micro application set to obtain updated micro application information and updated menu information; and authorizing the updated micro application information and the updated menu information to the current user.
In one embodiment, the micro-application information includes a micro-application name, a micro-application entry path, a document object model (dom) container assigned to the micro-application by the main application, whether the micro-application is available, and a micro-application activation rule; the menu information comprises button information, the name of the menu, an access path of a page corresponding to the menu and a relative path of the page corresponding to the menu in the micro application; the button information includes text displayed on the button, a button code, and an interface address of a method of button binding.
The application of the embodiment of the application has at least the following beneficial effects:
in the micro application loading process, the micro application is automatically registered and the micro application information is authorized through the main application, so that the application level authority control of the micro application is realized; registering the routing information of one route to a routing instance of any one of the at least one micro application, thereby realizing page-level authority control on the micro application; writing the routing meta-information of one route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of one route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of one route into a button, thereby realizing button-level right control on the micro-application; therefore, the authority control of multiple granularity of the micro application is realized, the micro application can be prevented from being illegally loaded, and the safety of the micro application is improved.
An embodiment of the present application further provides an electronic device, a schematic structural diagram of the electronic device is shown in fig. 5, and an electronic device 4000 shown in fig. 5 includes: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 4003 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 4001 to execute. The processor 4001 is used to execute computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: a server, etc.
The application of the embodiment of the application has at least the following beneficial effects:
in the micro application loading process, the micro application is automatically registered and the micro application information is authorized through the main application, so that the application level authority control of the micro application is realized; registering the routing information of one route to a routing instance of any one of the at least one micro application, thereby realizing page-level authority control on the micro application; writing the routing meta-information of one route into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of one route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of one route into a button, thereby realizing button-level right control on the micro-application; therefore, the authority control of multiple granularity of the micro application is realized, the micro application can be prevented from being illegally loaded, and the safety of the micro application is improved.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
Based on the same principle as the method provided by the embodiment of the present application, the embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in any of the alternative embodiments of the present application.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in this application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of this application are also within the protection scope of the embodiments of this application without departing from the technical idea of this application.

Claims (11)

1. A method for determining user access rights to a micro-application, comprising:
responding to a login operation of a main application of a current user login micro front end, wherein the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and determining that the current user can access the micro applications based on the micro application information;
acquiring at least one menu information based on a selected operation of the at least one menu information for at least one of the plurality of micro applications, each menu information of the at least one menu information including a plurality of button information;
determining routing information of a route corresponding to the menu information and routing meta information of the route corresponding to the button information in the menu information, wherein the routing meta information of the route is a meta field of a routing manager of an vue framework;
judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
2. The method of claim 1, wherein determining that the current user may access the plurality of micro-applications based on the micro-application information comprises:
and registering the micro applications through a main application calling function register micro apps based on the micro application information so that the current user can access the micro applications.
3. The method of claim 1, wherein determining whether page-level access to the micro-application is available according to the routing information of the route comprises:
and registering the routing information of the route to a routing instance of any one of the at least one micro application through a preset function addRoutes to perform page-level authority control on the micro application, wherein the routing instance comprises the routing information of the route.
4. The method according to claim 1, wherein said determining whether the current user can access the related information corresponding to the button according to the routing source information of the route comprises:
and writing the routing meta-information into a preset browser cache through a preset global routing hook function, extracting the routing meta-information of the route from the browser cache through a preset life cycle hook function, and rendering the routing meta-information of the route as a button.
5. The method of claim 4, wherein the rendering the routing meta information of the route as a button comprises:
and rendering the routing meta information of the route into a button list through an instruction v-for of a preset vue framework, wherein the button list comprises a plurality of buttons, and the buttons are buttons which are authorized to be accessed by the current user.
6. The method of claim 1, further comprising:
displaying the micro-application information of each micro-application in a micro-application set and the menu information of each micro-application in a preset configuration interface, wherein the menu information of each micro-application comprises button information;
responding to configuration operation of micro application information and menu information of at least one micro application in the micro application set, and updating the micro application information and the menu information of the at least one micro application in the micro application set to obtain updated micro application information and updated menu information; and authorizing the updated micro application information and the updated menu information to the current user.
7. The method according to any one of claims 1-6, wherein the micro-application information comprises a micro-application name, a micro-application entry path, a document object model (dom) container assigned to the micro-application by the main application, whether the micro-application is available, and a micro-application activation rule; the menu information comprises button information, the name of the menu, an access path of a page corresponding to the menu and a relative path of the page corresponding to the menu in the micro application; the button information includes text displayed on the button, a button code, and an interface address of a method of button binding.
8. An apparatus for determining user access rights to a micro-application, comprising:
the system comprises a first processing module, a second processing module and a third processing module, wherein the first processing module is used for responding to a login operation of a main application for a current user to login a micro front end, the login operation comprises micro application information of a plurality of micro applications corresponding to a page to be accessed by the current user, and the micro applications can be accessed by the current user based on the micro application information;
a second processing module, configured to obtain at least one piece of menu information based on a selection operation of the at least one piece of menu information for at least one of the multiple micro applications, where each piece of menu information in the at least one piece of menu information includes multiple pieces of button information;
a third processing module, configured to determine route information of a route corresponding to the menu information and route meta information of the route corresponding to the button information in the menu information, where the route meta information of the route is a meta field of a route manager of an vue framework;
the fourth processing module is used for judging whether page-level access can be carried out on the micro application according to the routing information of the route; and judging whether the current user can access the relevant information corresponding to the button or not according to the routing meta information of the route.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1-7 when executed by a processor.
CN202111619171.9A 2021-12-27 2021-12-27 Method, device, equipment and medium for determining user access micro application authority Pending CN114282204A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111619171.9A CN114282204A (en) 2021-12-27 2021-12-27 Method, device, equipment and medium for determining user access micro application authority

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111619171.9A CN114282204A (en) 2021-12-27 2021-12-27 Method, device, equipment and medium for determining user access micro application authority

Publications (1)

Publication Number Publication Date
CN114282204A true CN114282204A (en) 2022-04-05

Family

ID=80876621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111619171.9A Pending CN114282204A (en) 2021-12-27 2021-12-27 Method, device, equipment and medium for determining user access micro application authority

Country Status (1)

Country Link
CN (1) CN114282204A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116506215A (en) * 2023-06-16 2023-07-28 中国联合网络通信集团有限公司 Access processing method, device, electronic equipment and storage medium
CN117318994A (en) * 2023-08-29 2023-12-29 北京安锐卓越信息技术股份有限公司 Page access method, device, medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116506215A (en) * 2023-06-16 2023-07-28 中国联合网络通信集团有限公司 Access processing method, device, electronic equipment and storage medium
CN116506215B (en) * 2023-06-16 2023-09-12 中国联合网络通信集团有限公司 Access processing method, device, electronic equipment and storage medium
CN117318994A (en) * 2023-08-29 2023-12-29 北京安锐卓越信息技术股份有限公司 Page access method, device, medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109543454B (en) Anti-crawler method and related equipment
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN114282204A (en) Method, device, equipment and medium for determining user access micro application authority
CN107066631A (en) Display methods, device and the electronic equipment of the page
CN107920094B (en) Data acquisition method and device, server and network equipment
CN107580013B (en) Method and device for requesting data in cross-domain mode
CN104461491A (en) Running method and system of Hybrid components
CN111177672A (en) Page access control method and device and electronic equipment
CN112926061B (en) Plug-in processing method and device
RU2734027C2 (en) Method and device for preventing an attack on a server
CN111031111B (en) Page static resource access method, device and system
CN113536185B (en) Application page loading method, storage medium and related equipment
CN110708335A (en) Access authentication method and device and terminal equipment
CN102929971A (en) Multimedia information playing method and system
CA3134327A1 (en) Webpage integrity monitoring
CN114116078A (en) Application data processing method, device, equipment and medium based on micro front end
CN111767109A (en) H5 page display method and device based on terminal application and readable storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN108830076A (en) Improve method, electronic equipment and the storage medium of browser security
CN113132400B (en) Business processing method, device, computer system and storage medium
CN112818270A (en) Data cross-domain transfer method and device and computer equipment
CN108965108B (en) Message pushing method and related equipment
CN102999580A (en) Code input frame element processing method and browser
CN113329028B (en) Cross-domain access method and device
CN111651766B (en) Method and device for testing unauthorized access

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination