Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-06-18 21:44:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
86abcc6c3181791e41ffae0757720e5b77fefb5b
86abcc6c
1 parent
867986c0
ref |> 临时回退华为账号一键登录
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
View file @
86abcc6
...
...
@@ -170,30 +170,34 @@ struct OneKeyLoginPage {
.borderRadius(4)
.type(ButtonType.Normal)
.backgroundColor("#ED2800")
.onClick(() => {
Stack(){
//目前不支持文字和图标同时展示,后面优化
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
}
},
controller: this.controller
}).opacity(0)
}
.width('100%')
.height('100%')
this.requestLogin()
})
// Stack(){
// //目前不支持文字和图标同时展示,后面优化
// LoginWithHuaweiIDButton({
// params: {
// // LoginWithHuaweiIDButton支持的样式。
// style: loginComponentManager.Style.BUTTON_CUSTOM,
// // LoginWithHuaweiIDButton的边框圆角半径。
// // borderRadius: 4,
// // LoginWithHuaweiIDButton支持的登录类型。
// loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// // supportDarkMode: true,
// customButtonParams: {
// fontColor: loginComponentManager.FontColor.WHITE,
// // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
// backgroundColor:"#ED2800"
// }
// },
// controller: this.controller
// }).opacity(0)
// }
// .width('100%')
// .height('100%')
}
}
.height(48)
...
...
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
View file @
86abcc6
...
...
@@ -94,7 +94,7 @@ export default class HuaweiAuth {
// 创建授权请求,并设置参数
let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
// 获取头像昵称需要传如下scope
loginRequest.scopes = ['profile']; //, 'phone'
loginRequest.scopes = ['profile'
, 'phone'
]; //, 'phone'
// 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
loginRequest.permissions = ['serviceauthcode'];
// 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
...
...
Please
register
or
login
to post a comment