登录注册流程

概述

本文只为项目iWork做项目流程技术备忘,以及为后续开发作参考 主要分以下五个模块:

登录注册流程

扫码 & 设备配对

首页模块

控制 & 健康数据

设置

ps:项目要进行国际化

1-1登录界面
登录注册流程_第1张图片
登录界面
1-2登录流程
1-2-1 邮箱密码登录
  • 流程验证
    邮箱为空 → 请填写电子邮箱
    邮箱格式不正确 → 请填写正确电子邮箱
    密码为空 → 请填写密码
    密码不正确(6~14位数字或字母组合) → 请填写正确密码
    以上依次验证正确 则调用登录接口
  • 登录接口
    1.请求示例
    http://office.teammax.com.cn/client/office/[email protected]&method=login&requestId=3902&platType=i
    2.返回示例
    "id": "3902",
    "error": "",
    "result": {
        "msgToken": "Dr1Kvrl34CdYPVXlaL+rRKX/iV1cXKiR",
        "appUserInfoResult": {
            "msgToken": "Dr1Kvrl34CdYPVXlaL+rRKX/iV1cXKiR",
            "id": 1725,
            "username": "[email protected]",
            "nickName": "客户经理",
            "age": "0",
            "birthday": "2018-05-30",
            "userImg": "http://office.teammax.com.cn/user/images/201810/13152649ukot.png",
            "gender": "男",
            "department": "企业A",
            "isAdmin": false,
            "isWeixin": false,
            "dailySeat": "120",
            "vibrationIntensity": "5",
            "minStandingTime": "30",
            "sittingRemindTime": "52",
            "maxHeight": "1250",
            "minHeight": "600",
            "isOpenHeight": "开",
            "lastSittingHeight": "750",
            "lastStandingHeight": "1150",
            "isOpenPanel": "开",
            "isAutoLifting": "关"
        },
        "isFirstRegister": false
    }
}

根据接口返回数据 isFirstRegister 判断是否是首次登录 如果是首次登录 则主动跳转到 扫码界面
如果不是首次登录则可 跳转首页

此处登录成功 我还做了操作就是获取了设备列表

  • 获取设备列表接口
    1.请求示例
    http://office.teammax.com.cn/client/office/app.do?method=listDevice&requestId=10673&platType=i&msgToken=dfanxL0+k970+lkuC7VGO6X/iV1cXKiR
    2.返回示例
    "id": "10673",
    "error": "",
    "result": {
        "msgToken": "dfanxL0+k970+lkuC7VGO6X/iV1cXKiR",
        "deskDevices": [{
            "id": 1769,
            "name": "T51桌子",
            "titleImg": "http://office.teammax.com.cn/house/u/cms/www/201711/16100846ed0t.jpg",
            "deviceMac": "C4:F3:12:3A:0B:AC",
            "deviceModelId": 1664,
            "type": "桌",
            "department": {
                "id": 189,
                "name": null,
                "pId": 0,
                "description": null,
                "target": null,
                "url": null,
                "departments": null
            }
        }],
        "chairDevices": [{
            "id": 1790,
            "name": "T51椅子",
            "titleImg": "http://office.teammax.com.cn/house/u/cms/www/201711/161009164g79.jpg",
            "deviceMac": "64:CF:D9:17:27:6A",
            "deviceModelId": 1666,
            "type": "椅",
            "department": {
                "id": 188,
                "name": null,
                "pId": 0,
                "description": null,
                "target": null,
                "url": null,
                "departments": null
            }
        }],
        "deviceAndDevices": [{
            "desk": {
                "id": 1769,
                "name": "T51桌子",
                "titleImg": "http://office.teammax.com.cn/house/u/cms/www/201711/16100846ed0t.jpg",
                "deviceMac": "C4:F3:12:3A:0B:AC",
                "deviceModelId": 1664,
                "type": "桌",
                "department": {
                    "id": 189,
                    "name": null,
                    "pId": 0,
                    "description": null,
                    "target": null,
                    "url": null,
                    "departments": null
                }
            },
            "chair": {
                "id": 1790,
                "name": "T51椅子",
                "titleImg": "http://office.teammax.com.cn/house/u/cms/www/201711/161009164g79.jpg",
                "deviceMac": "64:CF:D9:17:27:6A",
                "deviceModelId": 1666,
                "type": "椅",
                "department": {
                    "id": 188,
                    "name": null,
                    "pId": 0,
                    "description": null,
                    "target": null,
                    "url": null,
                    "departments": null
                }
            }
        }]
    }
}

获取设备列表的目的是拿到当前用户名下的设备mac , 蓝牙只能连接当前用户名下的设备

1-2-2 第三方登录

第三方登录不做详述 主要是获取第三方登录信息 然后调用平台注册接口
在接口成功返回后的操作和登录成功返回操作一致 ,同样判定是否首次注册登录 来决定接下来的去向界面

2-1注册界面
登录注册流程_第2张图片
注册
2-1注册流程
  • 获取验证码
    首先判定邮箱
    邮箱为空 → 提示 请填写电子邮箱
    邮箱格式不正确 → 提示 请填写正确电子邮箱
    然后调用接口 sendEmail
    成功返回数据后 提示 :已向您邮箱 [email protected] 发送一封邮件请注意查收
  • 注册
    依次验证:
    邮箱为空 → 请填写电子邮箱
    邮箱格式不正确 → 请填写正确电子邮箱
    验证码为空 → 请填写验证码
    验证码不正确 → 请填写正确验证码
    密码为空 → 请填写密码
    密码格式不正确 → 请填写正确密码
    密码不一致 → 请保持密码一致

注册接口成功后 跳转扫码界面

3-1重置密码界面
登录注册流程_第3张图片
重置密码

逻辑和注册基本一样 只是接口请求成功后 就返回登录页面

下一页:扫码 & 设备配对

你可能感兴趣的:(登录注册流程)