From a35010df37c0db21529bc4c0faa809291da3198a Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 16 Jan 2023 23:54:55 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E6=9B=B4=E6=96=B0=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=EF=BC=9A=E5=86=85uni-push=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=8E=A8=E9=80=81=E6=A0=87=E8=AF=86=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 131 +- .../components/uni-badge/uni-badge.vue | 6 +- uni_modules/uni-id-pages/changelog.md | 234 +-- uni_modules/uni-id-pages/common/store.js | 313 ++-- .../uni-id-pages-email-form.vue | 502 ++--- .../uni-id-pages-user-profile.vue | 352 ++-- uni_modules/uni-id-pages/package.json | 2 +- .../pages/common/webview/webview.vue | 80 +- .../pages/login/login-smscode.vue | 246 +-- .../pages/login/login-withoutpwd.vue | 458 ++--- .../pages/register/register-admin.vue | 362 ++-- .../pages/register/register-by-email.vue | 432 ++--- .../pages/retrieve/retrieve-by-email.vue | 446 ++--- .../uni-id-pages/pages/retrieve/retrieve.vue | 492 ++--- .../userinfo/bind-mobile/bind-mobile.vue | 266 +-- .../pages/userinfo/cropImage/cropImage.vue | 76 +- .../userinfo/cropImage/limeClipper/README.md | 452 ++--- .../cropImage/limeClipper/images/photo.svg | 38 +- .../cropImage/limeClipper/images/rotate.svg | 30 +- .../userinfo/cropImage/limeClipper/index.css | 320 ++-- .../cropImage/limeClipper/limeClipper.vue | 1638 ++++++++--------- .../pages/userinfo/set-pwd/set-pwd.vue | 340 ++-- .../uni-id-pages/pages/userinfo/userinfo.vue | 502 ++--- uni_modules/uni-id-pages/readme.md | 28 +- .../database/opendb-device.schema.json | 282 +-- .../database/uni-id-device.schema.json | 164 +- .../uniCloud/database/uni-id-log.schema.json | 142 +- .../database/uni-id-permissions.schema.json | 104 +- .../database/uni-id-roles.schema.json | 100 +- 29 files changed, 4277 insertions(+), 4261 deletions(-) diff --git a/manifest.json b/manifest.json index 253530e..da54b18 100644 --- a/manifest.json +++ b/manifest.json @@ -1,68 +1,71 @@ { - "name" : "uni-starter", - "appid" : "__UNI__07F7150", - "description" : "云端一体应用快速开发基本项目模版", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - "modules" : {}, - "distribute" : { - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "ios" : {}, - "sdkConfigs" : { - "push" : { - "unipush" : null - } - } - } - }, - "quickapp" : {}, - "mp-weixin" : { - "appid" : "wx999bf02c8e05dfc9", - "setting" : { - "urlCheck" : false - }, - "usingComponents" : true - }, - "mp-alipay" : { - "usingComponents" : true + "name": "", + "appid": "", + "description": "云端一体应用快速开发基本项目模版", + "versionName": "", + "versionCode": "100", + "transformPx": false, + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 }, - "mp-baidu" : { - "usingComponents" : true + "modules": { }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false + "distribute": { + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios": { + }, + "sdkConfigs": { + "push": { + "unipush": null + } + } + } + }, + "quickapp": { + }, + "mp-weixin": { + "appid": "", + "setting": { + "urlCheck": false }, - "vueVersion" : "2" -} + "usingComponents": true + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "2" +} \ No newline at end of file diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue index 7b2ba31..664dc37 100644 --- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -191,13 +191,12 @@ /* #ifndef APP-NVUE */ display: flex; overflow: hidden; - box-sizing: border-box; - min-width: 20px; - font-feature-settings: "tnum"; + box-sizing: border-box; /* #endif */ justify-content: center; flex-direction: row; height: 20px; + min-width: 20px; padding: 0 4px; line-height: 18px; color: #fff; @@ -207,6 +206,7 @@ border: 1px solid #fff; text-align: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-feature-settings: "tnum"; font-size: $bage-size; /* #ifdef H5 */ z-index: 999; diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index e875bc9..2c5adcc 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,117 +1,123 @@ +## 1.0.41(2023-01-16) +- 优化 压缩依赖的文件资源大小 +## 1.0.40(2023-01-16) +- 更新依赖的 验证码插件`uni-captcha`版本的版本为 0.6.4 修复 部分情况下APP端无法获取验证码的问题 [详情参考](https://ext.dcloud.net.cn/plugin?id=4048) +- 修复 客户端token过期后,点击退出登录按钮报错的问题 +- uni-id-co 修复 updateUser 接口`手机号`和`邮箱`参数值为空字符串时,修改无效的问题 ## 1.0.39(2022-12-28) - uni-id-co 修复 URL化时第三方登录无法获取 uniPlatform 参数 - uni-id-co 修复 validator error -## 1.0.38(2022-12-26) -- uni-id-co 优化 手机号与邮箱验证规则为空字符串时不校验 -## 1.0.37(2022-12-09) -- 优化admin端样式 -## 1.0.36(2022-12-08) -- uni-id-co 修复 `updateUser` 接口部分参数为空时数据修改异常 -## 1.0.35(2022-11-30) -- uni-id-co 新增 匹配到的用户不可在当前应用登录时的错误码 `uni-id-account-not-exists-in-current-app` [错误码说明](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#errcode) -## 1.0.34(2022-11-29) -- 优化 toast 错误提示时间为3秒 -- uni-id-co 修复 无法从 clientInfo 中获取 uniIdToken -## 1.0.33(2022-11-25) -- uni-id-co 新增 外部系统联登接口,可为外部系统创建与uni-id相对应的账号,使该账号可以使用依赖uniId的系统及功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external) -- uni-id-co 新增 URL化请求时鉴权签名验证 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#http-reqeust-auth) -- uni-id-co 修复 微信登录时用户未设置头像的报错问题 -## 1.0.32(2022-11-21) -- 新增 设置密码页面 -- 新增 登录后跳转设置密码页面配置项`setPasswordAfterLogin` [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd-after-login) -- uni-id-co 新增 设置密码接口 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd) -## 1.0.31(2022-11-16) -- uni-id-co 修复 验证码可能无法收到的bug -## 1.0.30(2022-11-11) -- uni-id-co 修复 用户只有openid时绑定微信/QQ报错 -## 1.0.29(2022-11-10) -- uni-id-co 支持URL化方式请求 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#adapter-http) -## 1.0.28(2022-11-09) -- uni-id-co 升级密码加密算法,支持hmac-sha256加密 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-safe) -- uni-id-co 新增 开发者可以自定义密码加密规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#custom-password-encrypt) -- uni-id-co 新增 支持将其他系统用户迁移至uni-id [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#move-users-to-uni-id) -## 1.0.27(2022-10-26) -- uni-id-co 新增 secureNetworkHandshakeByWeixin 接口,用于建立和微信小程序的安全网络连接 -## 1.0.26(2022-10-18) -- 修复 uni-id-pages 导入时异常的Bug -## 1.0.25(2022-10-14) -- uni-id-co 增加 微信授权手机号登录方式 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile) -- uni-id-co 增加 解绑第三方平台账号 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-third-account) -- uni-id-co 微信绑定手机号支持通过`getPhoneNumber`事件回调的`code`绑定 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin) -- 修复 sendSmsCode 接口未在参数内传递 templateId 时 未能从配置文件读取 templateId 的Bug -## 1.0.24(2022-10-08) -- 修复 报uni-id-users表schema内错误的bug -## 1.0.23(2022-10-08) -- 修复 vue3下vite编译发行打包失败 -- 修复 某些情况下注册账号,报TypeErroe:Cannot read properties of undefined (reading ’showToast‘)的错误 -## 1.0.22(2022-09-23) -- 修复 某些情况下,修改密码报“两次输入密码不一致”的bug -## 1.0.21(2022-09-21) -- 修复 store.hasLogin的值在某些情况下会出错的bug -## 1.0.20(2022-09-21) -- 新增 store 账号信息状态管理,详情:用户中心页面 路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo` -## 1.0.19(2022-09-20) -- 修复 小程序端,使用将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)的uni-ui组件,样式错乱的问题 -## 1.0.18(2022-09-20) -- 修复 微信小程序端 WXSS 编译报错的bug -## 1.0.17(2022.09-19) -- 修复 无法退出登录的bug -## 1.0.16(2022-09-19) -- 修复 在 Edge 浏览器下 input[type="password"] 会出现浏览器自带的密码查看按钮 -- 优化 退出登录重定向页面为 uniIdRouter.loginPage -- 新增 注册账号页面支持返回登录页面 -## 1.0.15(2022-09-19) -- 更新表结构,解决在uni-admin中部分clientDB操作没有权限的问题 -## 1.0.14(2022-09-16) -- 修改 配置项`isAdmin`默认值为`false` -## 1.0.13(2022-09-16) -- 新增 管理员注册页面 -- 新增 配置项`isAdmin`区分是否为管理端 -- 新增 登录成功后自动跳转;跳转优先级:路由携带(`uniIdRedirectUrl`参数) > 返回上一路由 > 跳转首页 -- uni-id-co 优化 注册管理员时管理员存在提示文案 -## 1.0.12(2022-09-07) -- 修复 getSupportedLoginType判断是否支持微信公众号、PC网页微信扫码登录方式报错的Bug -- 优化 适配pc端样式 -- 新增 邮箱验证码注册 -- 新增 邮箱验证码找回密码 -- 新增 退出登录(全局)回调事件:`uni-id-pages-logout`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; -- 调整 抽离退出登录方法至`/uni_modules/uni-id-pages/common/common.js`中,方便在项目其他页面中调用 -- 调整 用户中心(路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo`)默认不再显示退出登录按钮。支持页面传参数`showLoginManage=true`恢复显示 -## 1.0.11(2022-09-01) -- 修复 iOS端,一键登录功能卡在showLoading的问题 -- 更新 合并密码强度与长度配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) -- uni-id-co 修复 调用 removeAuthorizedApp 接口报错的Bug -- uni-id-co 新增 管理端接口 updateUser [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user) -- uni-id-co 调整 为兼容旧版本,未配置密码强度时提供最简单的密码规则校验(长度大于6即可) -- uni-id-co 调整 注册、登录时如果携带了token则尝试对此token进行登出操作 -- uni-id-co 调整 管理端接口 addUser 增加 mobile、email等参数 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user) -## 1.0.10(2022-08-25) -- 修复 导入uni-id-pages插件时未自动导入uni-open-bridge-common的Bug -## 1.0.9(2022-08-23) -- 修复 uni-id-co 缺失uni-open-bridge-common依赖的Bug -## 1.0.8(2022-08-23) -- 新增 H5端支持微信登录(含微信公众号内的网页授权登录 和 普通浏览器内网页生成二维码,实现手机微信扫码登录)[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#weixinlogin) -- 新增 登录成功(全局)回调事件:`uni-id-pages-login-success`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; -- 新增 密码强度(是否必须包含大小写字母、数字和特殊符号以及长度)配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) -- 调整 uni-id-co 密码规则调整,废除之前的简单校验,允许配置密码强度 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-strength) -- 调整 uni-id-co 存储用户 openid 时同时以客户端 AppId 为 Key 的副本,参考:[微信登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin)、[QQ登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-qq) -- 调整 uni-id-co 依赖 uni-open-bridge-common 存储用户 session_key、access_token 等信息 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#save-user-token) -- 新增 uni-id-co 增加 beforeRegister 钩子用户在注册前向用户记录内添加一些数据 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register) -## 1.0.7(2022-07-19) -- 修复 uni-id-co接口 logout时没有删除token的Bug -## 1.0.6(2022-07-13) -- 新增 允许覆盖内置校验规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#custom-validator) -- 修复 app端clientInfo.appVersionCode为数字导致校验无法通过的Bug -## 1.0.5(2022-07-11) -修复 微信小程序调用uni-id-co接口报错的Bug [详情](https://ask.dcloud.net.cn/question/148877) -## 1.0.4(2022-07-06) -- uni-id-co增加clientInfo字段类型校验 -- 监听token更新时机,同步客户端push_clientid至uni-id-device表,改为:同步客户端push_clientid至uni-id-device表和opendb-device表 -## 1.0.3(2022-07-05) -新增监听token更新时机,同步客户端push_clientid至uni-id-device表 -## 1.0.2(2022-07-04) -修复微信小程序登录时无unionid报错的Bug [详情](https://ask.dcloud.net.cn/question/148016) -## 1.0.1(2022-06-28) -添加相关uni-id表 -## 1.0.0(2022-06-23) -正式版 +## 1.0.38(2022-12-26) +- uni-id-co 优化 手机号与邮箱验证规则为空字符串时不校验 +## 1.0.37(2022-12-09) +- 优化admin端样式 +## 1.0.36(2022-12-08) +- uni-id-co 修复 `updateUser` 接口部分参数为空时数据修改异常 +## 1.0.35(2022-11-30) +- uni-id-co 新增 匹配到的用户不可在当前应用登录时的错误码 `uni-id-account-not-exists-in-current-app` [错误码说明](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#errcode) +## 1.0.34(2022-11-29) +- 优化 toast 错误提示时间为3秒 +- uni-id-co 修复 无法从 clientInfo 中获取 uniIdToken +## 1.0.33(2022-11-25) +- uni-id-co 新增 外部系统联登接口,可为外部系统创建与uni-id相对应的账号,使该账号可以使用依赖uniId的系统及功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external) +- uni-id-co 新增 URL化请求时鉴权签名验证 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#http-reqeust-auth) +- uni-id-co 修复 微信登录时用户未设置头像的报错问题 +## 1.0.32(2022-11-21) +- 新增 设置密码页面 +- 新增 登录后跳转设置密码页面配置项`setPasswordAfterLogin` [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd-after-login) +- uni-id-co 新增 设置密码接口 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd) +## 1.0.31(2022-11-16) +- uni-id-co 修复 验证码可能无法收到的bug +## 1.0.30(2022-11-11) +- uni-id-co 修复 用户只有openid时绑定微信/QQ报错 +## 1.0.29(2022-11-10) +- uni-id-co 支持URL化方式请求 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#adapter-http) +## 1.0.28(2022-11-09) +- uni-id-co 升级密码加密算法,支持hmac-sha256加密 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-safe) +- uni-id-co 新增 开发者可以自定义密码加密规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#custom-password-encrypt) +- uni-id-co 新增 支持将其他系统用户迁移至uni-id [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#move-users-to-uni-id) +## 1.0.27(2022-10-26) +- uni-id-co 新增 secureNetworkHandshakeByWeixin 接口,用于建立和微信小程序的安全网络连接 +## 1.0.26(2022-10-18) +- 修复 uni-id-pages 导入时异常的Bug +## 1.0.25(2022-10-14) +- uni-id-co 增加 微信授权手机号登录方式 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile) +- uni-id-co 增加 解绑第三方平台账号 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-third-account) +- uni-id-co 微信绑定手机号支持通过`getPhoneNumber`事件回调的`code`绑定 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin) +- 修复 sendSmsCode 接口未在参数内传递 templateId 时 未能从配置文件读取 templateId 的Bug +## 1.0.24(2022-10-08) +- 修复 报uni-id-users表schema内错误的bug +## 1.0.23(2022-10-08) +- 修复 vue3下vite编译发行打包失败 +- 修复 某些情况下注册账号,报TypeErroe:Cannot read properties of undefined (reading ’showToast‘)的错误 +## 1.0.22(2022-09-23) +- 修复 某些情况下,修改密码报“两次输入密码不一致”的bug +## 1.0.21(2022-09-21) +- 修复 store.hasLogin的值在某些情况下会出错的bug +## 1.0.20(2022-09-21) +- 新增 store 账号信息状态管理,详情:用户中心页面 路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo` +## 1.0.19(2022-09-20) +- 修复 小程序端,使用将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)的uni-ui组件,样式错乱的问题 +## 1.0.18(2022-09-20) +- 修复 微信小程序端 WXSS 编译报错的bug +## 1.0.17(2022.09-19) +- 修复 无法退出登录的bug +## 1.0.16(2022-09-19) +- 修复 在 Edge 浏览器下 input[type="password"] 会出现浏览器自带的密码查看按钮 +- 优化 退出登录重定向页面为 uniIdRouter.loginPage +- 新增 注册账号页面支持返回登录页面 +## 1.0.15(2022-09-19) +- 更新表结构,解决在uni-admin中部分clientDB操作没有权限的问题 +## 1.0.14(2022-09-16) +- 修改 配置项`isAdmin`默认值为`false` +## 1.0.13(2022-09-16) +- 新增 管理员注册页面 +- 新增 配置项`isAdmin`区分是否为管理端 +- 新增 登录成功后自动跳转;跳转优先级:路由携带(`uniIdRedirectUrl`参数) > 返回上一路由 > 跳转首页 +- uni-id-co 优化 注册管理员时管理员存在提示文案 +## 1.0.12(2022-09-07) +- 修复 getSupportedLoginType判断是否支持微信公众号、PC网页微信扫码登录方式报错的Bug +- 优化 适配pc端样式 +- 新增 邮箱验证码注册 +- 新增 邮箱验证码找回密码 +- 新增 退出登录(全局)回调事件:`uni-id-pages-logout`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; +- 调整 抽离退出登录方法至`/uni_modules/uni-id-pages/common/common.js`中,方便在项目其他页面中调用 +- 调整 用户中心(路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo`)默认不再显示退出登录按钮。支持页面传参数`showLoginManage=true`恢复显示 +## 1.0.11(2022-09-01) +- 修复 iOS端,一键登录功能卡在showLoading的问题 +- 更新 合并密码强度与长度配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) +- uni-id-co 修复 调用 removeAuthorizedApp 接口报错的Bug +- uni-id-co 新增 管理端接口 updateUser [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user) +- uni-id-co 调整 为兼容旧版本,未配置密码强度时提供最简单的密码规则校验(长度大于6即可) +- uni-id-co 调整 注册、登录时如果携带了token则尝试对此token进行登出操作 +- uni-id-co 调整 管理端接口 addUser 增加 mobile、email等参数 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user) +## 1.0.10(2022-08-25) +- 修复 导入uni-id-pages插件时未自动导入uni-open-bridge-common的Bug +## 1.0.9(2022-08-23) +- 修复 uni-id-co 缺失uni-open-bridge-common依赖的Bug +## 1.0.8(2022-08-23) +- 新增 H5端支持微信登录(含微信公众号内的网页授权登录 和 普通浏览器内网页生成二维码,实现手机微信扫码登录)[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#weixinlogin) +- 新增 登录成功(全局)回调事件:`uni-id-pages-login-success`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; +- 新增 密码强度(是否必须包含大小写字母、数字和特殊符号以及长度)配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) +- 调整 uni-id-co 密码规则调整,废除之前的简单校验,允许配置密码强度 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-strength) +- 调整 uni-id-co 存储用户 openid 时同时以客户端 AppId 为 Key 的副本,参考:[微信登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin)、[QQ登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-qq) +- 调整 uni-id-co 依赖 uni-open-bridge-common 存储用户 session_key、access_token 等信息 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#save-user-token) +- 新增 uni-id-co 增加 beforeRegister 钩子用户在注册前向用户记录内添加一些数据 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register) +## 1.0.7(2022-07-19) +- 修复 uni-id-co接口 logout时没有删除token的Bug +## 1.0.6(2022-07-13) +- 新增 允许覆盖内置校验规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#custom-validator) +- 修复 app端clientInfo.appVersionCode为数字导致校验无法通过的Bug +## 1.0.5(2022-07-11) +修复 微信小程序调用uni-id-co接口报错的Bug [详情](https://ask.dcloud.net.cn/question/148877) +## 1.0.4(2022-07-06) +- uni-id-co增加clientInfo字段类型校验 +- 监听token更新时机,同步客户端push_clientid至uni-id-device表,改为:同步客户端push_clientid至uni-id-device表和opendb-device表 +## 1.0.3(2022-07-05) +新增监听token更新时机,同步客户端push_clientid至uni-id-device表 +## 1.0.2(2022-07-04) +修复微信小程序登录时无unionid报错的Bug [详情](https://ask.dcloud.net.cn/question/148016) +## 1.0.1(2022-06-28) +添加相关uni-id表 +## 1.0.0(2022-06-23) +正式版 diff --git a/uni_modules/uni-id-pages/common/store.js b/uni_modules/uni-id-pages/common/store.js index c632934..98966d0 100644 --- a/uni_modules/uni-id-pages/common/store.js +++ b/uni_modules/uni-id-pages/common/store.js @@ -1,153 +1,160 @@ -import pagesJson from '@/pages.json' -import config from '@/uni_modules/uni-id-pages/config.js' - -const uniIdCo = uniCloud.importObject("uni-id-co") -const db = uniCloud.database(); -const usersTable = db.collection('uni-id-users') - -let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{} -// console.log( hostUserInfo); -const data = { - userInfo: hostUserInfo, - hasLogin: Object.keys(hostUserInfo).length != 0 -} - -// console.log('data', data); -// 定义 mutations, 修改属性 -export const mutations = { - // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新 - async updateUserInfo(data = false) { - if (data) { - usersTable.where('_id==$env.uid').update(data).then(e => { - // console.log(e); - if (e.result.updated) { - uni.showToast({ - title: "更新成功", - icon: 'none', - duration: 3000 - }); - this.setUserInfo(data) - } else { - uni.showToast({ - title: "没有改变", - icon: 'none', - duration: 3000 - }); - } - }) - - } else { - try { - let res = await usersTable.where("'_id' == $cloudEnv_uid") - .field('mobile,nickname,username,email,avatar_file') - .get() - // console.log('fromDbData',res.result.data); - this.setUserInfo(res.result.data[0]) - } catch (e) { - this.setUserInfo({},{cover:true}) - console.error(e.message, e.errCode); - } - } - }, - async setUserInfo(data, {cover}={cover:false}) { - // console.log('set-userInfo', data); - let userInfo = cover?data:Object.assign(store.userInfo,data) - store.userInfo = Object.assign({},userInfo) - store.hasLogin = Object.keys(store.userInfo).length != 0 - // console.log('store.userInfo', store.userInfo); - uni.setStorage({ - key: "uni-id-pages-userInfo", - data:store.userInfo - }) - return data - }, - async logout() { - await uniIdCo.logout() - uni.removeStorageSync('uni_id_token'); - uni.setStorageSync('uni_id_token_expired', 0) - uni.redirectTo({ - url: `/${pagesJson.uniIdRouter?.loginPage ?? 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`, - }); - uni.$emit('uni-id-pages-logout') - this.setUserInfo({},{cover:true}) - }, - - loginBack (e = {}) { - const {uniIdRedirectUrl = ''} = e - let delta = 0; //判断需要返回几层 - let pages = getCurrentPages(); - // console.log(pages); - pages.forEach((page, index) => { - if (pages[pages.length - index - 1].route.split('/')[3] == 'login') { - delta++ - } - }) - // console.log('判断需要返回几层:', delta); - if (uniIdRedirectUrl) { - return uni.reLaunch({ - url: uniIdRedirectUrl - }) - } - // #ifdef H5 - if (e.loginType == 'weixin') { - // console.log('window.history', window.history); - return window.history.go(-3) - } - // #endif - - if (delta) { - const page = pagesJson.pages[0] - return uni.reLaunch({ - url: `/${page.path}` - }) - } - - uni.navigateBack({ - delta - }) - }, - loginSuccess(e = {}){ - const { - showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '', passwordConfirmed - } = e - // console.log({toastText,autoBack}); - if (showToast) { - uni.showToast({ - title: toastText, - icon: 'none', - duration: 3000 - }); - } - this.updateUserInfo() - - uni.$emit('uni-id-pages-login-success') - - if (config.setPasswordAfterLogin && !passwordConfirmed) { - return uni.redirectTo({ - url: uniIdRedirectUrl ? `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?uniIdRedirectUrl=${uniIdRedirectUrl}&loginType=${e.loginType}`: `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?loginType=${e.loginType}`, - fail: (err) => { - console.log(err) - } - }) - } - - if (autoBack) { - this.loginBack(uniIdRedirectUrl) - } - } - -} - -// #ifdef VUE2 -import Vue from 'vue' -// 通过Vue.observable创建一个可响应的对象 -export const store = Vue.observable(data) -// #endif - -// #ifdef VUE3 -import { - reactive -} from 'vue' -// 通过Vue.observable创建一个可响应的对象 -export const store = reactive(data) -// #endif +import pagesJson from '@/pages.json' +import config from '@/uni_modules/uni-id-pages/config.js' + +const uniIdCo = uniCloud.importObject("uni-id-co") +const db = uniCloud.database(); +const usersTable = db.collection('uni-id-users') + +let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{} +// console.log( hostUserInfo); +const data = { + userInfo: hostUserInfo, + hasLogin: Object.keys(hostUserInfo).length != 0 +} + +// console.log('data', data); +// 定义 mutations, 修改属性 +export const mutations = { + // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新 + async updateUserInfo(data = false) { + if (data) { + usersTable.where('_id==$env.uid').update(data).then(e => { + // console.log(e); + if (e.result.updated) { + uni.showToast({ + title: "更新成功", + icon: 'none', + duration: 3000 + }); + this.setUserInfo(data) + } else { + uni.showToast({ + title: "没有改变", + icon: 'none', + duration: 3000 + }); + } + }) + + } else { + try { + let res = await usersTable.where("'_id' == $cloudEnv_uid") + .field('mobile,nickname,username,email,avatar_file') + .get() + // console.log('fromDbData',res.result.data); + this.setUserInfo(res.result.data[0]) + } catch (e) { + this.setUserInfo({},{cover:true}) + console.error(e.message, e.errCode); + } + } + }, + async setUserInfo(data, {cover}={cover:false}) { + // console.log('set-userInfo', data); + let userInfo = cover?data:Object.assign(store.userInfo,data) + store.userInfo = Object.assign({},userInfo) + store.hasLogin = Object.keys(store.userInfo).length != 0 + // console.log('store.userInfo', store.userInfo); + uni.setStorage({ + key: "uni-id-pages-userInfo", + data:store.userInfo + }) + return data + }, + async logout() { + // 1. 已经过期就不需要调用服务端的注销接口 2.即使调用注销接口失败,不能阻塞客户端 + if(uniCloud.getCurrentUserInfo().tokenExpired > Date.now()){ + try{ + await uniIdCo.logout() + }catch(e){ + console.error(e); + } + } + uni.removeStorageSync('uni_id_token'); + uni.setStorageSync('uni_id_token_expired', 0) + uni.redirectTo({ + url: `/${pagesJson.uniIdRouter?.loginPage ?? 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`, + }); + uni.$emit('uni-id-pages-logout') + this.setUserInfo({},{cover:true}) + }, + + loginBack (e = {}) { + const {uniIdRedirectUrl = ''} = e + let delta = 0; //判断需要返回几层 + let pages = getCurrentPages(); + // console.log(pages); + pages.forEach((page, index) => { + if (pages[pages.length - index - 1].route.split('/')[3] == 'login') { + delta++ + } + }) + // console.log('判断需要返回几层:', delta); + if (uniIdRedirectUrl) { + return uni.reLaunch({ + url: uniIdRedirectUrl + }) + } + // #ifdef H5 + if (e.loginType == 'weixin') { + // console.log('window.history', window.history); + return window.history.go(-3) + } + // #endif + + if (delta) { + const page = pagesJson.pages[0] + return uni.reLaunch({ + url: `/${page.path}` + }) + } + + uni.navigateBack({ + delta + }) + }, + loginSuccess(e = {}){ + const { + showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '', passwordConfirmed + } = e + // console.log({toastText,autoBack}); + if (showToast) { + uni.showToast({ + title: toastText, + icon: 'none', + duration: 3000 + }); + } + this.updateUserInfo() + + uni.$emit('uni-id-pages-login-success') + + if (config.setPasswordAfterLogin && !passwordConfirmed) { + return uni.redirectTo({ + url: uniIdRedirectUrl ? `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?uniIdRedirectUrl=${uniIdRedirectUrl}&loginType=${e.loginType}`: `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?loginType=${e.loginType}`, + fail: (err) => { + console.log(err) + } + }) + } + + if (autoBack) { + this.loginBack(uniIdRedirectUrl) + } + } + +} + +// #ifdef VUE2 +import Vue from 'vue' +// 通过Vue.observable创建一个可响应的对象 +export const store = Vue.observable(data) +// #endif + +// #ifdef VUE3 +import { + reactive +} from 'vue' +// 通过Vue.observable创建一个可响应的对象 +export const store = reactive(data) +// #endif diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue b/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue index 372c59b..ba53d73 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue @@ -1,251 +1,251 @@ - - - - - + + + + + diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue b/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue index 218a99e..2c7b2e3 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue @@ -1,176 +1,176 @@ - - - - - + + + + + diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json index b82045a..ae1ae1f 100644 --- a/uni_modules/uni-id-pages/package.json +++ b/uni_modules/uni-id-pages/package.json @@ -1,7 +1,7 @@ { "id": "uni-id-pages", "displayName": "uni-id-pages", - "version": "1.0.39", + "version": "1.0.41", "description": "云端一体简单、统一、可扩展的用户中心页面模版", "keywords": [ "用户管理", diff --git a/uni_modules/uni-id-pages/pages/common/webview/webview.vue b/uni_modules/uni-id-pages/pages/common/webview/webview.vue index 4f3a263..cacf97d 100644 --- a/uni_modules/uni-id-pages/pages/common/webview/webview.vue +++ b/uni_modules/uni-id-pages/pages/common/webview/webview.vue @@ -1,40 +1,40 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/login/login-smscode.vue b/uni_modules/uni-id-pages/pages/login/login-smscode.vue index 4a83a27..2294825 100644 --- a/uni_modules/uni-id-pages/pages/login/login-smscode.vue +++ b/uni_modules/uni-id-pages/pages/login/login-smscode.vue @@ -1,123 +1,123 @@ - - - - + + + + diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue index f38956f..8567641 100644 --- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue +++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue @@ -1,229 +1,229 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/register/register-admin.vue b/uni_modules/uni-id-pages/pages/register/register-admin.vue index 9415fa0..8366cd4 100644 --- a/uni_modules/uni-id-pages/pages/register/register-admin.vue +++ b/uni_modules/uni-id-pages/pages/register/register-admin.vue @@ -1,181 +1,181 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/register/register-by-email.vue b/uni_modules/uni-id-pages/pages/register/register-by-email.vue index bb51d43..6f05c8a 100644 --- a/uni_modules/uni-id-pages/pages/register/register-by-email.vue +++ b/uni_modules/uni-id-pages/pages/register/register-by-email.vue @@ -1,216 +1,216 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue b/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue index be71711..d3cf17c 100644 --- a/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue +++ b/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue @@ -1,223 +1,223 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue b/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue index a95f5d8..183c405 100644 --- a/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue +++ b/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue @@ -1,246 +1,246 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue b/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue index 05e798b..1fcf786 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue @@ -1,133 +1,133 @@ - - - - - + + + + + diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue b/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue index ffc0e8b..2317b9b 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue @@ -1,39 +1,39 @@ - - - - - \ No newline at end of file diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md index 160c207..9219f81 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md @@ -1,227 +1,227 @@ -> 插件来源:[https://ext.dcloud.net.cn/plugin?id=3594](https://ext.dcloud.net.cn/plugin?id=3594) -##### 以下是作者写的插件介绍: - -# Clipper 图片裁剪 -> uniapp 图片裁剪,可用于图片头像等裁剪处理 -> [查看更多](http://liangei.gitee.io/limeui/#/clipper)
-> Q群:458377637 - - -## 平台兼容 - -| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | -| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | -| √ | √ | √ | 未测 | √ | √ | √ | - - -## 代码演示 -### 基本用法 -`@success` 事件点击 👉 **确定** 后会返回生成的图片信息,包含 `url`、`width`、`height` - -```html - - - -``` - -```js -// 非uni_modules引入 -import lClipper from '@/components/lime-clipper/' -// uni_modules引入 -import lClipper from '@/uni_modules/lime-clipper/components/lime-clipper/' -export default { - components: {lClipper}, - data() { - return { - show: false, - url: '', - } - } -} -``` - - -### 传入图片 -`image-url`可传入**相对路径**、**临时路径**、**本地路径**、**网络图片**
- -* **当为网络地址时** -* H5:👉 需要解决跨域问题。
-* 小程序:👉 需要配置 downloadFile 域名
- - -```html - - - -``` - -```js -export default { - components: {lClipper}, - data() { - return { - imageUrl: 'https://img12.360buyimg.com/pop/s1180x940_jfs/t1/97205/26/1142/87801/5dbac55aEf795d962/48a4d7a63ff80b8b.jpg', - show: false, - url: '', - } - } -} -``` - - -### 确定按钮颜色 -样式变量名:`--l-clipper-confirm-color` -可放到全局样式的 `page` 里或节点的 `style` -```html - -``` -```css -// css 中为组件设置 CSS 变量 -.clipper { - --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) -} -// 全局 -page { - --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) -} -``` - - -### 使用插槽 -共五个插槽 `cancel` 取消按钮、 `photo` 选择图片按钮、 `rotate` 旋转按钮、 `confirm` 确定按钮和默认插槽。 - -```html - - - - 取消 - 选择图片 - 旋转 - 确定 - - - 显示取消按钮 - - - 显示选择图片按钮 - - - 显示旋转按钮 - - - 显示确定按钮 - - - 锁定裁剪框宽度 - - - 锁定裁剪框高度 - - - 锁定裁剪框比例 - - - 限制移动范围 - - - 禁止缩放 - - - 禁止旋转 - - - - - -``` - -```js -export default { - components: {lClipper}, - data() { - return { - show: false, - url: '', - isLockWidth: false, - isLockHeight: false, - isLockRatio: true, - isLimitMove: false, - isDisableScale: false, - isDisableRotate: false, - isShowCancelBtn: true, - isShowPhotoBtn: true, - isShowRotateBtn: true, - isShowConfirmBtn: true - } - } -} -``` - - -## API - -### Props - -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ------------ | ---------------- | ------------ | -| image-url | 图片路径 | string | | -| quality | 图片的质量,取值范围为 [0, 1],不在范围内时当作1处理 | number | `1` | -| source | `{album: '从相册中选择'}`key为图片来源类型,value为选项说明 | Object | | -| width | 裁剪框宽度,单位为 `rpx` | number | `400` | -| height | 裁剪框高度 | number | `400` | -| min-width | 裁剪框最小宽度 | number | `200` | -| min-height |裁剪框最小高度 | number | `200` | -| max-width | 裁剪框最大宽度 | number | `600` | -| max-height | 裁剪框最大宽度 | number | `600` | -| min-ratio | 图片最小缩放比 | number | `0.5` | -| max-ratio | 图片最大缩放比 | number | `2` | -| rotate-angle | 旋转按钮每次旋转的角度 | number | `90` | -| scale-ratio | 生成图片相对于裁剪框的比例, **比例越高生成图片越清晰** | number | `1` | -| is-lock-width | 是否锁定裁剪框宽度 | boolean | `false` | -| is-lock-height | 是否锁定裁剪框高度上 | boolean | `false` | -| is-lock-ratio | 是否锁定裁剪框比例 | boolean | `true` | -| is-disable-scale | 是否禁止缩放 | boolean | `false` | -| is-disable-rotate | 是否禁止旋转 | boolean | `false` | -| is-limit-move | 是否限制移动范围 | boolean | `false` | -| is-show-photo-btn | 是否显示选择图片按钮 | boolean | `true` | -| is-show-rotate-btn | 是否显示转按钮 | boolean | `true` | -| is-show-confirm-btn | 是否显示确定按钮 | boolean | `true` | -| is-show-cancel-btn | 是否显示关闭按钮 | boolean | `true` | - - - -### 事件 Events - -| 事件名 | 说明 | 回调 | -| ------- | ------------ | -------------- | -| success | 生成图片成功 | {`width`, `height`, `url`} | -| fail | 生成图片失败 | `error` | -| cancel | 关闭 | `false` | -| ready | 图片加载完成 | {`width`, `height`, `path`, `orientation`, `type`} | -| change | 图片大小改变时触发 | {`width`, `height`} | -| rotate | 图片旋转时触发 | `angle` | - -## 常见问题 -> 1、H5端使用网络图片需要解决跨域问题。
-> 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配!
-> 3、H5端生成图片是base64,有时显示只有一半可以使用原生标签``
-> 4、IOS APP 请勿使用HBX2.9.3.20201014的版本!这个版本无法生成图片。
-> 5、APP端无成功反馈、也无失败反馈时,请更新基座和HBX。
- - -## 打赏 -如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。
+> 插件来源:[https://ext.dcloud.net.cn/plugin?id=3594](https://ext.dcloud.net.cn/plugin?id=3594) +##### 以下是作者写的插件介绍: + +# Clipper 图片裁剪 +> uniapp 图片裁剪,可用于图片头像等裁剪处理 +> [查看更多](http://liangei.gitee.io/limeui/#/clipper)
+> Q群:458377637 + + +## 平台兼容 + +| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | +| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | +| √ | √ | √ | 未测 | √ | √ | √ | + + +## 代码演示 +### 基本用法 +`@success` 事件点击 👉 **确定** 后会返回生成的图片信息,包含 `url`、`width`、`height` + +```html + + + +``` + +```js +// 非uni_modules引入 +import lClipper from '@/components/lime-clipper/' +// uni_modules引入 +import lClipper from '@/uni_modules/lime-clipper/components/lime-clipper/' +export default { + components: {lClipper}, + data() { + return { + show: false, + url: '', + } + } +} +``` + + +### 传入图片 +`image-url`可传入**相对路径**、**临时路径**、**本地路径**、**网络图片**
+ +* **当为网络地址时** +* H5:👉 需要解决跨域问题。
+* 小程序:👉 需要配置 downloadFile 域名
+ + +```html + + + +``` + +```js +export default { + components: {lClipper}, + data() { + return { + imageUrl: 'https://img12.360buyimg.com/pop/s1180x940_jfs/t1/97205/26/1142/87801/5dbac55aEf795d962/48a4d7a63ff80b8b.jpg', + show: false, + url: '', + } + } +} +``` + + +### 确定按钮颜色 +样式变量名:`--l-clipper-confirm-color` +可放到全局样式的 `page` 里或节点的 `style` +```html + +``` +```css +// css 中为组件设置 CSS 变量 +.clipper { + --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) +} +// 全局 +page { + --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) +} +``` + + +### 使用插槽 +共五个插槽 `cancel` 取消按钮、 `photo` 选择图片按钮、 `rotate` 旋转按钮、 `confirm` 确定按钮和默认插槽。 + +```html + + + + 取消 + 选择图片 + 旋转 + 确定 + + + 显示取消按钮 + + + 显示选择图片按钮 + + + 显示旋转按钮 + + + 显示确定按钮 + + + 锁定裁剪框宽度 + + + 锁定裁剪框高度 + + + 锁定裁剪框比例 + + + 限制移动范围 + + + 禁止缩放 + + + 禁止旋转 + + + + + +``` + +```js +export default { + components: {lClipper}, + data() { + return { + show: false, + url: '', + isLockWidth: false, + isLockHeight: false, + isLockRatio: true, + isLimitMove: false, + isDisableScale: false, + isDisableRotate: false, + isShowCancelBtn: true, + isShowPhotoBtn: true, + isShowRotateBtn: true, + isShowConfirmBtn: true + } + } +} +``` + + +## API + +### Props + +| 参数 | 说明 | 类型 | 默认值 | +| ------------- | ------------ | ---------------- | ------------ | +| image-url | 图片路径 | string | | +| quality | 图片的质量,取值范围为 [0, 1],不在范围内时当作1处理 | number | `1` | +| source | `{album: '从相册中选择'}`key为图片来源类型,value为选项说明 | Object | | +| width | 裁剪框宽度,单位为 `rpx` | number | `400` | +| height | 裁剪框高度 | number | `400` | +| min-width | 裁剪框最小宽度 | number | `200` | +| min-height |裁剪框最小高度 | number | `200` | +| max-width | 裁剪框最大宽度 | number | `600` | +| max-height | 裁剪框最大宽度 | number | `600` | +| min-ratio | 图片最小缩放比 | number | `0.5` | +| max-ratio | 图片最大缩放比 | number | `2` | +| rotate-angle | 旋转按钮每次旋转的角度 | number | `90` | +| scale-ratio | 生成图片相对于裁剪框的比例, **比例越高生成图片越清晰** | number | `1` | +| is-lock-width | 是否锁定裁剪框宽度 | boolean | `false` | +| is-lock-height | 是否锁定裁剪框高度上 | boolean | `false` | +| is-lock-ratio | 是否锁定裁剪框比例 | boolean | `true` | +| is-disable-scale | 是否禁止缩放 | boolean | `false` | +| is-disable-rotate | 是否禁止旋转 | boolean | `false` | +| is-limit-move | 是否限制移动范围 | boolean | `false` | +| is-show-photo-btn | 是否显示选择图片按钮 | boolean | `true` | +| is-show-rotate-btn | 是否显示转按钮 | boolean | `true` | +| is-show-confirm-btn | 是否显示确定按钮 | boolean | `true` | +| is-show-cancel-btn | 是否显示关闭按钮 | boolean | `true` | + + + +### 事件 Events + +| 事件名 | 说明 | 回调 | +| ------- | ------------ | -------------- | +| success | 生成图片成功 | {`width`, `height`, `url`} | +| fail | 生成图片失败 | `error` | +| cancel | 关闭 | `false` | +| ready | 图片加载完成 | {`width`, `height`, `path`, `orientation`, `type`} | +| change | 图片大小改变时触发 | {`width`, `height`} | +| rotate | 图片旋转时触发 | `angle` | + +## 常见问题 +> 1、H5端使用网络图片需要解决跨域问题。
+> 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配!
+> 3、H5端生成图片是base64,有时显示只有一半可以使用原生标签``
+> 4、IOS APP 请勿使用HBX2.9.3.20201014的版本!这个版本无法生成图片。
+> 5、APP端无成功反馈、也无失败反馈时,请更新基座和HBX。
+ + +## 打赏 +如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。
![输入图片说明](https://images.gitee.com/uploads/images/2020/1122/222521_bb543f96_518581.jpeg "微信图片编辑_20201122220352.jpg") \ No newline at end of file diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg index 4fd415f..7b4b590 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg @@ -1,19 +1,19 @@ - - - - - - - - - + + + + + + + + + diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg index 4cc7dba..0143706 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css index 3794573..ce542bf 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css @@ -1,160 +1,160 @@ -.flex-auto { - flex: auto; -} -.bg-transparent { - background-color: rgba(0,0,0,0.9); - transition-duration: 0.35s; -} -.l-clipper { - width: 100vw; - height: calc(100vh - var(--window-top)); - background-color: rgba(0,0,0,0.9); - position: fixed; - top: var(--window-top); - left: 0; - z-index: 1; -} -.l-clipper-mask { - position: relative; - z-index: 2; - pointer-events: none; -} -.l-clipper__content { - pointer-events: none; - position: absolute; - border: 1rpx solid rgba(255,255,255,0.3); - box-sizing: border-box; - box-shadow: rgba(0,0,0,0.5) 0 0 0 80vh; - background: transparent; -} -.l-clipper__content::before, -.l-clipper__content::after { - content: ''; - position: absolute; - border: 1rpx dashed rgba(255,255,255,0.3); -} -.l-clipper__content::before { - width: 100%; - top: 33.33%; - height: 33.33%; - border-left: none; - border-right: none; -} -.l-clipper__content::after { - width: 33.33%; - left: 33.33%; - height: 100%; - border-top: none; - border-bottom: none; -} -.l-clipper__edge { - position: absolute; - width: 34rpx; - height: 34rpx; - border: 6rpx solid #fff; - pointer-events: auto; -} -.l-clipper__edge::before { - content: ''; - position: absolute; - width: 40rpx; - height: 40rpx; - background-color: transparent; -} -.l-clipper__edge:nth-child(1) { - left: -6rpx; - top: -6rpx; - border-bottom-width: 0 !important; - border-right-width: 0 !important; -} -.l-clipper__edge:nth-child(1):before { - top: -50%; - left: -50%; -} -.l-clipper__edge:nth-child(2) { - right: -6rpx; - top: -6rpx; - border-bottom-width: 0 !important; - border-left-width: 0 !important; -} -.l-clipper__edge:nth-child(2):before { - top: -50%; - left: 50%; -} -.l-clipper__edge:nth-child(3) { - left: -6rpx; - bottom: -6rpx; - border-top-width: 0 !important; - border-right-width: 0 !important; -} -.l-clipper__edge:nth-child(3):before { - bottom: -50%; - left: -50%; -} -.l-clipper__edge:nth-child(4) { - right: -6rpx; - bottom: -6rpx; - border-top-width: 0 !important; - border-left-width: 0 !important; -} -.l-clipper__edge:nth-child(4):before { - bottom: -50%; - left: 50%; -} -.l-clipper-image { - width: 100%; - border-style: none; - position: absolute; - top: 0; - left: 0; - z-index: 1; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - transform-origin: center; -} -.l-clipper-canvas { - position: fixed; - z-index: 10; - left: -200vw; - top: -200vw; - pointer-events: none; -} -.l-clipper-tools { - position: fixed; - left: 0; - bottom: 10px; - width: 100%; - z-index: 99; - color: #fff; -} -.l-clipper-tools__btns { - font-weight: bold; - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - padding: 20rpx 40rpx; - box-sizing: border-box; -} -.l-clipper-tools__btns .cancel { - width: 112rpx; - height: 60rpx; - text-align: center; - line-height: 60rpx; -} -.l-clipper-tools__btns .confirm { - width: 112rpx; - height: 60rpx; - line-height: 60rpx; - background-color: #07c160; - border-radius: 6rpx; - text-align: center; -} -.l-clipper-tools__btns image { - display: block; - width: 60rpx; - height: 60rpx; -} -.l-clipper-tools__btns { - flex-direction: row; -} +.flex-auto { + flex: auto; +} +.bg-transparent { + background-color: rgba(0,0,0,0.9); + transition-duration: 0.35s; +} +.l-clipper { + width: 100vw; + height: calc(100vh - var(--window-top)); + background-color: rgba(0,0,0,0.9); + position: fixed; + top: var(--window-top); + left: 0; + z-index: 1; +} +.l-clipper-mask { + position: relative; + z-index: 2; + pointer-events: none; +} +.l-clipper__content { + pointer-events: none; + position: absolute; + border: 1rpx solid rgba(255,255,255,0.3); + box-sizing: border-box; + box-shadow: rgba(0,0,0,0.5) 0 0 0 80vh; + background: transparent; +} +.l-clipper__content::before, +.l-clipper__content::after { + content: ''; + position: absolute; + border: 1rpx dashed rgba(255,255,255,0.3); +} +.l-clipper__content::before { + width: 100%; + top: 33.33%; + height: 33.33%; + border-left: none; + border-right: none; +} +.l-clipper__content::after { + width: 33.33%; + left: 33.33%; + height: 100%; + border-top: none; + border-bottom: none; +} +.l-clipper__edge { + position: absolute; + width: 34rpx; + height: 34rpx; + border: 6rpx solid #fff; + pointer-events: auto; +} +.l-clipper__edge::before { + content: ''; + position: absolute; + width: 40rpx; + height: 40rpx; + background-color: transparent; +} +.l-clipper__edge:nth-child(1) { + left: -6rpx; + top: -6rpx; + border-bottom-width: 0 !important; + border-right-width: 0 !important; +} +.l-clipper__edge:nth-child(1):before { + top: -50%; + left: -50%; +} +.l-clipper__edge:nth-child(2) { + right: -6rpx; + top: -6rpx; + border-bottom-width: 0 !important; + border-left-width: 0 !important; +} +.l-clipper__edge:nth-child(2):before { + top: -50%; + left: 50%; +} +.l-clipper__edge:nth-child(3) { + left: -6rpx; + bottom: -6rpx; + border-top-width: 0 !important; + border-right-width: 0 !important; +} +.l-clipper__edge:nth-child(3):before { + bottom: -50%; + left: -50%; +} +.l-clipper__edge:nth-child(4) { + right: -6rpx; + bottom: -6rpx; + border-top-width: 0 !important; + border-left-width: 0 !important; +} +.l-clipper__edge:nth-child(4):before { + bottom: -50%; + left: 50%; +} +.l-clipper-image { + width: 100%; + border-style: none; + position: absolute; + top: 0; + left: 0; + z-index: 1; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transform-origin: center; +} +.l-clipper-canvas { + position: fixed; + z-index: 10; + left: -200vw; + top: -200vw; + pointer-events: none; +} +.l-clipper-tools { + position: fixed; + left: 0; + bottom: 10px; + width: 100%; + z-index: 99; + color: #fff; +} +.l-clipper-tools__btns { + font-weight: bold; + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + padding: 20rpx 40rpx; + box-sizing: border-box; +} +.l-clipper-tools__btns .cancel { + width: 112rpx; + height: 60rpx; + text-align: center; + line-height: 60rpx; +} +.l-clipper-tools__btns .confirm { + width: 112rpx; + height: 60rpx; + line-height: 60rpx; + background-color: #07c160; + border-radius: 6rpx; + text-align: center; +} +.l-clipper-tools__btns image { + display: block; + width: 60rpx; + height: 60rpx; +} +.l-clipper-tools__btns { + flex-direction: row; +} diff --git a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue index e6db3ea..4fc62b3 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue @@ -1,820 +1,820 @@ - - - - - \ No newline at end of file diff --git a/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue b/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue index 05ccbbd..1329b7f 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue @@ -1,170 +1,170 @@ - - - - - - + + + + + + diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue index 09701c6..36b34b1 100644 --- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue +++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue @@ -1,251 +1,251 @@ - - - - + + + + diff --git a/uni_modules/uni-id-pages/readme.md b/uni_modules/uni-id-pages/readme.md index 1fa0726..1650e45 100644 --- a/uni_modules/uni-id-pages/readme.md +++ b/uni_modules/uni-id-pages/readme.md @@ -1,15 +1,15 @@ -# 文档已移至uni-id-pages文档[https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html) - - - -关于插件更新的说明: - -所有uni_modules,在HBuilderX里点右键都可以直接升级。或者在插件市场导入覆盖。 - -覆盖时HBuilderX会弹出代码差异比对,可以决定接受哪些更改、拒绝哪些更改。 - -当拒绝局部修改时,注意可能产生兼容性问题。 - -你需要二次开发uni-id-pages的前端页面, -- 如果改动不大,那么每次更新uni-id-pages时,在HBuilderX的对比界面对比一下就好 +# 文档已移至uni-id-pages文档[https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html) + + + +关于插件更新的说明: + +所有uni_modules,在HBuilderX里点右键都可以直接升级。或者在插件市场导入覆盖。 + +覆盖时HBuilderX会弹出代码差异比对,可以决定接受哪些更改、拒绝哪些更改。 + +当拒绝局部修改时,注意可能产生兼容性问题。 + +你需要二次开发uni-id-pages的前端页面, +- 如果改动不大,那么每次更新uni-id-pages时,在HBuilderX的对比界面对比一下就好 - 如果改动较大,建议复制一套前端页面到自己工程的pages目录下,pages.json里只引用根目录pages下的页面,不引用uni_modules下的页面。然后每次uni-id-pages更新,你对比下比上一版uni-id-pages改了什么,看你是否需要再合并到你自己的pages里。pages.json里不引用uni_modules里的页面的话,打包时不会把这些页面打包进去,不影响发行后的包体积 \ No newline at end of file diff --git a/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json b/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json index 163e7c1..c3591cc 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json @@ -1,142 +1,142 @@ -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": true, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "DCloud appid" - }, - "device_id": { - "bsonType": "string", - "description": "设备唯一标识" - }, - "vendor": { - "bsonType": "string", - "description": "设备厂商" - }, - "push_clientid": { - "bsonType": "string", - "description": "推送设备客户端标识" - }, - "imei": { - "bsonType": "string", - "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" - }, - "oaid": { - "bsonType": "string", - "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" - }, - "idfa": { - "bsonType": "string", - "description": "iOS平台配置应用使用广告标识(IDFA)" - }, - "imsi": { - "bsonType": "string", - "description": "国际移动用户识别码(International Mobile Subscriber Identification Number)" - }, - "model": { - "bsonType": "string", - "description": "设备型号" - }, - "platform": { - "bsonType": "string", - "description": "平台类型" - }, - "uni_platform": { - "bsonType": "string", - "description": "uni-app 运行平台,与条件编译平台相同。" - }, - "os_name": { - "bsonType": "string", - "description": "ios|android|windows|mac|linux " - }, - "os_version": { - "bsonType": "string", - "description": "操作系统版本号 " - }, - "os_language": { - "bsonType": "string", - "description": "操作系统语言 " - }, - "os_theme": { - "bsonType": "string", - "description": "操作系统主题 light|dark" - }, - "pixel_ratio": { - "bsonType": "string", - "description": "设备像素比 " - }, - "network_model": { - "bsonType": "string", - "description": "设备网络型号wifi\/3G\/4G\/" - }, - "window_width": { - "bsonType": "string", - "description": "设备窗口宽度 " - }, - "window_height": { - "bsonType": "string", - "description": "设备窗口高度" - }, - "screen_width": { - "bsonType": "string", - "description": "设备屏幕宽度" - }, - "screen_height": { - "bsonType": "string", - "description": "设备屏幕高度" - }, - "rom_name": { - "bsonType": "string", - "description": "rom 名称" - }, - "rom_version": { - "bsonType": "string", - "description": "rom 版本" - }, - "location_latitude": { - "bsonType": "double", - "description": "纬度" - }, - "location_longitude": { - "bsonType": "double", - "description": "经度" - }, - "location_country": { - "bsonType": "string", - "description": "国家" - }, - "location_province": { - "bsonType": "string", - "description": "省份" - }, - "location_city": { - "bsonType": "string", - "description": "城市" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "last_update_date": { - "bsonType": "timestamp", - "description": "最后一次修改时间", - "forceDefaultValue": { - "$env": "now" - } - } - }, - "version": "0.0.1" +{ + "bsonType": "object", + "required": [], + "permission": { + "read": false, + "create": true, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "appid": { + "bsonType": "string", + "description": "DCloud appid" + }, + "device_id": { + "bsonType": "string", + "description": "设备唯一标识" + }, + "vendor": { + "bsonType": "string", + "description": "设备厂商" + }, + "push_clientid": { + "bsonType": "string", + "description": "推送设备客户端标识" + }, + "imei": { + "bsonType": "string", + "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" + }, + "oaid": { + "bsonType": "string", + "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" + }, + "idfa": { + "bsonType": "string", + "description": "iOS平台配置应用使用广告标识(IDFA)" + }, + "imsi": { + "bsonType": "string", + "description": "国际移动用户识别码(International Mobile Subscriber Identification Number)" + }, + "model": { + "bsonType": "string", + "description": "设备型号" + }, + "platform": { + "bsonType": "string", + "description": "平台类型" + }, + "uni_platform": { + "bsonType": "string", + "description": "uni-app 运行平台,与条件编译平台相同。" + }, + "os_name": { + "bsonType": "string", + "description": "ios|android|windows|mac|linux " + }, + "os_version": { + "bsonType": "string", + "description": "操作系统版本号 " + }, + "os_language": { + "bsonType": "string", + "description": "操作系统语言 " + }, + "os_theme": { + "bsonType": "string", + "description": "操作系统主题 light|dark" + }, + "pixel_ratio": { + "bsonType": "string", + "description": "设备像素比 " + }, + "network_model": { + "bsonType": "string", + "description": "设备网络型号wifi\/3G\/4G\/" + }, + "window_width": { + "bsonType": "string", + "description": "设备窗口宽度 " + }, + "window_height": { + "bsonType": "string", + "description": "设备窗口高度" + }, + "screen_width": { + "bsonType": "string", + "description": "设备屏幕宽度" + }, + "screen_height": { + "bsonType": "string", + "description": "设备屏幕高度" + }, + "rom_name": { + "bsonType": "string", + "description": "rom 名称" + }, + "rom_version": { + "bsonType": "string", + "description": "rom 版本" + }, + "location_latitude": { + "bsonType": "double", + "description": "纬度" + }, + "location_longitude": { + "bsonType": "double", + "description": "经度" + }, + "location_country": { + "bsonType": "string", + "description": "国家" + }, + "location_province": { + "bsonType": "string", + "description": "省份" + }, + "location_city": { + "bsonType": "string", + "description": "城市" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "last_update_date": { + "bsonType": "timestamp", + "description": "最后一次修改时间", + "forceDefaultValue": { + "$env": "now" + } + } + }, + "version": "0.0.1" } \ No newline at end of file diff --git a/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json b/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json index 356a6e2..4981d75 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json @@ -1,83 +1,83 @@ -{ - "bsonType": "object", - "required": [ - "user_id" - ], - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "user_id": { - "bsonType": "string", - "description": "用户id,参考uni-id-users表" - }, - "ua": { - "bsonType": "string", - "description": "userAgent" - }, - "uuid": { - "bsonType": "string", - "description": "设备唯一标识(需要加密存储)" - }, - "os_name": { - "bsonType": "string", - "description": "ios|android|windows|mac|linux " - }, - "os_version": { - "bsonType": "string", - "description": "操作系统版本号 " - }, - "os_language": { - "bsonType": "string", - "description": "操作系统语言 " - }, - "os_theme": { - "bsonType": "string", - "description": "操作系统主题 light|dark" - }, - "vendor": { - "bsonType": "string", - "description": "设备厂商" - }, - "push_clientid": { - "bsonType": "string", - "description": "推送设备客户端标识" - }, - "imei": { - "bsonType": "string", - "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" - }, - "oaid": { - "bsonType": "string", - "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" - }, - "idfa": { - "bsonType": "string", - "description": "iOS平台配置应用使用广告标识(IDFA)" - }, - "model": { - "bsonType": "string", - "description": "设备型号" - }, - "platform": { - "bsonType": "string", - "description": "平台类型" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "last_active_date": { - "bsonType": "timestamp", - "description": "最后登录时间" - }, - "last_active_ip": { - "bsonType": "string", - "description": "最后登录IP" - } - }, - "version": "0.0.1" +{ + "bsonType": "object", + "required": [ + "user_id" + ], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "用户id,参考uni-id-users表" + }, + "ua": { + "bsonType": "string", + "description": "userAgent" + }, + "uuid": { + "bsonType": "string", + "description": "设备唯一标识(需要加密存储)" + }, + "os_name": { + "bsonType": "string", + "description": "ios|android|windows|mac|linux " + }, + "os_version": { + "bsonType": "string", + "description": "操作系统版本号 " + }, + "os_language": { + "bsonType": "string", + "description": "操作系统语言 " + }, + "os_theme": { + "bsonType": "string", + "description": "操作系统主题 light|dark" + }, + "vendor": { + "bsonType": "string", + "description": "设备厂商" + }, + "push_clientid": { + "bsonType": "string", + "description": "推送设备客户端标识" + }, + "imei": { + "bsonType": "string", + "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" + }, + "oaid": { + "bsonType": "string", + "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" + }, + "idfa": { + "bsonType": "string", + "description": "iOS平台配置应用使用广告标识(IDFA)" + }, + "model": { + "bsonType": "string", + "description": "设备型号" + }, + "platform": { + "bsonType": "string", + "description": "平台类型" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "last_active_date": { + "bsonType": "timestamp", + "description": "最后登录时间" + }, + "last_active_ip": { + "bsonType": "string", + "description": "最后登录IP" + } + }, + "version": "0.0.1" } \ No newline at end of file diff --git a/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json b/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json index 1b3dc61..ff4f797 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json @@ -1,71 +1,71 @@ -{ - "bsonType": "object", - "required": ["user_id"], - "permission": { - "read": "'READ_UNI_ID_LOG' in auth.permission" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "device_uuid": { - "bsonType": "string", - "description": "设备唯一标识" - }, - "ip": { - "bsonType": "string", - "description": "ip地址" - }, - "state": { - "bsonType": "int", - "description": "结果:0 失败、1 成功" - }, - "type": { - "bsonType": "string", - "description": "操作类型", - "enum": [ - "logout", - "login", - "register", - "reset-pwd", - "bind-mobile", - "bind-weixin", - "bind-qq", - "bind-apple", - "bind-alipay" - ] - }, - "ua": { - "bsonType": "string", - "description": "userAgent" - }, - "user_id": { - "bsonType": "string", - "foreignKey": "uni-id-users._id", - "description": "用户id,参考uni-id-users表" - }, - "username": { - "bsonType": "string", - "description": "用户名" - }, - "email": { - "bsonType": "string", - "description": "邮箱" - }, - "mobile": { - "bsonType": "string", - "description": "手机号" - }, - "appid": { - "bsonType": "string", - "description": "客户端DCloud AppId" - } - } -} +{ + "bsonType": "object", + "required": ["user_id"], + "permission": { + "read": "'READ_UNI_ID_LOG' in auth.permission" + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "device_uuid": { + "bsonType": "string", + "description": "设备唯一标识" + }, + "ip": { + "bsonType": "string", + "description": "ip地址" + }, + "state": { + "bsonType": "int", + "description": "结果:0 失败、1 成功" + }, + "type": { + "bsonType": "string", + "description": "操作类型", + "enum": [ + "logout", + "login", + "register", + "reset-pwd", + "bind-mobile", + "bind-weixin", + "bind-qq", + "bind-apple", + "bind-alipay" + ] + }, + "ua": { + "bsonType": "string", + "description": "userAgent" + }, + "user_id": { + "bsonType": "string", + "foreignKey": "uni-id-users._id", + "description": "用户id,参考uni-id-users表" + }, + "username": { + "bsonType": "string", + "description": "用户名" + }, + "email": { + "bsonType": "string", + "description": "邮箱" + }, + "mobile": { + "bsonType": "string", + "description": "手机号" + }, + "appid": { + "bsonType": "string", + "description": "客户端DCloud AppId" + } + } +} diff --git a/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json b/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json index 0178d25..25209cb 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json @@ -1,52 +1,52 @@ -{ - "bsonType": "object", - "required": ["permission_id", "permission_name"], - "permission": { - "read": "'READ_UNI_ID_PERMISSIONS' in auth.permission", - "create": "'CREATE_UNI_ID_PERMISSIONS' in auth.permission", - "update": "'UPDATE_UNI_ID_PERMISSIONS' in auth.permission", - "delete": "'DELETE_UNI_ID_PERMISSIONS' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID,系统自动生成" - }, - "comment": { - "bsonType": "string", - "component": { - "name": "textarea" - }, - "description": "备注", - "label": "备注", - "title": "备注", - "trim": "both" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "permission_id": { - "bsonType": "string", - "component": { - "name": "input" - }, - "description": "权限唯一标识,不可修改,不允许重复", - "label": "权限标识", - "title": "权限ID", - "trim": "both" - }, - "permission_name": { - "bsonType": "string", - "component": { - "name": "input" - }, - "description": "权限名称", - "label": "权限名称", - "title": "权限名称", - "trim": "both" - } - } -} +{ + "bsonType": "object", + "required": ["permission_id", "permission_name"], + "permission": { + "read": "'READ_UNI_ID_PERMISSIONS' in auth.permission", + "create": "'CREATE_UNI_ID_PERMISSIONS' in auth.permission", + "update": "'UPDATE_UNI_ID_PERMISSIONS' in auth.permission", + "delete": "'DELETE_UNI_ID_PERMISSIONS' in auth.permission" + }, + "properties": { + "_id": { + "description": "存储文档 ID,系统自动生成" + }, + "comment": { + "bsonType": "string", + "component": { + "name": "textarea" + }, + "description": "备注", + "label": "备注", + "title": "备注", + "trim": "both" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "permission_id": { + "bsonType": "string", + "component": { + "name": "input" + }, + "description": "权限唯一标识,不可修改,不允许重复", + "label": "权限标识", + "title": "权限ID", + "trim": "both" + }, + "permission_name": { + "bsonType": "string", + "component": { + "name": "input" + }, + "description": "权限名称", + "label": "权限名称", + "title": "权限名称", + "trim": "both" + } + } +} diff --git a/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json b/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json index b9289c8..e2fe322 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json @@ -1,50 +1,50 @@ -{ - "bsonType": "object", - "required": ["role_id", "role_name"], - "permission": { - "read": "'READ_UNI_ID_ROLES' in auth.permission", - "create": "'CREATE_UNI_ID_ROLES' in auth.permission", - "update": "'UPDATE_UNI_ID_ROLES' in auth.permission", - "delete": "'DELETE_UNI_ID_ROLES' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID,系统自动生成" - }, - "comment": { - "title": "备注", - "bsonType": "string", - "description": "备注", - "trim": "both" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "permission": { - "title": "权限", - "bsonType": "array", - "foreignKey": "uni-id-permissions.permission_id", - "description": "角色拥有的权限列表", - "enum": { - "collection": "uni-id-permissions", - "field": "permission_name as text, permission_id as value" - } - }, - "role_id": { - "title": "唯一ID", - "bsonType": "string", - "description": "角色唯一标识,不可修改,不允许重复", - "trim": "both" - }, - "role_name": { - "title": "名称", - "bsonType": "string", - "description": "角色名称", - "trim": "both" - } - } -} +{ + "bsonType": "object", + "required": ["role_id", "role_name"], + "permission": { + "read": "'READ_UNI_ID_ROLES' in auth.permission", + "create": "'CREATE_UNI_ID_ROLES' in auth.permission", + "update": "'UPDATE_UNI_ID_ROLES' in auth.permission", + "delete": "'DELETE_UNI_ID_ROLES' in auth.permission" + }, + "properties": { + "_id": { + "description": "存储文档 ID,系统自动生成" + }, + "comment": { + "title": "备注", + "bsonType": "string", + "description": "备注", + "trim": "both" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "permission": { + "title": "权限", + "bsonType": "array", + "foreignKey": "uni-id-permissions.permission_id", + "description": "角色拥有的权限列表", + "enum": { + "collection": "uni-id-permissions", + "field": "permission_name as text, permission_id as value" + } + }, + "role_id": { + "title": "唯一ID", + "bsonType": "string", + "description": "角色唯一标识,不可修改,不允许重复", + "trim": "both" + }, + "role_name": { + "title": "名称", + "bsonType": "string", + "description": "角色名称", + "trim": "both" + } + } +} -- GitLab