CN105550016A - 一种基于react-native快速实现移动端用户登录的方法 - Google Patents
一种基于react-native快速实现移动端用户登录的方法 Download PDFInfo
- Publication number
- CN105550016A CN105550016A CN201510908991.8A CN201510908991A CN105550016A CN 105550016 A CN105550016 A CN 105550016A CN 201510908991 A CN201510908991 A CN 201510908991A CN 105550016 A CN105550016 A CN 105550016A
- Authority
- CN
- China
- Prior art keywords
- login
- mobile terminal
- react
- class
- interface
- 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.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
- G06F9/45529—Embedded in an application, e.g. JavaScript in a Web browser
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Telephonic Communication Services (AREA)
Abstract
本发明涉及react-native技术领域,特别涉及一种基于react-native快速实现移动端用户登录的方法。本发明方法步骤是:1、布局登录界面;2、封装Json接口类api.js,实现接口配置;3、封装数据获取类Util.js,实现数据获取封装类;4、调用Json接口,传入用户名和密码两个参数;5、通过调用工具类Util.js,与服务器进行交互验证,验证成功获取用户数据,失败返回异常提醒;6、把以上步骤采用组件化模式封装成Login.js,然后可以通过语句var?Login=require(′Login.js′);直接把登录组件插入到自己的项目中,从而实现登录功能。本发明提供了一种基于react-native快速实现移动端用户登录的方法;可以用于快速实现移动端用户登录。
Description
技术领域
本发明涉及react-native技术领域,特别涉及一种基于react-native快速实现移动端用户登录的方法。
背景技术
ReactNative结合了Web应用和Native应用的优势,可以使用JavaScript来开发iOS和Android原生应用。在JavaScript中用React抽象操作系统原生的UI组件,代替DOM元素来渲染等。
当前面临的问题是:
ReactNative是Facebook最新开源的,可以同时用来开发iOS和Android应用,每个需要用户注册的移动应用,都在重复实现登录功能,如果有一种可以同时支持iOS和Android的登录组件即插即用就好了。
发明内容
本发明解决的技术问题在于提供一种基于react-native快速实现移动端用户登录的方法;能够快速实现移动端用户的登录方法。
本发明解决上述技术问题的技术方案是:
所述的方法包含以下几个步骤:
步骤一、布局登录界面;
步骤二、封装Json接口类api.js,实现接口配置;
步骤三、封装数据获取类Util.js,实现数据获取封装类;
步骤四、调用Json接口,传入用户名和密码两个参数;
步骤五、通过调用工具类Util.js,与服务器进行交互验证,验证成功获取用户数据,失败返回异常提醒;
步骤六、组件化封装成Login.js,通过语句varLogin=require(′Login.js′),直接把登录组件插入到自己的项目中,实现登录功能。
所述的移动端包括iOS和Android。
本发明的有益效果:本发明提供一种基于react-native快速实现移动端用户登录的方法。
附图说明
下面结合附图对本发明进一步说明:
图1为本发明的方法流程图。
具体实施方式
如图1所示,本发明采用如下步骤可以实现移动端用户登录:
步骤一、布局登录界面;
步骤二、封装Json接口类api.js,实现接口配置。
步骤三、封装数据获取类Util.js,实现数据获取封装类。
步骤四、调用Json接口,传入用户名和密码两个参数;
varAPI=require(′./api.js′);
varpath=API.host+
API.login+′&userInfo.mobile=′+mobile+′&userInfo.userPwd=′+password;
步骤五、通过调用工具类Util.js,与服务器进行交互验证,验证成功获取用户数据,失败返回异常提醒。
步骤六、组件化封装成Login.js,可以通过语句varLogin=require(′Login.js′);直接把登录组件插入到自己的项目中,从而实现登录功能。
Claims (2)
1.一种基于react-native快速实现移动端用户登录的方法,其特征在于:所述的方法包含以下几个步骤:
步骤一、布局登录界面;
步骤二、封装Json接口类api.js,实现接口配置;
步骤三、封装数据获取类Util.js,实现数据获取封装类;
步骤四、调用Json接口,传入用户名和密码两个参数;
步骤五、通过调用工具类Util.js,与服务器进行交互验证,验证成功获取用户数据,失败返回异常提醒;
步骤六、组件化封装成Login.js,通过语句varLogin=require('Login.js'),直接把登录组件插入到自己的项目中,实现登录功能。
2.根据权利要求1所述的一种基于react-native快速实现移动端用户登录的方法,其特征在于:所述的移动端包括iOS和Android。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510908991.8A CN105550016A (zh) | 2015-12-09 | 2015-12-09 | 一种基于react-native快速实现移动端用户登录的方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510908991.8A CN105550016A (zh) | 2015-12-09 | 2015-12-09 | 一种基于react-native快速实现移动端用户登录的方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105550016A true CN105550016A (zh) | 2016-05-04 |
Family
ID=55829214
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510908991.8A Withdrawn CN105550016A (zh) | 2015-12-09 | 2015-12-09 | 一种基于react-native快速实现移动端用户登录的方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105550016A (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108446147A (zh) * | 2018-03-23 | 2018-08-24 | 携程旅游网络技术(上海)有限公司 | 移动终端的多线程计算方法及系统 |
CN109670328A (zh) * | 2018-12-25 | 2019-04-23 | 北京城市网邻信息技术有限公司 | 一种数据处理方法以及装置 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050229239A1 (en) * | 2004-04-05 | 2005-10-13 | Microsoft Corporation | Flow token |
CN101193089A (zh) * | 2006-11-20 | 2008-06-04 | 阿里巴巴公司 | 有状态会话系统及其实现方法 |
CN101415004A (zh) * | 2008-11-25 | 2009-04-22 | 江岳 | 嵌入式网页应用的认证方法 |
-
2015
- 2015-12-09 CN CN201510908991.8A patent/CN105550016A/zh not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050229239A1 (en) * | 2004-04-05 | 2005-10-13 | Microsoft Corporation | Flow token |
CN101193089A (zh) * | 2006-11-20 | 2008-06-04 | 阿里巴巴公司 | 有状态会话系统及其实现方法 |
CN101415004A (zh) * | 2008-11-25 | 2009-04-22 | 江岳 | 嵌入式网页应用的认证方法 |
Non-Patent Citations (2)
Title |
---|
FRANK LI LEE: "通过JavaScript进行登录验证", 《HTTPS://WENKU.BAIDU.COM/VIEW/6D976D0401F69E3142329403.HTML?FROM=SEARCH》 * |
HUANGJIAN1820: "react-native介绍", 《HTTPS://WENKU.BAIDU.COM/VIEW/2FA32FB43169A4517623A39E.HTML?FROM=SEARCH》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108446147A (zh) * | 2018-03-23 | 2018-08-24 | 携程旅游网络技术(上海)有限公司 | 移动终端的多线程计算方法及系统 |
CN108446147B (zh) * | 2018-03-23 | 2021-01-12 | 携程旅游网络技术(上海)有限公司 | 移动终端的多线程计算方法及系统 |
CN109670328A (zh) * | 2018-12-25 | 2019-04-23 | 北京城市网邻信息技术有限公司 | 一种数据处理方法以及装置 |
CN109670328B (zh) * | 2018-12-25 | 2022-04-26 | 北京城市网邻信息技术有限公司 | 一种数据处理方法以及装置 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104077146B (zh) | 一种移动终端应用程序个性化定制方法及其系统 | |
CN105589693A (zh) | 一种基于react-native的快速实现移动端数据获取的方法 | |
CN115097982B (zh) | 处理内容的方法及其电子设备 | |
US20160210632A1 (en) | Secured payment method and relevant device and system | |
US20150262031A1 (en) | Method And Apparatus For Identifying Picture | |
CN104484171A (zh) | 终端界面设计系统、方法及相关设备 | |
EP2911377A1 (en) | Method of providing preview image regarding display setting for device | |
JP6746007B2 (ja) | 画像生成方法および画像生成装置 | |
CN103618606A (zh) | 通过短信验证的App登录方法 | |
CN106850503B (zh) | 一种免登录身份认证方法及装置 | |
CN103970760B (zh) | 一种网页请求处理方法及装置 | |
CN103888408B (zh) | 将数据上传到社交平台的方法及装置 | |
US20180225098A1 (en) | Systems and methods for producing launchers for a mobile terminal | |
CN104035783A (zh) | 一种应用程序中适配第三方网页的平台集成方法和系统 | |
Al Abid et al. | Cross-platform development for an online food delivery application | |
US20180365255A1 (en) | Method for providing push service using web push, and electronic device supporting same | |
CN103413081A (zh) | 一种输入密码后的提示方法、密码修改方法及电子设备 | |
CN107704499A (zh) | 一种应用程序的页面跳转控制方法及装置 | |
CN105550016A (zh) | 一种基于react-native快速实现移动端用户登录的方法 | |
CN110895481A (zh) | 桌面应用的渲染方法、装置和系统 | |
CN105279076B (zh) | 一种网页测试方法及终端 | |
CN103856475A (zh) | 用于提供验证的方法和设备 | |
CN106919375B (zh) | 一种移动终端设备上的屏幕自适应方法及系统 | |
CN105100958A (zh) | 一种基于Android系统的视频流量引导的方法和装置 | |
CN104079527A (zh) | 一种信息处理方法及电子设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20160504 |
|
WW01 | Invention patent application withdrawn after publication |