Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vk-uni
vk-unicloud-router
提交
10ca8943
vk-unicloud-router
项目概览
vk-uni
/
vk-unicloud-router
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
vk-unicloud-router
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
10ca8943
编写于
11月 16, 2020
作者:
VK1688
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.5.3
上级
92b42731
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
68 addition
and
16 deletion
+68
-16
README.md
README.md
+2
-2
README/1.5/1.5.3.md
README/1.5/1.5.3.md
+26
-0
cloudfunctions-aliyun/common/uni-id/index.js
cloudfunctions-aliyun/common/uni-id/index.js
+1
-1
cloudfunctions-aliyun/common/uni-id/package.json
cloudfunctions-aliyun/common/uni-id/package.json
+1
-1
cloudfunctions-aliyun/common/vk-unicloud/index.js
cloudfunctions-aliyun/common/vk-unicloud/index.js
+1
-1
cloudfunctions-aliyun/common/vk-unicloud/package.json
cloudfunctions-aliyun/common/vk-unicloud/package.json
+1
-1
cloudfunctions-aliyun/db_init.json
cloudfunctions-aliyun/db_init.json
+19
-1
cloudfunctions-aliyun/router/package.json
cloudfunctions-aliyun/router/package.json
+1
-4
cloudfunctions-aliyun/router/service/user/pub/sendEmailCode.js
...functions-aliyun/router/service/user/pub/sendEmailCode.js
+3
-0
pages_template/uni-id/email/email.vue
pages_template/uni-id/email/email.vue
+3
-0
pages_template/uni-id/index/index.vue
pages_template/uni-id/index/index.vue
+4
-3
pages_template/uni-id/mobile/mobile.vue
pages_template/uni-id/mobile/mobile.vue
+6
-2
未找到文件。
README.md
浏览文件 @
10ca8943
### uniCloud云函数路由框架研究Q群:22466457 如有问题或建议可以在群内讨论。
### 插件名称:`vk-unicloud-router`
### 作者:VK
### 更新时间:2020-11-1
2
### 更新时间:2020-11-1
6
## 主要功能 以及 对开发者的价值
#### 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`作为用户体系,
有了统一的账户规范,并且围绕这套账户规范,有各种各样插件,那么开发者可以随意整合这些插件,让数据连同。
...
...
README/1.5/1.5.3.md
0 → 100644
浏览文件 @
10ca8943
### 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
cloudfunctions-aliyun/common/uni-id/index.js
浏览文件 @
10ca8943
此差异已折叠。
点击以展开。
cloudfunctions-aliyun/common/uni-id/package.json
浏览文件 @
10ca8943
{
"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"
,
...
...
cloudfunctions-aliyun/common/vk-unicloud/index.js
浏览文件 @
10ca8943
此差异已折叠。
点击以展开。
cloudfunctions-aliyun/common/vk-unicloud/package.json
浏览文件 @
10ca8943
{
"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"
,
...
...
cloudfunctions-aliyun/db_init.json
浏览文件 @
10ca8943
...
...
@@ -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"
:{
...
...
cloudfunctions-aliyun/router/package.json
浏览文件 @
10ca8943
...
...
@@ -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
}
cloudfunctions-aliyun/router/service/user/pub/sendEmailCode.js
浏览文件 @
10ca8943
...
...
@@ -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
,
...
...
pages_template/uni-id/email/email.vue
浏览文件 @
10ca8943
...
...
@@ -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>
...
...
pages_template/uni-id/index/index.vue
浏览文件 @
10ca8943
...
...
@@ -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>
...
...
pages_template/uni-id/mobile/mobile.vue
浏览文件 @
10ca8943
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录