Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
26b690b8
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1045
Star
30
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
26b690b8
编写于
8月 08, 2022
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增微信登录功能
上级
f4a5a96b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
140 addition
and
51 deletion
+140
-51
manifest.json
manifest.json
+2
-2
pages.json
pages.json
+14
-3
pages/test/test.vue
pages/test/test.vue
+22
-0
uni_modules/uni-id-pages/changelog.md
uni_modules/uni-id-pages/changelog.md
+1
-3
uni_modules/uni-id-pages/common/login-page.mixin.js
uni_modules/uni-id-pages/common/login-page.mixin.js
+31
-7
uni_modules/uni-id-pages/common/loginSuccess.js
uni_modules/uni-id-pages/common/loginSuccess.js
+13
-5
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
+25
-12
uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
...omponents/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
+2
-2
uni_modules/uni-id-pages/init.js
uni_modules/uni-id-pages/init.js
+0
-7
uni_modules/uni-id-pages/package-lock.json
uni_modules/uni-id-pages/package-lock.json
+29
-0
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+0
-9
uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json
.../uni-id-pages/uniCloud/database/opendb-device.schema.json
+1
-1
未找到文件。
manifest.json
浏览文件 @
26b690b8
...
...
@@ -137,12 +137,12 @@
"enable"
:
false
},
"devServer"
:
{
"port"
:
-11
,
"port"
:
8080
,
"disableHostCheck"
:
true
,
"https"
:
false
},
"router"
:
{
"mode"
:
"h
istory
"
"mode"
:
"h
ash
"
}
},
"_spaceID"
:
"9f641af8-e860-44e5-b18f-f68dd8fe3fe4"
,
...
...
pages.json
浏览文件 @
26b690b8
{
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/test/test"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationBarTitleText"
:
"uni-app"
}
...
...
@@ -39,7 +47,7 @@
{
"path"
:
"uni_modules/uni-id-pages/pages/login/login-withpwd"
,
"style"
:
{
"navigationBarTitleText"
:
""
"navigationBarTitleText"
:
""
}
},
{
...
...
@@ -80,7 +88,10 @@
"navigationBarTextStyle"
:
"black"
,
"navigationBarTitleText"
:
"uni-app"
,
"navigationBarBackgroundColor"
:
"#FFF"
,
"backgroundColor"
:
"#F8F8F8"
"backgroundColor"
:
"#F8F8F8"
,
/*
#ifdef
H
5
*/
"navigationStyle"
:
"custom"
/*
#endif
*/
}
,
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
...
...
pages/test/test.vue
0 → 100644
浏览文件 @
26b690b8
<
template
>
<view>
<navigator
url=
"/pages/index/index"
>
index
</navigator>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
uni_modules/uni-id-pages/changelog.md
浏览文件 @
26b690b8
## 1.0.7(2022-07-19)
-
新增 web移动端,微信内基于公众号登录
-
新增 web电脑端,基于微信开放平台的微信扫码登录
-
未安装
-
新增 登录成功(全局)回调事件:
`uni-id-pages-login-success`
,支持通过
[
uni.$on
](
https://uniapp.dcloud.net.cn/api/window/communication.html#on
)
监听;
## 1.0.7(2022-07-19)
-
修复 uni-id-co接口 logout时没有删除token的Bug
## 1.0.6(2022-07-13)
...
...
uni_modules/uni-id-pages/common/login-page.mixin.js
浏览文件 @
26b690b8
...
...
@@ -4,7 +4,7 @@ let mixin = {
data
()
{
return
{
config
,
isMounted
:
false
isMounted
:
false
}
},
onUnload
()
{
...
...
@@ -15,9 +15,33 @@ let mixin = {
mounted
()
{
this
.
isMounted
=
true
;
},
onLoad
(
e
)
{
if
(
e
.
is_weixin_redirect
)
{
uni
.
showLoading
({
mask
:
true
})
if
(
window
.
location
.
href
.
includes
(
'
#
'
)
){
// 将url通过 ? 分割获取后面的参数字符串 再通过 & 将每一个参数单独分割出来
let
paramsArr
=
window
.
location
.
href
.
split
(
'
?
'
)[
1
].
split
(
'
&
'
)
paramsArr
.
forEach
(
item
=>
{
let
arr
=
item
.
split
(
'
=
'
)
if
(
arr
[
0
]
==
'
code
'
){
e
.
code
=
arr
[
1
]
}
})
}
this
.
$nextTick
(
n
=>
{
console
.
log
(
this
.
$refs
.
uniFabLogin
);
this
.
$refs
.
uniFabLogin
.
login
({
code
:
e
.
code
},
'
weixin
'
)
})
}
},
computed
:
{
needAgreements
(){
if
(
this
.
isMounted
)
{
needAgreements
()
{
if
(
this
.
isMounted
)
{
if
(
this
.
$refs
.
agreements
)
{
return
this
.
$refs
.
agreements
.
needAgreements
}
else
{
...
...
@@ -27,7 +51,7 @@ let mixin = {
},
agree
:
{
get
()
{
if
(
this
.
isMounted
)
{
if
(
this
.
isMounted
)
{
if
(
this
.
$refs
.
agreements
)
{
return
this
.
$refs
.
agreements
.
isAgree
}
else
{
...
...
@@ -38,7 +62,7 @@ let mixin = {
set
(
agree
)
{
if
(
this
.
$refs
.
agreements
)
{
this
.
$refs
.
agreements
.
isAgree
=
agree
}
else
{
}
else
{
console
.
log
(
'
不存在 隐私政策协议组件
'
);
}
}
...
...
@@ -48,6 +72,6 @@ let mixin = {
loginSuccess
(
e
)
{
loginSuccess
(
e
)
}
}
}
}
export
default
mixin
export
default
mixin
uni_modules/uni-id-pages/common/loginSuccess.js
浏览文件 @
26b690b8
...
...
@@ -14,16 +14,24 @@ export default function(e = {}) {
}
if
(
autoBack
)
{
let
delta
=
0
;
//判断需要返回几层
let
pages
=
getCurrentPages
();
let
pages
=
getCurrentPages
();
uni
.
$emit
(
'
uni-id-pages-login-success
'
,
pages
)
console
.
log
(
pages
);
pages
.
forEach
((
page
,
index
)
=>
{
if
(
pages
[
pages
.
length
-
index
-
1
].
route
.
split
(
'
/
'
)[
3
]
==
'
login
'
)
{
delta
++
}
})
console
.
log
(
'
判断需要返回几层:
'
,
pages
,
delta
);
// #ifdef H5
if
(
e
.
loginType
==
'
weixin
'
){
console
.
log
(
'
window.history
'
,
window
.
history
);
return
window
.
history
.
go
(
-
3
)
}
// #endif
uni
.
navigateBack
({
delta
})
console
.
log
(
'
判断需要返回几层:
'
,
delta
);
// uni.navigateBack({
// delta
// })
}
}
uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
浏览文件 @
26b690b8
...
...
@@ -229,17 +229,27 @@
// #ifdef H5
if
(
type
==
'
weixin
'
){
console
.
log
(
'
开始微信网页登录
'
);
location
.
href
=
`https://open.weixin.qq.com/connect/qrconnect?appid=wx4dcf96ab6af4c5e8
&redirect_uri=
${
encodeURIComponent
(
'
http://test.0577app.com/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin_redirect
'
)}
&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect`
/*location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?
appid=wx32b2580e30ef8555
&redirect_uri=${encodeURIComponent('http://test.0577app.com/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin_redirect')}
&response_type=code
&scope=snsapi_userinfo
&state=STATE&connect_redirect=1#wechat_redirect`;*/
let
redirectUrl
=
location
.
protocol
+
'
//
'
+
document
.
domain
+
(
window
.
location
.
href
.
includes
(
'
#
'
)?
'
/#
'
:
''
)
+
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin
'
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'
micromessenger
'
){
console
.
log
(
'
在微信公众号内
'
);
return
window
.
open
(
`https://open.weixin.qq.com/connect/oauth2/authorize?
appid=wx32b2580e30ef8555
&redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&response_type=code
&scope=snsapi_userinfo
&state=STATE&connect_redirect=1#wechat_redirect`
);
}
else
{
console
.
log
(
'
非微信公众号内
'
);
return
location
.
href
=
`https://open.weixin.qq.com/connect/qrconnect?appid=wx4dcf96ab6af4c5e8
&redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect`
}
}
// #endif
...
...
@@ -426,6 +436,9 @@
})
return
this
.
$refs
.
userProfile
.
open
(
result
.
uid
)
}
// #endif
// #ifdef H5
result
.
loginType
=
type
// #endif
loginSuccess
(
result
)
})
...
...
@@ -489,7 +502,7 @@
width
:
750rpx
;
justify-content
:
space-around
;
position
:
fixed
;
bottom
:
10rpx
;
bottom
:
10rpx
;
left
:
0
;
}
...
...
@@ -509,7 +522,7 @@
align-items
:
center
;
height
:
200rpx
;
cursor
:
pointer
;
}
}
.logo
{
width
:
60rpx
;
...
...
uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
浏览文件 @
26b690b8
...
...
@@ -198,7 +198,7 @@
top
:
0
;
right
:
8px
;
width
:
260rpx
;
max-width
:
1
3
0px
;
max-width
:
1
0
0px
;
height
:
44px
;
/* #ifndef APP-NVUE */
display
:
flex
;
...
...
@@ -229,7 +229,7 @@
}
.
box
:
:
v-deep
.
content-clear-icon
{
margin-right
:
1
0
0px
;
margin-right
:
1
1
0px
;
}
.box
{
...
...
uni_modules/uni-id-pages/init.js
浏览文件 @
26b690b8
...
...
@@ -96,11 +96,4 @@ export default async function() {
}
})
}
//5.未启用uni统计,但使用uni-id-pages+uni-push2.0,onLaunch时上报device_id至服务端
if
(
uni
.
report
==
undefined
){
if
(
uni
.
getPushClientId
)
{
}
}
}
uni_modules/uni-id-pages/package-lock.json
0 → 100644
浏览文件 @
26b690b8
{
"name"
:
"uni-id-pages"
,
"version"
:
"1.0.7"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"version"
:
"1.0.7"
,
"dependencies"
:
{
"jweixin-module"
:
"^1.6.0"
},
"engines"
:
{
"HBuilderX"
:
"^3.4.17"
}
},
"node_modules/jweixin-module"
:
{
"version"
:
"1.6.0"
,
"resolved"
:
"https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz"
,
"integrity"
:
"sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
}
},
"dependencies"
:
{
"jweixin-module"
:
{
"version"
:
"1.6.0"
,
"resolved"
:
"https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz"
,
"integrity"
:
"sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
}
}
}
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
浏览文件 @
26b690b8
...
...
@@ -53,15 +53,6 @@
async
onLoad
(
e
)
{
console
.
log
(
e
);
let
type
=
e
.
type
if
(
type
==
'
weixin_redirect
'
){
this
.
$nextTick
(
n
=>
{
console
.
log
(
this
.
$refs
.
uniFabLogin
);
this
.
$refs
.
uniFabLogin
.
login
({
code
:
e
.
code
},
'
weixin
'
)
})
}
// console.log({type});
this
.
type
=
type
if
(
type
!=
'
univerify
'
){
...
...
uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json
浏览文件 @
26b690b8
...
...
@@ -3,7 +3,7 @@
"required"
:
[],
"permission"
:
{
"read"
:
false
,
"create"
:
fals
e
,
"create"
:
tru
e
,
"update"
:
false
,
"delete"
:
false
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录