CN116506215B - Access processing method, device, electronic equipment and storage medium - Google Patents
Access processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116506215B CN116506215B CN202310720527.0A CN202310720527A CN116506215B CN 116506215 B CN116506215 B CN 116506215B CN 202310720527 A CN202310720527 A CN 202310720527A CN 116506215 B CN116506215 B CN 116506215B
- Authority
- CN
- China
- Prior art keywords
- button
- user
- application
- information
- sub
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 15
- 238000000034 method Methods 0.000 claims abstract description 49
- 238000012545 processing Methods 0.000 claims abstract description 27
- 238000012544 monitoring process Methods 0.000 claims description 5
- 230000001360 synchronised effect Effects 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000007726 management method Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 101150046362 BTN1 gene Proteins 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0815—Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/105—Multiple levels of security
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- User Interface Of Digital Computer (AREA)
- Facsimiles In General (AREA)
Abstract
Description
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种访问处理方法、装置、电子设备以及存储介质。The present application relates to the field of computer technology, and in particular, to an access processing method, device, electronic device and storage medium.
背景技术Background technique
微前端是一种类似于微服务的架构,它将微服务的理念应用于浏览器端,将Web应用由单体应用转变为由多个小型前端应用聚合而成,各个前端子应用可以独立运行、独立开发、独立部署,并且各前端子应用的鉴权处理也由子前端子应用分别处理。Micro front-end is an architecture similar to microservices. It applies the concept of microservices to the browser side and transforms Web applications from a single application into an aggregation of multiple small front-end applications. Each front-end sub-application can run independently. , independently developed and independently deployed, and the authentication processing of each front-end sub-application is also handled separately by the sub-front-end sub-application.
然而当微前端系统划分的前端应用较多时,各前端子应用中需要分别设置鉴权模块,会导致整个系统中存在多个鉴权模块,容易出现鉴权混乱的问题。However, when the micro front-end system is divided into many front-end applications, authentication modules need to be set up in each front-end sub-application, which will lead to the existence of multiple authentication modules in the entire system, which is prone to authentication confusion.
发明内容Contents of the invention
本申请提供一种访问处理方法、装置、电子设备以及存储介质,用以解决现有技术中微前端系统中各子应用单独鉴权易出现鉴权混乱导致鉴权安全性降低的问题,实现了提高鉴权结果的准确性和安全性。This application provides an access processing method, device, electronic device and storage medium to solve the problem in the prior art that individual authentication of each sub-application in the micro front-end system is prone to authentication confusion, resulting in reduced authentication security, and achieves Improve the accuracy and security of authentication results.
第一方面,本申请提供一种访问处理方法,应用于微前端系统,所述微前端系统包括主应用和多个子应用,所述方法包括:In a first aspect, this application provides an access processing method applied to a micro front-end system. The micro front-end system includes a main application and multiple sub-applications. The method includes:
在用户成功登录所述主应用的情况下,接收所述用户对于按钮的按钮操作指令,并确定所述按钮所属的子应用;When the user successfully logs in to the main application, receive the user's button operation instruction for the button, and determine the sub-application to which the button belongs;
根据所述用户的登录信息确定所述用户的角色信息,并根据所述角色信息、所述子应用以及所述主应用,确定所述用户对应的按钮权限信息;Determine the user's role information based on the user's login information, and determine the button permission information corresponding to the user based on the role information, the sub-application and the main application;
若所述主应用根据所述按钮操作指令以及所述按钮权限信息,确定所述用户具备所述按钮的操作权限,则控制所述子应用响应所述按钮操作请求。If the main application determines that the user has the operation authority for the button based on the button operation instruction and the button authority information, the sub-application is controlled to respond to the button operation request.
可选的,在接收所述用户对于按钮的按钮操作指令之前,还包括:Optionally, before receiving the user's button operation instruction for the button, the method also includes:
接收所述用户输入的登录信息,并基于所述登录信息对所述用户进行所述主应用的登录权限认证;Receive the login information input by the user, and authenticate the user's login permission for the main application based on the login information;
若所述用户未通过所述登录权限认证,则向所述用户展示不具备登录权限的认证提示信息;If the user fails to pass the login authority authentication, then the authentication prompt information indicating that the user does not have login authority is displayed to the user;
若所述用户通过所述登录权限认证,则控制所述主应用响应所述登录信息,并向所述用户展示所述主应用的主页面;所述主页面中包含各所述子应用分对应的菜单。If the user passes the login authority authentication, the main application is controlled to respond to the login information, and the main page of the main application is displayed to the user; the main page includes corresponding sub-applications. menu.
可选的,所述接收所述用户对于按钮的按钮操作指令,并确定所述按钮所属的子应用,包括:Optionally, receiving a button operation instruction from the user for a button and determining the sub-application to which the button belongs includes:
接收所述用户对所述主页面中任一菜单的操作指令,若基于所述角色信息确定所述用户具备对当前菜单的操作权限,则向所述用户展示所述当前菜单;所述当前菜单包含多个按钮;Receive the user's operation instruction for any menu on the main page, and if it is determined based on the role information that the user has the operation authority for the current menu, then display the current menu to the user; the current menu Contains multiple buttons;
接收所述用户对所述当前菜单中任一按钮的按钮操作指令,并基于所述按钮操作指令确定所述按钮所属的子应用。Receive a button operation instruction from the user for any button in the current menu, and determine the sub-application to which the button belongs based on the button operation instruction.
可选的,所述根据所述角色信息、所述子应用以及所述主应用,确定所述用户对应的按钮权限信息,包括:Optionally, determining the button permission information corresponding to the user based on the role information, the sub-application and the main application includes:
在所述子应用中读取与所述用户角色信息对应的第一按钮权限信息,并在所述主应用中读取与所述用户角色信息对应的第二按钮权限信息;Read the first button permission information corresponding to the user role information in the sub-application, and read the second button permission information corresponding to the user role information in the main application;
基于所述第一按钮权限信息和所述第二按钮权限信息的信息比对结果确定所述用户对应的按钮权限信息。The button authority information corresponding to the user is determined based on the information comparison result of the first button authority information and the second button authority information.
可选的,所述基于所述第一按钮权限信息和所述第二按钮权限信息的信息比对结果确定所述用户对应的按钮权限信息,包括:Optionally, determining the button authority information corresponding to the user based on the information comparison result of the first button authority information and the second button authority information includes:
若所述第一按钮权限信息和所述第二按钮权限信息的比对结果一致,则将所述第一按钮权限信息或者所述第二按钮权限信息确定为所述用户对应的按钮权限信息;If the comparison results of the first button permission information and the second button permission information are consistent, then the first button permission information or the second button permission information is determined as the button permission information corresponding to the user;
若所述第一按钮权限信息和所述第二按钮权限信息的比对结果不一致,则所述用户对应的按钮权限信息为空。If the comparison results of the first button permission information and the second button permission information are inconsistent, the button permission information corresponding to the user is empty.
可选的,所述方法还包括:Optionally, the method also includes:
当监听到所述用户对所述当前菜单的调整指令时,解析所述调整指令,得到调整后的目标菜单地址;When monitoring the user's adjustment instruction for the current menu, parse the adjustment instruction to obtain the adjusted target menu address;
若所述目标菜单地址在预设的地址白名单内,则直接显示所述目标菜单地址对应的目标菜单;If the target menu address is in the preset address whitelist, the target menu corresponding to the target menu address is directly displayed;
若所述目标菜单地址不在预设的地址白名单内,则基于所述角色信息对所述用户是否具备对所述目标菜单地址对应的菜单的操作权限进行鉴权处理。If the target menu address is not in the preset address whitelist, authentication processing is performed based on the role information to determine whether the user has the operating authority to operate the menu corresponding to the target menu address.
可选的,所述方法还包括:Optionally, the method also includes:
对于任一子应用的任一按钮,预先获取各角色信息对按钮的按钮权限信息,并将所述按钮权限信息同步至所述主应用中进行存储。For any button of any sub-application, the button permission information of each role information for the button is obtained in advance, and the button permission information is synchronized to the main application for storage.
第二方面,本申请提供一种访问处理装置,包括:In the second aspect, this application provides an access processing device, including:
按钮操作指令接收模块,用于在用户成功登录所述主应用的情况下,接收所述用户对于按钮的按钮操作指令,并确定所述按钮所属的子应用;A button operation instruction receiving module, configured to receive the user's button operation instruction for a button when the user successfully logs in to the main application, and determine the sub-application to which the button belongs;
按钮权限信息获取模块,用于根据所述用户的登录信息确定所述用户的角色信息,并根据所述角色信息、所述子应用以及所述主应用,确定所述用户对应的按钮权限信息;A button permission information acquisition module, configured to determine the role information of the user based on the user's login information, and determine the button permission information corresponding to the user based on the role information, the sub-application and the main application;
操作权限鉴权模块,用于若所述主应用根据所述按钮操作指令以及所述按钮权限信息,确定所述用户具备所述按钮的操作权限,则控制所述子应用响应所述按钮操作请求。An operation permission authentication module, configured to control the sub-application to respond to the button operation request if the main application determines that the user has the operation permission for the button based on the button operation instruction and the button permission information. .
可选的,所述装置还包括:Optionally, the device also includes:
登录权限认证模块,用于接收所述用户输入的登录信息,并基于所述登录信息对所述用户进行所述主应用的登录权限认证;A login authority authentication module, configured to receive the login information input by the user, and authenticate the user's login authority for the main application based on the login information;
提示信息展示模块,用于若所述用户未通过所述登录权限认证,则向所述用户展示不具备登录权限的认证提示信息;A prompt information display module, configured to display authentication prompt information indicating that the user does not have login authority to the user if the user fails to pass the login authority authentication;
主页面展示模块,用于若所述用户通过所述登录权限认证,则控制所述主应用响应所述登录信息,并向所述用户展示所述主应用的主页面;所述主页面中包含各所述子应用分对应的菜单。A main page display module, used to control the main application to respond to the login information if the user passes the login authority authentication, and display the main page of the main application to the user; the main page contains Each of the sub-applications has a corresponding menu.
可选的,按钮操作指令接收模块,包括:Optional button operation instruction receiving module includes:
菜单展示单元,用于接收所述用户对所述主页面中任一菜单的操作指令,若基于所述角色信息确定所述用户具备对当前菜单的操作权限,则向所述用户展示所述当前菜单;所述当前菜单包含多个按钮;A menu display unit configured to receive the user's operating instructions for any menu on the main page, and if it is determined based on the role information that the user has the operating authority for the current menu, display the current menu to the user. Menu; the current menu contains multiple buttons;
按钮操作指令接收单元,用于接收所述用户对所述当前菜单中任一按钮的按钮操作指令,并基于所述按钮操作指令确定所述按钮所属的子应用。A button operation instruction receiving unit is configured to receive a button operation instruction from the user for any button in the current menu, and determine the sub-application to which the button belongs based on the button operation instruction.
可选的,按钮权限信息获取模块,包括:Optional, button permission information acquisition module, including:
角色按钮信息获取单元,用于在所述子应用中读取与所述用户角色信息对应的第一按钮权限信息,并在所述主应用中读取与所述用户角色信息对应的第二按钮权限信息;A role button information acquisition unit, configured to read the first button permission information corresponding to the user role information in the sub-application, and read the second button corresponding to the user role information in the main application permission information;
按钮权限信息确定单元,用于基于所述第一按钮权限信息和所述第二按钮权限信息的信息比对结果确定所述用户对应的按钮权限信息。A button authority information determining unit is configured to determine the button authority information corresponding to the user based on the information comparison result of the first button authority information and the second button authority information.
可选的,按钮权限信息确定单元,包括:Optional, button permission information determination unit includes:
第一按钮权限信息确定子单元,用于若所述第一按钮权限信息和所述第二按钮权限信息的比对结果一致,则将所述第一按钮权限信息或者所述第二按钮权限信息确定为所述用户对应的按钮权限信息;The first button authority information determination subunit is used to determine the first button authority information or the second button authority information if the comparison results of the first button authority information and the second button authority information are consistent. Determine the button permission information corresponding to the user;
第二按钮权限信息确定子单元,用于若所述第一按钮权限信息和所述第二按钮权限信息的比对结果不一致,则所述用户对应的按钮权限信息为空。The second button authority information determination subunit is used to determine that the button authority information corresponding to the user is empty if the comparison results of the first button authority information and the second button authority information are inconsistent.
可选的,该装置还包括:Optionally, the device also includes:
目标菜单地址获得模块,用于当监听到所述用户对所述当前菜单的调整指令时,解析所述调整指令,得到调整后的目标菜单地址;A target menu address obtaining module, configured to, when monitoring the user's adjustment instruction for the current menu, parse the adjustment instruction and obtain the adjusted target menu address;
目标菜单显示单元,用于若所述目标菜单地址在预设的地址白名单内,则直接显示所述目标菜单地址对应的目标菜单;A target menu display unit, configured to directly display the target menu corresponding to the target menu address if the target menu address is in a preset address whitelist;
操作权限鉴权单元,用于若所述目标菜单地址不在预设的地址白名单内,则基于所述角色信息对所述用户是否具备对所述目标菜单地址对应的菜单的操作权限进行鉴权处理。An operation authority authentication unit, configured to authenticate whether the user has the operation authority for the menu corresponding to the target menu address based on the role information if the target menu address is not in the preset address whitelist. deal with.
可选的,该装置还包括:Optionally, the device also includes:
按钮权限信息存储模块,用于对于任一子应用的任一按钮,预先获取各角色信息对按钮的按钮权限信息,并将所述按钮权限信息同步至所述主应用中进行存储。The button permission information storage module is used to obtain the button permission information of each role information pair button in advance for any button of any sub-application, and synchronize the button permission information to the main application for storage.
第三方面,本申请提供一种电子设备,包括:处理器,以及与所述处理器通信连接In a third aspect, this application provides an electronic device, including: a processor, and a communication connection with the processor
的存储器;memory;
所述存储器存储计算机执行指令;The memory stores computer execution instructions;
所述处理器执行所述存储器存储的计算机执行指令,以实现如第一方面所述的方法。The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect.
第四方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如第一方面所述的方法。In a fourth aspect, the present application provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When executed by a processor, the computer-executable instructions are used to implement the method as described in the first aspect. .
第五方面,本申请提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现第一方面所述的方法。In a fifth aspect, the present application provides a computer program product, including a computer program that implements the method described in the first aspect when executed by a processor.
本申请提供的技术方案,通过在用户通过微前端的登录认证的情况下,接收用户对子应用中按钮的操作,并基于操作所生成的操作指令,以及从子应用以及主应用中确定的按钮权限信息,在主应用中对用户所对应的角色是否拥有对该按钮的操作权限进行验证。当确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求;通过在主应用中进行统一鉴权可以解决现有技术中微前端系统中各子应用单独鉴权易出现鉴权混乱导致鉴权安全性降低的问题,实现微前端系统对子应用的统一管理,方便子应用在系统中的接入和抽离,并且基于两个应用确定权限信息的方式也提高了鉴权结果的准确性和安全性。The technical solution provided by this application receives the user's operation of the button in the sub-application when the user passes the login authentication of the micro front-end, and generates operation instructions based on the operation, as well as buttons determined from the sub-application and the main application. Permission information, in the main application, verify whether the user's corresponding role has the permission to operate the button. When it is determined that the user has the operation permission of the button, the sub-application is controlled to respond to the button operation request; by performing unified authentication in the main application, it can solve the problem that in the existing technology, individual authentication of each sub-application in the micro front-end system is prone to authentication confusion, resulting in authentication confusion. It solves the problem of reduced rights security and realizes the unified management of sub-applications by the micro-front-end system to facilitate the access and withdrawal of sub-applications in the system. The method of determining permission information based on two applications also improves the accuracy of authentication results. and security.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
图1为本申请提供的访问处理微前端系统的结构示意图;Figure 1 is a schematic structural diagram of the access processing micro front-end system provided by this application;
图2为本申请实施例提供的一种访问处理方法的流程示意图;Figure 2 is a schematic flow chart of an access processing method provided by an embodiment of the present application;
图3为本申请实施例提供的另一种访问处理方法的流程示意图;Figure 3 is a schematic flow chart of another access processing method provided by an embodiment of the present application;
图4为本申请实施例提供的另一种访问处理方法的流程示意图;Figure 4 is a schematic flowchart of another access processing method provided by an embodiment of the present application;
图5为本申请实施例提供的一种访问处理装置的结构示意图;Figure 5 is a schematic structural diagram of an access processing device provided by an embodiment of the present application;
图6为本申请实施例提供的一种电子设备的结构示意图;Figure 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图7为本申请实施例提供的一种电子设备的框图。Figure 7 is a block diagram of an electronic device provided by an embodiment of the present application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。Through the above-mentioned drawings, clear embodiments of the present application have been shown, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present application's concepts in any way, but are intended to illustrate the application's concepts for those skilled in the art with reference to specific embodiments.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the appended claims.
在目前的微前端架构中,主应用中只提供简单的子应用入口链接,具体用户有没有子应用的访问权限需要由各个子应用自行处理。然而当微前端系统划分的前端应用较多时,各前端子应用中需要分别设置鉴权模块,会导致整个系统中存在多个鉴权模块,容易出现鉴权混乱的问题。In the current micro front-end architecture, only simple sub-application entry links are provided in the main application. Whether the specific user has access rights to sub-applications needs to be handled by each sub-application itself. However, when the micro front-end system is divided into many front-end applications, authentication modules need to be set up in each front-end sub-application, which will lead to the existence of multiple authentication modules in the entire system, which is prone to authentication confusion.
本申请提供的访问处理方法,旨在解决现有技术的如上技术问题。在本申请中,主应用用来管理所有子应用,提供统一登录认证、鉴权、菜单展示等共性化功能模块;子应用只需专注模块功能开发即可,以此实现避免冗余开发。具体的,通过在主应用中统一为各子应用进行鉴权,避免了鉴权混乱的问题,并且基于分别存储在主应用和子应用中的权限数据对操作请求进行鉴权,实现了提高鉴权结果的准确性和安全性。The access processing method provided by this application is intended to solve the above technical problems of the existing technology. In this application, the main application is used to manage all sub-applications and provide common functional modules such as unified login authentication, authentication, menu display, etc.; sub-applications only need to focus on module function development to avoid redundant development. Specifically, by unified authentication for each sub-application in the main application, the problem of confusion in authentication is avoided, and operation requests are authenticated based on the permission data stored in the main application and sub-applications respectively, thereby improving authentication. Accuracy and safety of results.
图1为本申请提供的访问处理微前端系统的结构示意图。便于理解,下面结合图1对本申请实施例中的微前端应用系统进行说明。参见图1,该系统包括主应用和多个子应用。需要说明的是,图1中只是示例性的画出了三个子应用,并不表明本申请技术方案的保护范围仅限于此,本申请中对于子应用的数量不做限定。在本申请中,主应用用来管理所有子应用,提供统一登录认证、鉴权、菜单展示等共性化功能模块;子应用只需专注模块功能开发即可,以此实现避免冗余开发。具体的,当用户登录系统的主应用后,只需要在主应用中做一次权限处理,每次访问或做操作都会按照处理预先设定的角色权限进行权限校验,实现了统一管理,更方便的实现子应用的接入和抽离。Figure 1 is a schematic structural diagram of the access processing micro front-end system provided by this application. For ease of understanding, the micro front-end application system in the embodiment of the present application will be described below with reference to Figure 1 . Referring to Figure 1, the system includes a main application and multiple sub-applications. It should be noted that FIG. 1 only illustrates three sub-applications as an example, which does not mean that the protection scope of the technical solution of the present application is limited to this. The number of sub-applications is not limited in this application. In this application, the main application is used to manage all sub-applications and provide common functional modules such as unified login authentication, authentication, menu display, etc.; sub-applications only need to focus on module function development to avoid redundant development. Specifically, when a user logs in to the main application of the system, he only needs to perform permission processing once in the main application. Every time he accesses or performs an operation, the permissions will be verified according to the preset role permissions, achieving unified management and making it more convenient. To realize the access and detachment of sub-applications.
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
图2为本申请实施例提供的一种访问处理方法的流程示意图。该方法可以由访问处理装置执行,该访问处理装置可以是服务器也可以是电子设备,以下以电子设备为例进行说明,本实施例中的方法可以通过软件、硬件或者软硬件结合的方式来实现,如图2所示,该方法包括如下步骤。Figure 2 is a schematic flowchart of an access processing method provided by an embodiment of the present application. This method can be executed by an access processing device, which can be a server or an electronic device. The electronic device is used as an example for description below. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. , as shown in Figure 2, the method includes the following steps.
S210、在用户成功登录主应用的情况下,接收用户对于按钮的按钮操作指令,并确定按钮所属的子应用。S210. When the user successfully logs in to the main application, receive the user's button operation instruction for the button, and determine the sub-application to which the button belongs.
在本申请中,微前端系统包括主应用和多个子应用。主应用可以理解为微前端架构的众多应用中的基础工程,用于为整个系统提供统一的认证以及鉴权等功能服务。其余应用都在该主应用中注册,在此主应用中可以根据链接地址来决定要激活哪个子应用。即主应用可以提供总体的控制功能。除了主应用之外的其余应用都称为子应用,子应用可以根据主应用的逻辑来激活或销毁,可以提供具体的业务性功能。In this application, the micro front-end system includes a main application and multiple sub-applications. The main application can be understood as the basic project among the many applications of the micro front-end architecture, used to provide unified authentication and authentication and other functional services for the entire system. The rest of the applications are registered in the main application, and in this main application you can decide which sub-application to activate based on the link address. That is, the main application can provide overall control functions. Applications other than the main application are called sub-applications. Sub-applications can be activated or destroyed according to the logic of the main application and can provide specific business functions.
具体的,若用户欲访问微前端系统,则需要向微前端系统发送访问请求。可选的,若具备访问权限,则微前端系统允许用户登录微前端系统的主应用,并对子应用的进行操作。具体的,访问请求包括登录请求和操作请求。在本申请中,主应用中包括预设的认证模块,用于对微前端系统接收的登录请求进行认证处理。具体的,认证模块解析登录请求,基于获得的登录信息对用户进行登录权限认证,确定用户是否具备登录当前微前端系统的权限。可选的,若用户通过上述登录权限认证,则说明用户具备登录微前端系统的权限。换言之,可以允许当前用户登录微前端系统的主应用,并查看主应用对应的主页面。反之,若用户未通过上述登录权限认证,则说明用户不具备登录微前端系统的权限;此时可以向用户展示不具备登录权限的登录提示消息。Specifically, if the user wants to access the micro front-end system, he needs to send an access request to the micro front-end system. Optionally, if they have access rights, the micro front-end system allows users to log in to the main application of the micro front-end system and operate the sub-applications. Specifically, access requests include login requests and operation requests. In this application, the main application includes a preset authentication module for authenticating login requests received by the micro front-end system. Specifically, the authentication module parses the login request, authenticates the user's login permission based on the obtained login information, and determines whether the user has the permission to log in to the current micro front-end system. Optionally, if the user passes the above login permission authentication, it means that the user has the permission to log in to the micro front-end system. In other words, the current user can be allowed to log in to the main application of the micro front-end system and view the main page corresponding to the main application. On the contrary, if the user fails to pass the above login permission authentication, it means that the user does not have the permission to log in to the micro front-end system; at this time, a login prompt message that does not have the login permission can be displayed to the user.
可选的,当用户具备登录主应用的权限时,控制微前端的主应用响应用户的登录请求,即用户成功登录主应用;并且,在主应用的主页面中向用户展示微前端系统中各子应用的菜单列表,以便于用户基于菜单列表对欲访问的子应用进行操作。具体的,用户可以在对欲访问的子应用中的按钮进行操作,进而主应用接收基于对该按钮的操作所生成的按钮操作指令,并根据按钮操作指令中所包含的按钮信息确定被操作的按钮所属的子应用。Optionally, when the user has the permission to log in to the main application, the main application that controls the micro front-end responds to the user's login request, that is, the user successfully logs in to the main application; and, displays the various information in the micro front-end system to the user on the main page of the main application. The menu list of sub-applications allows users to operate the sub-applications they want to access based on the menu list. Specifically, the user can operate a button in the sub-application to be accessed, and then the main application receives a button operation instruction generated based on the operation of the button, and determines the operated button based on the button information contained in the button operation instruction. The sub-application that the button belongs to.
S220、根据用户的登录信息确定用户的角色信息,并根据角色信息、子应用以及主应用,确定用户对应的按钮权限信息。S220: Determine the user's role information based on the user's login information, and determine the user's corresponding button permission information based on the role information, sub-applications and main applications.
在本申请中,在主应用的数据库中预先为各用户设置了对应的角色信息,以使各用户拥有此角色对微前端系统中各子应用的菜单以及按钮的操作权限,上述设置方便对访问微前端系统的用户进行管理,提高了系统访问的安全性。In this application, corresponding role information is preset for each user in the database of the main application, so that each user has the operating authority of this role to the menus and buttons of each sub-application in the micro front-end system. The above settings facilitate access to Users of the micro front-end system are managed, which improves the security of system access.
具体的,用户登录信息中包含用户账号,基于用户账号在预先设置的角色表中查找该用户账号对应的角色,以根据查找结果确定用户对应的角色信息,进而基于该角色信息可以确定用户操作的按钮所对应的按钮权限信息。Specifically, the user login information contains the user account. Based on the user account, the role corresponding to the user account is searched in the preset role table, so as to determine the role information corresponding to the user based on the search results, and then the user operation can be determined based on the role information. The button permission information corresponding to the button.
需要说明的是,由于用于用户是否具备对按钮的操作权限进行鉴权的按钮权限信息分别存储至主应用和按钮对应的子应用中,所以在鉴权时需要分别从主应用以及该按钮所属子应用中分别获取按钮权限信息。具体的,在确定用户操作的按钮所属的子应用的基础上,分别在子应用的配置文件以及主应用的数据库中读取与用户的角色信息所对应的按钮权限信息。It should be noted that since the button permission information used to authenticate whether the user has the operation permission of the button is stored in the main application and the sub-application corresponding to the button, it is necessary to obtain the information from the main application and the sub-application to which the button belongs during authentication. Obtain button permission information separately in the application. Specifically, on the basis of determining the sub-application to which the button operated by the user belongs, the button permission information corresponding to the user's role information is read from the configuration file of the sub-application and the database of the main application respectively.
可选的,若在两个应用中获取到的按钮权限信息一致,则说明上述按钮权限信息是为被篡改过的,可以继续进行鉴权处理;反之,若获取到的信息不一致,则说明上述任一应用中存储的按钮权限信息都可能被篡改过,在此情况下,若以任一按钮权限信息进行鉴权处理都不能保证鉴权结果的准确性,因此情况下可以控制任何用户不允许访问该按钮,以保证系统被访问时的安全性。Optionally, if the button permission information obtained in the two applications is consistent, it means that the above button permission information has been tampered with, and the authentication process can continue; otherwise, if the information obtained is inconsistent, it means that the above The button permission information stored in any application may have been tampered with. In this case, the accuracy of the authentication result cannot be guaranteed if any button permission information is used for authentication. Therefore, in this case, it can be controlled that any user is not allowed to Access this button to ensure security when the system is accessed.
在上述实施方式的基础上,为了可以在微前端系统中访问子应用,需要先在主应用中对子应用进行应用注册,并在注册过程中将用户鉴权处理的按钮权限信息分别存储在子应用和主应用中。Based on the above implementation, in order to access the sub-application in the micro front-end system, the sub-application needs to be registered in the main application first, and during the registration process, the button permission information of the user authentication process is stored in the sub-application respectively. application and the main application.
可选的,在本申请中对于任一子应用的任一按钮,预先获取各角色信息对按钮的按钮权限信息,并将按钮权限信息同步至主应用中进行存储。Optionally, in this application, for any button of any sub-application, the button permission information of each role information for the button is obtained in advance, and the button permission information is synchronized to the main application for storage.
具体的,子应用在主应用中注册之前会预先在子应用中为各按钮分配各角色对应的按钮权限信息,并将各按钮权限信息以按钮以键值对的枚举值存储到当前子应用对应的配置文件中。进一步的,在将当前子应用注册到主应用时,会同步将子应用中存储的各个按钮对应的按钮权限信息配置到主应用为当前子应用预先生成的配置文件中。Specifically, before the sub-application is registered in the main application, the button permission information corresponding to each role will be assigned to each button in the sub-application in advance, and the permission information of each button will be stored in the current sub-application as an enumeration value of the button key-value pair. in the corresponding configuration file. Further, when the current sub-application is registered to the main application, the button permission information corresponding to each button stored in the sub-application will be synchronously configured into the configuration file pre-generated by the main application for the current sub-application.
可选的,主应用接收到子应用的注册请求时,会按照AppRouter属性规则在主应用中注册待注册的子应用信息。具体的,需要在主应用中动态加载子应用在后续展示过程中所依赖的系统资源,并且需要在主应用的数据库同步存储上述各个按钮对应的按钮权限信息。Optionally, when the main application receives a registration request from a sub-application, it will register the sub-application information to be registered in the main application according to the AppRouter attribute rules. Specifically, the system resources that the sub-application relies on during the subsequent display process need to be dynamically loaded in the main application, and the button permission information corresponding to each of the above buttons needs to be synchronously stored in the database of the main application.
S230、若主应用根据按钮操作指令以及按钮权限信息,确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求。S230. If the main application determines that the user has the operation permission of the button based on the button operation instruction and the button permission information, the sub-application is controlled to respond to the button operation request.
在本申请实施例中,在获得按钮操作指令的基础上,主应用基于按钮操作指令对用户的操作请求进行鉴权处理,即验证用户是否具备对该按钮拥有操作权限。具体的鉴权处理过程可以是,将按钮操作指令中包含的按钮信息与按钮权限信息中存储的各角色按钮信息进行比对,在比对成功的基础上,确定该角色按钮信息所对应的角色权限信息。可选的,若角色权限信息以为不具备操作权限,则向用户展示不具备操作权限的提示信息;反之,若角色权限信息为具备操作权限,则说明用户具备对该按钮的操作权限,进一步的,可以控制子应用响应按钮操作请求。In the embodiment of the present application, after obtaining the button operation instruction, the main application performs authentication processing on the user's operation request based on the button operation instruction, that is, it verifies whether the user has the operation authority for the button. The specific authentication process may be to compare the button information contained in the button operation instruction with the button information of each role stored in the button permission information. Based on the successful comparison, determine the role corresponding to the role button information. Permission information. Optionally, if the role permission information indicates that the user does not have the operation permission, a prompt message indicating that the user does not have the operation permission is displayed to the user; conversely, if the role permission information indicates that the user has the operation permission, it means that the user has the operation permission for the button. Further, , you can control the sub-application to respond to button operation requests.
在上述技术方案中,通过在用户通过微前端的登录认证的情况下,接收用户对子应用中按钮的操作,并基于操作所生成的操作指令,以及从子应用以及主应用中确定的按钮权限信息,在主应用中对用户所对应的角色是否拥有对该按钮的操作权限进行验证。当确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求;通过在主应用中进行统一鉴权可以解决现有技术中微前端系统中各子应用单独鉴权易出现鉴权混乱导致鉴权安全性降低的问题,实现微前端系统对子应用的统一管理,方便子应用在系统中的接入和抽离,并且基于两个应用确定权限信息的方式也提高了鉴权结果的准确性和安全性。In the above technical solution, when the user passes the login authentication of the micro front end, the user's operation on the button in the sub-application is received, and the operation instructions generated based on the operation, as well as the button permissions determined from the sub-application and the main application Information, in the main application, verify whether the user's corresponding role has the permission to operate the button. When it is determined that the user has the operation permission of the button, the sub-application is controlled to respond to the button operation request; by performing unified authentication in the main application, it can solve the problem that in the existing technology, individual authentication of each sub-application in the micro front-end system is prone to authentication confusion, resulting in authentication confusion. It solves the problem of reduced rights security and realizes the unified management of sub-applications by the micro-front-end system to facilitate the access and withdrawal of sub-applications in the system. The method of determining permission information based on two applications also improves the accuracy of authentication results. and security.
图3为本申请实施例提供的另一种访问处理方法的流程示意图。本实施例可理解为上述实施例介绍的方法中提及步骤的具体化介绍实施例,参见图3,该方法具体可以包括:Figure 3 is a schematic flowchart of another access processing method provided by an embodiment of the present application. This embodiment can be understood as a concrete introduction to the steps mentioned in the method introduced in the above embodiment. Referring to Figure 3, the method may specifically include:
S310、在用户成功登录主应用的情况下,接收用户对于按钮的按钮操作指令,并确定按钮所属的子应用。S310. When the user successfully logs in to the main application, receive the user's button operation instruction for the button, and determine the sub-application to which the button belongs.
具体的,对步骤S310中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S210的解释。Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S310, please refer to the explanation of step S210 in the above embodiment.
在上述实施方式的基础上,在本实施例中,步骤S310中判断的步骤中具体可以包括:Based on the above implementation, in this embodiment, the steps determined in step S310 may specifically include:
S311、接收用户输入的登录信息,并基于登录信息对用户进行主应用的登录权限认证。若用户未通过登录权限认证,则执行步骤S312;反之,若用户通过登录权限认证,则执行步骤S313。S311. Receive the login information input by the user, and authenticate the user's login permission for the main application based on the login information. If the user fails to pass the login authority authentication, step S312 is executed; otherwise, if the user passes the login authority authentication, step S313 is executed.
在本申请实施例中,用户输入的登录信息可以是用户输入的用户账号和用户密码信息。具体的,主应用的认证模块基于接收到的认证信息对用户输入的用户账号和用户密码信息在预先存储用户注册信息的账号数据表中进行匹配,并基于匹配结果确定用户是否可以通过登录权限认证。In this embodiment of the present application, the login information input by the user may be the user account and user password information input by the user. Specifically, the authentication module of the main application matches the user account and user password information entered by the user in the account data table that pre-stores the user registration information based on the received authentication information, and determines whether the user can pass the login authority authentication based on the matching result. .
S312、向用户展示不具备登录权限的认证提示信息。S312. Display the authentication prompt information indicating that the user does not have login permission to the user.
S313、控制主应用响应登录信息,并向用户展示主应用的主页面;主页面中包含各子应用分对应的菜单。S313. Control the main application to respond to the login information and display the main page of the main application to the user; the main page includes menus corresponding to each sub-application.
可选的,首先对用户账号进行匹配,若账号数据表中不存在该用户账号,则说明该用户并没有在微前端系统中进行预先注册,即没有对微前端系统的登录权限。具体的,可以向用户展示没有登录权限的提示信息。在上述基础上,还可以向用户展示“预先进行注册才能进行登录”的登录提示信息,以便于用户可以更快速的具备登录权限,提高用户体验感。反之,若账号数据表中存在用户账号,则说明该用户为预先在微前端系统中注册过的合法用户。进一步的,在该账号数据表中获取该用户账号对应的用户密码信息;可选的,若活该用户密码信息与用户输入的用户密码信息不一致,则说明该用户为通过登录权限认证,具体的,可以向用户展示登录权限认证失败的提示信息。在上述基础上,还可以向用户展示“请输入正确的密码才能进行登录”的登录提示信息,以便于用户可以更快速的具备登录权限,提高用户体验感。反之,若该用户密码信息与用户输入的用户密码信息一致,则确定该用户通过登录权限认证。具体的,控制主应用响应用户的登录信息,并向用户展示主应用的主页面。其中,主页面中包含各子应用分对应的菜单,以使用户可以基于展示的菜单对子应用中的按钮进行操作。Optionally, first match the user account. If the user account does not exist in the account data table, it means that the user has not been pre-registered in the micro front-end system, that is, he does not have login permission to the micro front-end system. Specifically, a prompt message indicating that the user does not have login permission can be displayed to the user. On the basis of the above, the login prompt information of "pre-register before logging in" can also be displayed to the user, so that the user can obtain the login permission more quickly and improve the user experience. On the contrary, if the user account exists in the account data table, it means that the user is a legal user who has been registered in the micro front-end system in advance. Further, obtain the user password information corresponding to the user account in the account data table; optionally, if the user password information is inconsistent with the user password information entered by the user, it means that the user has passed the login authority authentication. Specifically, A prompt message indicating failed login permission authentication can be displayed to the user. On the basis of the above, the login prompt information "Please enter the correct password to log in" can also be displayed to the user, so that the user can obtain the login permission more quickly and improve the user experience. On the contrary, if the user password information is consistent with the user password information input by the user, it is determined that the user has passed the login authority authentication. Specifically, the main application is controlled to respond to the user's login information and display the main page of the main application to the user. The main page includes a menu corresponding to each sub-application, so that the user can operate buttons in the sub-application based on the displayed menu.
S314、接收用户对主页面中任一菜单的操作指令,若基于角色信息确定用户具备对当前菜单的操作权限,则向用户展示当前菜单。S314. Receive the user's operation instruction for any menu on the main page. If it is determined based on the role information that the user has the operation authority for the current menu, display the current menu to the user.
在本申请实施例中,接收用户的对菜单的操作指令,并确定该操作指令中所包含的菜单信息。进而基于菜单信息和预先设置的各角色对菜单的菜单权限信息确定该用户对应的角色是否具备对该菜单的操作权限。可选的,若不具备操作权限,则向用户提示没有操作权限的提示信息;反之,若具备操作权限,则向用户显示该菜单,并以使用户基于该菜单中显示的各按钮进行对子应用的操作。In this embodiment of the present application, the user's operation instruction for the menu is received, and the menu information contained in the operation instruction is determined. Then, it is determined based on the menu information and the preset menu permission information of each role on the menu whether the role corresponding to the user has the operation permission on the menu. Optionally, if the user does not have the operation permission, a prompt message that the user does not have the operation permission will be prompted; conversely, if the user has the operation permission, the menu will be displayed to the user, and the user will be able to make adjustments based on each button displayed in the menu. Application operations.
S315、接收用户对当前菜单中任一按钮的按钮操作指令,并基于按钮操作指令确定按钮所属的子应用。S315. Receive the user's button operation instruction for any button in the current menu, and determine the sub-application to which the button belongs based on the button operation instruction.
在本申请实施例中,用户可以在对欲访问的子应用对应的菜单中的按钮进行操作,进而主应用接收基于对该按钮的操作所生成的按钮操作指令,并根据按钮操作指令中所包含的按钮信息确定被操作的按钮所属的子应用。In this embodiment of the present application, the user can operate the button in the menu corresponding to the sub-application to be accessed, and then the main application receives the button operation instruction generated based on the operation of the button, and performs the operation according to the button operation instruction. The button information determines the sub-application to which the operated button belongs.
S320、根据用户的登录信息确定用户的角色信息,并根据角色信息、子应用以及主应用,确定用户对应的按钮权限信息。S320: Determine the user's role information based on the user's login information, and determine the user's corresponding button permission information based on the role information, sub-applications and main applications.
具体的,对步骤S320中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S220的解释。Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S320, please refer to the explanation of step S220 in the above embodiment.
在上述实施方式的基础上,在本实施例中,步骤S320的步骤中具体可以包括:Based on the above implementation, in this embodiment, step S320 may specifically include:
S321、根据用户的登录信息确定用户的角色信息。S321. Determine the user's role information based on the user's login information.
S322、在子应用中读取与用户角色信息对应的第一按钮权限信息,并在主应用中读取与用户角色信息对应的第二按钮权限信息。S322. Read the first button permission information corresponding to the user role information in the sub-application, and read the second button permission information corresponding to the user role information in the main application.
在本申请中,主应用还预先设置有鉴权模块,用于对用户的操作指令进行鉴权,以确定用户是否具备对该按钮的操作权限。In this application, the main application is also pre-set with an authentication module for authenticating the user's operation instructions to determine whether the user has the operation authority for the button.
具体的,可以通过store通信读取主应用中存储的第一按钮权限信息,以及在按钮所属的子应用中读取第二按钮权限信息,并同时将第一按钮权限信息和第二按钮权限信息传输至上述鉴权模块,以使鉴权模块进行鉴权处理。Specifically, the first button permission information stored in the main application can be read through store communication, and the second button permission information can be read in the sub-application to which the button belongs, and the first button permission information and the second button permission information can be read at the same time. Transmitted to the above-mentioned authentication module, so that the authentication module can perform authentication processing.
S323、基于第一按钮权限信息和第二按钮权限信息的信息比对结果确定用户对应的按钮权限信息。S323. Determine the button permission information corresponding to the user based on the information comparison result of the first button permission information and the second button permission information.
在本申请实施例中,在鉴权模块读取到第一按钮权限信息和第二按钮权限信息的基础上,对两个按钮权限信息进行比对,进而基于比对结果确定用户对应角色对于该按钮所对应的按钮权限信息。In the embodiment of the present application, after the authentication module reads the first button permission information and the second button permission information, the two button permission information are compared, and then based on the comparison result, it is determined that the user's corresponding role is suitable for the The button permission information corresponding to the button.
可选的,本申请实施例中确定用户对应的按钮权限信息的方法可以包括:若第一按钮权限信息和第二按钮权限信息的比对结果一致,则将第一按钮权限信息或者第二按钮权限信息确定为用户对应的按钮权限信息;若第一按钮权限信息和第二按钮权限信息的比对结果不一致,则用户对应的按钮权限信息为空。Optionally, the method for determining the button permission information corresponding to the user in the embodiment of the present application may include: if the comparison results of the first button permission information and the second button permission information are consistent, then converting the first button permission information or the second button permission information into The permission information is determined to be the button permission information corresponding to the user; if the comparison results of the first button permission information and the second button permission information are inconsistent, the button permission information corresponding to the user is empty.
具体的,比对结果不一致说明上述任一应用中存储的按钮权限信息都可能被篡改过,在此情况下,若以任一按钮权限信息进行鉴权处理都不能保证鉴权结果的准确性,因此情况下,将按钮权限信息设置为空值,这样任何人都没有对该按钮的操作权限,即控制任何用户不允许访问该按钮,以保证系统被访问时的安全性。Specifically, inconsistent comparison results indicate that the button permission information stored in any of the above applications may have been tampered with. In this case, if any button permission information is used for authentication processing, the accuracy of the authentication result cannot be guaranteed. Therefore, set the button permission information to a null value, so that no one has the operation permission for the button, that is, no user is allowed to access the button to ensure the security of the system when it is accessed.
S330、若主应用根据按钮操作指令以及按钮权限信息,确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求。S330. If the main application determines that the user has the operation permission of the button based on the button operation instruction and the button permission information, the sub-application is controlled to respond to the button operation request.
具体的,对步骤S330中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S230的解释Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S330, please refer to the explanation of step S230 in the above embodiment.
在上述技术方案中,通过在用户通过微前端的登录认证的情况下,接收用户对子应用中按钮的操作,并将基于操作所生成的操作指令传输至主应用预设的鉴权模块中;并且将从子应用以及主应用中确定的按钮权限信息也传输至上述鉴权模块中,进而在鉴权模块中对用户所对应的角色是否拥有对该按钮的操作权限进行验证;当确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求;通过在主应用中进行统一鉴权可以解决现有技术中微前端系统中各子应用单独鉴权易出现鉴权混乱导致鉴权安全性降低的问题,实现微前端系统对子应用的统一管理,方便子应用在系统中的接入和抽离,并且基于两个应用确定权限信息的方式也提高了鉴权结果的准确性和安全性。In the above technical solution, when the user passes the login authentication of the micro front end, the user's operation on the button in the sub-application is received, and the operation instructions generated based on the operation are transmitted to the preset authentication module of the main application; And the button permission information determined from the sub-application and the main application is also transmitted to the above-mentioned authentication module, and then in the authentication module, it is verified whether the user's corresponding role has the operation permission for the button; when it is determined that the user has The operation authority of the button controls the sub-application to respond to the button operation request; by performing unified authentication in the main application, it can solve the problem that in the existing technology, individual authentication of each sub-application in the micro front-end system is prone to authentication confusion, resulting in reduced authentication security. solve the problem, realize the unified management of sub-applications by the micro front-end system, facilitate the access and extraction of sub-applications in the system, and the method of determining permission information based on the two applications also improves the accuracy and security of the authentication results.
在上述实施方案的基础上,本申请微前端系统主应用中的认证模块还会监听页面的变化情况。可选的,若当前显示的页面长时间无操作,用户在点击刷新时,认证模块会重新对用户进行登录认证处理,并当认证通过后重新显示该页面;可选的,若认证未通过,请求接口会在请求拦截器接收到特定code,进而认证模块会展示登录失效等相关提示,从而可以进一步提高系统被访问时的安全性。Based on the above implementation scheme, the authentication module in the main application of the micro front-end system of this application will also monitor page changes. Optional, if there is no operation on the currently displayed page for a long time, when the user clicks refresh, the authentication module will re-login the user and display the page again after the authentication is passed; optional, if the authentication fails, The request interface will receive a specific code in the request interceptor, and the authentication module will display related prompts such as login failure, which can further improve the security of the system when it is accessed.
图4为本申请实施例提供的另一种访问处理方法的流程示意图。本实施例可理解为上述实施例介绍的方法中未提及步骤的扩展介绍实施例,参见图4,该方法具体可以包括:Figure 4 is a schematic flowchart of another access processing method provided by an embodiment of the present application. This embodiment can be understood as an expanded embodiment of the steps not mentioned in the method introduced in the above embodiment. Refer to Figure 4. The method may specifically include:
S410、在用户成功登录主应用的情况下,接收用户对于按钮的按钮操作指令,并确定按钮所属的子应用。S410. When the user successfully logs in to the main application, receive the user's button operation instruction for the button, and determine the sub-application to which the button belongs.
具体的,对步骤S410中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S210和步骤S311-S315的解释。Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S410, please refer to the explanations of step S210 and steps S311-S315 in the above embodiment.
S420、根据用户的登录信息确定用户的角色信息,并根据角色信息、子应用以及主应用,确定用户对应的按钮权限信息。S420: Determine the user's role information based on the user's login information, and determine the user's corresponding button permission information based on the role information, sub-applications and main applications.
具体的,对步骤S420中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S220和步骤S321-S322的解释。Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S420, please refer to the explanations of step S220 and steps S321-S322 in the above embodiment.
S430、若主应用根据按钮操作指令以及按钮权限信息,确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求。S430. If the main application determines that the user has the operation permission of the button based on the button operation instruction and the button permission information, the sub-application is controlled to respond to the button operation request.
具体的,对步骤S330中技术手段、技术效果、技术名词的理解与举例,可参照上述实施例中对步骤S230的解释。Specifically, for understanding and examples of technical means, technical effects, and technical terms in step S330, please refer to the explanation of step S230 in the above embodiment.
S440、当监听到用户对当前菜单的调整指令时,解析调整指令,得到调整后的目标菜单地址。S440. When the user's adjustment instruction for the current menu is monitored, the adjustment instruction is parsed to obtain the adjusted target menu address.
S450、判断目标菜单地址是否在预设的地址白名单内。S450. Determine whether the target menu address is in the preset address whitelist.
S450、若目标菜单地址在预设的地址白名单内,则执行步骤S460;反之,若目标菜单地址不在预设的地址白名单内,则执行步骤S470。S450. If the target menu address is in the preset address whitelist, perform step S460; otherwise, if the target menu address is not in the preset address whitelist, perform step S470.
S460、直接显示目标菜单地址对应的目标菜单。S460. Directly display the target menu corresponding to the target menu address.
S470、基于角色信息对用户是否具备对目标菜单地址对应的菜单的操作权限进行鉴权处理。S470: Authenticate whether the user has the operating authority for the menu corresponding to the target menu address based on the role information.
在本申请实施例中,通过对当前菜单进行监听,当发现菜单地址发生变化时,进一步对菜单地址进行认证以及鉴权处理。其中,菜单的调整指令可以包括但不限于用户点击刷新页面的操作或者重新在地址栏输入新地址的操作。具体的,对获取到的调整指令时,对调整指令进行解析,得到调整后的目标菜单地址,即URL(Uniform Resource Locator,统一资源定位符)。进而,将该目标菜单地址在预设的地址白名单中进行匹配;可选的,若在该地址白名单中存在该目标菜单地址;则说明访问该目标菜单地址的用户不需要进行鉴权处理,即任何人都拥有对该菜单地址的访问权限。可选的,若在该地址白名单中不存在该目标菜单地址,则说明当用户访问该目标菜单地址时,需要根据用户对应的角色对用户进行鉴权处理,以确定该用户是否有权限对该目标菜单地址对应的目标菜单进行操作的权限。In the embodiment of the present application, by monitoring the current menu, when it is found that the menu address changes, the menu address is further authenticated and authenticated. The menu adjustment instructions may include but are not limited to the operation of the user clicking to refresh the page or the operation of re-entering a new address in the address bar. Specifically, when the adjustment instruction is obtained, the adjustment instruction is parsed to obtain the adjusted target menu address, that is, the URL (Uniform Resource Locator, Uniform Resource Locator). Furthermore, the target menu address is matched in a preset address whitelist; optionally, if the target menu address exists in the address whitelist, it means that the user accessing the target menu address does not need to undergo authentication processing. , that is, anyone has access rights to this menu address. Optionally, if the target menu address does not exist in the address whitelist, it means that when the user accesses the target menu address, the user needs to be authenticated according to the user's corresponding role to determine whether the user has the authority to access the address. The permission to operate the target menu corresponding to the target menu address.
本申请中,预设的地址白名单是在子应用注册到主应用时,基于任何用户都可以访问的子应用中的菜单所对应的菜单地址所生成的。具体的,在注册过程中,将各菜单地址对应的地址路由添加到路由接口的预设白名单中,以在后续进行鉴权时自动跳过。需要说明的是,地址路由在注册时需要以嵌套路由的方式进行添加,以便后续主应用进行菜单切换时能够成功自动鉴权。具体的。嵌套路由的方式可以为每个路由拼接应用前缀,用层层递归的方式得到{url1:{id,name,children:[{btn1},{btn2},..]}...}形式的映射对象。In this application, the default address whitelist is generated based on the menu addresses corresponding to the menus in the sub-application that can be accessed by any user when the sub-application is registered to the main application. Specifically, during the registration process, the address routes corresponding to each menu address are added to the preset whitelist of the routing interface so that they can be automatically skipped during subsequent authentication. It should be noted that address routes need to be added in the form of nested routes when registering, so that the main application can successfully automatically authenticate when it subsequently switches menus. specific. The nested routing method can apply prefixes to each route, and use layer-by-layer recursion to obtain the form {url1:{id,name,children:[{btn1},{btn2},..]}...} Mapping object.
图5为本申请提供的一种访问处理装置的结构示意图。参见图5,该装置包括:按钮操作指令接收模块510、按钮权限信息获取模块520和操作权限鉴权模块530;其中,Figure 5 is a schematic structural diagram of an access processing device provided by this application. Referring to Figure 5, the device includes: a button operation instruction receiving module 510, a button authority information acquisition module 520, and an operation authority authentication module 530; wherein,
按钮操作指令接收模块510,用于在用户成功登录主应用的情况下,接收用户对于按钮的按钮操作指令,并确定按钮所属的子应用;The button operation instruction receiving module 510 is used to receive the user's button operation instruction for the button when the user successfully logs in to the main application, and determine the sub-application to which the button belongs;
按钮权限信息获取模块520,用于根据用户的登录信息确定用户的角色信息,并根据角色信息、子应用以及主应用,确定用户对应的按钮权限信息;The button permission information acquisition module 520 is used to determine the user's role information based on the user's login information, and determine the user's corresponding button permission information based on the role information, sub-applications and main applications;
操作权限鉴权模块530,用于若主应用根据按钮操作指令以及按钮权限信息,确定用户具备按钮的操作权限,则控制子应用响应按钮操作请求。The operation permission authentication module 530 is used to control the sub-application to respond to the button operation request if the main application determines that the user has the button operation permission based on the button operation instruction and the button permission information.
可选的,装置还包括:Optionally, the device also includes:
登录权限认证模块,用于接收用户输入的登录信息,并基于登录信息对用户进行主应用的登录权限认证;The login permission authentication module is used to receive the login information input by the user and authenticate the user's login permission for the main application based on the login information;
提示信息展示模块,用于若用户未通过登录权限认证,则向用户展示不具备登录权限的认证提示信息;The prompt information display module is used to display the authentication prompt information to the user who does not have the login authority if the user fails to pass the login authority authentication;
主页面展示模块,用于若用户通过登录权限认证,则控制主应用响应登录信息,并向用户展示主应用的主页面;主页面中包含各子应用分对应的菜单。The main page display module is used to control the main application to respond to the login information if the user passes the login permission authentication, and displays the main page of the main application to the user; the main page contains menus corresponding to each sub-application.
可选的,按钮操作指令接收模块510,包括:Optionally, the button operation instruction receiving module 510 includes:
菜单展示单元,用于接收用户对主页面中任一菜单的操作指令,若基于角色信息确定用户具备对当前菜单的操作权限,则向用户展示当前菜单;当前菜单包含多个按钮;The menu display unit is used to receive the user's operation instructions for any menu on the main page. If it is determined based on the role information that the user has the operation permission for the current menu, the current menu is displayed to the user; the current menu contains multiple buttons;
按钮操作指令接收单元,用于接收用户对当前菜单中任一按钮的按钮操作指令,并基于按钮操作指令确定按钮所属的子应用。The button operation instruction receiving unit is configured to receive the user's button operation instruction for any button in the current menu, and determine the sub-application to which the button belongs based on the button operation instruction.
可选的,按钮权限信息获取模块520,包括:Optional, button permission information acquisition module 520 includes:
角色按钮信息获取单元,用于在子应用中读取与用户角色信息对应的第一按钮权限信息,并在主应用中读取与用户角色信息对应的第二按钮权限信息;The role button information acquisition unit is used to read the first button permission information corresponding to the user role information in the sub-application, and to read the second button permission information corresponding to the user role information in the main application;
按钮权限信息确定单元,用于基于第一按钮权限信息和第二按钮权限信息的信息比对结果确定用户对应的按钮权限信息。The button authority information determining unit is configured to determine the button authority information corresponding to the user based on the information comparison result of the first button authority information and the second button authority information.
可选的,按钮权限信息确定单元,包括:Optional, button permission information determination unit includes:
第一按钮权限信息确定子单元,用于若第一按钮权限信息和第二按钮权限信息的比对结果一致,则将第一按钮权限信息或者第二按钮权限信息确定为用户对应的按钮权限信息;The first button permission information determination subunit is used to determine the first button permission information or the second button permission information as the button permission information corresponding to the user if the comparison results of the first button permission information and the second button permission information are consistent. ;
第二按钮权限信息确定子单元,用于若第一按钮权限信息和第二按钮权限信息的比对结果不一致,则用户对应的按钮权限信息为空。The second button authority information determination subunit is used to determine that the button authority information corresponding to the user is empty if the comparison results of the first button authority information and the second button authority information are inconsistent.
可选的,该装置还包括:Optionally, the device also includes:
目标菜单地址获得模块,用于当监听到用户对当前菜单的调整指令时,解析调整指令,得到调整后的目标菜单地址;The target menu address acquisition module is used to parse the adjustment instructions and obtain the adjusted target menu address when monitoring the user's adjustment instructions for the current menu;
目标菜单显示单元,用于若目标菜单地址在预设的地址白名单内,则直接显示目标菜单地址对应的目标菜单;The target menu display unit is used to directly display the target menu corresponding to the target menu address if the target menu address is in the preset address whitelist;
操作权限鉴权单元,用于若目标菜单地址不在预设的地址白名单内,则基于角色信息对用户是否具备对目标菜单地址对应的菜单的操作权限进行鉴权处理。The operation authority authentication unit is used to authenticate whether the user has the operation authority for the menu corresponding to the target menu address based on the role information if the target menu address is not in the preset address whitelist.
可选的,该装置还包括:Optionally, the device also includes:
按钮权限信息存储模块,用于对于任一子应用的任一按钮,预先获取各角色信息对按钮的按钮权限信息,并将按钮权限信息同步至主应用中进行存储。The button permission information storage module is used to obtain the button permission information of each role information for any button of any sub-application in advance, and synchronize the button permission information to the main application for storage.
图6为本申请实施例提供的一种电子设备的结构示意图。如图6所示,本实施例的电子设备可以包括:FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 6, the electronic device of this embodiment may include:
至少一个处理器601;以及at least one processor 601; and
与至少一个处理器通信连接的存储器602;A memory 602 communicatively connected to at least one processor;
其中,存储器602存储有可被至少一个处理器601执行的指令,指令被至少一个处理器601执行,以使服务器执行如上述任一实施例的方法。The memory 602 stores instructions that can be executed by at least one processor 601, and the instructions are executed by at least one processor 601, so that the server performs the method as in any of the above embodiments.
可选地,存储器602既可以是独立的,也可以跟处理器601集成在一起。Optionally, the memory 602 can be independent or integrated with the processor 601 .
本实施例提供的电子设备的实现原理和技术效果可以参见前述各实施例,此处不再赘述。The implementation principles and technical effects of the electronic device provided by this embodiment can be referred to the foregoing embodiments, and will not be described again here.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现前述任一实施例的方法。Embodiments of the present application also provide a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executed instructions, the method of any of the foregoing embodiments is implemented.
本申请实施例还提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现前述任一实施例的方法。An embodiment of the present application also provides a computer program product, including a computer program, which implements the method of any of the foregoing embodiments when executed by a processor.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another unit. A system, or some features can be ignored, or not implemented.
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例方法的部分步骤。The above integrated modules implemented in the form of software function modules can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of various embodiments of the present application.
应理解,上述处理器可以是中央处理单元(Central Processing Unit,简称CPU),还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合申请所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。存储器可能包含高速RAM存储器,也可能还包括非易失性存储NVM,例如至少一个磁盘存储器,还可以为U盘、移动硬盘、只读存储器、磁盘或光盘等。It should be understood that the above-mentioned processor may be a central processing unit (Central Processing Unit, referred to as CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, referred to as DSP), or application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor. The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, which may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk.
上述存储介质可以是由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。存储介质可以是通用或专用计算机能够存取的任何可用介质。The above storage media can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Except programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. Storage media can be any available media that can be accessed by a general purpose or special purpose computer.
一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于专用集成电路(Application Specific Integrated Circuits,简称ASIC)中。当然,处理器和存储介质也可以作为分立组件存在于服务器或主控设备中。An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium may be located in Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium can also exist as discrete components in the server or main control device.
图7为本申请实施例提供的一种电子设备的框图,该电子设备可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。参见图7,电子设备可以为装置800。具体的,装置800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。Figure 7 is a block diagram of an electronic device provided by an embodiment of the present application. The electronic device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant. wait. Referring to FIG. 7 , the electronic device may be device 800 . Specifically, the device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communications. Component 816.
处理组件802通常控制装置800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。Processing component 802 generally controls the overall operations of device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在装置800的操作。这些数据的示例包括用于在装置800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 804 is configured to store various types of data to support operations at device 800 . Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
电源组件806为装置800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为装置800生成、管理和分配电力相关联的组件。Power supply component 806 provides power to the various components of device 800. Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 800 .
多媒体组件808包括在装置800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当装置800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 808 includes a screen that provides an output interface between device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当装置800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in operating modes, such as call mode, recording mode, and speech recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/ O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
传感器组件814包括一个或多个传感器,用于为装置800提供各个方面的状态情况。例如,传感器组件814可以检测到装置800的打开/关闭状态,组件的相对定位,例如组件为装置800的显示器和小键盘,传感器组件814还可以检测装置800或装置800一个组件的位置改变,用户与装置800接触的存在或不存在,装置800方位或加速/减速和装置800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor component 814 includes one or more sensors for providing various aspects of status to device 800 . For example, the sensor component 814 can detect the open/closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor component 814 can also detect the position change of the device 800 or a component of the device 800, the user The presence or absence of contact with device 800 , device 800 orientation or acceleration/deceleration and temperature changes of device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于装置800和其他设备之间有线或无线方式的通信。装置800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 816 is configured to facilitate wired or wireless communication between apparatus 800 and other devices. Device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communications component 816 also includes a near field communications (NFC) module to facilitate short-range communications. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,装置800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 800 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由装置800的处理器820执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 804 including instructions, which are executable by the processor 820 of the apparatus 800 to complete the above method is also provided. For example, non-transitory computer-readable storage media may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
一种非临时性计算机可读存储介质,当该存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行上述电子设备的方法。A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enable the electronic device to perform the method of the above-mentioned electronic device.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求书指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary technical means in the technical field that are not disclosed in this application. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310720527.0A CN116506215B (en) | 2023-06-16 | 2023-06-16 | Access processing method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310720527.0A CN116506215B (en) | 2023-06-16 | 2023-06-16 | Access processing method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116506215A CN116506215A (en) | 2023-07-28 |
CN116506215B true CN116506215B (en) | 2023-09-12 |
Family
ID=87324954
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310720527.0A Active CN116506215B (en) | 2023-06-16 | 2023-06-16 | Access processing method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116506215B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110110509A (en) * | 2019-04-12 | 2019-08-09 | 深圳壹账通智能科技有限公司 | Right management method and Related product |
CN114266021A (en) * | 2021-12-20 | 2022-04-01 | 中国农业银行股份有限公司 | User authority management method, device, equipment and medium |
CN114282204A (en) * | 2021-12-27 | 2022-04-05 | 中电金信软件有限公司 | Method, apparatus, device and medium for determining user's permission to access micro-applications |
CN115577344A (en) * | 2021-06-21 | 2023-01-06 | 中移(成都)信息通信科技有限公司 | Authority management method, device, equipment and storage medium |
CN115794093A (en) * | 2022-12-13 | 2023-03-14 | 北京恒泰实达科技股份有限公司 | Micro front end implementation method based on multi-application fusion |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112214260B (en) * | 2015-09-21 | 2023-09-22 | 创新先进技术有限公司 | Method and device for loading APP (application) of terminal |
CN114647518A (en) * | 2020-12-21 | 2022-06-21 | 腾讯科技(深圳)有限公司 | Micro front-end system, sub-application loading method, and computer-readable storage medium |
-
2023
- 2023-06-16 CN CN202310720527.0A patent/CN116506215B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110110509A (en) * | 2019-04-12 | 2019-08-09 | 深圳壹账通智能科技有限公司 | Right management method and Related product |
CN115577344A (en) * | 2021-06-21 | 2023-01-06 | 中移(成都)信息通信科技有限公司 | Authority management method, device, equipment and storage medium |
CN114266021A (en) * | 2021-12-20 | 2022-04-01 | 中国农业银行股份有限公司 | User authority management method, device, equipment and medium |
CN114282204A (en) * | 2021-12-27 | 2022-04-05 | 中电金信软件有限公司 | Method, apparatus, device and medium for determining user's permission to access micro-applications |
CN115794093A (en) * | 2022-12-13 | 2023-03-14 | 北京恒泰实达科技股份有限公司 | Micro front end implementation method based on multi-application fusion |
Also Published As
Publication number | Publication date |
---|---|
CN116506215A (en) | 2023-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10075426B2 (en) | Web-based single sign-on with form-fill proxy application | |
WO2017113842A1 (en) | Intelligent device control method and apparatus | |
US10425403B2 (en) | Method and device for accessing smart camera | |
JP6422997B2 (en) | Business process execution method, apparatus, system, program, and recording medium | |
EP3726376B1 (en) | Program orchestration method and electronic device | |
WO2019056575A1 (en) | Account login method, terminal and computer-readable non-volatile storage medium | |
US20220382884A1 (en) | Method and device for parsing shared password | |
EP3308565A1 (en) | Pairing of nearby devices using a synchronized cue signal | |
JP6149163B2 (en) | WI-FI network connection method, apparatus, program, and recording medium | |
EP3176719B1 (en) | Methods and devices for acquiring certification document | |
KR101642019B1 (en) | Method, apparatus, program, and recording medium of verifying terminal | |
KR102416855B1 (en) | Quick Response (QR) codes for secure provisioning of user devices to perform secure actions | |
CN104376273A (en) | Data access control method and device | |
US20170004212A1 (en) | Method and apparatus for acquiring search results | |
CN113221195B (en) | A method, device and storage medium for storing business data | |
WO2017045314A1 (en) | Text message reading method and device | |
CN107231338B (en) | Network connection method, device and device for network connection | |
CN116506215B (en) | Access processing method, device, electronic equipment and storage medium | |
CN108009269A (en) | Show the method, apparatus of page data | |
WO2017166461A1 (en) | Method and apparatus for managing application program call | |
CN117421715A (en) | Authority management method, device, electronic equipment and storage medium | |
CN112667852B (en) | Video-based searching method and device, electronic equipment and storage medium | |
CN111638917A (en) | Application start limiting method, device and storage medium | |
CN113918128B (en) | Web page deployment method, device and electronic device | |
CN110365653B (en) | User registration method and device |
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 |