laravel-kit maintained by hanlogy
Description
Hanlogy Laravel Kit
Author
Last update
2020/08/30 23:25
(dev-master)
License
Downloads
106
Last update
2020/08/30 23:25
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/30 23:25
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/30 21:18
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/30 20:44
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/29 19:13
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/29 15:08
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/25 14:56
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/21 17:56
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/08/21 15:54
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/07/14 22:37
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/07/14 13:47
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/06/06 16:35
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/06/06 15:59
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/21 18:21
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/20 22:17
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/20 22:05
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/20 21:53
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/06 13:40
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/04 00:32
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/04 00:28
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/03 23:48
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/05/03 23:39
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/25 21:13
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/14 00:13
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/14 00:09
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/12 00:07
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/11 17:44
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/09 00:14
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/04/08 22:55
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/03/21 23:16
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/03/21 22:03
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/03/21 20:22
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/03/21 18:45
License
Require
- moontoast/math ^1.1
- guzzlehttp/guzzle ^6.3
- fruitcake/laravel-cors ^1.0
Last update
2020/02/28 13:50
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/02/28 13:50
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/21 16:59
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/21 14:33
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/21 14:33
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/14 09:37
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/14 09:28
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2020/01/01 20:39
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/28 13:40
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/25 21:00
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/16 08:08
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/15 11:25
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/11 22:30
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 16:08
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 15:51
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 10:58
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 10:21
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 09:56
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/08 09:41
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/12/07 14:35
License
Require
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/11/30 22:18
License
Require
- php ^7.2
- laravel/framework ^6.2
- moontoast/math ^1.1
- barryvdh/laravel-cors ^0.11.4
- guzzlehttp/guzzle ^6.3
Last update
2019/11/20 23:53
License
Require
- php ^7.2
- laravel/framework ^6.2
- moontoast/math ^1.1
Installation
composer require "hanlogy/laravel-kit"
Configuration
php artisan vendor:publish --provider="Hanlogy\LaravelKit\ServiceProvider"
配置说明
<?php
return [
// 支持的地区(暂时尚未用到该配置)
'regions' => env('REGIONS'),
// 支持的语言(目前用于发送验证信息时生成instance名称使用)
'langs' => env('LANGS'),
'central_mirror' => [
'services' => explode(',',env('CENTRAL_MIRROR_SERVICES')),
'host' => env('CENTRAL_MIRROR_HOST'),
'token' => env('CENTRAL_MIRROR_TOKEN'),
],
'ossimage' => [
'host' => env('OSSIMAGE_HOST'),
'token' => env('OSSIMAGE_TOKEN'),
],
'sms' => [
'host' => env('SMS_HOST'),
'token' => env('SMS_TOKEN'),
],
'ebs' => [
'host' => env('EBS_HOST'),
'token' => env('EBS_TOKEN'),
],
'webhooks' => [
'slack' => env('WEBHOOK_SLACK'),
],
];
接口说明
/vcode/send
{
"account": "46-765869871",
"type": "mobile",
"action": "register",
"lang": "hans"
}
参数 account
- 手机号码或者邮箱
- 手机号码可以以0开头,国际编号不可以以0或者+开头,国际编号和号码以
-隔开
参数 type
取值包括 mobile 或者 email
参数 action
- 不可自定义
- 取值包括:register(注册), change(修改email/mobile)
不包括password(新密码), 新密码使用单独的接口
/member/reset-password
参数 lang
- 取值和其他接口的url参数的lang要求一致,格式为
语言_地区,地区可以忽略 - 取值不考虑后端是否支持,后端具体兼容处理
- 兼容处理需要hanlogy.conf中的对应的langs相关配置转换。
转换举例
DEFAULT_LANG="hans"
LANGS="en,hans,hant_TW,en_UK"
en=>enhans_CN=>hanshans_SE=>hanshant_HK=>hanshant_TW=>hant_TWhant=>hanshans=>hans
instance 的生成原理
- 名称规则
${action}_vcode_${lang} lang为根据配置中支持的语言,兼容处理后的结果
错误值
email_exists OR mobile_exists: Email/Mobile已经存在。action 为 register和 change的时返回
no_access: action为change时,没有token
vcode_fail: 生成vcode的时候出错
too_frequently: 操作太频繁,同一个账号同一个行为每分钟只可以发送一次
unknown_member: action为change时,根据token找不到member
no_change: action为change时,新旧账号一致
/vcode/validate
{
"account": "86-18913313534",
"type": "mobile",
"action": "register",
"code": "372971"
}
错误值
vcode_not_exist: 验证码不存在
vcode_not_match: 验证码不匹配
vcode_expired: 验证码过期
/member/register
错误值
vcode_missing: vcode为空