Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
e62a9ae4
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看板
提交
e62a9ae4
编写于
12月 09, 2022
作者:
study夏羽
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.0.37
上级
0143adf2
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
161 addition
and
167 deletion
+161
-167
pages/index/index.vue
pages/index/index.vue
+7
-7
uni_modules/uni-id-pages/changelog.md
uni_modules/uni-id-pages/changelog.md
+2
-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/login-page.scss
uni_modules/uni-id-pages/common/login-page.scss
+2
-1
uni_modules/uni-id-pages/common/store.js
uni_modules/uni-id-pages/common/store.js
+8
-11
uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue
...es/components/uni-id-pages-avatar/uni-id-pages-avatar.vue
+6
-8
uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue
...nts/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue
+7
-7
uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue
...nents/uni-id-pages-email-form/uni-id-pages-email-form.vue
+3
-3
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
+13
-18
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/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue
...s/uni-id-pages-user-profile/uni-id-pages-user-profile.vue
+1
-1
uni_modules/uni-id-pages/config.js
uni_modules/uni-id-pages/config.js
+1
-1
uni_modules/uni-id-pages/init.js
uni_modules/uni-id-pages/init.js
+6
-9
uni_modules/uni-id-pages/package.json
uni_modules/uni-id-pages/package.json
+1
-1
uni_modules/uni-id-pages/pages/common/webview/webview.vue
uni_modules/uni-id-pages/pages/common/webview/webview.vue
+1
-1
uni_modules/uni-id-pages/pages/login/login-smscode.vue
uni_modules/uni-id-pages/pages/login/login-smscode.vue
+3
-3
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+11
-5
uni_modules/uni-id-pages/pages/login/login-withpwd.vue
uni_modules/uni-id-pages/pages/login/login-withpwd.vue
+1
-1
uni_modules/uni-id-pages/pages/register/register-admin.vue
uni_modules/uni-id-pages/pages/register/register-admin.vue
+5
-4
uni_modules/uni-id-pages/pages/register/register-by-email.vue
...modules/uni-id-pages/pages/register/register-by-email.vue
+4
-4
uni_modules/uni-id-pages/pages/register/register.vue
uni_modules/uni-id-pages/pages/register/register.vue
+3
-3
uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
...modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
+11
-11
uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
+5
-5
uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
...s/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
+2
-2
uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
...les/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
+4
-4
uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue
...dules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue
+1
-1
uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
...les/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
+1
-1
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
+1
-1
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
+48
-51
未找到文件。
pages/index/index.vue
浏览文件 @
e62a9ae4
<
template
>
<view
class=
"content"
>
<button
@
click=
"toUserInfoPage"
>
个人资料
</button>
<uni-forms-item
label=
"登录方式"
>
<uni-forms-item
label=
"登录方式"
labelWidth=
"70"
>
<uni-data-checkbox
:multiple=
"false"
v-model=
"loginType"
:localdata=
"loginTypeOption"
></uni-data-checkbox>
</uni-forms-item>
<button
@
click=
"toLogin"
>
前往登录
</button>
...
...
@@ -26,12 +26,12 @@
"
value
"
:
"
smsCode
"
,
"
text
"
:
"
手机验证码
"
},
{
"
value
"
:
"
apple
"
,
"
text
"
:
"
苹果登录
"
},
{
"
value
"
:
"
weixinMobile
"
,
"
text
"
:
"
微信手机号登录
"
}]
"
value
"
:
"
apple
"
,
"
text
"
:
"
苹果登录
"
},
{
"
value
"
:
"
weixinMobile
"
,
"
text
"
:
"
微信手机号登录
"
}]
}
},
onLoad
()
{},
...
...
uni_modules/uni-id-pages/changelog.md
浏览文件 @
e62a9ae4
## 1.0.37(2022-12-09)
-
优化admin端样式
## 1.0.36(2022-12-08)
-
uni-id-co 优化 手机号与邮箱验证规则为空字符串时不校验
-
uni-id-co 修复
`updateUser`
接口部分参数为空时数据修改异常
...
...
uni_modules/uni-id-pages/common/login-page.mixin.js
浏览文件 @
e62a9ae4
...
...
@@ -36,7 +36,7 @@ let mixin = {
})
}
this
.
$nextTick
(
n
=>
{
console
.
log
(
this
.
$refs
.
uniFabLogin
);
//
console.log(this.$refs.uniFabLogin);
this
.
$refs
.
uniFabLogin
.
login
({
code
:
e
.
code
},
'
weixin
'
)
...
...
uni_modules/uni-id-pages/common/login-page.scss
浏览文件 @
e62a9ae4
...
...
@@ -115,9 +115,10 @@
text-align
:
center
;
height
:
40px
;
line-height
:
40px
;
margin
:
15px
0
0
0
;
margin
:
15px
0
10px
0
;
color
:
#FFF
!
important
;
border-radius
:
5px
;
font-size
:
16px
;
}
.uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd
{
...
...
uni_modules/uni-id-pages/common/store.js
浏览文件 @
e62a9ae4
...
...
@@ -6,20 +6,20 @@ const db = uniCloud.database();
const
usersTable
=
db
.
collection
(
'
uni-id-users
'
)
let
hostUserInfo
=
uni
.
getStorageSync
(
'
uni-id-pages-userInfo
'
)
||
{}
console
.
log
(
hostUserInfo
);
//
console.log( hostUserInfo);
const
data
=
{
userInfo
:
hostUserInfo
,
hasLogin
:
Object
.
keys
(
hostUserInfo
).
length
!=
0
}
console
.
log
(
'
data
'
,
data
);
//
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
);
//
console.log(e);
if
(
e
.
result
.
updated
)
{
uni
.
showToast
({
title
:
"
更新成功
"
,
...
...
@@ -41,7 +41,7 @@ export const mutations = {
let
res
=
await
usersTable
.
where
(
"
'_id' == $cloudEnv_uid
"
)
.
field
(
'
mobile,nickname,username,email,avatar_file
'
)
.
get
()
console
.
log
(
'
fromDbData
'
,
res
.
result
.
data
);
//
console.log('fromDbData',res.result.data);
this
.
setUserInfo
(
res
.
result
.
data
[
0
])
}
catch
(
e
)
{
this
.
setUserInfo
({},{
cover
:
true
})
...
...
@@ -50,11 +50,11 @@ export const mutations = {
}
},
async
setUserInfo
(
data
,
{
cover
}
=
{
cover
:
false
})
{
console
.
log
(
'
set-userInfo
'
,
data
);
//
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
);
//
console.log('store.userInfo', store.userInfo);
uni
.
setStorage
({
key
:
"
uni-id-pages-userInfo
"
,
data
:
store
.
userInfo
...
...
@@ -90,7 +90,7 @@ export const mutations = {
}
// #ifdef H5
if (e.loginType == 'weixin') {
console.log('window.history', window.history);
//
console.log('window.history', window.history);
return window.history.go(-3)
}
// #endif
...
...
@@ -110,10 +110,7 @@ export const mutations = {
const {
showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '', passwordConfirmed
} = e
console.log({
toastText,
autoBack
});
// console.log({toastText,autoBack});
if (showToast) {
uni.showToast({
title: toastText,
...
...
uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue
浏览文件 @
e62a9ae4
...
...
@@ -48,7 +48,7 @@
async
mounted
()
{
// #ifdef H5
this
.
isPC
=
!
[
'
ios
'
,
'
android
'
].
includes
(
uni
.
getSystemInfoSync
().
platform
);
console
.
log
(
'
this.isPC
'
,
this
.
isPC
,
uni
.
getSystemInfoSync
().
platform
);
//
console.log(' this.isPC', this.isPC, uni.getSystemInfoSync().platform);
// #endif
},
computed
:
{
...
...
@@ -68,7 +68,7 @@
mutations
.
updateUserInfo
({
avatar_file
})
},
uploadAvatarImg
(
res
)
{
console
.
log
(
this
.
hasLogin
);
//
console.log(this.hasLogin);
if
(
!
this
.
hasLogin
){
return
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd
'
...
...
@@ -84,7 +84,7 @@
count
:
1
,
crop
,
success
:
async
(
res
)
=>
{
console
.
log
(
res
);
//
console.log(res);
let
tempFile
=
res
.
tempFiles
[
0
],
avatar_file
=
{
// #ifdef H5
...
...
@@ -109,13 +109,13 @@
}
},
complete
(
e
)
{
console
.
log
(
e
);
//
console.log(e);
}
});
})
}
// #endif
console
.
log
(
this
.
userInfo
);
//
console.log(this.userInfo);
let
cloudPath
=
this
.
userInfo
.
_id
+
''
+
Date
.
now
()
avatar_file
.
name
=
cloudPath
uni
.
showLoading
({
...
...
@@ -131,9 +131,7 @@
});
// console.log(result)
avatar_file
.
url
=
fileID
console
.
log
({
avatar_file
});
// console.log({avatar_file});
uni
.
hideLoading
()
this
.
setAvatarFile
(
avatar_file
)
}
...
...
uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue
浏览文件 @
e62a9ae4
...
...
@@ -28,12 +28,12 @@
uni
.
showLoading
({
mask
:
true
})
wx
.
checkSession
({
success
()
{
console
.
log
(
'
session_key 未过期
'
);
//
console.log('session_key 未过期');
resolve
()
uni
.
hideLoading
()
},
fail
()
{
console
.
log
(
'
session_key 已经失效,正在执行更新
'
);
//
console.log('session_key 已经失效,正在执行更新');
wx
.
login
({
success
({
code
...
...
@@ -41,13 +41,13 @@
uniCloud
.
importObject
(
"
uni-id-co
"
,{
customUI
:
true
}).
loginByWeixin
({
code
}).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
resolve
()
}).
catch
(
e
=>
{
console
.
log
(
e
);
reject
()
}).
finally
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
hideLoading
()
})
},
...
...
@@ -61,13 +61,13 @@
})
},
async
bindMobileByMpWeixin
(
e
)
{
console
.
log
(
e
);
//
console.log(e);
if
(
e
.
detail
.
errMsg
==
"
getPhoneNumber:ok
"
)
{
console
.
log
(
e
.
detail
);
//
console.log(e.detail);
//检查登录信息是否过期,否则通过重新登录刷新session_key
await
this
.
beforeGetphonenumber
()
uniIdCo
.
bindMobileByMpWeixin
(
e
.
detail
).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
this
.
$emit
(
'
success
'
)
}).
finally
(
e
=>
{
this
.
closeMe
()
...
...
uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue
浏览文件 @
e62a9ae4
...
...
@@ -141,7 +141,7 @@
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
,
{
customUI
:
true
})
console
.
log
(
'
uniIdCo
'
,
uniIdCo
)
//
console.log('uniIdCo', uniIdCo)
console
.
log
(
'
sendEmailCode
'
,{
"
email
"
:
this
.
email
,
"
scene
"
:
this
.
type
,
...
...
@@ -152,7 +152,7 @@
"
scene
"
:
this
.
type
,
"
captcha
"
:
this
.
captcha
}).
then
(
result
=>
{
console
.
log
(
result
.
code
);
//
console.log(result.code);
uni
.
showToast
({
title
:
"
邮箱验证码发送成功
"
,
icon
:
'
none
'
,
...
...
@@ -161,7 +161,7 @@
this
.
reverseNumber
=
Number
(
this
.
count
);
this
.
getCode
();
}).
catch
(
e
=>
{
console
.
log
(
JSON
.
stringify
(
e
));
//
console.log(JSON.stringify(e));
if
(
e
.
code
==
"
uni-id-invalid-mail-template
"
)
{
this
.
modelValue
=
"
123456
"
uni
.
showToast
({
...
...
uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
浏览文件 @
e62a9ae4
...
...
@@ -49,7 +49,7 @@
return
this
.
getParentComponent
().
agree
},
set
(
agree
)
{
console
.
log
(
'
setAgree
'
,
agree
);
//
console.log('setAgree', agree);
return
this
.
getParentComponent
().
agree
=
agree
}
}
...
...
@@ -294,15 +294,13 @@
}
//判断是否需要弹出隐私协议授权框
console
.
log
(
type
,
this
.
agree
);
//
console.log(type, this.agree);
let
needAgreements
=
(
config
?.
agreements
?.
scope
||
[]).
includes
(
'
register
'
)
console
.
log
({
needAgreements
});
// console.log({needAgreements});
if
(
type
!=
'
univerify
'
&&
needAgreements
&&
!
this
.
agree
)
{
let
agreementsRef
=
this
.
getParentComponent
().
$refs
.
agreements
return
agreementsRef
.
popup
(()
=>
{
console
.
log
(
type
,
navigateBack
);
//
console.log(type, navigateBack);
this
.
login_before
(
type
,
navigateBack
,
options
)
})
}
...
...
@@ -314,7 +312,7 @@
document
.
domain
+
(
window
.
location
.
href
.
includes
(
'
#
'
)?
'
/#
'
:
''
)
+
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin
'
console
.
log
(
'
redirectUrl----
'
,
redirectUrl
);
//
console.log('redirectUrl----',redirectUrl);
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'
micromessenger
'
){
// console.log('在微信公众号内');
...
...
@@ -340,7 +338,7 @@
if
(
type
==
'
univerify
'
)
{
let
univerifyManager
=
uni
.
getUniverifyManager
()
let
onButtonsClickFn
=
async
res
=>
{
console
.
log
(
'
点击了第三方登录,provider:
'
,
res
,
res
.
provider
,
this
.
univerifyStyle
.
buttons
.
list
);
//
console.log('点击了第三方登录,provider:', res, res.provider, this.univerifyStyle.buttons.list);
//同步一键登录弹出层隐私协议框是否打勾
let
agree
=
(
await
uni
.
getCheckBoxState
())[
1
].
state
//console.log('agree',agree);
...
...
@@ -381,7 +379,7 @@
return
univerifyManager
.
login
({
"
univerifyStyle
"
:
this
.
univerifyStyle
,
success
:
res
=>
{
console
.
log
(
'
login success
'
,
res
)
//
console.log('login success', res)
this
.
login
(
res
.
authResult
,
'
univerify
'
)
},
fail
(
err
)
{
...
...
@@ -392,7 +390,7 @@
});
},
complete
:
async
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
hideLoading
()
//同步一键登录弹出层隐私协议框是否打勾
this
.
agree
=
(
await
uni
.
getCheckBoxState
())[
1
].
state
...
...
@@ -415,7 +413,7 @@
"
univerifyStyle
"
:
this
.
univerifyStyle
,
// #endif
success
:
async
e
=>
{
console
.
log
(
e
);
//
console.log(e);
if
(
type
==
'
apple
'
)
{
let
res
=
await
this
.
getUserInfo
({
provider
:
"
apple
"
...
...
@@ -434,18 +432,15 @@
})
},
login
(
params
,
type
)
{
//联网验证登录
console
.
log
(
'
执行登录开始----
'
);
console
.
log
({
params
,
type
});
// console.log('执行登录开始----');
console
.
log
({
params
,
type
});
//toLowerCase
let
action
=
'
loginBy
'
+
type
.
trim
().
replace
(
type
[
0
],
type
[
0
].
toUpperCase
())
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
,{
customUI
:
true
})
uniIdCo
[
action
](
params
).
then
(
result
=>
{
console
.
log
(
"
login-result
"
,
result
);
//
console.log("login-result", result);
uni
.
showToast
({
title
:
'
登录成功
'
,
icon
:
'
none
'
,
...
...
@@ -468,7 +463,7 @@
mutations
.
loginSuccess
(
result
)
})
.
catch
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
showModal
({
content
:
e
.
message
,
confirmText
:
"
知道了
"
,
...
...
uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
浏览文件 @
e62a9ae4
...
...
@@ -146,7 +146,7 @@
"
scene
"
:
this
.
type
,
"
captcha
"
:
this
.
captcha
}).
then
(
result
=>
{
console
.
log
(
result
.
code
);
//
console.log(result.code);
uni
.
showToast
({
title
:
"
短信验证码发送成功
"
,
icon
:
'
none
'
,
...
...
@@ -155,7 +155,7 @@
this
.
reverseNumber
=
Number
(
this
.
count
);
this
.
getCode
();
}).
catch
(
e
=>
{
console
.
log
(
JSON
.
stringify
(
e
));
//
console.log(JSON.stringify(e));
if
(
e
.
code
==
"
uni-id-invalid-sms-template-id
"
)
{
this
.
modelValue
=
"
123456
"
uni
.
showToast
({
...
...
uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue
浏览文件 @
e62a9ae4
...
...
@@ -31,7 +31,7 @@
uni
.
getUserProfile
({
desc
:
"
用于设置账户昵称和头像
"
,
complete
:
(
e
)
=>
{
console
.
log
(
"
getUserProfile:
"
,
e
);
//
console.log("getUserProfile:", e);
callBack
(
e
)
}
})
...
...
uni_modules/uni-id-pages/config.js
浏览文件 @
e62a9ae4
...
...
@@ -5,7 +5,7 @@ export default {
登录类型 未列举到的或运行环境不支持的,将被自动隐藏。
如果需要在不同平台有不同的配置,直接用条件编译即可
*/
"
isAdmin
"
:
fals
e
,
// 区分管理端与用户端
"
isAdmin
"
:
tru
e
,
// 区分管理端与用户端
"
loginTypes
"
:
[
// "qq",
// "xiaomi",
...
...
uni_modules/uni-id-pages/init.js
浏览文件 @
e62a9ae4
...
...
@@ -50,7 +50,7 @@ export default async function() {
uni
.
preLogin
({
provider
:
'
univerify
'
,
complete
:
e
=>
{
console
.
log
(
e
);
//
console.log(e);
}
})
}
...
...
@@ -65,10 +65,7 @@ export default async function() {
code
,
// 错误码详见https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=returnvalue
message
})
{
console
.
error
(
'
onDBError
'
,
{
code
,
message
});
// console.error('onDBError', {code,message});
}
// 解绑clientDB错误事件
//db.off('error', onDBError)
...
...
@@ -77,17 +74,17 @@ export default async function() {
//4. 同步客户端push_clientid至device表
if
(
uniCloud
.
onRefreshToken
)
{
uniCloud
.
onRefreshToken
(()
=>
{
console
.
log
(
'
onRefreshToken
'
);
//
console.log('onRefreshToken');
if
(
uni
.
getPushClientId
)
{
uni
.
getPushClientId
({
success
:
async
function
(
e
)
{
console
.
log
(
e
)
//
console.log(e)
let
pushClientId
=
e
.
cid
console
.
log
(
pushClientId
);
//
console.log(pushClientId);
let
res
=
await
uniIdCo
.
setPushCid
({
pushClientId
})
console
.
log
(
'
getPushClientId
'
,
res
);
//
console.log('getPushClientId', res);
},
fail
(
e
)
{
console
.
log
(
e
)
...
...
uni_modules/uni-id-pages/package.json
浏览文件 @
e62a9ae4
{
"id"
:
"uni-id-pages"
,
"displayName"
:
"uni-id-pages"
,
"version"
:
"1.0.3
6
"
,
"version"
:
"1.0.3
7
"
,
"description"
:
"云端一体简单、统一、可扩展的用户中心页面模版"
,
"keywords"
:
[
"用户管理"
,
...
...
uni_modules/uni-id-pages/pages/common/webview/webview.vue
浏览文件 @
e62a9ae4
...
...
@@ -20,7 +20,7 @@
});
title
=
"
页面路径错误
"
}
else
{
console
.
log
(
url
,
title
);
//
console.log(url,title);
this
.
url
=
url
;
}
if
(
title
){
...
...
uni_modules/uni-id-pages/pages/login/login-smscode.vue
浏览文件 @
e62a9ae4
...
...
@@ -38,7 +38,7 @@
this
.
phone
=
phoneNumber
;
},
onShow
()
{
console
.
log
(
'
onShow
'
);
//
console.log('onShow');
// #ifdef H5
document
.
onkeydown
=
event
=>
{
var
e
=
event
||
window
.
event
;
...
...
@@ -68,14 +68,14 @@
"
code
"
:
this
.
code
,
"
captcha
"
:
this
.
captcha
}).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
this
.
loginSuccess
(
e
)
}).
catch
(
e
=>
{
if
(
e
.
errCode
==
'
uni-id-captcha-required
'
)
{
this
.
$refs
.
popup
.
open
()
}
else
{
console
.
log
(
e
.
errMsg
);
console
.
log
(
e
.
errCode
);
//
console.log(e.errCode);
}
}).
finally
(
e
=>
{
this
.
captcha
=
''
...
...
uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
浏览文件 @
e62a9ae4
...
...
@@ -11,8 +11,8 @@
<text
class=
"tip"
>
将根据第三方账号服务平台的授权范围获取你的信息
</text>
<view
class=
"quickLogin"
>
<image
v-if=
"type !== 'weixinMobile'"
@
click=
"quickLogin"
:src=
"imgSrc"
mode=
"widthFix"
class=
"quickLoginBtn"
></image>
<button
v-else
type=
"primary"
open-type=
"getPhoneNumber"
@
getphonenumber=
"quickLogi
n"
>
微信授权手机号登录
</button>
<uni-id-pages-agreements
scope=
"register"
ref=
"agreements"
></uni-id-pages-agreements>
<button
v-else
type=
"primary"
open-type=
"getPhoneNumber"
@
getphonenumber=
"quickLogin"
class=
"uni-bt
n"
>
微信授权手机号登录
</button>
<uni-id-pages-agreements
scope=
"register"
ref=
"agreements"
></uni-id-pages-agreements>
</view>
</
template
>
<
template
v-else
>
...
...
@@ -56,7 +56,7 @@
}
},
async
onLoad
(
e
)
{
console
.
log
(
e
);
//
console.log(e);
//获取通过url传递的参数type设置当前登录方式,如果没传递直接默认以配置的登录
let
type
=
e
.
type
||
config
.
loginTypes
[
0
]
this
.
type
=
type
...
...
@@ -111,7 +111,7 @@
this
.
$refs
.
uniFabLogin
.
login_before
(
this
.
type
,
true
,
options
)
},
toSmsPage
()
{
console
.
log
(
'
toSmsPage
'
,
this
.
agree
);
//
console.log('toSmsPage',this.agree);
if
(
!
this
.
isPhone
)
{
this
.
focusPhone
=
true
return
uni
.
showToast
({
...
...
@@ -147,7 +147,13 @@
<
style
lang=
"scss"
scoped
>
@import
"@/uni_modules/uni-id-pages/common/login-page.scss"
;
@media
screen
and
(
min-width
:
690px
)
{
.uni-content
{
height
:
350px
;
}
}
.uni-content
,
.quickLogin
{
/* #ifndef APP-NVUE */
...
...
uni_modules/uni-id-pages/pages/login/login-withpwd.vue
浏览文件 @
e62a9ae4
...
...
@@ -152,7 +152,7 @@
@media
screen
and
(
min-width
:
690px
)
{
.uni-content
{
max-height
:
65
0px
;
height
:
60
0px
;
}
}
...
...
uni_modules/uni-id-pages/pages/register/register-admin.vue
浏览文件 @
e62a9ae4
...
...
@@ -102,18 +102,18 @@
}).
catch
((
errors
)
=>
{
let
key
=
errors
[
0
].
key
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
);
//
console.log(key);
this
[
'
focus
'
+
key
]
=
true
})
},
submitForm
(
params
)
{
uniIdCo
.
registerAdmin
(
this
.
formData
).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
navigateBack
()
})
.
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
.
message
);
//
console.log(e);
//
console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this
.
$refs
.
captcha
.
getImageCaptcha
()
uni
.
showModal
({
...
...
@@ -153,6 +153,7 @@
@media
screen
and
(
min-width
:
690px
)
{
.uni-content
{
padding
:
30px
40px
60px
;
max-height
:
520px
;
}
.link-box
{
...
...
uni_modules/uni-id-pages/pages/register/register-by-email.vue
浏览文件 @
e62a9ae4
...
...
@@ -144,22 +144,22 @@
}).
catch
((
errors
)
=>
{
let
key
=
errors
[
0
].
key
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
);
//
console.log(key);
this
[
'
focus
'
+
key
]
=
true
})
},
submitForm
(
params
)
{
uniIdCo
.
registerUserByEmail
(
this
.
formData
).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
,
complete
:
(
e
)
=>
{
console
.
log
(
e
);
//
console.log(e);
}
})
})
.
catch
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
console
.
log
(
e
.
message
);
})
},
...
...
uni_modules/uni-id-pages/pages/register/register.vue
浏览文件 @
e62a9ae4
...
...
@@ -109,17 +109,17 @@
}).
catch
((
errors
)
=>
{
let
key
=
errors
[
0
].
key
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
);
//
console.log(key);
this
[
'
focus
'
+
key
]
=
true
})
},
submitForm
(
params
)
{
uniIdCo
.
registerUser
(
this
.
formData
).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
this
.
loginSuccess
(
e
)
})
.
catch
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
console
.
log
(
e
.
message
);
//更好的体验:登录错误,直接刷新验证码
this
.
$refs
.
captcha
.
getImageCaptcha
()
...
...
uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
浏览文件 @
e62a9ae4
...
...
@@ -137,8 +137,8 @@
* 完成并提交
*/
submit
()
{
console
.
log
(
"
formData
"
,
this
.
formData
);
console
.
log
(
'
rules
'
,
this
.
rules
);
//
console.log("formData", this.formData);
//
console.log('rules', this.rules);
this
.
$refs
.
form
.
validate
()
.
then
(
res
=>
{
let
{
...
...
@@ -153,11 +153,11 @@
password
,
captcha
}).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
,
complete
:
(
e
)
=>
{
console
.
log
(
e
);
//
console.log(e);
}
})
})
...
...
@@ -171,11 +171,11 @@
}).
catch
(
errors
=>
{
let
key
=
errors
[
0
].
key
if
(
key
==
'
code
'
){
console
.
log
(
this
.
$refs
.
shortCode
);
//
console.log(this.$refs.shortCode);
return
this
.
$refs
.
shortCode
.
focusSmsCodeInput
=
true
}
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
,
'
focus
'
+
key
);
//
console.log(key,'focus'+key);
this
[
'
focus
'
+
key
]
=
true
})
},
...
...
@@ -184,11 +184,11 @@
url
:
'
/uni_modules/uni-id-pages/pages/retrieve/retrieve
'
})
},
backLogin
()
{
uni
.
redirectTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
})
}
backLogin
()
{
uni
.
redirectTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withpwd
'
})
}
}
}
</
script
>
...
...
uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
浏览文件 @
e62a9ae4
...
...
@@ -166,8 +166,8 @@
* 完成并提交
*/
submit
()
{
console
.
log
(
"
formData
"
,
this
.
formData
);
console
.
log
(
'
rules
'
,
this
.
rules
);
//
console.log("formData", this.formData);
//
console.log('rules', this.rules);
this
.
$refs
.
form
.
validate
()
.
then
(
res
=>
{
let
{
...
...
@@ -182,7 +182,7 @@
password
,
captcha
}).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
navigateBack
()
})
.
catch
(
e
=>
{
...
...
@@ -195,11 +195,11 @@
}).
catch
(
errors
=>
{
let
key
=
errors
[
0
].
key
if
(
key
==
'
code
'
){
console
.
log
(
this
.
$refs
.
shortCode
);
//
console.log(this.$refs.shortCode);
return
this
.
$refs
.
shortCode
.
focusSmsCodeInput
=
true
}
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
,
'
focus
'
+
key
);
//
console.log(key,'focus'+key);
this
[
'
focus
'
+
key
]
=
true
})
},
...
...
uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
浏览文件 @
e62a9ae4
...
...
@@ -65,10 +65,10 @@
});
}
console
.
log
(
this
.
formData
);
//
console.log(this.formData);
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
)
uniIdCo
.
bindMobileBySms
(
this
.
formData
).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
showToast
({
title
:
e
.
errMsg
,
icon
:
'
none
'
,
...
...
uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
浏览文件 @
e62a9ae4
...
...
@@ -82,8 +82,8 @@
* 完成并提交
*/
submit
()
{
console
.
log
(
"
formData
"
,
this
.
formData
);
console
.
log
(
'
rules
'
,
this
.
rules
);
//
console.log("formData", this.formData);
//
console.log('rules', this.rules);
this
.
$refs
.
form
.
validate
()
.
then
(
res
=>
{
let
{
...
...
@@ -94,7 +94,7 @@
oldPassword
,
newPassword
}).
then
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
removeStorageSync
(
'
uni_id_token
'
);
uni
.
setStorageSync
(
'
uni_id_token_expired
'
,
0
)
uni
.
redirectTo
({
...
...
@@ -109,7 +109,7 @@
}).
catch
(
errors
=>
{
let
key
=
errors
[
0
].
key
key
=
key
.
replace
(
key
[
0
],
key
[
0
].
toUpperCase
())
console
.
log
(
key
,
'
focus
'
+
key
);
//
console.log(key, 'focus' + key);
this
[
'
focus
'
+
key
]
=
true
})
}
...
...
uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue
浏览文件 @
e62a9ae4
...
...
@@ -12,7 +12,7 @@ export default {
data
()
{
return
{
path
:
''
,
options
:{
"
width
"
:
600
,
"
height
"
:
600
}}},
onLoad
({
path
,
options
})
{
this
.
path
=
path
console
.
log
(
'
path-path-path-path
'
,
path
);
//
console.log('path-path-path-path',path);
if
(
options
){
this
.
options
=
JSON
.
parse
(
options
)
}
...
...
uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
浏览文件 @
e62a9ae4
...
...
@@ -43,7 +43,7 @@
const
uniIdco
=
uniCloud
.
importObject
(
"
uni-id-co
"
);
uniIdco
.
closeAccount
().
then
((
e
)
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
showToast
({
title
:
'
注销成功
'
,
duration
:
3000
...
...
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
浏览文件 @
e62a9ae4
...
...
@@ -115,7 +115,7 @@ export default {
this
.
$refs
.
popup
.
open
()
}
else
{
console
.
log
(
e
.
errMsg
);
console
.
log
(
e
.
errCode
);
//
console.log(e.errCode);
}
}).
finally
(
e
=>
{
this
.
formData
.
captcha
=
''
...
...
uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
浏览文件 @
e62a9ae4
...
...
@@ -78,7 +78,7 @@
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-id-pages/pages/login/login-withoutpwd
'
,
complete
:
(
e
)
=>
{
console
.
log
(
e
);
//
console.log(e);
}
})
},
...
...
@@ -92,7 +92,7 @@
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd
'
,
complete
:
(
e
)
=>
{
console
.
log
(
e
);
//
console.log(e);
}
})
},
...
...
@@ -123,14 +123,14 @@
"
provider
"
:
'
univerify
'
,
"
univerifyStyle
"
:
this
.
univerifyStyle
,
success
:
async
e
=>
{
console
.
log
(
e
.
authResult
);
//
console.log(e.authResult);
uniIdCo
.
bindMobileByUniverify
(
e
.
authResult
).
then
(
res
=>
{
console
.
log
(
res
);
mutations
.
updateUserInfo
()
//
console.log(res);
mutations
.
updateUserInfo
()
}).
catch
(
e
=>
{
console
.
log
(
e
);
}).
finally
(
e
=>
{
console
.
log
(
e
);
//
console.log(e);
uni
.
closeAuthView
()
})
},
...
...
@@ -143,60 +143,57 @@
})
},
bindMobileBySmsCode
()
{
uni
.
navigateTo
({
url
:
'
./bind-mobile/bind-mobile
'
})
uni
.
navigateTo
({
url
:
'
./bind-mobile/bind-mobile
'
})
},
setNickname
(
nickname
)
{
console
.
log
(
nickname
);
if
(
nickname
)
{
mutations
.
updateUserInfo
({
nickname
})
this
.
$refs
.
dialog
.
close
()
}
else
{
this
.
$refs
.
dialog
.
open
()
}
//
console.log(nickname);
if
(
nickname
)
{
mutations
.
updateUserInfo
({
nickname
})
this
.
$refs
.
dialog
.
close
()
}
else
{
this
.
$refs
.
dialog
.
open
()
}
},
deactivate
(){
uni
.
navigateTo
({
url
:
"
/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate
"
})
},
async
bindThirdAccount
(
provider
)
{
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
)
const
bindField
=
{
weixin
:
'
wx_openid
'
,
alipay
:
'
ali_openid
'
,
apple
:
'
apple_openid
'
,
qq
:
'
qq_openid
'
}[
provider
.
toLowerCase
()]
if
(
this
.
userInfo
[
bindField
])
{
await
uniIdCo
[
'
unbind
'
+
provider
]()
await
mutations
.
updateUserInfo
()
}
else
{
uni
.
login
({
provider
:
provider
.
toLowerCase
(),
onlyAuthorize
:
true
,
success
:
async
e
=>
{
const
res
=
await
uniIdCo
[
'
bind
'
+
provider
]({
code
:
e
.
code
})
if
(
res
.
errCode
)
{
uni
.
showToast
({
title
:
res
.
errMsg
||
'
绑定失败
'
,
duration
:
3000
})
}
await
mutations
.
updateUserInfo
()
},
fail
:
async
(
err
)
=>
{
console
.
log
(
err
);
uni
.
hideLoading
()
}
})
}
async
bindThirdAccount
(
provider
)
{
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
)
const
bindField
=
{
weixin
:
'
wx_openid
'
,
alipay
:
'
ali_openid
'
,
apple
:
'
apple_openid
'
,
qq
:
'
qq_openid
'
}[
provider
.
toLowerCase
()]
}
if
(
this
.
userInfo
[
bindField
])
{
await
uniIdCo
[
'
unbind
'
+
provider
]()
await
mutations
.
updateUserInfo
()
}
else
{
uni
.
login
({
provider
:
provider
.
toLowerCase
(),
onlyAuthorize
:
true
,
success
:
async
e
=>
{
const
res
=
await
uniIdCo
[
'
bind
'
+
provider
]({
code
:
e
.
code
})
if
(
res
.
errCode
)
{
uni
.
showToast
({
title
:
res
.
errMsg
||
'
绑定失败
'
,
duration
:
3000
})
}
await
mutations
.
updateUserInfo
()
},
fail
:
async
(
err
)
=>
{
console
.
log
(
err
);
uni
.
hideLoading
()
}
})
}
}
}
}
</
script
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录