提交 10ca8943 编写于 作者: VK1688's avatar VK1688

1.5.3

上级 92b42731
### uniCloud云函数路由框架研究Q群:22466457 如有问题或建议可以在群内讨论。
### 插件名称:`vk-unicloud-router`
### 作者:VK
### 更新时间:2020-11-12
### 更新时间:2020-11-16
## 主要功能 以及 对开发者的价值
#### 1、实现云函数路由模式
......@@ -18,7 +18,7 @@
#### 4、全面支持`url化`的云函数请求,您无需关心url化后参数的获取问题
#### 5、已集成`uni-id` 当前版本:`1.1.16`(已支持真实发送邮箱验证码和阿里云短信验证码)
#### 5、已集成`uni-id` 当前版本:`2.0.3`(已支持真实发送邮箱验证码和阿里云短信验证码)
```
5.1、由于每个应用基本都会用上用户系统,官方建议所有`uniCloud`应用均使用`uni-id`作为用户体系,
有了统一的账户规范,并且围绕这套账户规范,有各种各样插件,那么开发者可以随意整合这些插件,让数据连同。
......
### uniCloud 云函数路由研究群:22466457 如有问题或建议可以在群内讨论。
### 更新内容
#### 1、【升级】uni-id升级至2.0.3
```
重要调整:uni-id自2.0版本起 修改验证码表名为opendb-verify-codes(之前是uni-verify)
```
#### 2、【升级】vk-unicloud升级至1.8.5
#### 3、【优化】减少`vk-unicloud`npm包大小,大大减少云函数上传时间(基本在10秒左右即可上传完成)。
#### 注意:默认已移除以下npm包,若需要用到,请在`cloudfunctions/router`目录下的`package.json`的`dependencies`中增加
```
"@alicloud/pop-core": "^1.7.9",
"form-data": "^3.0.0",
"nodemailer": "^6.4.11"
完整的"dependencies"
"dependencies": {
"config": "file:../common/config",
"uni-id": "file:../common/uni-id",
"vk-unicloud": "file:../common/vk-unicloud",
"@alicloud/pop-core": "^1.7.9",
"form-data": "^3.0.0",
"nodemailer": "^6.4.11"
},
```
### 你也可以在评论区发布留言交流心得。
\ No newline at end of file
{
"name": "uni-id",
"version": "1.1.16",
"version": "2.0.3",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
......
{
"name": "vk-unicloud",
"version": "1.8.2",
"version": "1.8.5",
"description": "在router目录下执行 npm i vk-unicloud 进行安装和升级",
"main": "index.js",
"homepage": "https://gitee.com/vk-uni/vk-uni-cloud-router.git",
......
......@@ -127,7 +127,7 @@
}
}]
},
"uni-verify": {
"opendb-verify-codes": {
"data": [],
"index": [{
"IndexName": "mobile",
......@@ -153,6 +153,24 @@
}],
"MgoIsUnique": false
}
},{
"IndexName": "type",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "type",
"Direction": "1"
}],
"MgoIsUnique": false
}
},{
"IndexName": "state",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "state",
"Direction": "1"
}],
"MgoIsUnique": false
}
}]
},
"opendb-components-dynamic":{
......
......@@ -12,10 +12,7 @@
"dependencies": {
"config": "file:../common/config",
"uni-id": "file:../common/uni-id",
"vk-unicloud": "file:../common/vk-unicloud",
"@alicloud/pop-core": "^1.7.9",
"form-data": "^3.0.0",
"nodemailer": "^6.4.11"
"vk-unicloud": "file:../common/vk-unicloud"
},
"private": true
}
......@@ -31,6 +31,9 @@ module.exports = {
};
// 发送验证码开始
var emailConfig = config.vk.service.email;
if(typeof nodemailer === "undefined"){
return { code : -1, msg : '请先安装npm包"nodemailer": "^6.4.11"' };
}
let emailService = nodemailer.createTransport({
"host": emailConfig[data.serviceType].host,
"port": emailConfig[data.serviceType].port,
......
......@@ -4,6 +4,9 @@
<input type="text" placeholder="验证码" v-model="form1.code" />
<view class="tips" style="color: red;">上次发送的验证码:{{form1.code}}</view>
<view class="title">邮箱注册&登录相关</view>
<view class="tips" style="text-align: left;">如需要使用此功能,先确保已安装npm包
<view>"nodemailer": "^6.4.11"</view>
</view>
<view style="display: flex;">
<button type="default" @tap="sendEmailCode('login')">真实-发送验证码</button>
<button type="default" @tap="setVerifyCode('login')">模拟-发送验证码</button>
......
......@@ -4,7 +4,7 @@
当前集成的
<text style="font-weight: bold;margin: 0 10rpx;">uni-id</text>
版本:
<text style="font-weight: bold;">1.1.16</text>
<text style="font-weight: bold;">2.0.3</text>
</view>
<button type="default" @tap="pageTo('../password/password')">用户名和密码</button>
......@@ -18,6 +18,8 @@
<!-- #endif -->
<view style="margin-bottom: 20rpx;">uni-id 1.1.3 新增 分销裂变</view>
<button type="default" @tap="pageTo('../util/util')">通用方法</button>
<view style="margin-bottom: 20rpx;">插件版本1.2.2 新增 数据库API调用方法</view>
<button type="default" @tap="pageTo('../../db-test/db-test')">数据库API调用方法</button>
<view style="margin-bottom: 20rpx;">插件版本1.4.4 新增 Vuex状态管理</view>
<button type="default" @tap="pageTo('../../vuex/vuex')">Vuex状态管理演示示例</button>
<view style="margin-bottom: 20rpx;">插件版本1.4.3 新增 云函数临时缓存</view>
......@@ -28,8 +30,7 @@
<button type="default" @tap="pageTo('../login/index/index')">登录注册找回密码页面模板</button>
<view style="margin-bottom: 20rpx;">插件版本1.2.9 新增 动态数据组件</view>
<button type="default" @tap="pageTo('../../components-dynamic/index/index')">动态数据组件</button>
<view style="margin-bottom: 20rpx;">插件版本1.2.2 新增 数据库调用方法</view>
<button type="default" @tap="pageTo('../../db-test/db-test')">数据库调用方法</button>
</view>
......
......@@ -4,12 +4,16 @@
<input type="text" placeholder="验证码" v-model="form1.code" />
<view class="tips" style="color: red;">上次发送的验证码:{{form1.code}}</view>
<view class="title">手机号注册&登录相关</view>
<view class="tips" style="text-align: left;">如需要使用此功能,先确保已安装npm包
<view>"@alicloud/pop-core": "^1.7.9",</view>
<view>"form-data": "^3.0.0"</view>
</view>
<view style="display: flex;">
<button type="default" @tap="sendSmsCode('login')">真实-发送验证码</button>
<button type="default" @tap="setVerifyCode('login')">模拟-发送验证码</button>
</view>
<button type="default" @tap="loginBySms">短信验证码登录(不存在则注册)</button>
<view class="tips">如果不使用uni-id自带的发送验证码功能,可以自行调用接口设置验证码,参数与发送验证码一致</view>
<view class="tips">已支持阿里云短信发送,如果不使用uni-id自带的发送验证码功能,可以修改公共模块config中的vk.service.sms.aliyun参数</view>
<view class="title">绑定手机相关</view>
<view style="display: flex;">
<button type="default" @tap="sendSmsCode('bind')">真实-发送验证码</button>
......@@ -42,7 +46,7 @@
data() {
return {
form1:{
mobile: '15200000001',
mobile: '',
code: '',
password:"123456"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册