提交 8f3761f8 编写于 作者: C chenruilong

1.1.15

上级 6362c8b1
## 1.1.15(2023-07-13)
- uni-id-co 修复 QQ登录时不存在头像时报错的问题
## 1.1.14(2023-05-19) ## 1.1.14(2023-05-19)
- 修复 退出登录不会跳转至登录页的问题 - 修复 退出登录不会跳转至登录页的问题
## 1.1.13(2023-05-10) ## 1.1.13(2023-05-10)
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.1.14", "version": "1.1.15",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
class="input-box" placeholder="再次输入密码" maxlength="20" type="password" v-model="formData.password2" class="input-box" placeholder="再次输入密码" maxlength="20" type="password" v-model="formData.password2"
trim="both" /> trim="both" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item> <!-- <uni-forms-item>-->
<uni-captcha ref="captcha" scene="register" v-model="formData.captcha" /> <!-- <uni-captcha ref="captcha" scene="register" v-model="formData.captcha" />-->
</uni-forms-item> <!-- </uni-forms-item>-->
<uni-id-pages-agreements scope="register" ref="agreements" ></uni-id-pages-agreements> <uni-id-pages-agreements scope="register" ref="agreements" ></uni-id-pages-agreements>
<button class="uni-btn" type="primary" @click="submit">注册</button> <button class="uni-btn" type="primary" @click="submit">注册</button>
<button @click="navigateBack" class="register-back">返回</button> <button @click="navigateBack" class="register-back">返回</button>
...@@ -85,14 +85,14 @@ ...@@ -85,14 +85,14 @@
*/ */
submit() { submit() {
this.$refs.form.validate().then((res) => { this.$refs.form.validate().then((res) => {
if(this.formData.captcha.length != 4){ // if(this.formData.captcha.length != 4){
this.$refs.captcha.focusCaptchaInput = true // this.$refs.captcha.focusCaptchaInput = true
return uni.showToast({ // return uni.showToast({
title: '请输入验证码', // title: '请输入验证码',
icon: 'none', // icon: 'none',
duration: 3000 // duration: 3000
}); // });
} // }
if (this.needAgreements && !this.agree) { if (this.needAgreements && !this.agree) {
return this.$refs.agreements.popup(()=>{ return this.$refs.agreements.popup(()=>{
this.submitForm(res) this.submitForm(res)
......
...@@ -67,6 +67,8 @@ module.exports = function () { ...@@ -67,6 +67,8 @@ module.exports = function () {
.join('&') .join('&')
if (isNaN(Number(timestamp)) || (Number(timestamp) + timeout) < Date.now()) { if (isNaN(Number(timestamp)) || (Number(timestamp) + timeout) < Date.now()) {
console.error('[timestamp error], timestamp:', timestamp, 'timeout:', timeout)
throw { throw {
errCode: ERROR.ILLEGAL_REQUEST errCode: ERROR.ILLEGAL_REQUEST
} }
...@@ -75,6 +77,7 @@ module.exports = function () { ...@@ -75,6 +77,7 @@ module.exports = function () {
const reSignature = crypto.createHmac('sha256', `${this.config.requestAuthSecret + nonce}`).update(`${timestamp}${bodyStr}`).digest('hex') const reSignature = crypto.createHmac('sha256', `${this.config.requestAuthSecret + nonce}`).update(`${timestamp}${bodyStr}`).digest('hex')
if (signature !== reSignature.toUpperCase()) { if (signature !== reSignature.toUpperCase()) {
console.error('[signature error], signature:', signature, 'reSignature:', reSignature.toUpperCase(), 'requestAuthSecret:', this.config.requestAuthSecret)
throw { throw {
errCode: ERROR.ILLEGAL_REQUEST errCode: ERROR.ILLEGAL_REQUEST
} }
......
...@@ -119,6 +119,7 @@ module.exports = async function (params = {}) { ...@@ -119,6 +119,7 @@ module.exports = async function (params = {}) {
accessToken, accessToken,
openid openid
}) })
if (avatar) {
// eslint-disable-next-line n/no-deprecated-api // eslint-disable-next-line n/no-deprecated-api
const extName = url.parse(avatar).pathname.split('.').pop() const extName = url.parse(avatar).pathname.split('.').pop()
const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}` const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}`
...@@ -134,13 +135,14 @@ module.exports = async function (params = {}) { ...@@ -134,13 +135,14 @@ module.exports = async function (params = {}) {
cloudPath, cloudPath,
fileContent: getAvatarRes.data fileContent: getAvatarRes.data
}) })
extraData.nickname = nickname
extraData.avatar_file = { extraData.avatar_file = {
name: cloudPath, name: cloudPath,
extname: extName, extname: extName,
url: fileID url: fileID
} }
} }
extraData.nickname = nickname
}
await saveQQUserKey.call(this, { await saveQQUserKey.call(this, {
openid, openid,
sessionKey, sessionKey,
......
{ {
"name": "uni-id-co", "name": "uni-id-co",
"version": "1.1.14", "version": "1.1.15",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"keywords": [], "keywords": [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册