diff --git a/changelog.md b/changelog.md
index 6925062128765947205829ebb5d3d75c3320aadd..9bbe3354db6b4cc3c560171ebc52774dec041f46 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,6 @@
+## 1.1.12(2021-09-28)
+1. 改造微信登陆逻辑,直接使用`uni.login`参数`"onlyAuthorize":true`实现
+2. 修复,一键登录弹出层,已勾选“同意隐私政策协议”点击自定义登陆按钮,报“你未同意隐私政策协议”的bug
## 1.1.11(2021-09-24)
优化邀请下载app页(`pages/ucenter/invite`)下载按钮闪烁的问题
## 1.1.10(2021-09-23)
diff --git a/components/uni-agreements/uni-agreements.vue b/components/uni-agreements/uni-agreements.vue
index 2d0c5db6152e3812ba75327b555e7e4d85a62664..2c0af79c1e4b5593604e670f1c244a461c09c91d 100644
--- a/components/uni-agreements/uni-agreements.vue
+++ b/components/uni-agreements/uni-agreements.vue
@@ -36,6 +36,11 @@
this.$emit('setAgree',this.isAgree)
}
},
+ created() {
+ uni.$on('setAgreementsAgree',state=>{
+ this.$emit('setAgree',state)
+ })
+ },
data() {
return {
isAgree:false
diff --git a/components/uni-quick-login/uni-quick-login.vue b/components/uni-quick-login/uni-quick-login.vue
index b012c0fdd1e803f5345a55bbda43d97cbb085159..db78fe41ca741b7edffddf7a79a6ae1f8883e8ea 100644
--- a/components/uni-quick-login/uni-quick-login.vue
+++ b/components/uni-quick-login/uni-quick-login.vue
@@ -75,7 +75,6 @@
"logo": "/static/uni-quick-login/univerify.png",
}
],
- oauthServices: [],
config: {},
univerifyStyle: { //一键登录弹出窗的样式配置参数
"fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
@@ -110,7 +109,7 @@
},
async created() {
let servicesList = this.servicesList
- //去掉配置中不存在的
+ //去掉配置中不存在的 注意,在/common/appInit.js中已清除有配置但设备环境不支持的登陆项
servicesList = servicesList.filter(item => this.loginConfig.includes(item.id))
//处理一键登录
if (this.loginConfig.includes('univerify')) {
@@ -128,6 +127,7 @@
}
})
}
+ console.log(servicesList);
//如果当前页面为默认登陆界面。当前第一优先级的“微信和苹果登陆”要隐藏,因为他已经被渲染在默认登陆界面顶部
if (
this.getRoute(1) == '/pages/ucenter/login-page/index/index' && ['weixin', 'apple'].includes(this
@@ -143,18 +143,6 @@
console.log('servicesList', servicesList, this.servicesList);
},
mounted() {
- // #ifdef APP-PLUS
- plus.oauth.getServices(oauthServices => {
- this.oauthServices = oauthServices
- }, err => {
- uni.showModal({
- title: this.$t('uniQuickLogin').getProviderFail + ':' + JSON.stringify(err),
- showCancel: false,
- confirmText: this.$t('common').gotIt
- });
- console.error('获取服务供应商失败:' + JSON.stringify(err));
- })
- // #endif
},
methods: {
...mapMutations({
@@ -189,36 +177,12 @@
uni.showLoading({
mask: true
})
- // console.log(arguments);
- let oauthService = this.oauthServices.find((service) => service.id == type)
- // console.log(type);
-
- // #ifdef APP-PLUS
- //请勿直接使用前端获取的unionid或openid直接用于登录,前端的数据都是不可靠的
- if (type == 'weixin') {
- return oauthService.authorize(({
- code
- }) => {
- // console.log(code);
- this.login({
- code
- }, type)
- },
- err => {
- uni.hideLoading()
- console.error(err);
- uni.showModal({
- content: JSON.stringify(err),
- showCancel: false
- });
- })
- }
- // #endif
-
uni.login({
"provider": type,
+ "onlyAuthorize":true, //请勿直接使用前端获取的unionid或openid直接用于登录,前端的数据都是不可靠的
"univerifyStyle": this.univerifyStyle,
complete: (e) => {
+ uni.hideLoading()
console.log(e);
},
success: async e => {
@@ -227,22 +191,12 @@
let res = await this.getUserInfo({
provider: "apple"
})
- uni.hideLoading()
Object.assign(e.authResult, res.userInfo)
}
- // #ifdef MP-WEIXIN
- if (type == 'weixin') {
- return this.login({
- code: e.code
- }, type)
- }
- // #endif
- this.login(e.authResult, type)
+ this.login( type == 'weixin'?e.code:e.authResult , type)
},
- fail: (err) => {
- uni.hideLoading()
+ fail:async (err) => {
console.log(err);
-
if (type == 'univerify') {
if (err.metadata && err.metadata.error_data) {
uni.showToast({
@@ -280,6 +234,11 @@
icon: 'none'
});
console.log('点击了第三方登陆,provider:', err.provider);
+
+ //同步一键登陆弹出层隐私协议框是否打勾
+ let agree = (await uni.getCheckBoxState())[1].state
+ console.log('agree',agree);
+ uni.$emit('setAgreementsAgree',agree)
let {
path
} = this.servicesList.find(item => item.id == err.provider) || {}
@@ -287,7 +246,10 @@
if (path && path != this.getRoute(1)) { //存在路径,且并不是当前已经打开的路径
this.to(path)
} else {
- this.login_before(err.provider)
+ setTimeout(()=>{
+ console.log('agree',this.agree);
+ this.login_before(err.provider)
+ },500)
}
break;
default:
diff --git a/manifest.json b/manifest.json
index ed7d6a8762fe0cd3b78ef01ed895487b102b6e48..a465b4a686aa95ba9acd9a4537f18b9f088a47f5 100644
--- a/manifest.json
+++ b/manifest.json
@@ -29,8 +29,90 @@
},
"zh" : {
// 中文(简体)
- "name" : "统一应用基本项目" // 应用名称
- }
+ "name": "统一应用基本项目" // 应用名称
+ }
+ },
+ "privacy": {
+ "prompt": "template",
+ "template": {
+ "title": "服务协议和隐私政策",
+ "message": " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
+ "buttonAccept": "同意",
+ "buttonRefuse": "暂不同意"
+ }
+ },
+ "compatible": {
+ "ignoreVersion": true
+ },
+ "usingComponents": true,
+ "nvueStyleCompiler": "uni-app",
+ "compilerVersion": 3,
+ "splashscreen": {
+ "alwaysShowBeforeRender": false,
+ "waiting": true,
+ "autoclose": true,
+ "delay": 0
+ },
+ "modules": {
+ "Fingerprint": {
+ },
+ "Share": {
+ },
+ "OAuth": {
+ },
+ "FaceID": {
+ },
+ "Geolocation": {
+ },
+ "Push": {
+ }
+ },
+ "distribute": {
+ "android": {
+ "permissions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "abiFilters": [
+ "armeabi-v7a",
+ "arm64-v8a",
+ "x86"
+ ]
+ },
+ "ios": {
+ "capabilities": {
+ "entitlements": {
+ "com.apple.developer.associated-domains": [
+ "applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
+ ]
+ }
+ }
+ },
+ "sdkConfigs": {
+ "oauth": {
+ "apple": {
+ },
+ "weixin": {
+ "appid": "",
+ "appsecret": "",
+ "UniversalLinks": ""
+ },
+ "univerify": {
+ }
},
"privacy" : {
"prompt" : "template",
diff --git a/package.json b/package.json
index 612c60b264402d615c180e18ce92068e88944da5..08e24f9a848aea2ee215dcd96d2a36a4ea5188eb 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-starter",
"displayName": "uni-starter",
- "version": "1.1.11",
+ "version": "1.1.12",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"login",
diff --git a/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json b/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
index d64b865bd1f8860ce8a91013418d701a445c85f4..45ed18948717441838296916a6954e7158194645 100644
--- a/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
+++ b/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
@@ -4,8 +4,8 @@
"permission": {
"create": "auth.uid != null",
"read": true,
- "delete": true,
- "update": true
+ "delete": false,
+ "update": false
},
"properties": {
"_id": {
diff --git a/uni_modules_tools/copy/manifest.json b/uni_modules_tools/copy/manifest.json
index f4b3f42e2e016e8af5c74c005b851314e1bbc0d3..d1fc39a357ba78712d16af4305b242d08ca6c3da 100644
--- a/uni_modules_tools/copy/manifest.json
+++ b/uni_modules_tools/copy/manifest.json
@@ -1,6 +1,6 @@
{
"name" : "统一应用基本项目",
- "appid" : "__UNI__E5373F7",
+ "appid" : "__UNI__03B096E",
"description" : "云端一体应用快速开发模版",
"versionName" : "1.0.0",
"versionCode" : "100",
@@ -58,8 +58,8 @@
"Share" : {},
"OAuth" : {},
"FaceID" : {},
- "Push" : {},
- "Geolocation" : {}
+ "Geolocation" : {},
+ "Push" : {}
},
"distribute" : {
"android" : {
@@ -96,7 +96,7 @@
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "",
- "UniversalLinks" : ""
+ "UniversalLinks" : "https://uniapp.dcloud.io/ulink/"
},
"univerify" : {}
},
@@ -104,7 +104,7 @@
"share" : {
"weixin" : {
"appid" : "wxffdd8fa6ec4ef2a0",
- "UniversalLinks" : ""
+ "UniversalLinks" : "https://uniapp.dcloud.io/ulink/"
}
},
"geolocation" : {
@@ -195,7 +195,7 @@
}
}
},
- "_spaceID" : "",
+ "_spaceID" : "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e",
"vueVersion" : "2"
}
//...