Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
af79f313
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看板
提交
af79f313
编写于
10月 14, 2022
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.0.25
上级
a74b4df2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
61 addition
and
66 deletion
+61
-66
uni_modules/uni-id-pages/changelog.md
uni_modules/uni-id-pages/changelog.md
+5
-0
uni_modules/uni-id-pages/common/store.js
uni_modules/uni-id-pages/common/store.js
+53
-53
uni_modules/uni-id-pages/package.json
uni_modules/uni-id-pages/package.json
+1
-1
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
+0
-10
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
...i-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
+2
-2
未找到文件。
uni_modules/uni-id-pages/changelog.md
浏览文件 @
af79f313
## 1.0.25(2022-10-14)
-
uni-id-co 增加 微信授权手机号登录方式
[
文档
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile
)
-
uni-id-co 增加 解绑第三方平台账号
[
文档
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-third-account
)
-
uni-id-co 微信绑定手机号支持通过
`getPhoneNumber`
事件回调的
`code`
绑定
[
文档
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin
)
-
修复 sendSmsCode 接口未在参数内传递 templateId 时 未能从配置文件读取 templateId 的Bug
## 1.0.24(2022-10-08)
-
修复 报uni-id-users表schema内错误的bug
## 1.0.23(2022-10-08)
...
...
uni_modules/uni-id-pages/common/store.js
浏览文件 @
af79f313
import
pagesJson
from
'
@/pages.json
'
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
)
const
db
=
uniCloud
.
database
();
const
db
=
uniCloud
.
database
();
const
usersTable
=
db
.
collection
(
'
uni-id-users
'
)
let
hostUserInfo
=
uni
.
getStorageSync
(
'
uni-id-pages-userInfo
'
)
||
{}
console
.
log
(
hostUserInfo
);
const
data
=
{
userInfo
:
hostUserInfo
,
hasLogin
:
Object
.
keys
(
hostUserInfo
).
length
!=
0
}
console
.
log
(
'
data
'
,
data
);
// 定义 mutations, 修改属性
export
const
mutations
=
{
// data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
async
updateUserInfo
(
data
=
false
)
{
let
hostUserInfo
=
uni
.
getStorageSync
(
'
uni-id-pages-userInfo
'
)
||
{}
console
.
log
(
hostUserInfo
);
const
data
=
{
userInfo
:
hostUserInfo
,
hasLogin
:
Object
.
keys
(
hostUserInfo
).
length
!=
0
}
console
.
log
(
'
data
'
,
data
);
// 定义 mutations, 修改属性
export
const
mutations
=
{
// data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
async
updateUserInfo
(
data
=
false
)
{
if
(
data
)
{
usersTable
.
where
(
'
_id==$env.uid
'
).
update
(
data
).
then
(
e
=>
{
console
.
log
(
e
);
...
...
@@ -32,32 +32,32 @@ export const mutations = {
icon
:
'
none
'
});
}
})
}
else
{
})
}
else
{
try
{
let
res
=
await
usersTable
.
where
(
"
'_id' == $cloudEnv_uid
"
)
.
field
(
'
mobile,nickname,username,email,avatar_file
'
)
.
get
()
console
.
log
(
'
fromDbData
'
,
res
.
result
.
data
);
this
.
setUserInfo
(
res
.
result
.
data
[
0
])
}
catch
(
e
)
{
this
.
setUserInfo
({},{
cover
:
true
})
console
.
error
(
e
.
message
,
e
.
errCode
);
}
}
},
async
setUserInfo
(
data
,
{
cover
}
=
{
cover
:
false
})
{
.
get
()
console
.
log
(
'
fromDbData
'
,
res
.
result
.
data
);
this
.
setUserInfo
(
res
.
result
.
data
[
0
])
}
catch
(
e
)
{
this
.
setUserInfo
({},{
cover
:
true
})
console
.
error
(
e
.
message
,
e
.
errCode
);
}
}
},
async
setUserInfo
(
data
,
{
cover
}
=
{
cover
:
false
})
{
console
.
log
(
'
set-userInfo
'
,
data
);
let
userInfo
=
cover
?
data
:
Object
.
assign
(
store
.
userInfo
,
data
)
store
.
userInfo
=
Object
.
assign
({},
userInfo
)
store
.
hasLogin
=
Object
.
keys
(
store
.
userInfo
).
length
!=
0
console
.
log
(
'
store.userInfo
'
,
store
.
userInfo
);
uni
.
setStorage
({
key
:
"
uni-id-pages-userInfo
"
,
data
:
store
.
userInfo
})
return
data
store
.
userInfo
=
Object
.
assign
({},
userInfo
)
store
.
hasLogin
=
Object
.
keys
(
store
.
userInfo
).
length
!=
0
console
.
log
(
'
store.userInfo
'
,
store
.
userInfo
);
uni
.
setStorage
({
key
:
"
uni-id-pages-userInfo
"
,
data
:
store
.
userInfo
})
return
data
},
async
logout
()
{
await
uniIdCo
.
logout
()
...
...
@@ -69,7 +69,7 @@ export const mutations = {
uni.$emit('uni-id-pages-logout')
this.setUserInfo({},{cover:true})
},
loginSuccess(e){
loginSuccess(e
= {}
){
const {
showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = ''
} = e
...
...
@@ -106,32 +106,32 @@ export const mutations = {
return window.history.go(-3)
}
// #endif
if (delta) {
const page = pagesJson.pages[0]
return uni.reLaunch({
url: `
/
$
{
page
.
path
}
`
})
}
uni.navigateBack({
delta
})
}
}
}
// #ifdef VUE2
import Vue from 'vue'
// 通过Vue.observable创建一个可响应的对象
export const store = Vue.observable(data)
// #endif
// #ifdef VUE3
import {
reactive
} from 'vue'
// 通过Vue.observable创建一个可响应的对象
export const store = reactive(data)
}
// #ifdef VUE2
import Vue from 'vue'
// 通过Vue.observable创建一个可响应的对象
export const store = Vue.observable(data)
// #endif
// #ifdef VUE3
import {
reactive
} from 'vue'
// 通过Vue.observable创建一个可响应的对象
export const store = reactive(data)
// #endif
uni_modules/uni-id-pages/package.json
浏览文件 @
af79f313
{
"id"
:
"uni-id-pages"
,
"displayName"
:
"uni-id-pages"
,
"version"
:
"1.0.2
4
"
,
"version"
:
"1.0.2
5
"
,
"description"
:
"云端一体简单、统一、可扩展的用户中心页面模版"
,
"keywords"
:
[
"用户管理"
,
...
...
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
浏览文件 @
af79f313
...
...
@@ -14,16 +14,6 @@
<uni-list-item
v-if=
"hasPwd"
class=
"item"
@
click=
"changePassword"
title=
"修改密码"
link
>
</uni-list-item>
</uni-list>
<uni-list
class=
"mt10"
>
<uni-list-item
@
click=
"bindThirdAccount('Weixin')"
title=
"微信"
link
:rightText=
"userInfo.wx_openid ? '已绑定': '未绑定' "
></uni-list-item>
<uni-list-item
@
click=
"bindThirdAccount('QQ')"
title=
"QQ"
link
:rightText=
"userInfo.qq_openid ? '已绑定': '未绑定' "
></uni-list-item>
<uni-list-item
@
click=
"bindThirdAccount('Alipay')"
title=
"支付宝"
link
:rightText=
"userInfo.ali_openid ? '已绑定': '未绑定' "
></uni-list-item>
<uni-list-item
@
click=
"bindThirdAccount('Apple')"
title=
"Apple"
link
:rightText=
"userInfo.apple_openid ? '已绑定': '未绑定' "
></uni-list-item>
</uni-list>
<uni-list
class=
"mt10"
>
<uni-list-item
@
click=
"deactivate"
title=
"注销账号"
link=
"navigateTo"
></uni-list-item>
</uni-list>
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
浏览文件 @
af79f313
{
"name"
:
"uni-id-co"
,
"version"
:
"1.0.2
2
"
,
"version"
:
"1.0.2
5
"
,
"description"
:
""
,
"main"
:
"index.js"
,
"keywords"
:
[],
...
...
@@ -16,4 +16,4 @@
"extensions"
:
{
"uni-cloud-sms"
:
{}
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录