xugenyuan

ref |> 临时回退华为账号一键登录

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -170,30 +170,34 @@ struct OneKeyLoginPage { @@ -170,30 +170,34 @@ struct OneKeyLoginPage {
170 .borderRadius(4) 170 .borderRadius(4)
171 .type(ButtonType.Normal) 171 .type(ButtonType.Normal)
172 .backgroundColor("#ED2800") 172 .backgroundColor("#ED2800")
  173 + .onClick(() => {
173 174
174 - Stack(){  
175 - //目前不支持文字和图标同时展示,后面优化  
176 - LoginWithHuaweiIDButton({  
177 - params: {  
178 - // LoginWithHuaweiIDButton支持的样式。  
179 - style: loginComponentManager.Style.BUTTON_CUSTOM,  
180 - // LoginWithHuaweiIDButton的边框圆角半径。  
181 - // borderRadius: 4,  
182 - // LoginWithHuaweiIDButton支持的登录类型。  
183 - loginType: loginComponentManager.LoginType.QUICK_LOGIN,  
184 - // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。  
185 - // supportDarkMode: true,  
186 - customButtonParams: {  
187 - fontColor: loginComponentManager.FontColor.WHITE,  
188 - // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"  
189 - backgroundColor:"#ED2800"  
190 - }  
191 - },  
192 - controller: this.controller  
193 - }).opacity(0)  
194 - }  
195 - .width('100%')  
196 - .height('100%') 175 + this.requestLogin()
  176 + })
  177 +
  178 + // Stack(){
  179 + // //目前不支持文字和图标同时展示,后面优化
  180 + // LoginWithHuaweiIDButton({
  181 + // params: {
  182 + // // LoginWithHuaweiIDButton支持的样式。
  183 + // style: loginComponentManager.Style.BUTTON_CUSTOM,
  184 + // // LoginWithHuaweiIDButton的边框圆角半径。
  185 + // // borderRadius: 4,
  186 + // // LoginWithHuaweiIDButton支持的登录类型。
  187 + // loginType: loginComponentManager.LoginType.QUICK_LOGIN,
  188 + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
  189 + // // supportDarkMode: true,
  190 + // customButtonParams: {
  191 + // fontColor: loginComponentManager.FontColor.WHITE,
  192 + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
  193 + // backgroundColor:"#ED2800"
  194 + // }
  195 + // },
  196 + // controller: this.controller
  197 + // }).opacity(0)
  198 + // }
  199 + // .width('100%')
  200 + // .height('100%')
197 } 201 }
198 } 202 }
199 .height(48) 203 .height(48)
@@ -94,7 +94,7 @@ export default class HuaweiAuth { @@ -94,7 +94,7 @@ export default class HuaweiAuth {
94 // 创建授权请求,并设置参数 94 // 创建授权请求,并设置参数
95 let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); 95 let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
96 // 获取头像昵称需要传如下scope 96 // 获取头像昵称需要传如下scope
97 - loginRequest.scopes = ['profile']; //, 'phone' 97 + loginRequest.scopes = ['profile', 'phone']; //, 'phone'
98 // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode 98 // 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
99 loginRequest.permissions = ['serviceauthcode']; 99 loginRequest.permissions = ['serviceauthcode'];
100 // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面 100 // 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面