Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
德宏大魔王
uni-starter
提交
a214c0b2
U
uni-starter
项目概览
德宏大魔王
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a214c0b2
编写于
2月 10, 2023
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2.1.2
上级
212eef74
变更
30
展开全部
显示空白变更内容
内联
并排
Showing
30 changed file
with
452 addition
and
613 deletion
+452
-613
changelog.md
changelog.md
+2
-2
package.json
package.json
+1
-1
uniCloud-aliyun/database/db_init.json
uniCloud-aliyun/database/db_init.json
+23
-97
uniCloud-aliyun/database/uni-stat-error-source-map.schema.ext.js
...d-aliyun/database/uni-stat-error-source-map.schema.ext.js
+29
-0
uniCloud-aliyun/database/uni-stat-error-source-map.schema.json
...oud-aliyun/database/uni-stat-error-source-map.schema.json
+61
-0
uni_modules/uni-forms/changelog.md
uni_modules/uni-forms/changelog.md
+2
-0
uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
...es/uni-forms/components/uni-forms-item/uni-forms-item.vue
+3
-7
uni_modules/uni-forms/package.json
uni_modules/uni-forms/package.json
+1
-1
uni_modules/uni-id-pages/changelog.md
uni_modules/uni-id-pages/changelog.md
+4
-0
uni_modules/uni-id-pages/common/login-page.mixin.js
uni_modules/uni-id-pages/common/login-page.mixin.js
+6
-1
uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue
...dules/uni-id-pages/components/cloud-image/cloud-image.vue
+20
-20
uni_modules/uni-id-pages/package.json
uni_modules/uni-id-pages/package.json
+1
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js
...ges/uniCloud/cloudfunctions/uni-id-co/common/constants.js
+7
-2
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
...i-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
+28
-7
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js
...es/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js
+2
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js
...loudfunctions/uni-id-co/middleware/verify-request-sign.js
+9
-3
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/update-user.js
...loud/cloudfunctions/uni-id-co/module/admin/update-user.js
+2
-3
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/index.js
...niCloud/cloudfunctions/uni-id-co/module/external/index.js
+2
-1
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/login.js
...niCloud/cloudfunctions/uni-id-co/module/external/login.js
+45
-6
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/register.js
...loud/cloudfunctions/uni-id-co/module/external/register.js
+32
-7
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/update-user-info.js
...udfunctions/uni-id-co/module/external/update-user-info.js
+161
-0
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
...i-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
+1
-1
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
...s/uni-id-pages/uniCloud/database/uni-id-users.schema.json
+10
-2
uni_modules/uni-id/changelog.md
uni_modules/uni-id/changelog.md
+0
-113
uni_modules/uni-id/package.json
uni_modules/uni-id/package.json
+0
-85
uni_modules/uni-id/readme.md
uni_modules/uni-id/readme.md
+0
-33
uni_modules/uni-id/uni-id.zip
uni_modules/uni-id/uni-id.zip
+0
-0
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
...s/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
+0
-201
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/index.js
...les/uni-id/uniCloud/cloudfunctions/common/uni-id/index.js
+0
-1
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package.json
...uni-id/uniCloud/cloudfunctions/common/uni-id/package.json
+0
-17
未找到文件。
changelog.md
浏览文件 @
a214c0b2
## 2.1.2(2023-02-
06
)
## 2.1.2(2023-02-
10
)
-
-
新增 微信小程序端 首页需强制登录时,隐藏返回首页按钮
## 2.1.1(2023-02-02)
## 2.1.1(2023-02-02)
-
重要 分包加载uni-id-pages 优化后 运行时主包大小为:637KB 分包为:78KB,发布后主包大小为:585KB 分包为:75KB
-
重要 分包加载uni-id-pages 优化后 运行时主包大小为:637KB 分包为:78KB,发布后主包大小为:585KB 分包为:75KB
-
新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料
[
详情参考
](
https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236
)
-
新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料
[
详情参考
](
https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236
)
...
...
package.json
浏览文件 @
a214c0b2
{
{
"id"
:
"uni-starter"
,
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"2.1.
1
"
,
"version"
:
"2.1.
2
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"keywords"
:
[
"login"
,
"login"
,
...
...
uniCloud-aliyun/database/db_init.json
浏览文件 @
a214c0b2
//
在本文件中可配置云数据库初始化,数据格式见:https://uniapp.dcloud.io/uniCloud/hellodb?id=db-init
//
在本文件中可配置云数据库初始化,数据格式见:https://uniapp.dcloud.io/uniCloud/hellodb?id=db-init
//
编写完毕后对本文件点右键,可按配置规则创建表和添加数据
//
编写完毕后对本文件点右键,可按配置规则创建表和添加数据
{
{
"uni-id-users"
:
{
"uni-id-users"
:
{
"data"
:
[{
"data"
:
[{
...
@@ -11,6 +13,15 @@
...
@@ -11,6 +13,15 @@
"mobile_confirmed"
:
1
"mobile_confirmed"
:
1
}]
}]
},
},
"uni-id-roles"
:
{
"data"
:
[{
"role_id"
:
"admin"
,
"role_name"
:
"超级管理员"
,
"permission"
:
[],
"comment"
:
"超级管理员拥有所有权限"
,
"create_date"
:
0
}]
},
"opendb-banner"
:
{
"opendb-banner"
:
{
"data"
:
[{
"data"
:
[{
"status"
:
true
,
"status"
:
true
,
...
@@ -22,8 +33,7 @@
...
@@ -22,8 +33,7 @@
"size"
:
70880
,
"size"
:
70880
,
"image"
:
{
"image"
:
{
"width"
:
500
,
"width"
:
500
,
"height"
:
333
,
"height"
:
333
"location"
:
"blob:http://localhost:8081/a3bfaab4-7ee6-44d5-a171-dc8225d83598"
},
},
"path"
:
"https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"
"path"
:
"https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"
},
},
...
@@ -43,8 +53,7 @@
...
@@ -43,8 +53,7 @@
"size"
:
70880
,
"size"
:
70880
,
"image"
:
{
"image"
:
{
"width"
:
500
,
"width"
:
500
,
"height"
:
333
,
"height"
:
333
"location"
:
"blob:http://localhost:8081/1a6f718a-4012-476a-9172-590fef2cc518"
},
},
"path"
:
"https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"
"path"
:
"https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"
},
},
...
@@ -72,95 +81,6 @@
...
@@ -72,95 +81,6 @@
"create_date"
:
1616092287006
"create_date"
:
1616092287006
}]
}]
},
},
"opendb-app-versions"
:
{
"data"
:
[{
"is_silently"
:
false
,
"is_mandatory"
:
false
,
"appid"
:
"__UNI__03B096E"
,
"name"
:
"uni-starter"
,
"title"
:
"新增升级中心"
,
"contents"
:
"新增升级中心"
,
"platform"
:
[
"Android"
],
"version"
:
"1.0.1"
,
"url"
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-3469aac7-a663-4c5d-8ee8-94275f8c09ab/3128d010-01c5-4121-a1d6-f3f919944a23.apk"
,
"stable_publish"
:
false
,
"type"
:
"native_app"
,
"create_date"
:
1616771628150
}],
"index"
:
[{
"IndexName"
:
"appid"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[{
"Name"
:
"appid"
,
"Direction"
:
"1"
},
{
"Name"
:
"uni_platform"
,
"Direction"
:
"1"
},
{
"Name"
:
"create_env"
,
"Direction"
:
"1"
}],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"查找上线发行应用"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[{
"Name"
:
"appid"
,
"Direction"
:
"1"
},
{
"Name"
:
"platform"
,
"Direction"
:
"1"
},
{
"Name"
:
"stable_publish"
,
"Direction"
:
"1"
},
{
"Name"
:
"uni_platform"
,
"Direction"
:
"1"
},
{
"Name"
:
"create_env"
,
"Direction"
:
"1"
}],
"MgoIsUnique"
:
false
}
}]
},
"opendb-verify-codes"
:
{
"data"
:
[]
},
"opendb-app-list"
:
{
"data"
:
[],
"index"
:
[{
"IndexName"
:
"appid"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[{
"Name"
:
"appid"
,
"Direction"
:
"1"
}],
"MgoIsUnique"
:
true
}
},
{
"IndexName"
:
"name"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[{
"Name"
:
"name"
,
"Direction"
:
"1"
}],
"MgoIsUnique"
:
false
}
}]
},
"uni-id-roles"
:
{
"data"
:
[]
},
"uni-id-permissions"
:
{
"data"
:
[]
},
"uni-id-log"
:
{
"data"
:
[]
},
"opendb-admin-menus"
:
{
"opendb-admin-menus"
:
{
"data"
:
[{
"data"
:
[{
"menu_id"
:
"index"
,
"menu_id"
:
"index"
,
...
@@ -579,8 +499,14 @@
...
@@ -579,8 +499,14 @@
}
}
]
]
},
},
"uni-id-permissions"
:
{},
"uni-id-log"
:
{},
"uni-id-tag"
:
{},
"uni-id-tag"
:
{},
"uni-id-device"
:
{},
"uni-id-device"
:
{},
"uni-id-scores"
:
{},
"opendb-verify-codes"
:
{},
"opendb-app-list"
:
{},
"opendb-app-versions"
:
{},
"opendb-device"
:
{},
"opendb-device"
:
{},
"opendb-department"
:
{},
"opendb-department"
:
{},
"opendb-sms-task"
:
{},
"opendb-sms-task"
:
{},
...
@@ -595,6 +521,7 @@
...
@@ -595,6 +521,7 @@
"uni-stat-app-platforms"
:
{},
"uni-stat-app-platforms"
:
{},
"uni-stat-error-logs"
:
{},
"uni-stat-error-logs"
:
{},
"uni-stat-error-result"
:
{},
"uni-stat-error-result"
:
{},
"uni-stat-error-source-map"
:
{},
"uni-stat-event-logs"
:
{},
"uni-stat-event-logs"
:
{},
"uni-stat-event-result"
:
{},
"uni-stat-event-result"
:
{},
"uni-stat-events"
:
{},
"uni-stat-events"
:
{},
...
@@ -608,8 +535,8 @@
...
@@ -608,8 +535,8 @@
"uni-stat-session-logs"
:
{},
"uni-stat-session-logs"
:
{},
"uni-stat-share-logs"
:
{},
"uni-stat-share-logs"
:
{},
"uni-stat-user-session-logs"
:
{},
"uni-stat-user-session-logs"
:
{},
"uni-pay-orders"
:
{},
"uni-stat-pay-result"
:
{},
"uni-stat-pay-result"
:
{},
"uni-pay-orders"
:
{},
"opendb-tempdata"
:
{},
"opendb-tempdata"
:
{},
"opendb-feedback"
:
{},
"opendb-feedback"
:
{},
"opendb-news-categories"
:
{},
"opendb-news-categories"
:
{},
...
@@ -618,6 +545,5 @@
...
@@ -618,6 +545,5 @@
"opendb-search-hot"
:
{},
"opendb-search-hot"
:
{},
"opendb-search-log"
:
{},
"opendb-search-log"
:
{},
"opendb-sign-in"
:
{},
"opendb-sign-in"
:
{},
"read-news-log"
:
{},
"read-news-log"
:
{}
"uni-id-scores"
:
{}
}
}
uniCloud-aliyun/database/uni-stat-error-source-map.schema.ext.js
0 → 100644
浏览文件 @
a214c0b2
module
.
exports
=
{
trigger
:
{
// 监听 - 删除前
beforeDelete
:
async
function
(
obj
=
{})
{
let
{
collection
,
operation
,
where
,
field
}
=
obj
;
// 删除表记录前先删除云存储内的文件
const
db
=
uniCloud
.
database
();
const
_
=
db
.
command
;
let
getRes
=
await
db
.
collection
(
"
uni-stat-error-source-map
"
).
where
(
where
).
limit
(
1000
).
get
();
let
list
=
getRes
.
data
;
if
(
list
&&
list
.
length
>
0
)
{
let
fileList
=
list
.
map
((
item
,
index
)
=>
{
return
item
.
file_id
;
});
try
{
let
deleteFileRes
=
await
uniCloud
.
deleteFile
({
fileList
});
// console.log('deleteFileRes: ', deleteFileRes)
}
catch
(
err
)
{}
}
}
}
}
uniCloud-aliyun/database/uni-stat-error-source-map.schema.json
0 → 100644
浏览文件 @
a214c0b2
{
"bsonType"
:
"object"
,
"description"
:
"存储sourceMap文件资源地址"
,
"required"
:
[],
"permission"
:
{
"read"
:
"'READ_UNI_STAT_ERROR_RESULT' in auth.permission"
,
"create"
:
"'READ_UNI_STAT_ERROR_RESULT' in auth.permission"
,
"update"
:
"'READ_UNI_STAT_ERROR_RESULT' in auth.permission"
,
"delete"
:
"'READ_UNI_STAT_ERROR_RESULT' in auth.permission"
},
"properties"
:
{
"_id"
:
{
"description"
:
"ID,系统自动生成"
},
"appid"
:
{
"bsonType"
:
"string"
,
"description"
:
"应用ID"
},
"uni_platform"
:
{
"title"
:
"应用平台"
,
"bsonType"
:
"string"
,
"description"
:
"uni客户端平台,如:web、mp-weixin、mp-alipay、app等"
,
"trim"
:
"both"
},
"version"
:
{
"bsonType"
:
"string"
,
"description"
:
"客户端上报的应用版本号"
},
"file_id"
:
{
"bsonType"
:
"string"
,
"description"
:
"fileID"
},
"url"
:
{
"bsonType"
:
"string"
,
"description"
:
"文件外网url路径"
},
"name"
:
{
"bsonType"
:
"string"
,
"description"
:
"文件名"
},
"size"
:
{
"bsonType"
:
"int"
,
"description"
:
"文件大小"
},
"cloud_path"
:
{
"bsonType"
:
"string"
,
"description"
:
"云端路径,通过该值识别是否是同一个文件"
},
"base"
:
{
"bsonType"
:
"string"
,
"description"
:
"基础路径"
},
"create_time"
:
{
"bsonType"
:
"timestamp"
,
"description"
:
"上传时间"
,
"forceDefaultValue"
:
{
"$env"
:
"now"
}
}
}
}
uni_modules/uni-forms/changelog.md
浏览文件 @
a214c0b2
## 1.4.9(2023-02-10)
-
修复 required 参数无法动态绑定
## 1.4.8(2022-08-23)
## 1.4.8(2022-08-23)
-
优化 根据 rules 自动添加 required 的问题
-
优化 根据 rules 自动添加 required 的问题
## 1.4.7(2022-08-22)
## 1.4.7(2022-08-22)
...
...
uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
浏览文件 @
a214c0b2
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<view
class=
"uni-forms-item"
<view
class=
"uni-forms-item"
:class=
"['is-direction-' + localLabelPos ,border?'uni-forms-item--border':'' ,border && isFirstBorder?'is-first-border':'']"
>
:class=
"['is-direction-' + localLabelPos ,border?'uni-forms-item--border':'' ,border && isFirstBorder?'is-first-border':'']"
>
<slot
name=
"label"
>
<slot
name=
"label"
>
<view
class=
"uni-forms-item__label"
:class=
"
{'no-label':!label
&&
!
isR
equired}"
<view
class=
"uni-forms-item__label"
:class=
"
{'no-label':!label
&&
!
r
equired}"
:style="{width:localLabelWidth,justifyContent: localLabelAlign}">
:style="{width:localLabelWidth,justifyContent: localLabelAlign}">
<text
v-if=
"
isR
equired"
class=
"is-required"
>
*
</text>
<text
v-if=
"
r
equired"
class=
"is-required"
>
*
</text>
<text>
{{
label
}}
</text>
<text>
{{
label
}}
</text>
</view>
</view>
</slot>
</slot>
...
@@ -126,7 +126,6 @@
...
@@ -126,7 +126,6 @@
data
()
{
data
()
{
return
{
return
{
errMsg
:
''
,
errMsg
:
''
,
isRequired
:
false
,
userRules
:
null
,
userRules
:
null
,
localLabelAlign
:
'
left
'
,
localLabelAlign
:
'
left
'
,
localLabelWidth
:
'
65px
'
,
localLabelWidth
:
'
65px
'
,
...
@@ -315,7 +314,6 @@
...
@@ -315,7 +314,6 @@
this
.
localLabelWidth
=
this
.
_labelWidthUnit
(
labelWidth
)
this
.
localLabelWidth
=
this
.
_labelWidthUnit
(
labelWidth
)
// 标签位置
// 标签位置
this
.
localLabelPos
=
this
.
_labelPosition
()
this
.
localLabelPos
=
this
.
_labelPosition
()
this
.
isRequired
=
this
.
required
// 将需要校验的子组件加入form 队列
// 将需要校验的子组件加入form 队列
this
.
form
&&
type
&&
childrens
.
push
(
this
)
this
.
form
&&
type
&&
childrens
.
push
(
this
)
...
@@ -351,8 +349,6 @@
...
@@ -351,8 +349,6 @@
this
.
validator
=
validator
this
.
validator
=
validator
// 默认值赋予
// 默认值赋予
this
.
itemSetValue
(
_getDataValue
(
this
.
name
,
localData
))
this
.
itemSetValue
(
_getDataValue
(
this
.
name
,
localData
))
this
.
isRequired
=
this
.
_isRequired
()
},
},
unInit
()
{
unInit
()
{
if
(
this
.
form
)
{
if
(
this
.
form
)
{
...
...
uni_modules/uni-forms/package.json
浏览文件 @
a214c0b2
{
{
"id"
:
"uni-forms"
,
"id"
:
"uni-forms"
,
"displayName"
:
"uni-forms 表单"
,
"displayName"
:
"uni-forms 表单"
,
"version"
:
"1.4.
8
"
,
"version"
:
"1.4.
9
"
,
"description"
:
"由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据"
,
"description"
:
"由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据"
,
"keywords"
:
[
"keywords"
:
[
"uni-ui"
,
"uni-ui"
,
...
...
uni_modules/uni-id-pages/changelog.md
浏览文件 @
a214c0b2
## 1.1.2(2023-02-10)
-
新增 微信小程序端 首页需强制登录时,隐藏返回首页按钮
-
uni-id-co 新增 外部联登后修改用户信息接口(updateUserInfoByExternal)
[
文档
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo
)
-
uni-id-co 优化外部联登接口(登录、注册)逻辑
## 1.1.1(2023-02-02)
## 1.1.1(2023-02-02)
-
新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料
[
详情参考
](
https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236
)
-
新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料
[
详情参考
](
https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236
)
## 1.1.0(2023-01-31)
## 1.1.0(2023-01-31)
...
...
uni_modules/uni-id-pages/common/login-page.mixin.js
浏览文件 @
a214c0b2
...
@@ -46,6 +46,11 @@ let mixin = {
...
@@ -46,6 +46,11 @@ let mixin = {
if
(
e
.
uniIdRedirectUrl
)
{
if
(
e
.
uniIdRedirectUrl
)
{
this
.
uniIdRedirectUrl
=
decodeURIComponent
(
e
.
uniIdRedirectUrl
)
this
.
uniIdRedirectUrl
=
decodeURIComponent
(
e
.
uniIdRedirectUrl
)
}
}
if
(
getCurrentPages
().
length
===
1
){
uni
.
hideHomeButton
()
console
.
log
(
'
已隐藏:返回首页按钮
'
);
}
},
},
computed
:
{
computed
:
{
needAgreements
()
{
needAgreements
()
{
...
...
components/cloud-image/cloud-image.vue
→
uni_modules/uni-id-pages/
components/cloud-image/cloud-image.vue
浏览文件 @
a214c0b2
uni_modules/uni-id-pages/package.json
浏览文件 @
a214c0b2
{
{
"id"
:
"uni-id-pages"
,
"id"
:
"uni-id-pages"
,
"displayName"
:
"uni-id-pages"
,
"displayName"
:
"uni-id-pages"
,
"version"
:
"1.1.
1
"
,
"version"
:
"1.1.
2
"
,
"description"
:
"云端一体简单、统一、可扩展的用户中心页面模版"
,
"description"
:
"云端一体简单、统一、可扩展的用户中心页面模版"
,
"keywords"
:
[
"keywords"
:
[
"用户管理"
,
"用户管理"
,
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js
浏览文件 @
a214c0b2
...
@@ -10,6 +10,7 @@ const openDataCollectionName = 'opendb-open-data'
...
@@ -10,6 +10,7 @@ const openDataCollectionName = 'opendb-open-data'
const
openDataCollection
=
db
.
collection
(
openDataCollectionName
)
const
openDataCollection
=
db
.
collection
(
openDataCollectionName
)
const
USER_IDENTIFIER
=
{
const
USER_IDENTIFIER
=
{
_id
:
'
uid
'
,
username
:
'
username
'
,
username
:
'
username
'
,
mobile
:
'
mobile
'
,
mobile
:
'
mobile
'
,
email
:
'
email
'
,
email
:
'
email
'
,
...
@@ -22,7 +23,8 @@ const USER_IDENTIFIER = {
...
@@ -22,7 +23,8 @@ const USER_IDENTIFIER = {
'
qq_openid.app
'
:
'
qq-account
'
,
'
qq_openid.app
'
:
'
qq-account
'
,
'
qq_openid.mp
'
:
'
qq-account
'
,
'
qq_openid.mp
'
:
'
qq-account
'
,
ali_openid
:
'
alipay-account
'
,
ali_openid
:
'
alipay-account
'
,
apple_openid
:
'
alipay-account
'
apple_openid
:
'
alipay-account
'
,
identities
:
'
idp
'
}
}
const
USER_STATUS
=
{
const
USER_STATUS
=
{
...
@@ -76,6 +78,8 @@ const EMAIL_SCENE = {
...
@@ -76,6 +78,8 @@ const EMAIL_SCENE = {
BIND_EMAIL
:
'
bind-email
'
BIND_EMAIL
:
'
bind-email
'
}
}
const
EXTERNAL_DIRECT_CONNECT_PROVIDER
=
'
externalDirectConnect
'
module
.
exports
=
{
module
.
exports
=
{
db
,
db
,
dbCmd
,
dbCmd
,
...
@@ -88,5 +92,6 @@ module.exports = {
...
@@ -88,5 +92,6 @@ module.exports = {
CAPTCHA_SCENE
,
CAPTCHA_SCENE
,
LOG_TYPE
,
LOG_TYPE
,
SMS_SCENE
,
SMS_SCENE
,
EMAIL_SCENE
EMAIL_SCENE
,
EXTERNAL_DIRECT_CONNECT_PROVIDER
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
浏览文件 @
a214c0b2
...
@@ -83,7 +83,8 @@ const {
...
@@ -83,7 +83,8 @@ const {
const
{
const
{
externalRegister
,
externalRegister
,
externalLogin
externalLogin
,
updateUserInfoByExternal
}
=
require
(
'
./module/external
'
)
}
=
require
(
'
./module/external
'
)
module
.
exports
=
{
module
.
exports
=
{
...
@@ -602,15 +603,35 @@ module.exports = {
...
@@ -602,15 +603,35 @@ module.exports = {
*/
*/
setPwd
,
setPwd
,
/**
/**
* 外部
用户注册,将自身系统的用户账号导入uniId,为其创建一个对应uniId的账号(unieid),使得该账号可以使用依赖uniId的系统及功能。
* 外部
注册用户
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register
* @returns
* @param {object} params
* @param {string} params.externalUid 业务系统的用户id
* @param {string} params.nickname 昵称
* @param {string} params.gender 性别
* @param {string} params.avatar 头像
* @returns {object}
*/
*/
externalRegister
,
externalRegister
,
/**
/**
* 外部用户登录
,使用unieid即可登录
* 外部用户登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login
* @returns
* @param {object} params
* */
* @param {string} params.userId uni-id体系用户id
externalLogin
* @param {string} params.externalUid 业务系统的用户id
* @returns {object}
*/
externalLogin
,
/**
* 使用 userId 或 externalUid 获取用户信息
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo
* @param {object} params
* @param {string} params.userId uni-id体系的用户id
* @param {string} params.externalUid 业务系统的用户id
* @param {string} params.nickname 昵称
* @param {string} params.gender 性别
* @param {string} params.avatar 头像
* @returns {object}
*/
updateUserInfoByExternal
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js
浏览文件 @
a214c0b2
const
{
const
{
db
,
dbCmd
,
dbCmd
,
userCollection
userCollection
}
=
require
(
'
../../common/constants
'
)
}
=
require
(
'
../../common/constants
'
)
...
@@ -85,6 +84,8 @@ function getUserQueryCondition (userRecord = {}) {
...
@@ -85,6 +84,8 @@ function getUserQueryCondition (userRecord = {}) {
username
:
username
.
toLowerCase
()
username
:
username
.
toLowerCase
()
})
})
}
}
}
else
if
(
key
===
'
identities
'
)
{
queryItem
.
identities
=
dbCmd
.
elemMatch
(
value
)
}
}
condition
.
push
(
queryItem
)
condition
.
push
(
queryItem
)
}
}
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js
浏览文件 @
a214c0b2
...
@@ -2,17 +2,23 @@ const crypto = require('crypto')
...
@@ -2,17 +2,23 @@ const crypto = require('crypto')
const
{
ERROR
}
=
require
(
'
../common/error
'
)
const
{
ERROR
}
=
require
(
'
../common/error
'
)
const
needSignFunctions
=
new
Set
([
const
needSignFunctions
=
new
Set
([
'
externalRegister
'
,
'
externalRegister
'
,
'
externalLogin
'
'
externalLogin
'
,
'
updateUserInfoByExternal
'
])
])
module
.
exports
=
function
()
{
module
.
exports
=
function
()
{
const
methodName
=
this
.
getMethodName
()
const
methodName
=
this
.
getMethodName
()
const
{
source
}
=
this
.
getUniversalClientInfo
()
const
{
source
}
=
this
.
getUniversalClientInfo
()
// 非 HTTP 方式请求不需要鉴权
if
(
source
!==
'
http
'
)
return
// 指定接口需要鉴权
// 指定接口需要鉴权
if
(
!
needSignFunctions
.
has
(
methodName
))
return
if
(
!
needSignFunctions
.
has
(
methodName
))
return
// 非 HTTP 方式请求不需要鉴权
if
(
source
!==
'
http
'
)
{
throw
{
errCode
:
ERROR
.
ILLEGAL_REQUEST
}
}
const
timeout
=
20
*
1000
// 请求超过20秒不能再请求,防止重放攻击
const
timeout
=
20
*
1000
// 请求超过20秒不能再请求,防止重放攻击
const
{
headers
,
body
:
_body
}
=
this
.
getHttpInfo
()
const
{
headers
,
body
:
_body
}
=
this
.
getHttpInfo
()
const
{
'
uni-id-nonce
'
:
nonce
,
'
uni-id-timestamp
'
:
timestamp
,
'
uni-id-signature
'
:
signature
}
=
headers
const
{
'
uni-id-nonce
'
:
nonce
,
'
uni-id-timestamp
'
:
timestamp
,
'
uni-id-signature
'
:
signature
}
=
headers
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/update-user.js
浏览文件 @
a214c0b2
...
@@ -83,10 +83,10 @@ module.exports = async function (params = {}) {
...
@@ -83,10 +83,10 @@ module.exports = async function (params = {}) {
username
,
username
,
dcloud_appid
:
authorizedApp
,
dcloud_appid
:
authorizedApp
,
nickname
,
nickname
,
role
:
role
,
role
,
mobile
,
mobile
,
email
,
email
,
tags
:
tags
,
tags
,
status
status
}
}
...
@@ -132,7 +132,6 @@ module.exports = async function (params = {}) {
...
@@ -132,7 +132,6 @@ module.exports = async function (params = {}) {
await
userCollection
.
doc
(
uid
).
update
(
realData
)
await
userCollection
.
doc
(
uid
).
update
(
realData
)
return
{
return
{
errCode
:
0
errCode
:
0
}
}
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/index.js
浏览文件 @
a214c0b2
module
.
exports
=
{
module
.
exports
=
{
externalRegister
:
require
(
'
./register
'
),
externalRegister
:
require
(
'
./register
'
),
externalLogin
:
require
(
'
./login
'
)
externalLogin
:
require
(
'
./login
'
),
updateUserInfoByExternal
:
require
(
'
./update-user-info
'
)
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/login.js
浏览文件 @
a214c0b2
const
{
preLogin
,
postLogin
}
=
require
(
'
../../lib/utils/login
'
)
const
{
preLogin
,
postLogin
}
=
require
(
'
../../lib/utils/login
'
)
const
{
EXTERNAL_DIRECT_CONNECT_PROVIDER
}
=
require
(
'
../../common/constants
'
)
const
{
ERROR
}
=
require
(
'
../../common/error
'
)
/**
* 外部用户登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login
* @param {object} params
* @param {string} params.uid uni-id体系用户id
* @param {string} params.externalUid 业务系统的用户id
* @returns {object}
*/
module
.
exports
=
async
function
(
params
=
{})
{
module
.
exports
=
async
function
(
params
=
{})
{
const
schema
=
{
const
schema
=
{
unieid
:
'
username
'
uid
:
{
required
:
false
,
type
:
'
string
'
},
externalUid
:
{
required
:
false
,
type
:
'
string
'
}
}
}
this
.
middleware
.
validate
(
params
,
schema
)
this
.
middleware
.
validate
(
params
,
schema
)
const
{
const
{
unieid
uid
,
externalUid
}
=
params
}
=
params
const
user
=
await
preLogin
.
call
(
this
,
{
if
(
!
uid
&&
!
externalUid
)
{
user
:
{
throw
{
username
:
unieid
errCode
:
ERROR
.
PARAM_REQUIRED
,
errMsgValue
:
{
param
:
'
uid or externalUid
'
}
}
}
let
query
if
(
uid
)
{
query
=
{
_id
:
uid
}
}
}
else
{
query
=
{
identities
:
{
provider
:
EXTERNAL_DIRECT_CONNECT_PROVIDER
,
uid
:
externalUid
}
}
}
const
user
=
await
preLogin
.
call
(
this
,
{
user
:
query
})
})
const
result
=
await
postLogin
.
call
(
this
,
{
const
result
=
await
postLogin
.
call
(
this
,
{
...
@@ -24,6 +63,6 @@ module.exports = async function (params = {}) {
...
@@ -24,6 +63,6 @@ module.exports = async function (params = {}) {
return
{
return
{
errCode
:
result
.
errCode
,
errCode
:
result
.
errCode
,
newToken
:
result
.
newToken
,
newToken
:
result
.
newToken
,
u
nie
id
u
id
:
result
.
u
id
}
}
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/register.js
浏览文件 @
a214c0b2
const
{
preRegister
,
postRegister
}
=
require
(
'
../../lib/utils/register
'
)
const
{
preRegister
,
postRegister
}
=
require
(
'
../../lib/utils/register
'
)
const
{
EXTERNAL_DIRECT_CONNECT_PROVIDER
}
=
require
(
'
../../common/constants
'
)
/**
* 外部注册用户
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register
* @param {object} params
* @param {string} params.externalUid 业务系统的用户id
* @param {string} params.nickname 昵称
* @param {string} params.gender 性别
* @param {string} params.avatar 头像
* @returns {object}
*/
module
.
exports
=
async
function
(
params
=
{})
{
module
.
exports
=
async
function
(
params
=
{})
{
const
schema
=
{
const
schema
=
{
unieid
:
'
username
'
,
externalUid
:
'
string
'
,
nickname
:
{
nickname
:
{
required
:
false
,
required
:
false
,
type
:
'
nickname
'
type
:
'
nickname
'
...
@@ -20,7 +31,7 @@ module.exports = async function (params = {}) {
...
@@ -20,7 +31,7 @@ module.exports = async function (params = {}) {
this
.
middleware
.
validate
(
params
,
schema
)
this
.
middleware
.
validate
(
params
,
schema
)
const
{
const
{
unie
id
,
externalU
id
,
avatar
,
avatar
,
gender
,
gender
,
nickname
nickname
...
@@ -28,25 +39,39 @@ module.exports = async function (params = {}) {
...
@@ -28,25 +39,39 @@ module.exports = async function (params = {}) {
await
preRegister
.
call
(
this
,
{
await
preRegister
.
call
(
this
,
{
user
:
{
user
:
{
username
:
unieid
identities
:
{
provider
:
EXTERNAL_DIRECT_CONNECT_PROVIDER
,
uid
:
externalUid
}
}
}
})
})
const
result
=
await
postRegister
.
call
(
this
,
{
const
result
=
await
postRegister
.
call
(
this
,
{
user
:
{
user
:
{
username
:
unieid
,
avatar
,
gender
,
nickname
,
identities
:
[
{
provider
:
EXTERNAL_DIRECT_CONNECT_PROVIDER
,
userInfo
:
{
avatar
,
avatar
,
gender
,
gender
,
nickname
nickname
},
uid
:
externalUid
}
]
}
}
})
})
return
{
return
{
errCode
:
result
.
errCode
,
errCode
:
result
.
errCode
,
newToken
:
result
.
newToken
,
newToken
:
result
.
newToken
,
unie
id
,
externalU
id
,
avatar
,
avatar
,
gender
,
gender
,
nickname
nickname
,
uid
:
result
.
uid
}
}
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/update-user-info.js
0 → 100644
浏览文件 @
a214c0b2
const
{
userCollection
,
EXTERNAL_DIRECT_CONNECT_PROVIDER
}
=
require
(
'
../../common/constants
'
)
const
{
ERROR
}
=
require
(
'
../../common/error
'
)
const
{
findUser
}
=
require
(
'
../../lib/utils/account
'
)
const
PasswordUtils
=
require
(
'
../../lib/utils/password
'
)
/**
* 使用 uid 或 externalUid 获取用户信息
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo
* @param {object} params
* @param {string} params.uid uni-id体系的用户id
* @param {string} params.externalUid 业务系统的用户id
* @param {string} params.nickname 昵称
* @param {string} params.gender 性别
* @param {string} params.avatar 头像
* @returns {object}
*/
module
.
exports
=
async
function
(
params
=
{})
{
const
schema
=
{
uid
:
{
required
:
false
,
type
:
'
string
'
},
externalUid
:
{
required
:
false
,
type
:
'
string
'
},
username
:
{
required
:
false
,
type
:
'
string
'
},
password
:
{
required
:
false
,
type
:
'
password
'
},
authorizedApp
:
{
required
:
false
,
type
:
'
array<string>
'
},
// 指定允许登录的app,传空数组或不传时表示可以不可以在任何端登录
nickname
:
{
required
:
false
,
type
:
'
nickname
'
},
role
:
{
require
:
false
,
type
:
'
array<string>
'
},
mobile
:
{
required
:
false
,
type
:
'
mobile
'
},
email
:
{
required
:
false
,
type
:
'
email
'
},
tags
:
{
required
:
false
,
type
:
'
array<string>
'
},
status
:
{
required
:
false
,
type
:
'
number
'
}
}
this
.
middleware
.
validate
(
params
,
schema
)
const
{
uid
,
externalUid
,
username
,
password
,
authorizedApp
,
nickname
,
role
,
mobile
,
email
,
tags
,
status
}
=
params
if
(
!
uid
&&
!
externalUid
)
{
throw
{
errCode
:
ERROR
.
PARAM_REQUIRED
,
errMsgVal
:
{
param
:
'
uid or externalUid
'
}
}
}
let
query
if
(
uid
)
{
query
=
{
_id
:
uid
}
}
else
{
query
=
{
identities
:
{
provider
:
EXTERNAL_DIRECT_CONNECT_PROVIDER
,
uid
:
externalUid
}
}
}
// 更新的用户数据字段
const
data
=
{
username
,
dcloud_appid
:
authorizedApp
,
nickname
,
role
,
mobile
,
email
,
tags
,
status
}
const
realData
=
Object
.
keys
(
data
).
reduce
((
res
,
key
)
=>
{
const
item
=
data
[
key
]
if
(
item
!==
undefined
)
{
res
[
key
]
=
item
}
return
res
},
{})
// 更新用户名时验证用户名是否重新
if
(
username
)
{
const
{
userMatched
}
=
await
findUser
({
userQuery
:
{
username
},
authorizedApp
})
if
(
userMatched
.
filter
(
user
=>
user
.
_id
!==
uid
).
length
)
{
throw
{
errCode
:
ERROR
.
ACCOUNT_EXISTS
}
}
}
if
(
password
)
{
const
passwordUtils
=
new
PasswordUtils
({
clientInfo
:
this
.
getUniversalClientInfo
(),
passwordSecret
:
this
.
config
.
passwordSecret
})
const
{
passwordHash
,
version
}
=
passwordUtils
.
generatePasswordHash
({
password
})
realData
.
password
=
passwordHash
realData
.
password_secret_version
=
version
}
await
userCollection
.
where
(
query
).
update
(
realData
)
return
{
errCode
:
0
}
}
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
浏览文件 @
a214c0b2
{
{
"name"
:
"uni-id-co"
,
"name"
:
"uni-id-co"
,
"version"
:
"1.
0.38
"
,
"version"
:
"1.
1.2
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"keywords"
:
[],
"keywords"
:
[],
...
...
uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json
浏览文件 @
a214c0b2
...
@@ -388,7 +388,7 @@
...
@@ -388,7 +388,7 @@
"title"
:
"用户名"
,
"title"
:
"用户名"
,
"trim"
:
"both"
,
"trim"
:
"both"
,
"permission"
:
{
"permission"
:
{
"read"
:
true
,
"read"
:
"doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
}
},
},
...
@@ -459,6 +459,14 @@
...
@@ -459,6 +459,14 @@
"read"
:
false
,
"read"
:
false
,
"write"
:
false
"write"
:
false
}
}
},
"identities"
:
{
"bsonType"
:
"array"
,
"description"
:
"三方平台身份信息;一个对象代表一个身份,参数支持: provider 身份源, userInfo 三方用户信息, openid 三方openid, unionid 三方unionid, uid 三方uid"
,
"permission"
:
{
"read"
:
"'READ_UNI_ID_USERS' in auth.permission"
,
"write"
:
"'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission"
}
}
}
},
},
"required"
:
[]
"required"
:
[]
...
...
uni_modules/uni-id/changelog.md
已删除
100644 → 0
浏览文件 @
212eef74
## 3.3.29(2022-10-20)
-
使用
[
uni-open-bridge-common
](
https://uniapp.dcloud.net.cn/uniCloud/uni-open-bridge.html#common
)
存储用户三方凭证,以便其他服务使用。
## 3.3.28(2022-07-27)
-
修复 app端微信登录返回的accessToken过期时间(expired)不正确的Bug
## 3.3.27(2022-07-27)
-
短信发送失败、微信登录失败等场景下输出原始错误方便排查错误
## 3.3.26(2022-07-08)
-
兼容配置放在uni-id下的逻辑,但是仍推荐使用uni-config-center
## 3.3.25(2022-06-30)
-
修复config文件不合法时未抛出具体错误的Bug
## 3.3.24(2022-06-28)
-
修复3.3.12引出的使用多应用配置时报错的Bug
## 3.3.23(2022-06-13)
-
修复上版本引出的部分依赖未找到的Bug
## 3.3.22(2022-06-13)
-
新增 preferedWebPlatform 配置用于解决HBuilderX 3.4.9版本起web端platform不一致的问题
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=prefered-web-platform
)
## 3.3.21(2022-05-24)
-
修复createInstance传入clientInfo无效的Bug
## 3.3.20(2022-05-19)
-
调整以下错误码(账号已注册[uni-id-account-exists]、账号不存在[uni-id-account-not-exists]、账号已绑定[uni-id-account-bound])
## 3.3.19(2022-05-19)
-
修复 addUser 部分情况下会创建出重复账号的Bug
## 3.3.18(2022-05-12)
-
调整绑定、解绑邮箱手机号接口,只要传递code参数就进行验证码校验即使传递的值为undefined
## 3.3.17(2022-05-09)
-
register_env内增加os_name字段用于区分注册时的客户端系统类型
## 3.3.16(2022-05-09)
-
修复 addUser接口添加的用户无法使用密码登录的Bug
[
详情
](
https://ask.dcloud.net.cn/question/144670
)
## 3.3.15(2022-05-08)
-
修复config文件语法错误时报
`this.t is not a function`
的Bug 感谢@寒暄
## 3.3.14(2022-05-08)
-
新增 getWeixinUserInfo接口 用于获取app平台微信登录用户的用户信息
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#get-weixin-user-info
)
-
新增 addUser接口 用于手动添加用户
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#add-user
)
-
新增 resetPwdBySms接口 用于使用短信验证码重置密码
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#reset-pwd-by-sms
)
-
新增 refreshToken接口 用于主动刷新用户token
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#refresh-token
)
-
调整 用户注册时记录用户注册环境到 register_env 字段
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#user-table
)
-
调整 用户注册时将注册 ip 移至 register_env 内
## 3.3.13(2022-03-04)
-
createInstance方法支持传递clientInfo
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id.html#create-instance
)
-
修复
`this.t is not a function`
报错
## 3.3.12(2022-01-15)
-
新增 preferedAppPlatform 配置用于解决uni-app vue2版本vue3版本获取platform不一致的问题
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=prefered-app-platform
)
-
修复 checkToken 未返回自定义token内容的Bug
## 3.3.11(2022-01-11)
-
修复用户名密码登录时多个应用出现重复用户名登录报错的Bug
## 3.3.10(2022-01-07)
-
新增 自定义国际化语言支持
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=custom-i8n
)
-
修复 一键登录时未校验重复手机号是否已验证的Bug
-
修复 Apple登录时用户邮箱为空时报错的Bug
-
修复 登录接口未传username时错误提示不正确的Bug
## 3.3.9(2021-11-09)
-
去除重复的context.xxx未找到的提示语
## 3.3.8(2021-10-28)
-
新增 用户账户封禁接口
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=ban-account
)
-
新增 用户账户注销接口
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=close-account
)
-
修复 未传appid时用户重复注册的Bug
## 3.3.7(2021-10-08)
-
移除部分接口的废弃提示
## 3.3.6(2021-09-08)
-
修复 邀请码可能重复的Bug
## 3.3.5(2021-08-10)
-
修复版本号错误
## 3.3.4(2021-08-10)
-
微信、QQ、支付宝登录新增type参数用于指定当前是登录还是注册
## 3.3.3(2021-08-04)
-
修复使用数组形式的配置文件报错的Bug
## 3.3.2(2021-08-03)
-
修复上3.3.0版本引出的createInstance接口传入配置不生效的Bug 感谢
[
hmh
](
https://gitee.com/hmh
)
## 3.3.1(2021-07-30)
-
修复 将设置用户允许登录的应用列表时传入空数组报错的Bug
## 3.3.0(2021-07-30)
-
新增 不同端应用配置隔离
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config
)
-
新增 不同端用户隔离
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user
)
+
此版本升级需要开发者处理一下用户数据,请参考
[
补齐用户dcloud_appid字段
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=makeup-dcloud-appid
)
-
新增 QQ登录、注册相关功能
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=qq
)
-
调整 不再支持绑定手机、邮箱时不填验证码直接绑定
## 3.2.1(2021-07-09)
-
撤销3.2.0版本所做的调整
## 3.2.0(2021-07-09)
-
【重要】支持不同端(管理端、用户端等)用户隔离
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-user
)
-
支持不同端(管理端、用户端等)配置文件隔离
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=isolate-config
)
## 3.1.3(2021-07-08)
-
移除插件内误传的node_modules
## 3.1.2(2021-07-08)
-
修复 微信小程序绑定微信账号时报错的Bug
## 3.1.1(2021-07-01)
-
使用新的错误码规范,兼容旧版
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=errcode
)
-
修复微信登录、绑定时未返回用户accessToken的Bug
## 3.1.0(2021-04-19)
-
增加对用户名、邮箱、密码字段的两端去空格
-
默认忽略用户名、邮箱的大小写
[
详情
](
https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive
)
-
修复 customToken导出async方法报错的Bug
## 3.0.12(2021-04-13)
-
调整bindTokenToDevice默认值为false
## 3.0.11(2021-04-12)
-
修复3.0.7版本引出的多个用户访问时可能出现30201报错的Bug
## 3.0.10(2021-04-08)
-
优化错误提示
## 3.0.9(2021-04-08)
-
bindMobile接口支持通过一键登录的方式绑定
-
优化错误提示
## 3.0.8(2021-03-19)
-
修复 3.0.7版本某些情况下生成token报错的Bug
## 3.0.7(2021-03-19)
-
新增 支持uni-config-center,更新uni-id无须再担心配置被覆盖
[
详情
](
https://uniapp.dcloud.io/uniCloud/uni-id?id=uni-config-center
)
-
新增 自定义token内容,可以缓存角色权限之外的更多信息到客户端
[
详情
](
https://uniapp.dcloud.io/uniCloud/uni-id?id=custom-token
)
-
新增 支持传入context获取uni-id实例,防止单实例多并发时全局context混乱
[
详情
](
https://uniapp.dcloud.io/uniCloud/uni-id?id=create-instance
)
## 3.0.6(2021-03-05)
-
新增
[
uniID.wxBizDataCrypt
](
https://uniapp.dcloud.io/uniCloud/uni-id?id=%e5%be%ae%e4%bf%a1%e6%95%b0%e6%8d%ae%e8%a7%a3%e5%af%86
)
方法
-
优化loginByApple方法,提高接口响应速度
## 3.0.5(2021-02-03)
-
调整为uni_modules目录规范
uni_modules/uni-id/package.json
已删除
100644 → 0
浏览文件 @
212eef74
{
"id"
:
"uni-id"
,
"displayName"
:
"uni-id"
,
"version"
:
"3.3.29"
,
"description"
:
"简单、统一、可扩展的用户中心"
,
"keywords"
:
[
"uniid"
,
"uni-id"
,
"用户管理"
,
"用户中心"
,
"短信验证码"
],
"repository"
:
"https://gitee.com/dcloud/uni-id.git"
,
"engines"
:
{
"HBuilderX"
:
"^3.1.0"
},
"dcloudext"
:
{
"sale"
:
{
"regular"
:
{
"price"
:
"0.00"
},
"sourcecode"
:
{
"price"
:
"0.00"
}
},
"contact"
:
{
"qq"
:
""
},
"declaration"
:
{
"ads"
:
"无"
,
"data"
:
"无"
,
"permissions"
:
"无"
},
"npmurl"
:
""
,
"type"
:
"unicloud-template-function"
},
"uni_modules"
:
{
"dependencies"
:
[
"uni-config-center"
,
"uni-open-bridge-common"
],
"encrypt"
:
[],
"platforms"
:
{
"cloud"
:
{
"tcb"
:
"y"
,
"aliyun"
:
"y"
},
"client"
:
{
"App"
:
{
"app-vue"
:
"u"
,
"app-nvue"
:
"u"
},
"H5-mobile"
:
{
"Safari"
:
"u"
,
"Android Browser"
:
"u"
,
"微信浏览器(Android)"
:
"u"
,
"QQ浏览器(Android)"
:
"u"
},
"H5-pc"
:
{
"Chrome"
:
"u"
,
"IE"
:
"u"
,
"Edge"
:
"u"
,
"Firefox"
:
"u"
,
"Safari"
:
"u"
},
"小程序"
:
{
"微信"
:
"u"
,
"阿里"
:
"u"
,
"百度"
:
"u"
,
"字节跳动"
:
"u"
,
"QQ"
:
"u"
,
"钉钉"
:
"u"
,
"快手"
:
"u"
,
"飞书"
:
"u"
,
"京东"
:
"u"
},
"快应用"
:
{
"华为"
:
"u"
,
"联盟"
:
"u"
},
"Vue"
:
{
"vue2"
:
"y"
,
"vue3"
:
"u"
}
}
}
}
}
uni_modules/uni-id/readme.md
已删除
100644 → 0
浏览文件 @
212eef74
**文档已移至[uni-id文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id)**
> 一般uni-id升级大版本时为不兼容更新,从低版本迁移到高版本请参考:[uni-id迁移指南](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=migration)
## 重要升级说明
**uni-id 3.x版本,搭配的uniCloud admin版本需大于1.2.10。**
### 缓存角色权限
自
`uni-id 3.0.0`
起,支持在token内缓存用户的角色权限,默认开启此功能,各登录接口的needPermission参数不再生效。如需关闭请在config内配置
`"removePermissionAndRoleFromToken": true`
。
为什么要缓存角色权限?要知道云数据库是按照读写次数来收取费用的,并且读写数据库会拖慢接口响应速度。未配置
`"removePermissionAndRoleFromToken": true`
的情况下,可以在调用checkToken接口时不查询数据库获取用户角色权限。
详细checkToken流程如下:
![](
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/ed45d350-5a4d-11eb-b997-9918a5dda011.jpg
)
可以看出,旧版token(removePermissionAndRoleFromToken为true时生成的)在checkToken时如需返回权限需要进行两次数据库查询。新版token不需要查库即可返回权限信息。
**注意**
-
由于角色权限缓存在token内,可能会存在权限已经更新但是用户token未过期之前依然是旧版角色权限的情况。可以调短一些token过期时间来减少这种情况的影响。
-
admin角色token内不包含permission,如需自行判断用户是否有某个权限,要注意admin角色需要额外判断一下,写法如下
```
js
const
{
role
,
permission
}
=
await
uniID
.
checkToken
(
event
.
uniIdToken
)
if
(
role
.
includes
(
'
admin
'
)
||
permission
.
includes
(
'
your permission id
'
))
{
// 当前角色拥有'your permission id'对应的权限
}
```
\ No newline at end of file
uni_modules/uni-id/uni-id.zip
已删除
100644 → 0
浏览文件 @
212eef74
文件已删除
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/LICENSE.md
已删除
100644 → 0
浏览文件 @
212eef74
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1.
Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2.
Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3.
Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4.
Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5.
Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6.
Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7.
Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8.
Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9.
Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/index.js
已删除
100644 → 0
浏览文件 @
212eef74
此差异已折叠。
点击以展开。
uni_modules/uni-id/uniCloud/cloudfunctions/common/uni-id/package.json
已删除
100644 → 0
浏览文件 @
212eef74
{
"name"
:
"uni-id"
,
"version"
:
"3.3.29"
,
"description"
:
"uni-id for uniCloud"
,
"main"
:
"index.js"
,
"homepage"
:
"https://uniapp.dcloud.io/uniCloud/uni-id"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"git+https://gitee.com/dcloud/uni-id.git"
},
"author"
:
""
,
"license"
:
"Apache-2.0"
,
"dependencies"
:
{
"uni-config-center"
:
"file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
,
"uni-open-bridge-common"
:
"file:../../../../../uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common"
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录