提交 83a26e41 编写于 作者: DCloud_JSON's avatar DCloud_JSON 提交者: Anne_LXM

2.1.1

上级 cf7a021e
## 2.1.1(2023-02-02)
- 重要 分包加载uni-id-pages 优化后 运行时主包大小为:637KB 分包为:78KB,发布后主包大小为:585KB 分包为:75KB
- 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236)
## 2.1.0(2023-01-17) ## 2.1.0(2023-01-17)
- 重要 新增uni-admin需要的相关依赖和初始化数据(方便uni-admin关联uni-starter后可直接运行) - 重要 新增uni-admin需要的相关依赖和初始化数据(方便uni-admin关联uni-starter后可直接运行)
- 升级依赖的 [uni-id-pages](https://ext.dcloud.net.cn/plugin?name=uni-id-pages) 修复如下问题: - 升级依赖的 [uni-id-pages](https://ext.dcloud.net.cn/plugin?name=uni-id-pages) 修复如下问题:
......
{ {
"id": "uni-starter", "id": "uni-starter",
"displayName": "uni-starter", "displayName": "uni-starter",
"version": "2.1.0", "version": "2.1.1",
"description": "云端一体应用快速开发基本项目模版", "description": "云端一体应用快速开发基本项目模版",
"keywords": [ "keywords": [
"login", "login",
"登录", "登录",
"搜索", "搜索",
"uni-id实例", "uni-id实例",
"留言板" "留言板"
], ],
"repository": "https://gitcode.net/dcloud/uni-starter", "repository": "https://gitcode.net/dcloud/uni-starter",
"engines": { "engines": {
"HBuilderX": "^3.2.6" "HBuilderX": "^3.2.6"
...@@ -83,8 +83,5 @@ ...@@ -83,8 +83,5 @@
}, },
"dependencies": { "dependencies": {
"qrcodejs2": "^0.0.2" "qrcodejs2": "^0.0.2"
},
"devDependencies": {
"jest-image-snapshot": "^6.1.0"
} }
} }
## 1.1.15(2023-07-13)
- uni-id-co 修复 QQ登录时不存在头像时报错的问题
## 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)
- 修复 PC微信扫码登录跳转地址错误
- uni-id-co 新增 请求鉴权支持 uni-cloud-s2s 模块验证签名 [uni-cloud-s2s文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html)
## 1.1.9(2023-03-24)
- 修复 跳转至登录页面的url参数包含`uniIdRedirectUrl`后无法返回的问题
## 1.1.8(2023-03-02)
- 修复 调试模式下没有对微信授权手机号登录方式进行配置检测
## 1.1.7(2023-02-27)
- 【重要】新增 实名认证功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#frv)
## 1.1.6(2023-02-24)
- uni-id-co 新增 注册用户时允许配置默认角色 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#config-defult-role)
- uni-id-co 优化 `updateUserInfoByExternal`接口,允许修改头像、性别
- uni-id-co 修复 请求签名密钥字段 `requestAuthSecret` 缺少为空判断
- uni-id-co 修复 `externalRegister`接口头像未使用`avatar_file`字段保存
- 修复 web微信登录回调地址不正确
## 1.1.5(2023-02-23)
- 更新 微信小程序端 更新头像信息,如果是使用微信的头像则不再调用裁剪接口
## 1.1.4(2023-02-21)
- 修复 部分情况下 `uniIdRedirectUrl` 参数无效的问题
## 1.1.3(2023-02-20)
- 修复 非微信小程序端报`TypeError: uni.hideHomeButton is not a function`的问题
## 1.1.2(2023-02-10)
- 新增 微信小程序端 首页需强制登录时,隐藏返回首页按钮
- uni-id-co 新增 外部联登后修改用户信息接口(updateUserInfoByExternal) [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo)
- uni-id-co 优化外部联登接口(登录、注册)逻辑
## 1.1.1(2023-02-02) ## 1.1.1(2023-02-02)
- 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236) - 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236)
## 1.1.0(2023-01-31) ## 1.1.0(2023-01-31)
......
<template> <template>
<button open-type="chooseAvatar" @chooseavatar="bindchooseavatar" @click="uploadAvatarImg" class="box" :class="{'showBorder':border}" :style="{width,height,lineHeight:height}"> <button open-type="chooseAvatar" @chooseavatar="bindchooseavatar" @click="uploadAvatarImg" class="box" :class="{'showBorder':border}" :style="{width,height,lineHeight:height}">
<cloud-image v-if="avatar_file" :src="avatar_file.url" :width="width" :height="height"></cloud-image> <cloud-image v-if="avatar_file" :src="avatar_file.url" :width="width" :height="height"></cloud-image>
<uni-icons v-else :style="{width,height,lineHeight:height}" class="chooseAvatar" type="plusempty" size="30" <uni-icons v-else :style="{width,height,lineHeight:height}" class="chooseAvatar" type="plusempty" size="30"
color="#dddddd"></uni-icons> color="#dddddd"></uni-icons>
</button> </button>
</template> </template>
<script> <script>
import { import {
store, store,
mutations mutations
} from '@/uni_modules/uni-id-pages/common/store.js' } from '@/uni_modules/uni-id-pages/common/store.js'
/** /**
* uni-id-pages-avatar * uni-id-pages-avatar
* @description 用户头像组件 * @description 用户头像组件
* @property {String} width 图片的宽,默认为:50px * @property {String} width 图片的宽,默认为:50px
* @property {String} height 图片的高,默认为:50px * @property {String} height 图片的高,默认为:50px
*/ */
export default { export default {
data() { data() {
return { return {
isPC: false isPC: false
} }
}, },
props: { props: {
//头像图片宽 //头像图片宽
width: { width: {
type: String, type: String,
default () { default () {
return "50px" return "50px"
} }
}, },
//头像图片高 //头像图片高
height: { height: {
type: String, type: String,
default () { default () {
return "50px" return "50px"
} }
}, },
border:{ border:{
type: Boolean, type: Boolean,
default () { default () {
return false return false
} }
} }
}, },
async mounted() { async mounted() {
// #ifdef H5 // #ifdef H5
this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform); this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform);
// #endif // #endif
}, },
computed: { computed: {
hasLogin() { hasLogin() {
return store.hasLogin return store.hasLogin
}, },
...@@ -58,21 +58,44 @@ ...@@ -58,21 +58,44 @@
return store.userInfo return store.userInfo
}, },
avatar_file() { avatar_file() {
return store.userInfo.avatar_file return store.userInfo.avatar_file
} }
}, },
methods: { methods: {
setAvatarFile(avatar_file) { setAvatarFile(avatar_file) {
// 使用 clientDB 提交数据 // 使用 clientDB 提交数据
mutations.updateUserInfo({avatar_file}) mutations.updateUserInfo({avatar_file})
}, },
async bindchooseavatar(res){ async bindchooseavatar(res){
let avatarUrl = res.detail.avatarUrl let avatarUrl = res.detail.avatarUrl
let avatar_file = { let avatar_file = {
extname: avatarUrl.split('.')[avatarUrl.split('.').length - 1], extname: avatarUrl.split('.')[avatarUrl.split('.').length - 1],
name:'', name:'',
url:'' url:avatarUrl
} }
// 裁剪
let filePath = await new Promise((callback) => {
wx.cropImage({
src:avatarUrl,
cropScale:"1:1",
success: res => {
callback(res.tempFilePath)
},
fail(e){
console.error(e)
uni.showModal({
content: 'wx.cropImage ' + e.errMsg,
showCancel: false,
confirmText:"跳过裁剪",
complete() {
callback(avatarUrl)
}
});
}
})
})
//上传到服务器 //上传到服务器
let cloudPath = this.userInfo._id + '' + Date.now() let cloudPath = this.userInfo._id + '' + Date.now()
avatar_file.name = cloudPath avatar_file.name = cloudPath
...@@ -84,7 +107,7 @@ ...@@ -84,7 +107,7 @@
let { let {
fileID fileID
} = await uniCloud.uploadFile({ } = await uniCloud.uploadFile({
filePath:avatarUrl, filePath,
cloudPath, cloudPath,
fileType: "image" fileType: "image"
}); });
...@@ -93,20 +116,20 @@ ...@@ -93,20 +116,20 @@
}catch(e){ }catch(e){
console.error(e); console.error(e);
} }
console.log('avatar_file',avatar_file);
this.setAvatarFile(avatar_file) this.setAvatarFile(avatar_file)
}, },
uploadAvatarImg(res) { uploadAvatarImg(res) {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
return false // 微信小程序走 bindchooseavatar方法 return false // 微信小程序走 bindchooseavatar方法
// #endif // #endif
// #ifndef MP-WEIXIN
if(!this.hasLogin){ if(!this.hasLogin){
return uni.navigateTo({ return uni.navigateTo({
url:'/uni_modules/uni-id-pages/pages/login/login-withoutpwd' url:'/uni_modules/uni-id-pages/pages/login/login-withoutpwd'
}) })
} }
const crop = { const crop = {
quality: 100, quality: 100,
width: 600, width: 600,
...@@ -169,12 +192,11 @@ ...@@ -169,12 +192,11 @@
this.setAvatarFile(avatar_file) this.setAvatarFile(avatar_file)
} }
}) })
// #endif }
} }
} }
} </script>
</script>
<style> <style>
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
.box{ .box{
...@@ -184,17 +206,17 @@ ...@@ -184,17 +206,17 @@
.box{ .box{
padding: 0; padding: 0;
} }
.chooseAvatar { .chooseAvatar {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
padding: 1px; padding: 1px;
} }
.showBorder{ .showBorder{
border: solid 1px #ddd; border: solid 1px #ddd;
} }
</style> </style>
...@@ -211,22 +211,22 @@ ...@@ -211,22 +211,22 @@
} else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启 } else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启
uni.navigateBack(); uni.navigateBack();
} else if (this.getRoute(1) != path) { } else if (this.getRoute(1) != path) {
if(index === 0){ if(index === 0){
uni.navigateTo({ uni.navigateTo({
url: path, url: path,
animationType: 'slide-in-left', animationType: 'slide-in-left',
complete(e) { complete(e) {
// console.log(e); // console.log(e);
} }
}) })
}else{ }else{
uni.redirectTo({ uni.redirectTo({
url: path, url: path,
animationType: 'slide-in-left', animationType: 'slide-in-left',
complete(e) { complete(e) {
// console.log(e); // console.log(e);
} }
}) })
} }
} else { } else {
console.log('出乎意料的情况,path:' + path); console.log('出乎意料的情况,path:' + path);
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.1.15", "version": "1.1.1",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
......
...@@ -11,11 +11,6 @@ ...@@ -11,11 +11,6 @@
</uni-list-item> </uni-list-item>
<uni-list-item v-if="userInfo.email" class="item" title="电子邮箱" :rightText="userInfo.email"> <uni-list-item v-if="userInfo.email" class="item" title="电子邮箱" :rightText="userInfo.email">
</uni-list-item> </uni-list-item>
<!-- #ifdef APP -->
<!-- 如未开通实人认证服务,可以将实名认证入口注释 -->
<uni-list-item class="item" @click="realNameVerify" title="实名认证" :rightText="realNameStatus !== 2 ? '未认证': '已认证'" link>
</uni-list-item>
<!-- #endif -->
<uni-list-item v-if="hasPwd" class="item" @click="changePassword" title="修改密码" link> <uni-list-item v-if="hasPwd" class="item" @click="changePassword" title="修改密码" link>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
...@@ -37,24 +32,17 @@ ...@@ -37,24 +32,17 @@
</view> </view>
</template> </template>
<script> <script>
const uniIdCo = uniCloud.importObject("uni-id-co") const uniIdCo = uniCloud.importObject("uni-id-co")
import { import {
store, store,
mutations mutations
} from '@/uni_modules/uni-id-pages/common/store.js' } from '@/uni_modules/uni-id-pages/common/store.js'
export default { export default {
computed: { computed: {
userInfo() { userInfo() {
return store.userInfo return store.userInfo
}, }
realNameStatus () { },
if (!this.userInfo.realNameAuth) {
return 0
}
return this.userInfo.realNameAuth.authStatus
}
},
data() { data() {
return { return {
univerifyStyle: { univerifyStyle: {
...@@ -71,8 +59,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co") ...@@ -71,8 +59,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
// }, // },
hasPwd: false, hasPwd: false,
showLoginManage: false ,//通过页面传参隐藏登录&退出登录按钮 showLoginManage: false ,//通过页面传参隐藏登录&退出登录按钮
setNicknameIng:false, setNicknameIng:false
uniToken:''
} }
}, },
async onShow() { async onShow() {
...@@ -87,10 +74,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co") ...@@ -87,10 +74,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
let res = await uniIdCo.getAccountInfo() let res = await uniIdCo.getAccountInfo()
this.hasPwd = res.isPasswordSet this.hasPwd = res.isPasswordSet
}, },
onReady() {
this.uniToken = uni.getStorageSync('uni_id_token')
console.log("uniToken: ----", this.uniToken);
},
methods: { methods: {
login() { login() {
uni.navigateTo({ uni.navigateTo({
...@@ -171,12 +154,13 @@ const uniIdCo = uniCloud.importObject("uni-id-co") ...@@ -171,12 +154,13 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
this.setNicknameIng = false this.setNicknameIng = false
this.$refs.dialog.close() this.$refs.dialog.close()
} else { } else {
this.setNicknameIng = true
this.$refs.dialog.open() this.$refs.dialog.open()
} }
}, },
deactivate(){ deactivate() {
uni.navigateTo({ uni.navigateTo({
url:"/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate" url: "/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate"
}) })
}, },
async bindThirdAccount(provider) { async bindThirdAccount(provider) {
...@@ -186,7 +170,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co") ...@@ -186,7 +170,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
alipay: 'ali_openid', alipay: 'ali_openid',
apple: 'apple_openid', apple: 'apple_openid',
qq: 'qq_openid' qq: 'qq_openid'
}[provider.toLowerCase()] } [provider.toLowerCase()]
if (this.userInfo[bindField]) { if (this.userInfo[bindField]) {
await uniIdCo['unbind' + provider]() await uniIdCo['unbind' + provider]()
...@@ -213,11 +197,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co") ...@@ -213,11 +197,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
} }
}) })
} }
},
realNameVerify () {
uni.navigateTo({
url: "/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify"
})
} }
} }
} }
......
## 1.8.3(2023-04-17)
- 修复 uni-popup 重复打开时的 bug
## 1.8.2(2023-02-02) ## 1.8.2(2023-02-02)
- uni-popup-dialog 组件新增 inputType 属性 - uni-popup-dialog 组件新增 inputType 属性
## 1.8.1(2022-12-01) ## 1.8.1(2022-12-01)
......
{ {
"id": "uni-popup", "id": "uni-popup",
"displayName": "uni-popup 弹出层", "displayName": "uni-popup 弹出层",
"version": "1.8.3", "version": "1.8.2",
"description": " Popup 组件,提供常用的弹层", "description": " Popup 组件,提供常用的弹层",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册