Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
f4a5a96b
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1051
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4a5a96b
编写于
8月 08, 2022
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信公众号、pc扫码登录完成
上级
e230c642
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
81 addition
and
32 deletion
+81
-32
manifest.json
manifest.json
+9
-1
uni_modules/uni-id-common/changelog.md
uni_modules/uni-id-common/changelog.md
+2
-0
uni_modules/uni-id-common/package.json
uni_modules/uni-id-common/package.json
+1
-1
uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js
...mon/uniCloud/cloudfunctions/common/uni-id-common/index.js
+1
-1
uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json
...uniCloud/cloudfunctions/common/uni-id-common/package.json
+1
-1
uni_modules/uni-id-pages/changelog.md
uni_modules/uni-id-pages/changelog.md
+6
-0
uni_modules/uni-id-pages/common/login-page.mixin.js
uni_modules/uni-id-pages/common/login-page.mixin.js
+1
-1
uni_modules/uni-id-pages/common/loginSuccess.js
uni_modules/uni-id-pages/common/loginSuccess.js
+4
-4
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
+24
-7
uni_modules/uni-id-pages/config.js
uni_modules/uni-id-pages/config.js
+3
-3
uni_modules/uni-id-pages/init.js
uni_modules/uni-id-pages/init.js
+7
-0
uni_modules/uni-id-pages/package.json
uni_modules/uni-id-pages/package.json
+13
-10
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+9
-3
未找到文件。
manifest.json
浏览文件 @
f4a5a96b
...
...
@@ -134,7 +134,15 @@
"vueVersion"
:
"2"
,
"h5"
:
{
"unipush"
:
{
"enable"
:
true
"enable"
:
false
},
"devServer"
:
{
"port"
:
-11
,
"disableHostCheck"
:
true
,
"https"
:
false
},
"router"
:
{
"mode"
:
"history"
}
},
"_spaceID"
:
"9f641af8-e860-44e5-b18f-f68dd8fe3fe4"
,
...
...
uni_modules/uni-id-common/changelog.md
浏览文件 @
f4a5a96b
## 1.0.13(2022-07-21)
-
修复 创建token时未传角色权限信息生成的token不正确的bug
## 1.0.12(2022-07-15)
-
提升与旧版本uni-id的兼容性(补充读取配置文件时回退平台app-plus、h5),但是仍推荐使用新平台名进行配置(app、web)
## 1.0.11(2022-07-14)
...
...
uni_modules/uni-id-common/package.json
浏览文件 @
f4a5a96b
{
"id"
:
"uni-id-common"
,
"displayName"
:
"uni-id-common"
,
"version"
:
"1.0.1
2
"
,
"version"
:
"1.0.1
3
"
,
"description"
:
"包含uni-id token生成、校验、刷新功能的云函数公共模块"
,
"keywords"
:
[
"uni-id-common"
,
...
...
uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js
浏览文件 @
f4a5a96b
此差异已折叠。
点击以展开。
uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json
浏览文件 @
f4a5a96b
{
"name"
:
"uni-id-common"
,
"version"
:
"1.0.1
2
"
,
"version"
:
"1.0.1
3
"
,
"description"
:
"uni-id token生成、校验、刷新"
,
"main"
:
"index.js"
,
"homepage"
:
"https://uniapp.dcloud.io/uniCloud/uni-id-common.html"
,
...
...
uni_modules/uni-id-pages/changelog.md
浏览文件 @
f4a5a96b
## 1.0.7(2022-07-19)
-
新增 web移动端,微信内基于公众号登录
-
新增 web电脑端,基于微信开放平台的微信扫码登录
-
未安装
## 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
浏览文件 @
f4a5a96b
...
...
@@ -48,6 +48,6 @@ let mixin = {
loginSuccess
(
e
)
{
loginSuccess
(
e
)
}
}
}
}
export
default
mixin
uni_modules/uni-id-pages/common/loginSuccess.js
浏览文件 @
f4a5a96b
...
...
@@ -15,15 +15,15 @@ export default function(e = {}) {
if
(
autoBack
)
{
let
delta
=
0
;
//判断需要返回几层
let
pages
=
getCurrentPages
();
//
console.log(pages);
console
.
log
(
pages
);
pages
.
forEach
((
page
,
index
)
=>
{
if
(
pages
[
pages
.
length
-
index
-
1
].
route
.
split
(
'
/
'
)[
3
]
==
'
login
'
)
{
delta
++
}
})
console
.
log
(
'
判断需要返回几层:
'
,
delta
);
uni
.
navigateBack
({
delta
})
//
uni.navigateBack({
//
delta
//
})
}
}
uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
浏览文件 @
f4a5a96b
...
...
@@ -15,7 +15,8 @@
<
script
>
import
config
from
'
@/uni_modules/uni-id-pages/config.js
'
//前一个窗口的页面地址。控制点击切换快捷登录方式是创建还是返回
import
loginSuccess
from
'
../../common/loginSuccess.js
'
;
import
loginSuccess
from
'
../../common/loginSuccess.js
'
;
const
db
=
uniCloud
.
database
();
const
usersTable
=
db
.
collection
(
'
uni-id-users
'
)
let
allServicesList
=
[]
...
...
@@ -186,6 +187,9 @@
})
//console.log('servicesList', servicesList, this.servicesList);
},
async
mounted
()
{
},
methods
:
{
setUserInfo
(
e
)
{
console
.
log
(
'
setUserInfo
'
,
e
);
...
...
@@ -221,7 +225,23 @@
}
},
async
login_before
(
type
,
navigateBack
=
true
)
{
console
.
log
(
type
);
console
.
log
(
type
);
// #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`;*/
}
// #endif
//提示空实现
if
([
"
qq
"
,
...
...
@@ -232,10 +252,6 @@
"
google
"
,
"
alipay
"
,
"
douyin
"
,
//H5端没有支持微信登录
// #ifdef H5
"
weixin
"
// #endif
].
includes
(
type
))
{
return
uni
.
showToast
({
title
:
'
该登录方式暂未实现,欢迎提交pr
'
,
...
...
@@ -383,7 +399,8 @@
}
})
},
login
(
params
,
type
)
{
//联网验证登录
login
(
params
,
type
)
{
//联网验证登录
console
.
log
(
'
执行登录开始----
'
);
console
.
log
({
params
,
type
...
...
uni_modules/uni-id-pages/config.js
浏览文件 @
f4a5a96b
...
...
@@ -18,9 +18,7 @@ export default {
// #ifdef APP
"
univerify
"
,
// #endif
// #ifndef H5
"
weixin
"
,
// #endif
"
username
"
,
// #ifdef APP
"
apple
"
,
...
...
@@ -32,6 +30,8 @@ export default {
"
serviceUrl
"
:
"
https://xxx
"
,
//用户服务协议链接
"
privacyUrl
"
:
"
https://xxx
"
,
//隐私政策条款链接
// 哪些场景下显示,1.注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、2.登录(如:用户名密码登录)
"
scope
"
:
[
'
register
'
,
'
login
'
]
"
scope
"
:
[
// 'register', 'login'
]
}
}
uni_modules/uni-id-pages/init.js
浏览文件 @
f4a5a96b
...
...
@@ -95,5 +95,12 @@ 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.json
浏览文件 @
f4a5a96b
...
...
@@ -4,12 +4,12 @@
"version"
:
"1.0.7"
,
"description"
:
"云端一体简单、统一、可扩展的用户中心页面模版"
,
"keywords"
:
[
"用户管理"
,
"用户中心"
,
"短信验证码"
,
"login"
,
"登录"
],
"用户管理"
,
"用户中心"
,
"短信验证码"
,
"login"
,
"登录"
],
"repository"
:
"https://gitcode.net/dcloud/hello_uni-id-pages"
,
"engines"
:
{
"HBuilderX"
:
"^3.4.17"
...
...
@@ -42,11 +42,11 @@
"uni-captcha"
,
"uni-config-center"
,
"uni-data-checkbox"
,
"uni-easyinput"
,
"uni-easyinput"
,
"uni-forms"
,
"uni-icons"
,
"uni-id-common"
,
"uni-list"
,
"uni-list"
,
"uni-load-more"
,
"uni-popup"
,
"uni-scss"
,
...
...
@@ -89,7 +89,7 @@
"钉钉"
:
"u"
,
"快手"
:
"u"
,
"飞书"
:
"u"
,
"京东"
:
"u"
"京东"
:
"u"
},
"快应用"
:
{
"华为"
:
"u"
,
...
...
@@ -97,5 +97,8 @@
}
}
}
},
"dependencies"
:
{
"jweixin-module"
:
"^1.6.0"
}
}
}
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
浏览文件 @
f4a5a96b
...
...
@@ -53,13 +53,20 @@
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
'
){
this
.
focusPhone
=
true
}
this
.
$nextTick
(()
=>
{
//关闭重复显示的登录快捷方式
if
([
'
weixin
'
,
'
apple
'
].
includes
(
type
))
{
...
...
@@ -67,7 +74,6 @@
item
.
id
!=
type
)
}
})
uni
.
$on
(
'
uni-id-pages-set-login-type
'
,
type
=>
{
this
.
type
=
type
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录