提交 badab554 编写于 作者: DCloud_JSON's avatar DCloud_JSON

1. 简化宫格页面写法,方便理解如何控制不同状态角色的用户是否可见哪些元素。 2....

1. 简化宫格页面写法,方便理解如何控制不同状态角色的用户是否可见哪些元素。 2. uni-id-cf发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。 3. uni-id-cf统一action名称为驼峰法
上级 b70843d1
## 1.0.30(2021-07-01)
1. 简化宫格页面写法,方便理解如何控制不同状态角色的用户是否可见哪些元素。
2. uni-id-cf发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。
3. uni-id-cf统一action名称为驼峰法
## 1.0.29(2021-06-29) ## 1.0.29(2021-06-29)
1. 修复在安卓10以下设备,操作登陆获取不到oaid会直接导致登陆失败的bug 1. 修复在安卓10以下设备,操作登陆获取不到oaid会直接导致登陆失败的bug
2. 修复uniCloud版本为阿里云版时删除头像设置失败,腾讯云版删除头像后二次上传失败的问题 2. 修复uniCloud版本为阿里云版时删除头像设置失败,腾讯云版删除头像后二次上传失败的问题
......
...@@ -28,14 +28,17 @@ ...@@ -28,14 +28,17 @@
<uni-section title="宫格组件" style="margin: 0;" type="line"></uni-section> <uni-section title="宫格组件" style="margin: 0;" type="line"></uni-section>
<view class="example-body"> <view class="example-body">
<uni-grid :column="3" :highlight="true" @change="change"> <uni-grid :column="3" :highlight="true" @change="change">
<uni-grid-item v-for="(item, index) in list" :index="index" :key="index" <template v-for="(item,i) in gridList">
v-if="index<3?true:(index<6?hasLogin:uniIDHasRole('admin'))" <uni-grid-item :index="i" :key="i"
v-if="i<3 || i>3&&i<7&&hasLogin || i>7&&uniIDHasRole('admin')"
> >
<view class="grid-item-box" style="background-color: #fff;"> <view class="grid-item-box" style="background-color: #fff;">
<image :src="item.url" class="image" mode="aspectFill" /> <image :src="'/static/grid/c'+(i+1)+'.png'" class="image" mode="aspectFill" />
<text class="text">{{ item.text }}</text> <text class="text">{{item}}</text>
</view> </view>
</uni-grid-item> </uni-grid-item>
</template>
</uni-grid> </uni-grid>
</view> </view>
</view> </view>
...@@ -52,67 +55,7 @@ ...@@ -52,67 +55,7 @@
}, },
data() { data() {
return { return {
list: [{ gridList: ['所有人可见','所有人可见','所有人可见', '游客不可见', '游客不可见', '游客不可见','管理员可见','管理员可见','管理员可见'],
url: '/static/grid/c1.png',
text: '所有人可见',
badge: '0',
type: "primary",
isShow: true
},
{
url: '/static/grid/c2.png',
text: '所有人可见',
badge: '1',
type: "success",
isShow: true
}, {
url: '/static/grid/c3.png',
text: '所有人可见',
badge: '1',
type: "success",
isShow: true
},
{
url: '/static/grid/c4.png',
text: '游客不可见',
badge: '1',
type: "success",
isShow: "this.hasLogin"
},
{
url: '/static/grid/c5.png',
text: '游客不可见',
badge: '1',
type: "success",
isShow: "hasLogin"
},
{
url: '/static/grid/c6.png',
text: '游客不可见',
badge: '1',
type: "success",
isShow: "hasLogin"
},
{
url: '/static/grid/c7.png',
text: '管理员可见',
badge: '99',
type: "warning",
isShow: "uniIDHasPermission('admin')"
},
{
url: '/static/grid/c8.png',
text: '管理员可见',
badge: '2',
type: "error",
isShow: "uniIDHasPermission('admin')"
},
{
url: '/static/grid/c9.png',
text: '管理员可见',
isShow: "uniIDHasPermission('admin')"
}
],
// 查询字段,多个字段用 , 分割 // 查询字段,多个字段用 , 分割
field: '_id,bannerfile,open_url,title', field: '_id,bannerfile,open_url,title',
where: 'category_id==grid', where: 'category_id==grid',
...@@ -155,13 +98,8 @@ ...@@ -155,13 +98,8 @@
}, },
methods: { methods: {
change(e) { change(e) {
let {
index
} = e.detail
this.list[index].badge && this.list[index].badge++
uni.showToast({ uni.showToast({
title: `点击第${index+1}个宫格`, title: `点击第${e.detail.index}个宫格`,
icon: 'none' icon: 'none'
}) })
}, },
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
uniCloud.callFunction({ uniCloud.callFunction({
name:'uni-id-cf', name:'uni-id-cf',
data:{ data:{
action:'bind_mobile_by_sms', action:'bindMobileBySms',
params:{ params:{
"mobile": this.formData.phone, "mobile": this.formData.phone,
"code": this.formData.code "code": this.formData.code
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
uniCloud.callFunction({ uniCloud.callFunction({
name: 'uni-id-cf', name: 'uni-id-cf',
data: { data: {
action: 'bind_mobile_by_univerify', action: 'bindMobileByUniverify',
params: e.authResult, params: e.authResult,
}, },
success: ({ success: ({
......
## 1.0.2(2021-07-01)
1. 发送短信验证码api,默认注释掉:虚拟发送短信验证码的代码块。
2. 统一action名称为驼峰法
## 1.0.1(2021-06-28) ## 1.0.1(2021-06-28)
修复resetPwdBySmsCode接口,未注册过的用户也能调用的问题 修复resetPwdBySmsCode接口,未注册过的用户也能调用的问题
## 1.0.0(2021-06-21) ## 1.0.0(2021-06-21)
......
{ {
"id": "uni-id-cf", "id": "uni-id-cf",
"displayName": "uni-id-cf", "displayName": "uni-id-cf",
"version": "1.0.1", "version": "1.0.2",
"description": "uni-id-cf", "description": "uni-id-cf",
"keywords": [ "keywords": [
"uni-id-cf", "uni-id-cf",
......
...@@ -130,7 +130,7 @@ exports.main = async (event, context) => { ...@@ -130,7 +130,7 @@ exports.main = async (event, context) => {
let res = {} let res = {}
switch (action) { //根据action的值执行对应的操作 switch (action) { //根据action的值执行对应的操作
case 'bind_mobile_by_univerify': case 'bindMobileByUniverify':
let { let {
appid, apiKey, apiSecret appid, apiKey, apiSecret
} = uniIdConfig.service.univerify } = uniIdConfig.service.univerify
...@@ -150,7 +150,7 @@ exports.main = async (event, context) => { ...@@ -150,7 +150,7 @@ exports.main = async (event, context) => {
res.mobile = univerifyRes.phoneNumber res.mobile = univerifyRes.phoneNumber
} }
break; break;
case 'bind_mobile_by_sms': case 'bindMobileBySms':
// console.log({ // console.log({
// uid: params.uid, // uid: params.uid,
// mobile: params.mobile, // mobile: params.mobile,
...@@ -247,12 +247,14 @@ exports.main = async (event, context) => { ...@@ -247,12 +247,14 @@ exports.main = async (event, context) => {
res = await uniID.logout(uniIdToken) res = await uniID.logout(uniIdToken)
break; break;
case 'sendSmsCode': case 'sendSmsCode':
// 测试期间短信统一用 123456 正式项目删除即可 /* -开始- 测试期间,为节约资源。统一虚拟短信验证码为: 123456;开启以下代码块即可 */
return uniID.setVerifyCode({ // return uniID.setVerifyCode({
mobile: params.mobile, // mobile: params.mobile,
code: '123456', // code: '123456',
type: params.type // type: params.type
}) // })
/* -结束- */
// 简单限制一下客户端调用频率 // 简单限制一下客户端调用频率
const ipLimit = await db.collection('opendb-verify-codes').where({ const ipLimit = await db.collection('opendb-verify-codes').where({
ip: context.CLIENTIP, ip: context.CLIENTIP,
......
{ {
"name" : "uni-starter", "name" : "uni-starter",
"appid" : "__UNI__E5373F7", "appid" : "__UNI__03B096E",
"description" : "云端一体应用快速开发模版", "description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册