提交 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)
- 重要 新增uni-admin需要的相关依赖和初始化数据(方便uni-admin关联uni-starter后可直接运行)
- 升级依赖的 [uni-id-pages](https://ext.dcloud.net.cn/plugin?name=uni-id-pages) 修复如下问题:
......
{
"id": "uni-starter",
"displayName": "uni-starter",
"version": "2.1.0",
"version": "2.1.1",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"login",
"登录",
"搜索",
"uni-id实例",
"留言板"
],
"login",
"登录",
"搜索",
"uni-id实例",
"留言板"
],
"repository": "https://gitcode.net/dcloud/uni-starter",
"engines": {
"HBuilderX": "^3.2.6"
......@@ -83,8 +83,5 @@
},
"dependencies": {
"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)
- 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236)
## 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}">
<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"
color="#dddddd"></uni-icons>
</button>
</template>
<script>
<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"
color="#dddddd"></uni-icons>
</button>
</template>
<script>
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js'
/**
* uni-id-pages-avatar
* @description 用户头像组件
* @property {String} width 图片的宽,默认为:50px
* @property {String} height 图片的高,默认为:50px
*/
} from '@/uni_modules/uni-id-pages/common/store.js'
/**
* uni-id-pages-avatar
* @description 用户头像组件
* @property {String} width 图片的宽,默认为:50px
* @property {String} height 图片的高,默认为:50px
*/
export default {
data() {
return {
isPC: false
}
},
props: {
//头像图片宽
width: {
type: String,
default () {
return "50px"
}
},
//头像图片高
height: {
type: String,
default () {
return "50px"
}
data() {
return {
isPC: false
}
},
props: {
//头像图片宽
width: {
type: String,
default () {
return "50px"
}
},
//头像图片高
height: {
type: String,
default () {
return "50px"
}
},
border:{
type: Boolean,
default () {
return false
}
}
},
async mounted() {
// #ifdef H5
this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform);
// #endif
},
computed: {
}
},
async mounted() {
// #ifdef H5
this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform);
// #endif
},
computed: {
hasLogin() {
return store.hasLogin
},
......@@ -58,21 +58,44 @@
return store.userInfo
},
avatar_file() {
return store.userInfo.avatar_file
}
},
methods: {
setAvatarFile(avatar_file) {
return store.userInfo.avatar_file
}
},
methods: {
setAvatarFile(avatar_file) {
// 使用 clientDB 提交数据
mutations.updateUserInfo({avatar_file})
mutations.updateUserInfo({avatar_file})
},
async bindchooseavatar(res){
let avatarUrl = res.detail.avatarUrl
let avatar_file = {
extname: avatarUrl.split('.')[avatarUrl.split('.').length - 1],
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()
avatar_file.name = cloudPath
......@@ -84,7 +107,7 @@
let {
fileID
} = await uniCloud.uploadFile({
filePath:avatarUrl,
filePath,
cloudPath,
fileType: "image"
});
......@@ -93,20 +116,20 @@
}catch(e){
console.error(e);
}
console.log('avatar_file',avatar_file);
this.setAvatarFile(avatar_file)
},
},
uploadAvatarImg(res) {
// #ifdef MP-WEIXIN
return false // 微信小程序走 bindchooseavatar方法
// #endif
// #ifndef MP-WEIXIN
if(!this.hasLogin){
return uni.navigateTo({
url:'/uni_modules/uni-id-pages/pages/login/login-withoutpwd'
})
}
const crop = {
quality: 100,
width: 600,
......@@ -169,12 +192,11 @@
this.setAvatarFile(avatar_file)
}
})
// #endif
}
}
}
</script>
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
.box{
......@@ -184,17 +206,17 @@
.box{
padding: 0;
}
.chooseAvatar {
/* #ifndef APP-NVUE */
.chooseAvatar {
/* #ifndef APP-NVUE */
display: inline-block;
box-sizing: border-box;
/* #endif */
border-radius: 10px;
box-sizing: border-box;
/* #endif */
border-radius: 10px;
text-align: center;
padding: 1px;
}
.showBorder{
border: solid 1px #ddd;
}
</style>
}
</style>
......@@ -211,22 +211,22 @@
} else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启
uni.navigateBack();
} else if (this.getRoute(1) != path) {
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);
}
})
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);
......
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
"version": "1.1.15",
"version": "1.1.1",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
......
......@@ -11,11 +11,6 @@
</uni-list-item>
<uni-list-item v-if="userInfo.email" class="item" title="电子邮箱" :rightText="userInfo.email">
</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>
</uni-list>
......@@ -37,24 +32,17 @@
</view>
</template>
<script>
const uniIdCo = uniCloud.importObject("uni-id-co")
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js'
const uniIdCo = uniCloud.importObject("uni-id-co")
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js'
export default {
computed: {
userInfo() {
return store.userInfo
},
realNameStatus () {
if (!this.userInfo.realNameAuth) {
return 0
}
return this.userInfo.realNameAuth.authStatus
}
},
computed: {
userInfo() {
return store.userInfo
}
},
data() {
return {
univerifyStyle: {
......@@ -71,8 +59,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
// },
hasPwd: false,
showLoginManage: false ,//通过页面传参隐藏登录&退出登录按钮
setNicknameIng:false,
uniToken:''
setNicknameIng:false
}
},
async onShow() {
......@@ -87,10 +74,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
let res = await uniIdCo.getAccountInfo()
this.hasPwd = res.isPasswordSet
},
onReady() {
this.uniToken = uni.getStorageSync('uni_id_token')
console.log("uniToken: ----", this.uniToken);
},
methods: {
login() {
uni.navigateTo({
......@@ -171,12 +154,13 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
this.setNicknameIng = false
this.$refs.dialog.close()
} else {
this.setNicknameIng = true
this.$refs.dialog.open()
}
},
deactivate(){
deactivate() {
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) {
......@@ -186,7 +170,7 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
alipay: 'ali_openid',
apple: 'apple_openid',
qq: 'qq_openid'
}[provider.toLowerCase()]
} [provider.toLowerCase()]
if (this.userInfo[bindField]) {
await uniIdCo['unbind' + provider]()
......@@ -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)
- uni-popup-dialog 组件新增 inputType 属性
## 1.8.1(2022-12-01)
......
{
"id": "uni-popup",
"displayName": "uni-popup 弹出层",
"version": "1.8.3",
"version": "1.8.2",
"description": " Popup 组件,提供常用的弹层",
"keywords": [
"uni-ui",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册