Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-starter
提交
0ac6e149
U
uni-starter
项目概览
DCloud
/
uni-starter
通知
4552
Star
227
Fork
208
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0ac6e149
编写于
9月 28, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. 改造微信登陆逻辑,直接使用参数实现 2. 修复,一键登录弹出层,已勾选“同意隐私政策协议”点击自定义登陆按钮,报“你未同意隐私政策协议”的bug
上级
e7d17999
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
34 addition
and
64 deletion
+34
-64
changelog.md
changelog.md
+3
-0
components/uni-agreements/uni-agreements.vue
components/uni-agreements/uni-agreements.vue
+5
-0
components/uni-quick-login/uni-quick-login.vue
components/uni-quick-login/uni-quick-login.vue
+15
-53
manifest.json
manifest.json
+2
-2
package.json
package.json
+1
-1
uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
...ni-feedback/uniCloud/database/opendb-feedback.schema.json
+2
-2
uni_modules_tools/copy/manifest.json
uni_modules_tools/copy/manifest.json
+6
-6
未找到文件。
changelog.md
浏览文件 @
0ac6e149
## 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)
...
...
components/uni-agreements/uni-agreements.vue
浏览文件 @
0ac6e149
...
...
@@ -36,6 +36,11 @@
this
.
$emit
(
'
setAgree
'
,
this
.
isAgree
)
}
},
created
()
{
uni
.
$on
(
'
setAgreementsAgree
'
,
state
=>
{
this
.
$emit
(
'
setAgree
'
,
state
)
})
},
data
()
{
return
{
isAgree
:
false
...
...
components/uni-quick-login/uni-quick-login.vue
浏览文件 @
0ac6e149
...
...
@@ -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
:
...
...
manifest.json
浏览文件 @
0ac6e149
...
...
@@ -62,9 +62,9 @@
},
"FaceID"
:
{
},
"Push"
:
{
},
"Geolocation"
:
{
},
"Push"
:
{
}
},
"distribute"
:
{
...
...
package.json
浏览文件 @
0ac6e149
{
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.1.1
1
"
,
"version"
:
"1.1.1
2
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"login"
,
...
...
uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json
浏览文件 @
0ac6e149
...
...
@@ -4,8 +4,8 @@
"permission"
:
{
"create"
:
"auth.uid != null"
,
"read"
:
true
,
"delete"
:
tru
e
,
"update"
:
tru
e
"delete"
:
fals
e
,
"update"
:
fals
e
},
"properties"
:
{
"_id"
:
{
...
...
uni_modules_tools/copy/manifest.json
浏览文件 @
0ac6e149
{
"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"
}
//...
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录