Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
f0de2a63
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1054
Star
31
Fork
43
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f0de2a63
编写于
2月 24, 2023
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复 web微信登录回调地址不正确
上级
2922ab59
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
18 deletion
+34
-18
uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
...ponents/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
+34
-18
未找到文件。
uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
浏览文件 @
f0de2a63
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
"
id
"
:
"
weixin
"
,
"
id
"
:
"
weixin
"
,
"
text
"
:
"
微信登录
"
,
"
text
"
:
"
微信登录
"
,
"
logo
"
:
"
/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png
"
,
"
logo
"
:
"
/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png
"
,
},
},
// #ifndef MP-WEIXIN
// #ifndef MP-WEIXIN
{
{
"
id
"
:
"
apple
"
,
"
id
"
:
"
apple
"
,
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
"
id
"
:
"
sinaweibo
"
,
"
id
"
:
"
sinaweibo
"
,
"
text
"
:
"
新浪微博
"
,
//暂未提供该登录方式的接口示例
"
text
"
:
"
新浪微博
"
,
//暂未提供该登录方式的接口示例
"
logo
"
:
"
/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png
"
,
"
logo
"
:
"
/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png
"
,
}
}
// #endif
// #endif
],
],
univerifyStyle
:
{
//一键登录弹出窗的样式配置参数
univerifyStyle
:
{
//一键登录弹出窗的样式配置参数
...
@@ -201,8 +201,8 @@
...
@@ -201,8 +201,8 @@
}
}
return
'
/
'
+
pages
[
pages
.
length
-
n
].
route
return
'
/
'
+
pages
[
pages
.
length
-
n
].
route
},
},
toPage
(
path
,
index
=
0
)
{
toPage
(
path
,
index
=
0
)
{
let
type
=
[
'
navigateTo
'
,
'
redirectTo
'
][
index
]
let
type
=
[
'
navigateTo
'
,
'
redirectTo
'
][
index
]
//console.log('比较', this.getRoute(1),this.getRoute(2), path)
//console.log('比较', this.getRoute(1),this.getRoute(2), path)
if
(
this
.
getRoute
(
1
)
==
path
.
split
(
'
?
'
)[
0
]
&&
this
.
getRoute
(
1
)
==
if
(
this
.
getRoute
(
1
)
==
path
.
split
(
'
?
'
)[
0
]
&&
this
.
getRoute
(
1
)
==
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd
'
)
{
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd
'
)
{
...
@@ -294,10 +294,26 @@
...
@@ -294,10 +294,26 @@
// #ifdef H5
// #ifdef H5
if
(
type
==
'
weixin
'
){
if
(
type
==
'
weixin
'
){
// console.log('开始微信网页登录');
// console.log('开始微信网页登录');
let
redirectUrl
=
location
.
protocol
+
'
//
'
+
// let redirectUrl = location.protocol +'//'+
document
.
domain
+
// document.domain +
(
window
.
location
.
href
.
includes
(
'
#
'
)?
'
/#
'
:
''
)
+
// (window.location.href.includes('#')?'/#':'') +
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin
'
// '/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin'
// #ifdef VUE2
const
baseUrl
=
process
.
env
.
BASE_URL
// #endif
// #ifdef VUE3
const
baseUrl
=
import
.
meta
.
env
.
BASE_URL
// #endif
let
redirectUrl
=
location
.
protocol
+
'
//
'
+
location
.
host
+
(
baseUrl
?
'
/
'
:
''
)
+
baseUrl
.
replace
(
/^
\/
|
\/
$/
,
''
)
+
(
window
.
location
.
href
.
includes
(
'
#
'
)?
'
/#
'
:
''
)
+
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin
'
// console.log('redirectUrl----',redirectUrl);
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'
micromessenger
'
){
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'
micromessenger
'
){
// console.log('在微信公众号内');
// console.log('在微信公众号内');
...
@@ -327,20 +343,20 @@
...
@@ -327,20 +343,20 @@
let
onButtonsClickFn
=
async
res
=>
{
let
onButtonsClickFn
=
async
res
=>
{
console
.
log
(
'
点击了第三方登录,provider:
'
,
res
,
res
.
provider
,
this
.
univerifyStyle
.
buttons
.
list
);
console
.
log
(
'
点击了第三方登录,provider:
'
,
res
,
res
.
provider
,
this
.
univerifyStyle
.
buttons
.
list
);
clickAnotherButtons
=
true
clickAnotherButtons
=
true
let
checkBoxState
=
await
uni
.
getCheckBoxState
();
let
checkBoxState
=
await
uni
.
getCheckBoxState
();
// 同步一键登录弹出层隐私协议框是否打勾
// 同步一键登录弹出层隐私协议框是否打勾
// #ifdef VUE2
// #ifdef VUE2
this
.
agree
=
checkBoxState
[
1
].
state
this
.
agree
=
checkBoxState
[
1
].
state
// #endif
// #endif
// #ifdef VUE3
// #ifdef VUE3
this
.
agree
=
checkBoxState
.
state
this
.
agree
=
checkBoxState
.
state
// #endif
// #endif
let
{
let
{
path
path
}
=
this
.
univerifyStyle
.
buttons
.
list
[
res
.
index
]
}
=
this
.
univerifyStyle
.
buttons
.
list
[
res
.
index
]
if
(
path
)
{
if
(
path
)
{
if
(
this
.
getRoute
(
1
).
includes
(
'
login-withoutpwd
'
)
&&
path
.
includes
(
'
login-withoutpwd
'
)
){
if
(
this
.
getRoute
(
1
).
includes
(
'
login-withoutpwd
'
)
&&
path
.
includes
(
'
login-withoutpwd
'
)
){
this
.
getParentComponent
().
showCurrentWebview
()
this
.
getParentComponent
().
showCurrentWebview
()
}
}
this
.
toPage
(
path
,
1
)
this
.
toPage
(
path
,
1
)
closeUniverify
()
closeUniverify
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录