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

更新依赖的modules版本

上级 5c122dae
## 1.1.14(2023-05-19)
- 修复 退出登录不会跳转至登录页的问题
## 1.1.13(2023-05-10)
- 修复 启用摇树优化 报错的问题
## 1.1.12(2023-05-05)
- uni-id-co 新增 调用 add-user 接口创建用户时允许触发 beforeRegister 钩子方法,beforeRegister 钩子[详见](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register)
- uni-id-co 新增 自无 unionid 到有 unionid 状态进行登录时为用户补充 unionid 字段
- uni-id-co 修复 i18n 在特定场景下报错的 bug
- uni-id-co 修复 跨平台解绑微信/QQ时无法解绑的 bug
- uni-id-co 修复 微信小程序等平台创建验证码时无法展示的 bug
- uni-id-co 修复 更新 push_clientid 时因 device_id 没有变化导致无法更新
## 1.1.11(2023-03-24)
- 修复 tabbar页面因为token无效而强制跳转至登录页面(url参数包含`uniIdRedirectUrl`)后无法返回的问题
## 1.1.10(2023-03-24)
......
export default function checkIdCard (idCardNumber) {
function checkIdCard (idCardNumber) {
if (!idCardNumber || typeof idCardNumber !== 'string' || idCardNumber.length !== 18) return false
const coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
......@@ -12,3 +12,5 @@ export default function checkIdCard (idCardNumber) {
return checkCode[sum % 11].toString() === code.toLowerCase()
}
export default checkIdCard
......@@ -79,7 +79,7 @@ export const mutations = {
uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0)
uni.redirectTo({
url: `/${pagesJson.uniIdRouter && pagesJson.uniIdRouter.loginPage ? 'uni_modules/uni-id-pages/pages/login/login-withoutpwd': ''}`,
url: `/${pagesJson.uniIdRouter && pagesJson.uniIdRouter.loginPage ? pagesJson.uniIdRouter.loginPage: 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`,
});
uni.$emit('uni-id-pages-logout')
this.setUserInfo({},{cover:true})
......
......@@ -202,7 +202,6 @@
return '/' + pages[pages.length - n].route
},
toPage(path,index = 0) {
let type = ['navigateTo','redirectTo'][index]
//console.log('比较', this.getRoute(1),this.getRoute(2), path)
if (this.getRoute(1) == path.split('?')[0] && this.getRoute(1) ==
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd') {
......@@ -212,13 +211,23 @@
} else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启
uni.navigateBack();
} else if (this.getRoute(1) != path) {
uni[type]({
if(index === 0){
uni.navigateTo({
url: path,
animationType: 'slide-in-left',
complete(e) {
// console.log(e);
}
})
}else{
uni.redirectTo({
url: path,
animationType: 'slide-in-left',
complete(e) {
// console.log(e);
}
})
}
} else {
console.log('出乎意料的情况,path:' + path);
}
......
......@@ -17,24 +17,14 @@ export default {
// "douyin",
// #ifdef APP
// 'univerify',
'univerify',
// #endif
// #ifdef MP-WEIXIN
'weixin',
// #endif
// #ifndef MP-WEIXIN
'username',
// #endif
// #ifdef APP
'apple',
// #endif
// #ifndef MP-WEIXIN
'smsCode',
// #endif
'smsCode'
],
// 政策协议
agreements: {
......@@ -62,7 +52,7 @@ export default {
* weak(弱:密码必须包含字母和数字,长度范围:6-16位之间)
* 为空或false则不验证密码强度
*/
// passwordStrength: 'medium',
passwordStrength: 'medium',
/**
* 登录后允许用户设置密码(只针对未设置密码得用户)
* 开启此功能将 setPasswordAfterLogin 设置为 true 即可
......
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
"version": "1.1.11",
"version": "1.1.14",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
......
......@@ -152,7 +152,7 @@
@media screen and (min-width: 690px) {
.uni-content {
height: 600px;
height: auto;
}
}
......
......@@ -40,8 +40,9 @@
</template>
<script>
import checkIdCard from '@/uni_modules/uni-id-pages/common/check-id-card.js'
import checkIdCard from '@/uni_modules/uni-id-pages/common/check-id-card.js';
import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js';
import {
store,
mutations
......
......@@ -212,11 +212,16 @@ module.exports = {
}
// 国际化
const messages = require('./lang/index')
const fallbackLocale = 'zh-Hans'
const i18n = uniCloud.initI18n({
locale: clientInfo.locale,
fallbackLocale: 'zh-Hans',
messages: require('./lang/index')
fallbackLocale,
messages: JSON.parse(JSON.stringify(messages))
})
if (!messages[i18n.locale]) {
i18n.setLocale(fallbackLocale)
}
this.t = i18n.t.bind(i18n)
this.response = {}
......
......@@ -173,8 +173,8 @@ async function thirdPartyLogin (params = {}) {
user
} = params
return {
mobileComfirmd: user.mobile_comfirmd,
emailComfirmd: user.email_comfirmd
mobileConfirmed: !!user.mobile_confirmed,
emailConfirmed: !!user.email_confirmed
}
}
......
......@@ -113,7 +113,17 @@ module.exports = async function (params = {}) {
data.mobile_confirmed = 1
}
await userCollection.add(data)
// 触发 beforeRegister 钩子
const beforeRegister = this.hooks.beforeRegister
let userRecord = data
if (beforeRegister) {
userRecord = await beforeRegister({
userRecord,
clientInfo: this.getUniversalClientInfo()
})
}
await userCollection.add(userRecord)
return {
errCode: 0,
errMsg: ''
......
......@@ -70,6 +70,7 @@ module.exports = async function (params) {
status: REAL_NAME_STATUS.CERTIFY_FAILED
})
console.log(ERROR.FRV_FAIL, 'error: ', res)
throw {
errCode: ERROR.FRV_FAIL
}
......
......@@ -108,7 +108,8 @@ module.exports = async function (params = {}) {
const extraData = {
qq_openid: {
[`${qqPlatform}_${appId}`]: openid
}
},
qq_unionid: unionid
}
if (type === 'register' && qqPlatform !== 'mp') {
const {
......
......@@ -110,7 +110,8 @@ module.exports = async function (params = {}) {
const extraData = {
wx_openid: {
[`${weixinPlatform}_${appId}`]: openid
}
},
wx_unionid: unionid
}
if (type === 'register' && weixinPlatform !== 'mp') {
const {
......
......@@ -5,10 +5,6 @@ const {
const {
LOG_TYPE, dbCmd
} = require('../../common/constants')
const {
getQQPlatform
} = require('../../lib/utils/qq')
/**
* 解绑QQ
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-qq
......@@ -16,20 +12,11 @@ const {
*/
module.exports = async function () {
const { uid } = this.authInfo
const { appId } = this.getUniversalClientInfo()
const qqPlatform = getQQPlatform.call(this)
await preUnBind.call(this, {
uid,
unBindAccount: {
qq_openid: dbCmd.or([
{
[qqPlatform]: dbCmd.exists(true)
},
{
[`${qqPlatform}_${appId}`]: dbCmd.exists(true)
}
]),
qq_openid: dbCmd.exists(true),
qq_unionid: dbCmd.exists(true)
},
logType: LOG_TYPE.UNBIND_QQ
......
......@@ -16,14 +16,12 @@ const {
*/
module.exports = async function () {
const { uid } = this.authInfo
const weixinPlatform = getWeixinPlatform.call(this)
// const weixinPlatform = getWeixinPlatform.call(this)
await preUnBind.call(this, {
uid,
unBindAccount: {
wx_openid: {
[weixinPlatform]: dbCmd.exists(true)
},
wx_openid: dbCmd.exists(true),
wx_unionid: dbCmd.exists(true)
},
logType: LOG_TYPE.UNBIND_WEIXIN
......
......@@ -117,11 +117,7 @@ module.exports = async function (params = {}) {
errCode: 0
}
}
// 同一用户允许更新token_expired,不同用户在token_expired小于Date.now()时允许更新。搭配逻辑:用户退出登录时将token_expired置0
if (
deviceRecord.user_id === uid ||
(deviceRecord.token_expired < Date.now())
) {
await deviceCollection.where({
device_id: deviceId
}).update({
......@@ -133,9 +129,4 @@ module.exports = async function (params = {}) {
return {
errCode: 0
}
}
return {
errCode: ERROR.SYSTEM_ERROR
}
}
......@@ -18,7 +18,7 @@ module.exports = async function (params = {}) {
}
this.middleware.validate(params, schema)
const deviceId = this.getUniversalClientInfo().deviceId
const { deviceId, platform } = this.getUniversalClientInfo()
const {
scene
} = params
......@@ -29,6 +29,7 @@ module.exports = async function (params = {}) {
}
return this.uniCaptcha.create({
deviceId,
scene
scene,
uniPlatform: platform
})
}
......@@ -18,7 +18,8 @@ module.exports = async function (params = {}) {
}
this.middleware.validate(params, schema)
const deviceId = this.getUniversalClientInfo().deviceId
const { deviceId, platform } = this.getUniversalClientInfo()
const {
scene
} = params
......@@ -29,6 +30,7 @@ module.exports = async function (params = {}) {
}
return this.uniCaptcha.refresh({
deviceId,
scene
scene,
uniPlatform: platform
})
}
{
"name": "uni-id-co",
"version": "1.1.10",
"version": "1.1.14",
"description": "",
"main": "index.js",
"keywords": [],
......
## 1.2.0(2023-04-27)
- 优化 微信小程序平台 使用微信新增 API getStableAccessToken 获取 access_token, access_token 有效期内重复调用该接口不会更新 access_token, [详情](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getStableAccessToken.html)
## 1.1.5(2023-03-27)
- 修复 微信小程序平台 某些情况下 encrypt_key 插入错误的问题
## 1.1.4(2023-03-13)
......
{
"id": "uni-open-bridge-common",
"displayName": "uni-open-bridge-common",
"version": "1.1.5",
"version": "1.2.0",
"description": "统一接管微信等三方平台认证凭据",
"keywords": [
"uni-open-bridge-common",
......
......@@ -20,8 +20,8 @@ class WeixinServer {
getAccessToken() {
return uniCloud.httpclient.request(WeixinServer.AccessToken_Url, {
dataType: 'json',
method: 'GET',
dataAsQueryString: true,
method: 'POST',
contentType: 'json',
data: {
appid: this._appid,
secret: this._secret,
......@@ -106,7 +106,7 @@ class WeixinServer {
}
}
WeixinServer.AccessToken_Url = 'https://api.weixin.qq.com/cgi-bin/token'
WeixinServer.AccessToken_Url = 'https://api.weixin.qq.com/cgi-bin/stable_token'
WeixinServer.Code2Session_Url = 'https://api.weixin.qq.com/sns/jscode2session'
WeixinServer.User_Encrypt_Key_Url = 'https://api.weixin.qq.com/wxa/business/getuserencryptkey'
WeixinServer.AccessToken_H5_Url = 'https://api.weixin.qq.com/cgi-bin/token'
......
## 1.3.2(2023-05-04)
- 修复 NVUE 平台报错的问题
## 1.3.1(2021-11-23)
- 修复 init 方法初始化问题
## 1.3.0(2021-11-19)
......
......@@ -10,7 +10,10 @@ const nvueAnimation = uni.requireNativePlugin('animation')
class MPAnimation {
constructor(options, _this) {
this.options = options
this.animation = uni.createAnimation(options)
// 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
this.animation = uni.createAnimation({
...options
})
this.currentStepAnimates = {}
this.next = 0
this.$ = _this
......
<template>
<!-- #ifndef APP-NVUE -->
<view v-show="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick"><slot></slot></view>
<!-- #endif -->
</template>
<script>
......@@ -48,7 +53,11 @@ export default {
customClass:{
type: String,
default: ''
}
},
onceRender:{
type:Boolean,
default:false
},
},
data() {
return {
......
{
"id": "uni-transition",
"displayName": "uni-transition 过渡动画",
"version": "1.3.1",
"version": "1.3.2",
"description": "元素的简单过渡动画",
"keywords": [
"uni-ui",
......@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册