CN116701790B - Front-end authority control method based on route and related equipment - Google Patents

Front-end authority control method based on route and related equipment Download PDF

Info

Publication number
CN116701790B
CN116701790B CN202310969326.4A CN202310969326A CN116701790B CN 116701790 B CN116701790 B CN 116701790B CN 202310969326 A CN202310969326 A CN 202310969326A CN 116701790 B CN116701790 B CN 116701790B
Authority
CN
China
Prior art keywords
function
button
authority
authority information
dynamic
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.)
Active
Application number
CN202310969326.4A
Other languages
Chinese (zh)
Other versions
CN116701790A (en
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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202310969326.4A priority Critical patent/CN116701790B/en
Publication of CN116701790A publication Critical patent/CN116701790A/en
Application granted granted Critical
Publication of CN116701790B publication Critical patent/CN116701790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The disclosure provides a front-end authority control method based on routing and related equipment, and relates to the technical field of computers. The method comprises the steps of obtaining authority information, wherein the authority information comprises routing authority information and functional authority information; displaying a navigation bar according to the routing authority information; when a closure function preset by a function button is triggered, generating a dynamic function identifier; and determining the state of the function button according to the dynamic function identifier and the function authority information. According to the method and the device, the dynamic function identifier is generated through the closure function preset by the function button, the state of the function button is controlled by combining the function authority information, the authority control of the front end is achieved, and the coupling degree of the front end and the rear end is reduced.

Description

Front-end authority control method based on route and related equipment
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a front-end authority control method based on routing and related equipment.
Background
Front-end rights control is not new, and as early as the back-end MVC era, display/hidden control of buttons and menus has been ubiquitous in web systems, but was implemented in jsp or php templates by back-end programmers at that time. Along with the popularity of a front-end and back-end separation structure, the front end and the back end realize development decoupling by taking an interface as a boundary, the authority control is divided into two parts, and the ownership of the authority control of the front end is really returned to the front end. The front-end control function authority is to hide the function button or disable the button clicking event, thereby achieving the authority control. The front end decides whether a button of a certain page is hidden or not, and when the certain page is rendered, a certain function is called and judged, and whether the button identification (function identification) of the page is in an authorized identification set or not is judged.
In the prior art, the button identifier (function identifier) is a fixed unique value to identify, and the fixed function identifier makes the coupling degree of the front end and the back end large.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure provides a front-end authority control method and related equipment based on routing, which at least overcome the problem of high coupling degree between the front end and the rear end due to the fixed function identifier in the related technology to a certain extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to one aspect of the present disclosure, there is provided a front-end authority control method based on routing, including: acquiring authority information, wherein the authority information comprises routing authority information and functional authority information; displaying a navigation bar according to the routing authority information; when a closure function preset by a function button is triggered, generating a dynamic function identifier; and determining the state of the function button according to the dynamic function identifier and the function authority information.
In some embodiments, the determining the function button state according to the dynamic function identifier and the function authority information includes: judging whether the dynamic function identifier exists in the function authority information or not; if yes, displaying the function button; if not, hiding the function button.
In some embodiments, the preset closure function includes: and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
In some embodiments, the acquiring rights information includes: acquiring right information returned after a user logs in a system, wherein the right information comprises routing right information and functional right information; and storing the functional authority information into a browser cache, and storing the routing authority information into a memory.
In some embodiments, the generating the dynamic function identifier when the preset closure function of the function button triggers includes: acquiring a click event, and displaying a page corresponding to the click event; and rendering the page, calling a closure function preset by the function button, and generating a dynamic function identifier.
In some embodiments, the function button comprises: a new button is added; editing the button; delete button.
In some embodiments, each function button is packaged as a component, where the component includes a call to a closure function.
According to another aspect of the present disclosure, there is also provided a front-end authority control device based on routing, including: the system comprises a right information acquisition module, a control module and a control module, wherein the right information acquisition module is used for acquiring right information, and the right information comprises routing right information and functional right information; the page display module is used for displaying a navigation bar according to the routing authority information; the dynamic function identifier generation module is used for generating a dynamic function identifier when a closure function preset by the function button is triggered; and the function button state determining module is used for determining the function button state according to the dynamic function identifier and the function authority information.
According to another aspect of the present disclosure, there is also provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the route-based front end entitlement control method of any of the preceding claims via execution of the executable instructions.
According to another aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the route-based front-end authority control method of any one of the above.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the route-based front end authority control method of any one of the above.
The front-end authority control method based on the route and the related equipment provided by the embodiment of the disclosure acquire the authority information, wherein the authority information comprises the route authority information and the function authority information; displaying a navigation bar according to the routing authority information; when a closure function preset by a function button is triggered, generating a dynamic function identifier; and determining the state of the function button according to the dynamic function identifier and the function authority information. According to the method and the device, the dynamic function identifier is generated through the closure function preset by the function button, the state of the function button is controlled by combining the function authority information, the authority control of the front end is achieved, and the coupling degree of the front end and the rear end is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 is a schematic diagram of a front-end rights control system architecture based on routing in an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of a method for route-based front end authority control in an embodiment of the disclosure;
FIG. 3 is a flowchart of a specific example of a method for route-based front end rights control in an embodiment of the disclosure;
FIG. 4 is a flowchart of another embodiment of a method for route-based front end rights control in an embodiment of the disclosure;
FIG. 5 is a flowchart of another embodiment of a method for route-based front end rights control in an embodiment of the present disclosure;
FIG. 6 is a flowchart of a specific example of a route-based front end authority control method in an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a front-end authority control device based on routing in an embodiment of the disclosure;
FIG. 8 illustrates a block diagram of a computer device in an embodiment of the present disclosure;
fig. 9 shows a schematic diagram of a computer-readable storage medium in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The following detailed description of embodiments of the present disclosure refers to the accompanying drawings.
FIG. 1 illustrates an exemplary application system architecture diagram to which the route-based front-end rights control method of embodiments of the present disclosure may be applied. As shown in fig. 1, the system architecture may include a terminal device 101, a network 102, and a server 103.
The medium used by the network 102 to provide a communication link between the terminal device 101 and the server 103 may be a wired network or a wireless network.
Alternatively, the wireless network or wired network described above uses standard communication techniques and/or protocols. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible MarkupLanguage, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet security protocol (Internet Protocol Security, IPSec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
The terminal device 101 may be a variety of electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, and the like.
Alternatively, the clients of the applications installed in different terminal devices 101 are the same or clients of the same type of application based on different operating systems. The specific form of the application client may also be different based on the different terminal platforms, for example, the application client may be a mobile phone client, a PC client, etc.
The server 103 may be a server providing various services, such as a background management server providing support for devices operated by the user with the terminal apparatus 101. The background management server can analyze and process the received data such as the request and the like, and feed back the processing result to the terminal equipment.
Optionally, 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 providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
Those skilled in the art will appreciate that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative, and that any number of terminal devices, networks, and servers may be provided as desired. The embodiments of the present disclosure are not limited in this regard.
Under the system architecture, the embodiment of the disclosure provides a front-end authority control method based on routing, which can be executed by any electronic device with computing processing capability.
In some embodiments, the method for controlling front-end authority based on routing provided in the embodiments of the present disclosure may be performed by a terminal device of the above system architecture.
Fig. 2 shows a flowchart of a front-end authority control method based on routing in an embodiment of the disclosure, and as shown in fig. 2, the front-end authority control method based on routing provided in the embodiment of the disclosure includes the following steps:
s202, acquiring authority information, wherein the authority information comprises routing authority information and functional authority information.
It should be noted that, the above routing authority information may be to control a website routing address accessible to the user, and display a navigation menu corresponding to the routing address with authority on the interface of the front end. The function permission information may be resource permission data, and the instruction is used to control the view displayed on the interface of the front end, so that the control that the user has permission to operate is displayed on the interface of the front end, for example, the function permission information is the display of the function button.
For example, taking a user login and a different page presentation in the product service design center as examples, a new button, an edit button, and a delete button on the rule template management interface as examples, whether to display the buttons is implemented.
The user logs in successfully and returns a set of rights (corresponding to the rights information), and the rights comprise two parts, namely a routing rights set (corresponding to the routing rights information) and a functional rights set (corresponding to the functional rights information).
Wherein the routing authority set comprises:
[{"component":"@/layout/index",
"enableCache":0,
"icon":"rule_manager,
"id":"802022",
"isMenu":1,
"name":"ruleManager",
"path":"ruleManager",
"remark" rule management routing ",
"title": rule management ",
"children":[
{"children":[],
"component":"@/views/ruleModel/index",
"enableCache":0,
"icon":"rule_model,
"id":"802023",
"isMenu":1,
"name":"ruleModel",
"path":"ruleModel",
"remark" rule template routing ",
"title": "rule template" },
{"children":[],
"component":"@/views/ruleInstance/index",
"enableCache":0,
"icon":"rule_instance,
"id":"802024",
"isMenu":1,
"name":"ruleInstance",
"path":"ruleInstance",
"remark" rule instance routing ",
"title": "rule instance" } ].
The function authority set comprises: [ "rule model-dit", "rule model-create", "rule-query" ].
S204, displaying the navigation bar page according to the routing authority information.
It should be noted that the navigation bar may be a row of horizontal navigation buttons located at the top or side area of the page, above or below the banner page, and capable of linking to each page in the website or software, also referred to as a menu bar or a navigation menu bar.
For example, the left menu navigation bar is presented according to the routing authority (corresponding to the routing authority information).
S206, when the preset closure function of the function button is triggered, generating a dynamic function identifier.
It should be noted that the function Button may be a front Button, such as a Vue Button (Button). The closure function may be an internal function that ECMA Script (European Computer Manufacturers Association Script) allows to use. The function definition and the function expression are located within the function body of another function. Moreover, these internal functions have access to all local variables, parameters, and other internal functions declared in the external function in which they reside. When one of such internal functions is called outside of the external function that contains them, a closure is formed. The internal function may be executed after the external function returns. While this internal function executes, it still has to access the local variables, parameters, and other internal functions of its external function. The values of these local variables, parameters and function declarations (initially) are the values at which the external function returns, but are also affected by the internal function.
S208, determining the state of the function button according to the dynamic function identification and the function authority information.
The above-mentioned function button state may be an attribute of the function button, such as a display state and a hidden state (Disabled state).
In one embodiment of the present disclosure, the preset closure function includes: and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
In one embodiment of the present disclosure, the function button includes: a new button is added; editing the button; delete button.
In one embodiment of the present disclosure, each function button is packaged as a component, where the component includes a call to a closure function and a call to a custom instruction.
For example, clicking on the rule template menu, the system will display the rule template interface, and in the process of rendering the rule template management interface by the browser, will call the newly added component button (corresponding to the newly added button), edit the component button (corresponding to the edit button), delete the dynamic function identification closure function and the custom instruction defined on the component button (corresponding to the delete button) node, wherein isShowFunctionButton in the following code is the dynamic function identification closure function, v-permission is the custom instruction, and the code is as follows:
<el-button
v-permission="isShowFunctionButton('create')"
type="primary" icon="el-icon-plus"
click= "openCreateDataForm" > New button >.
The global closure function is used for generating dynamic function identifiers, such as adding, editing and deleting corresponding dynamic function identifiers of rule template management interfaces, namely rule model-create, rule model-wait, rule model-delete. The closure function (globally registered) is as follows:
isShowFunctionButton() {
return function(operation) {
const permission = [ ]
const options={option:operation}
permission.push(this.getPowerPath(options))
return permission}}
getPowerPath(options) {
const permissionPath = (this.$route.name.toLowerCase()).concat(`-${options.option}`)
return permissionPath }。
the function of the custom instruction function is to control whether the function buttons show the current interface, and the main implementation logic is that each function button calls the custom instruction function when rendering, and transmits the function identifier corresponding to the function button and the Dom corresponding to the function button into the custom function, and the function identifier (equivalent to the dynamic function identifier) of the button and the function permission set in the browser cache are compared in the executing process, if the function identifier of the button is in the permission set, the button is shown, and if the button function is not in the permission set, the Dom corresponding to the button needs to be hidden.
The present disclosure encapsulates each function button into a component that includes a call to a closure function and a call to a custom instruction, and then the closure function generates a dynamic identifier, where a rule of the dynamic identifier is a route name-button code corresponding to a current page, for example: and the function button identification is User-Create when the User manages the new function of the interface.
According to the method and the device, dynamic function identification is generated through the closure function preset by the function buttons, the state of the function buttons is controlled by combining the function authority information, the authority control is achieved, and the coupling degree of the front end and the rear end is reduced.
In one embodiment of the present disclosure, as shown in fig. 3, the front-end authority control method based on routing provided in the embodiment of the present disclosure may determine the status of a function button by:
s302, judging whether a dynamic function identifier exists in the function authority information;
s304, if yes, displaying a function button;
s306, if not, hiding the function buttons.
It should be noted that, the above-mentioned S302-S306 may be encapsulated in the component of the function button as a custom instruction.
In one embodiment of the present disclosure, as shown in fig. 4, the front-end authority control method based on routing provided in the embodiment of the present disclosure may determine authority information through the following steps, so that the front-end dynamic control function authority can be implemented:
s402, acquiring right information returned after a user logs in a system, wherein the right information comprises routing right information and functional right information;
s404, storing the function authority information into a browser cache and storing the routing authority information into a memory.
In one embodiment of the present disclosure, as shown in fig. 5, the route-based front end authority control method provided in the embodiment of the present disclosure may generate a dynamic function identifier by:
s502, acquiring a click event, and displaying a page corresponding to the click event;
s504, performing page rendering, calling a closure function preset by a function button, and generating a dynamic function identifier.
Fig. 6 is a flowchart illustrating a specific example of a front-end authority control method based on routing in an embodiment of the present disclosure, and as shown in fig. 6, the front-end authority control method based on routing provided in the embodiment of the present disclosure includes the following steps:
s601, a user logs in the system, and the front end acquires user authority data (corresponding to the authority information) from the background;
s602, a function authority identification set (equivalent to the function authority information) is put into a browser cache, and a routing authority set is stored into a memory opened by an application;
s603, limiting the route address which can be accessed by the user according to the route authority data (corresponding to the route authority information), and displaying the authorized route address on a menu navigation bar (corresponding to the navigation bar page);
s604, clicking a menu, initializing a corresponding interface, initializing a function button on the interface (displaying a corresponding page, rendering the corresponding page by a browser, and calling a dynamic function identification closure function and a user-defined instruction defined on a button Dom node);
s605, triggering and calling a closure function on a function button (a dynamic function identification closure function can generate a function identification according to a page corresponding route name and a fixed button code) to generate a dynamic function identification;
s606, the custom instruction on the function button is also called (according to the logic of the custom instruction, whether the function button is displayed or not is determined);
s607, judging whether the dynamic function identifier is in the function authority identifier set, if so, jumping to S608, and if not, jumping to S609;
s608, displaying a function button (on the front page);
s609, hide the function button (on the front page).
The authority identification dynamic combination reduces the coupling between the front end and the rear end; the dynamic combination button identification can make the buttons modularized, expand the function buttons of the system in the later period at low cost, and improve the programming efficiency; and the expandability is improved.
It should be noted that, in the technical solution of the present disclosure, the acquiring, storing, using, processing, etc. of data all conform to relevant regulations of national laws and regulations, and various types of data such as personal identity data, operation data, behavior data, etc. relevant to individuals, clients, crowds, etc. acquired in the embodiments of the present disclosure have been authorized.
Based on the same inventive concept, the embodiment of the disclosure also provides a front-end authority control device based on routing, as described in the following embodiment. Since the principle of solving the problem of the embodiment of the device is similar to that of the embodiment of the method, the implementation of the embodiment of the device can be referred to the implementation of the embodiment of the method, and the repetition is omitted.
Fig. 7 shows a schematic diagram of a front-end authority control device based on routing in an embodiment of the disclosure, as shown in fig. 7, where the device includes: the system comprises a permission information acquisition module 71, a page display module 72, a dynamic function identification generation module 73, a function button state determination module 74 and a component encapsulation module 75.
Wherein, the rights information acquisition module 71 is configured to acquire rights information, where the rights information includes routing rights information and functional rights information;
the page display module 72 is configured to display a navigation bar according to the routing authority information;
a dynamic function identifier generating module 73, configured to generate a dynamic function identifier when a closure function preset by the function button is triggered;
the function button state determining module 74 is configured to determine a function button state according to the dynamic function identifier and the function authority information.
In one example of the present disclosure, the function button status determination module 74 is further configured to determine whether a dynamic function identifier exists in the function permission information; if yes, displaying the function buttons; if not, hiding the function button.
In one example of the present disclosure, the closure function preset in the dynamic function identifier generating module 73 includes: and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
In one example of the present disclosure, the rights information obtaining module 71 is further configured to obtain rights information returned after the user logs into the system, where the rights information includes routing rights information and functional rights information; and storing the functional authority information into a browser cache, and storing the routing authority information into a memory.
In an example of the present disclosure, the dynamic function identifier generating module 73 is further configured to obtain a click event, and display a page corresponding to the click event; and rendering the page, calling a closure function preset by the function button, and generating a dynamic function identifier.
In one example of the present disclosure, the function buttons in the routing-based front end authority control device include:
a new button is added;
editing the button;
delete button.
In one example of the present disclosure, the routing-based front end authority control device further includes a component encapsulation module 75 for encapsulating each function button as a component, where the component includes a call to a closure function.
Here, the rights information obtaining module 71, the page displaying module 72, the dynamic function identifier generating module 73 and the function button status determining module 74 correspond to S202 to S208 in the method embodiment, and the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the method embodiment. It should be noted that the modules described above may be implemented as part of an apparatus in a computer system, such as a set of computer-executable instructions.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to such an embodiment of the present disclosure is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 8, the electronic device 800 is embodied in the form of a general purpose computing device. Components of electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, and a bus 830 connecting the various system components, including the memory unit 820 and the processing unit 810.
Wherein the storage unit stores program code that is executable by the processing unit 810 such that the processing unit 810 performs steps according to various exemplary embodiments of the present disclosure described in the above section of the present specification.
For example, the processing unit 810 may perform the following steps of the method embodiment described above:
acquiring authority information, wherein the authority information comprises routing authority information and functional authority information;
displaying a navigation bar according to the routing authority information;
when a closure function preset by a function button is triggered, generating a dynamic function identifier;
and determining the state of the function button according to the dynamic function identifier and the function authority information.
For example, the processing unit 810 may perform the following steps of the method embodiment described above:
judging whether the dynamic function identifier exists in the function authority information or not;
if yes, displaying the function buttons;
if not, hiding the function button.
For example, the processing unit 810 performs the preset closure function in the above method embodiment, including:
and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
For example, the processing unit 810 may perform the following steps of the method embodiment described above:
acquiring right information returned after a user logs in a system, wherein the right information comprises routing right information and functional right information;
and storing the functional authority information into a browser cache, and storing the routing authority information into a memory.
For example, the processing unit 810 may perform the following steps of the method embodiment described above:
acquiring a click event, and displaying a page corresponding to the click event;
and rendering the page, calling a closure function preset by the function button, and generating a dynamic function identifier.
For example, the processing unit 810 executes the function buttons in the above method embodiment, including:
a new button is added;
editing the button;
delete button.
For example, the processing unit 810 may perform the following steps of the method embodiment described above:
each function button is packaged as a component, where the component includes a call to a closure function.
The storage unit 820 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 8201 and/or cache memory 8202, and may further include Read Only Memory (ROM) 8203.
Storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 830 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 840 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and/or any device (e.g., router, modem, etc.) that enables the electronic device 800 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 850. Also, electronic device 800 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 860. As shown, network adapter 860 communicates with other modules of electronic device 800 over bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 800, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In particular, according to embodiments of the present disclosure, the process described above with reference to the flowcharts may be implemented as a computer program product comprising: and the computer program is executed by the processor to realize the front-end authority control method based on the route.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium, which may be a readable signal medium or a readable storage medium, is also provided. Fig. 9 illustrates a schematic diagram of a computer-readable storage medium in an embodiment of the present disclosure, where a program product capable of implementing the method of the present disclosure is stored on the computer-readable storage medium 900 as illustrated in fig. 9. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
In one embodiment, the program product of the disclosed embodiments, when executed by a processor, performs a method comprising:
acquiring authority information, wherein the authority information comprises routing authority information and functional authority information;
displaying a navigation bar according to the routing authority information;
when a closure function preset by a function button is triggered, generating a dynamic function identifier;
and determining the state of the function button according to the dynamic function identifier and the function authority information.
In one embodiment, the program product of the disclosed embodiments, when executed by a processor, performs a method comprising:
judging whether the dynamic function identifier exists in the function authority information or not;
if yes, displaying the function buttons;
if not, hiding the function button.
In one embodiment, a program product in an embodiment of the present disclosure, when executed by a processor, includes:
and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
In one embodiment, the program product of the disclosed embodiments, when executed by a processor, performs a method comprising:
acquiring right information returned after a user logs in a system, wherein the right information comprises routing right information and functional right information;
and storing the functional authority information into a browser cache, and storing the routing authority information into a memory.
In one embodiment, the program product of the disclosed embodiments, when executed by a processor, performs a method comprising:
acquiring a click event, and displaying a page corresponding to the click event;
and rendering the page, calling a closure function preset by the function button, and generating a dynamic function identifier.
In one embodiment, the program product in the embodiments of the present disclosure, when executed by a processor, functions the buttons include:
a new button is added;
editing the button;
delete button.
In one embodiment, the program product of the disclosed embodiments, when executed by a processor, performs a method comprising:
each function button is packaged as a component, where the component includes a call to a closure function.
More specific examples of the computer readable storage medium in the present disclosure may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, the program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, the program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the description of the above embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. The front-end authority control method based on the route is characterized by comprising the following steps:
acquiring authority information, wherein the authority information comprises routing authority information and functional authority information;
displaying a navigation bar according to the routing authority information;
when a closure function preset by a function button is triggered, generating a dynamic function identifier;
determining a function button state according to the dynamic function identifier and the function authority information;
wherein, when the preset closure function of the function button is triggered, generating the dynamic function identifier includes: invoking a closure function preset by a function button to generate a dynamic function identifier;
and determining the state of the function button according to the dynamic function identifier and the function authority information comprises the following steps: and determining whether the function button state is a display state or a hidden state according to whether the dynamic function identifier exists in the function authority information.
2. The routing-based front end authority control method of claim 1, wherein the determining a function button state according to the dynamic function identification and the function authority information comprises:
judging whether the dynamic function identifier exists in the function authority information or not;
if yes, displaying the function button;
if not, hiding the function button.
3. The route-based front-end authority control method according to claim 1, wherein the preset closure function comprises:
and generating a dynamic function identifier according to the route name and the button code corresponding to the current page.
4. The route-based front-end authority control method according to claim 1, wherein the acquiring authority information includes:
acquiring right information returned after a user logs in a system, wherein the right information comprises routing right information and functional right information;
and storing the functional authority information into a browser cache, and storing the routing authority information into a memory.
5. The routing-based front-end authority control method according to claim 1, wherein the generating the dynamic function identifier when the function button preset closure function triggers comprises:
acquiring a click event, and displaying a page corresponding to the click event;
and rendering the page, calling a closure function preset by the function button, and generating a dynamic function identifier.
6. The route-based front-end authority control method of claim 1, wherein the function button comprises:
a new button is added;
editing the button;
delete button.
7. The route-based front-end authority control method of claim 6, wherein each function button function is packaged as a component, wherein the component comprises a call to a closure function.
8. A routing-based front-end entitlement control device comprising:
the system comprises a right information acquisition module, a control module and a control module, wherein the right information acquisition module is used for acquiring right information, and the right information comprises routing right information and functional right information;
the page display module is used for displaying a navigation bar according to the routing authority information;
the dynamic function identifier generation module is used for generating a dynamic function identifier when a closure function preset by the function button is triggered;
the function button state determining module is used for determining the state of the function button according to the dynamic function identifier and the function authority information;
wherein, the dynamic function identification generation module is further used for: invoking a closure function preset by a function button to generate a dynamic function identifier;
the function button state determining module is further configured to: and determining whether the function button state is a display state or a hidden state according to whether the dynamic function identifier exists in the function authority information.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the route-based front end entitlement control method of any of claims 1-7 via execution of the executable instructions.
10. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the route-based front end authority control method of any of claims 1 to 7.
CN202310969326.4A 2023-08-03 2023-08-03 Front-end authority control method based on route and related equipment Active CN116701790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310969326.4A CN116701790B (en) 2023-08-03 2023-08-03 Front-end authority control method based on route and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310969326.4A CN116701790B (en) 2023-08-03 2023-08-03 Front-end authority control method based on route and related equipment

Publications (2)

Publication Number Publication Date
CN116701790A CN116701790A (en) 2023-09-05
CN116701790B true CN116701790B (en) 2023-11-07

Family

ID=87837792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310969326.4A Active CN116701790B (en) 2023-08-03 2023-08-03 Front-end authority control method based on route and related equipment

Country Status (1)

Country Link
CN (1) CN116701790B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669597A (en) * 2018-10-31 2019-04-23 武汉艺果互动科技股份有限公司 Front end authority control method, equipment and storage equipment when user browses web sites
CN111563215A (en) * 2020-07-16 2020-08-21 平安国际智慧城市科技股份有限公司 Method and device for controlling front-end operation authority and related equipment
CN112016128A (en) * 2020-10-29 2020-12-01 北京淇瑀信息科技有限公司 Vue development method and device based on CRUD and authority management
CN112241266A (en) * 2019-07-17 2021-01-19 腾讯科技(北京)有限公司 Authority control method, device and equipment under front-end rendering scene and storage medium
CN112257091A (en) * 2020-10-28 2021-01-22 南开大学 Authority control method based on front-end and back-end separation
CN112487392A (en) * 2020-12-08 2021-03-12 浪潮云信息技术股份公司 Method for realizing authority control of management system by front end
CN113050927A (en) * 2021-04-12 2021-06-29 平安国际智慧城市科技股份有限公司 Permission control method and device based on user-defined instruction and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200133645A1 (en) * 2018-10-30 2020-04-30 Jpmorgan Chase Bank, N.A. User interface and front end application automatic generation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669597A (en) * 2018-10-31 2019-04-23 武汉艺果互动科技股份有限公司 Front end authority control method, equipment and storage equipment when user browses web sites
CN112241266A (en) * 2019-07-17 2021-01-19 腾讯科技(北京)有限公司 Authority control method, device and equipment under front-end rendering scene and storage medium
CN111563215A (en) * 2020-07-16 2020-08-21 平安国际智慧城市科技股份有限公司 Method and device for controlling front-end operation authority and related equipment
CN112257091A (en) * 2020-10-28 2021-01-22 南开大学 Authority control method based on front-end and back-end separation
CN112016128A (en) * 2020-10-29 2020-12-01 北京淇瑀信息科技有限公司 Vue development method and device based on CRUD and authority management
CN112487392A (en) * 2020-12-08 2021-03-12 浪潮云信息技术股份公司 Method for realizing authority control of management system by front end
CN113050927A (en) * 2021-04-12 2021-06-29 平安国际智慧城市科技股份有限公司 Permission control method and device based on user-defined instruction and computer equipment

Also Published As

Publication number Publication date
CN116701790A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN109032706B (en) Intelligent contract execution method, device, equipment and storage medium
EP2798494B1 (en) Virtual channel for embedded process communication
US9398087B1 (en) Secure deployment of an application across deployment locations
CN105940654B (en) Franchise static web application in trust
US8650481B1 (en) Stable and secure use of content scripts in browser extensions
US10574724B2 (en) Automatic discovery of management nodes and generation of CLI using HA module
CN105940409A (en) Web service sandbox system
KR20110030461A (en) System and method for dynamic partitioning of applications in client-server environments
US20110137909A1 (en) Location independent execution of user interface operations
CN104704468A (en) Cross system installation of WEB applications
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN111740948A (en) Data packet issuing method, dynamic updating method, device, equipment and medium
US20170116056A1 (en) Thread synchronization for platform neutrality
CN112988175A (en) Cross-platform application installation package generation method, device, medium and electronic equipment
CN113158195A (en) Distributed vulnerability scanning method and system based on POC script
CN116701790B (en) Front-end authority control method based on route and related equipment
CN113434217B (en) Vulnerability scanning method, vulnerability scanning device, computer equipment and medium
CN114816361A (en) Method, device, equipment, medium and program product for generating splicing project
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN114219643A (en) Transaction calling method, device, equipment and storage medium
CN116149639A (en) Method and device for developing components, electronic equipment and storage medium
CN113221097A (en) Code execution method and device, electronic terminal and storage medium
CN112182083A (en) File generation method, device, equipment and storage medium
CN117591982A (en) Verification method, system, device, equipment and storage medium
CN114706583A (en) Web application generation method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant