diff --git a/changelog.md b/changelog.md index f012130add1d0dcad5b0e248a7630660feab333f..536e4c0d6421ce66ccd66f7cedc56bbbeeae5d33 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.2.8(2022-09-01) ++ 修复 iOS端,一键登录功能卡在showLoading的问题 ## 1.2.7(2022-08-10) - 修复微信小程序绑定手机号失败的问题 ## 1.2.6(2022-06-29) diff --git a/components/uni-quick-login/uni-quick-login.vue b/components/uni-quick-login/uni-quick-login.vue index cd8662c78f100e78677da3ac7b005a745438fa1e..1dc4204f7adb547e9c0b0a4aef0ba2a655b137cc 100644 --- a/components/uni-quick-login/uni-quick-login.vue +++ b/components/uni-quick-login/uni-quick-login.vue @@ -190,10 +190,8 @@ icon: 'none' }); } - uni.showLoading({mask: true}) - if (type == 'univerify' && uni.getUniverifyManager) { + if (type == 'univerify') { let univerifyManager = uni.getUniverifyManager() - console.log('是新版'); let onButtonsClickFn = async res =>{ console.log('点击了第三方登录,provider:',res, res.provider,this.univerifyStyle.buttons.list); //同步一键登录弹出层隐私协议框是否打勾 @@ -231,10 +229,11 @@ } // 订阅自定义按钮点击事件 univerifyManager.onButtonsClick(onButtonsClickFn) - // 调用一键登录弹框 - return univerifyManager.login({ - "univerifyStyle": this.univerifyStyle, - success:res=> { + // 调用一键登录弹框 + console.log(this.univerifyStyle,univerifyManager.login); + return univerifyManager.login({ + "univerifyStyle": this.univerifyStyle, + success:res=> { console.log('login success', res) this.login(res.authResult, 'univerify') }, @@ -245,16 +244,17 @@ }); }, complete(e){ + console.log(e); uni.hideLoading() // 取消订阅自定义按钮点击事件 univerifyManager.offButtonsClick(onButtonsClickFn) - } - }) - } + } + }) + } + uni.showLoading({mask: true}) uni.login({ "provider": type, "onlyAuthorize": true, //请勿直接使用前端获取的unionid或openid直接用于登录,前端的数据都是不可靠的 - "univerifyStyle": this.univerifyStyle, complete: (e) => { console.log(e); uni.hideLoading() @@ -271,63 +271,6 @@ }, fail: async (err) => { console.log(err); - // 以下代码为兼容旧版(HBuilderX3.2.13之前)HBuilderX3.2.13以上版本可直接删除 - if (type == 'univerify'&& !uni.getUniverifyManager) { - if (err.metadata && err.metadata.error_data) { - uni.showToast({ - title: t('oneClickLogin') + ":" + err.metadata.error_data, - icon: 'none' - }); - } - if (err.errMsg) { - uni.showToast({ - title: t('oneClickLogin') + ":" + err.errMsg, - icon: 'none' - }); - } - switch (err.errCode) { - case 30002: - console.log('在一键登录界面,点击其他登录方式'); - break; - case 30003: - console.log('关闭了登录'); - if (navigateBack) { - uni.navigateBack() - } - break; - case 30006: - uni.showModal({ - title: t('loginErr'), - content: err.metadata.error_data, - showCancel: false, - confirmText: t('gotIt'), - }); - break; - case "30008": - console.log('点击了第三方登录,provider:', err.provider); - //同步一键登录弹出层隐私协议框是否打勾 - let agree = (await uni.getCheckBoxState())[1].state - console.log('agree', agree); - uni.$emit('setAgreementsAgree', agree) - let { - path - } = this.univerifyStyle.buttons.list[res.index] - console.log('path', path); - if (path) { - this.to(path) - } else { - setTimeout(() => { - console.log('agree', this.agree); - this.login_before(err.provider) - }, 500) - } - break; - default: - console.log(err); - break; - } - } - // 以上代码为兼容旧版(HBuilderX3.2.13之前)HBuilderX3.2.13以上版本可直接删除 } }) }, diff --git a/manifest.json b/manifest.json index 6b1027a5f829f63c7a733e02df92d9c0f17ab167..e46add7a225a95e2346e71140c2c506fece5bf97 100644 --- a/manifest.json +++ b/manifest.json @@ -1,72 +1,79 @@ { - "name": "uni-starter", - "appid": "__UNI__EC87F46", - "description": "", - "versionName": "1.0.0", - "versionCode": "100", - "transformPx": false, - /* 5+App特有相关 */ - "app-plus": { - "usingComponents": true, - "nvueStyleCompiler": "uni-app", - "compilerVersion": 3, - "splashscreen": { - "alwaysShowBeforeRender": true, - "waiting": true, - "autoclose": true, - "delay": 0 - }, - /* 模块配置 */ - "modules": {}, - /* 应用发布信息 */ - "distribute": { - /* android打包配置 */ - "android": { - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios": {}, - /* SDK配置 */ - "sdkConfigs": {} - } - }, - /* 快应用特有相关 */ - "quickapp": {}, - /* 小程序特有相关 */ - "mp-weixin": { - "appid": "", - "setting": { - "urlCheck": false - }, - "usingComponents": true - }, - "mp-alipay": { - "usingComponents": true - }, - "mp-baidu": { - "usingComponents": true - }, - "mp-toutiao": { - "usingComponents": true - }, - "uniStatistics": { - "enable": false - }, - "vueVersion": "2" + "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 + }, + "modules": { + "OAuth": { + } + }, + "distribute": { + "android": { + "permissions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios": { + }, + "sdkConfigs": { + "oauth": { + "univerify": { + } + } + } + } + }, + "quickapp": { + }, + "mp-weixin": { + "appid": "", + "setting": { + "urlCheck": false + }, + "usingComponents": true, + "permission": { + "scope.userLocation": { + "desc": "用于提供应用算法支持" + } + } + }, + "mp-alipay": { + "usingComponents": true + }, + "mp-baidu": { + "usingComponents": true + }, + "mp-toutiao": { + "usingComponents": true + }, + "uniStatistics": { + "enable": false + }, + "vueVersion": "2" } diff --git a/package.json b/package.json index 098b563e487e371067922e4aaceba1d43cd091e3..b9373d94d3474a57123d0d5fdbdbe8e63e66f9ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.2.7", + "version": "1.2.8", "description": "云端一体应用快速开发基本项目模版", "keywords": [ "login", diff --git a/pages/ucenter/login-page/index/index.vue b/pages/ucenter/login-page/index/index.vue index e1750d5ce521c4af434976f4beac9d218b16a5e6..332774f3009ce6a7884a605178c9591e187d8c7e 100644 --- a/pages/ucenter/login-page/index/index.vue +++ b/pages/ucenter/login-page/index/index.vue @@ -125,11 +125,10 @@ @import url("../common/login-page.css"); - .quickLogin { - width: 650rpx; + .quickLogin { height: 350px; align-items: center; - justify-content: center; + justify-content: center; } .quickLoginBtn { diff --git a/uni_modules.config.json b/uni_modules.config.json index ebabb75f3953edb8ebb2b78a440765f627301409..c1bde5147caf39d306fe6f52a02ab90fc23c88fe 100644 --- a/uni_modules.config.json +++ b/uni_modules.config.json @@ -1,6 +1,6 @@ { "scripts": { - "preupload": "node uni_modules_tools/main.js change", - "postupload": "node uni_modules_tools/main.js recovery" + // "preupload": "node uni_modules_tools/main.js change", + // "postupload": "node uni_modules_tools/main.js recovery" } } \ No newline at end of file diff --git a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js index c0560e3df125463dd6e186a4d9af3393ee504bdb..393afb2bc0c6beca1c4dba1767416173d7a05115 100644 --- a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js +++ b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js @@ -425,8 +425,10 @@ exports.main = async (event, context) => { await uniIdLog(loginRes) return loginRes break; - case 'loginByUniverify': - res = await uniID.loginByUniverify(params) + case 'loginByUniverify': + console.error(params) + res = await uniID.loginByUniverify(params) + console.log(999999999,res) await uniIdLog(res) break; case 'loginByApple': diff --git a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package.json b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package.json index 99aae9d090f211ded46896db0ecc3345dfd8926e..42a527c9c5faecc87420fbfa61b07d89d66f8b4a 100644 --- a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package.json +++ b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/package.json @@ -1,16 +1,19 @@ { - "name": "uni-id-cf-123", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha", - "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center", - "uni-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id" - } + "name": "uni-id-cf-123", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha", + "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center", + "uni-id": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id" + }, + "extensions": { + "uni-cloud-verify": {} + } } diff --git a/uni_modules_tools/change_after.js b/uni_modules_tools/change_after.js index f174a41e462ca60d04f4bbbc8b8bebe1f99695a3..431dc4e0f2c2898ec2bd616dd66ed769f5b9538e 100644 --- a/uni_modules_tools/change_after.js +++ b/uni_modules_tools/change_after.js @@ -1,10 +1,12 @@ const fs = require('fs'); module.exports = function(){ console.log('开始执行脚本change_after'); - let changelog = fs.readFileSync(process.cwd() + '/changelog.md', 'utf-8').split("##")[1].split("\n").slice(1).join(' '); +/* let changelog = fs.readFileSync(process.cwd() + '/changelog.md', 'utf-8').split("##")[1].split("\n").slice(1).join(' '); console.log(changelog); // 这里是修改完相关敏感配置后执行的脚本,你可以在这里自定义逻辑, - // 比如执行git提交命令 + + + // 比如执行git提交命令 var shell = require("shelljs"); var exec = shell.exec; @@ -20,5 +22,6 @@ module.exports = function(){ shell.echo('Error: Git commit failed'); shell.exit(1); } - shell.exec(`echo git success ${changelog}`); + shell.exec(`echo git success ${changelog}`); + */ } \ No newline at end of file diff --git a/uni_modules_tools/config.js b/uni_modules_tools/config.js index d1676bfbdb412048f4688e405673215ed4b03977..2fd9447ae6c5bcfaa38fb688a47409ddb652da85 100644 --- a/uni_modules_tools/config.js +++ b/uni_modules_tools/config.js @@ -1,41 +1,27 @@ // "文件路径" : {"键名":"改成什么"} { "/manifest.json": { - "appid": "请点击重新获取" ,//清空appid - "mp-weixin" : { - "appid" : "" - }, - "app-plus" : { - "distribute" :{ - "sdkConfigs" : { - "oauth" : { - "weixin" : { - "appid" : "", - "appsecret" : "", - "UniversalLinks" : "" - }, - "univerify" : {} - }, - "share" : { - "weixin" : { - "appid" : "", - "UniversalLinks" : "" - } - }, - "geolocation" : { - "baidu" : { - "__platform__" : [ "ios", "android" ], - "appkey_ios" : "请填写地图的key", - "appkey_android" : "请填写地图的key" - } - } - } - } - }, - "_spaceID" : "", - "vueVersion" : "2" + "appid": "", + "name": "", + "versionName": "", + "mp-weixin": { + "appid": "" + }, + "vueVersion": "2", + "app-plus": { + "modules": { + "OAuth": {} + }, + "distribute": { + "sdkConfigs": { + "oauth": { + "univerify": {} + } + } + } + } }, - "/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": { + "/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json": { "tokenExpiresIn": 7200, "app": { "oauth": { @@ -77,4 +63,4 @@ } } } -} \ No newline at end of file +} diff --git a/uni_modules_tools/main.js b/uni_modules_tools/main.js index 9b0c5936e681e65b31a40b9bc3a3e3b92f5b03ca..762bd832e94f8acbeefe4771200d89a7b666b5e2 100644 --- a/uni_modules_tools/main.js +++ b/uni_modules_tools/main.js @@ -1,10 +1,10 @@ -//脚本文件目录 __dirname -//运行脚本的目录,即:项目的目录 process.cwd() - +//脚本文件目录 __dirname +//运行脚本的目录,即:项目的目录 process.cwd() + //配置文件 -const fs = require('fs'), +const fs = require('fs'), Hjson = require('hjson'), - config = Hjson.rt.parse(fs.readFileSync(__dirname+'/config.js', 'utf-8')) + config = Hjson.rt.parse(fs.readFileSync(__dirname+'/config.js', 'utf-8')) const change_after = require('./change_after') if(process.argv[2] == 'change'){ @@ -75,28 +75,29 @@ function recovery(){ - -//创建目录并写入文件 -function writeFileRecursive(path, buffer, callback) { - let lastPath = path.substring(0, path.lastIndexOf("/")); - fs.mkdir(lastPath, { - recursive: true - }, (err) => { - if (err) return callback(err); - fs.writeFile(path, buffer, function(err) { - if (err) return callback(err); - return callback(null); - }); - }); -} - -//递归合并,为了保留注释内容 -function mergeJSON(minor, main) { - for (var key in main) { + +//创建目录并写入文件 +function writeFileRecursive(path, buffer, callback) { + let lastPath = path.substring(0, path.lastIndexOf("/")); + fs.mkdir(lastPath, { + recursive: true + }, (err) => { + if (err) return callback(err); + fs.writeFile(path, buffer, function(err) { + if (err) return callback(err); + return callback(null); + }); + }); +} + +//递归合并,为了保留注释内容 +function mergeJSON(minor, main) { + for (var key in main) { if (typeof(main[key]) != 'object' ) { minor[key] = main[key]; }else{ + console.log('[',minor[key], main[key],']'); mergeJSON(minor[key], main[key]); - } + } } } \ No newline at end of file