diff --git a/uni_modules/uni-id-pages/common/check-id-card.js b/uni_modules/uni-id-pages/common/check-id-card.js
new file mode 100644
index 0000000000000000000000000000000000000000..c01ea18c9a27d1640e5bd124b6e337cb54e4f9f4
--- /dev/null
+++ b/uni_modules/uni-id-pages/common/check-id-card.js
@@ -0,0 +1,14 @@
+export default function checkIdCard (idCardNumber) {
+ if (!idCardNumber) return false
+
+ const coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
+ const checkCode = [1, 0, 'x', 9, 8, 7, 6, 5, 4, 3, 2]
+ const code = idCardNumber.substring(17)
+
+ let sum = 0
+ for (let i = 0; i < 17; i++) {
+ sum += Number(idCardNumber.charAt(i)) * coefficient[i]
+ }
+
+ return checkCode[sum % 11].toString() === code.toLowerCase()
+}
\ No newline at end of file
diff --git a/uni_modules/uni-id-pages/common/store.js b/uni_modules/uni-id-pages/common/store.js
index 98966d08657a76156d2a5075efb59b01b12eaccf..30510bf5f69090c0744551680c929c3352d76012 100644
--- a/uni_modules/uni-id-pages/common/store.js
+++ b/uni_modules/uni-id-pages/common/store.js
@@ -37,12 +37,21 @@ export const mutations = {
})
} else {
+ const uniIdCo = uniCloud.importObject("uni-id-co", {
+ customUI: true
+ })
try {
let res = await usersTable.where("'_id' == $cloudEnv_uid")
- .field('mobile,nickname,username,email,avatar_file')
- .get()
+ .field('mobile,nickname,username,email,avatar_file')
+ .get()
+
+ const realNameRes = await uniIdCo.getRealNameInfo()
+
// console.log('fromDbData',res.result.data);
- this.setUserInfo(res.result.data[0])
+ this.setUserInfo({
+ ...res.result.data[0],
+ realNameAuth: realNameRes
+ })
} catch (e) {
this.setUserInfo({},{cover:true})
console.error(e.message, e.errCode);
diff --git a/uni_modules/uni-id-pages/config.js b/uni_modules/uni-id-pages/config.js
index b03a2bf94ab8e55b989ec33db81932052dbff939..e847774904015c7b21e0bc94379681b158bed1ea 100644
--- a/uni_modules/uni-id-pages/config.js
+++ b/uni_modules/uni-id-pages/config.js
@@ -1,50 +1,50 @@
export default {
- //调试模式
- "debug": false,
- /*
+ // 调试模式
+ debug: false,
+ /*
登录类型 未列举到的或运行环境不支持的,将被自动隐藏。
如果需要在不同平台有不同的配置,直接用条件编译即可
*/
- "isAdmin": false, // 区分管理端与用户端
- "loginTypes": [
- // "qq",
- // "xiaomi",
- // "sinaweibo",
- // "taobao",
- // "facebook",
- // "google",
- // "alipay",
- // "douyin",
+ isAdmin: false, // 区分管理端与用户端
+ loginTypes: [
+ // "qq",
+ // "xiaomi",
+ // "sinaweibo",
+ // "taobao",
+ // "facebook",
+ // "google",
+ // "alipay",
+ // "douyin",
- // #ifdef APP
- "univerify",
- // #endif
- "weixin",
- "username",
- // #ifdef APP
- "apple",
- // #endif
- "smsCode"
- ],
- //政策协议
- "agreements": {
- "serviceUrl": "https://xxx", //用户服务协议链接
- "privacyUrl": "https://xxx", //隐私政策条款链接
- // 哪些场景下显示,1.注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、2.登录(如:用户名密码登录)
- "scope": [
- 'register', 'login'
- ]
- },
- // 提供各类服务接入(如微信登录服务)的应用id
- "appid": {
- "weixin": {
- // 微信公众号的appid,来源:登录微信公众号(https://mp.weixin.qq.com)-> 设置与开发 -> 基本配置 -> 公众号开发信息 -> AppID
- "h5": "xxxxxx",
- // 微信开放平台的appid,来源:登录微信开放平台(https://open.weixin.qq.com) -> 管理中心 -> 网站应用 -> 选择对应的应用名称,点击查看 -> AppID
- "web": "xxxxxx"
- }
- },
- /**
+ // #ifdef APP
+ 'univerify',
+ // #endif
+ 'weixin',
+ 'username',
+ // #ifdef APP
+ 'apple',
+ // #endif
+ 'smsCode'
+ ],
+ // 政策协议
+ agreements: {
+ serviceUrl: 'https://xxx', // 用户服务协议链接
+ privacyUrl: 'https://xxx', // 隐私政策条款链接
+ // 哪些场景下显示,1.注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、2.登录(如:用户名密码登录)
+ scope: [
+ 'register', 'login', 'realNameVerify'
+ ]
+ },
+ // 提供各类服务接入(如微信登录服务)的应用id
+ appid: {
+ weixin: {
+ // 微信公众号的appid,来源:登录微信公众号(https://mp.weixin.qq.com)-> 设置与开发 -> 基本配置 -> 公众号开发信息 -> AppID
+ h5: 'xxxxxx',
+ // 微信开放平台的appid,来源:登录微信开放平台(https://open.weixin.qq.com) -> 管理中心 -> 网站应用 -> 选择对应的应用名称,点击查看 -> AppID
+ web: 'xxxxxx'
+ }
+ },
+ /**
* 密码强度
* super(超强:密码必须包含大小写字母、数字和特殊符号,长度范围:8-16位之间)
* strong(强: 密密码必须包含字母、数字和特殊符号,长度范围:8-16位之间)
@@ -52,8 +52,8 @@ export default {
* weak(弱:密码必须包含字母和数字,长度范围:6-16位之间)
* 为空或false则不验证密码强度
*/
- "passwordStrength":"medium",
- /**
+ passwordStrength: 'medium',
+ /**
* 登录后允许用户设置密码(只针对未设置密码得用户)
* 开启此功能将 setPasswordAfterLogin 设置为 true 即可
* "setPasswordAfterLogin": false
@@ -63,5 +63,5 @@ export default {
* "allowSkip": true
* }
* */
- "setPasswordAfterLogin": false
+ setPasswordAfterLogin: false
}
diff --git a/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify-icon.svg b/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify-icon.svg
new file mode 100644
index 0000000000000000000000000000000000000000..6eb17492cdd9236edb20d789bf97e74c1a25b2fe
--- /dev/null
+++ b/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify.vue b/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify.vue
new file mode 100644
index 0000000000000000000000000000000000000000..06d53b601c3858b5730b581462d1ced1e31b50e0
--- /dev/null
+++ b/uni_modules/uni-id-pages/pages/userinfo/face-verify/face-verify.vue
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+ {{verifyFailTitle}}
+ {{verifyFailContent}}
+
+
+ 请在控制台查看详细错误(此提示仅在开发环境展示)
+
+
+ 确认{{realNameDesensitized}}本人操作
+
+
+
+
+ 温馨提示
+
+
+ {{text}}
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue b/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue
new file mode 100644
index 0000000000000000000000000000000000000000..22da3982ecb573edb1cda495293b96b136e11a01
--- /dev/null
+++ b/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+ 实名认证
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
index 36b34b17ad803f2b00aed403a05b1294bcb04906..58dc45e196a0c750fdd7d9afbae02130dc3ed390 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
@@ -11,12 +11,19 @@
+
+
+
+
+
+
+
@@ -30,9 +37,7 @@