ref |> 开启一键登录功能
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
2 changed files
with
8 additions
and
2 deletions
| @@ -3,6 +3,7 @@ import { Params } from 'wdBean/Index' | @@ -3,6 +3,7 @@ import { Params } from 'wdBean/Index' | ||
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 4 | import HuaweiAuth from '../../utils/HuaweiAuth' | 4 | import HuaweiAuth from '../../utils/HuaweiAuth' |
| 5 | import { BusinessError } from '@kit.BasicServicesKit' | 5 | import { BusinessError } from '@kit.BasicServicesKit' |
| 6 | +import { ToastUtils } from 'wdKit/Index' | ||
| 6 | 7 | ||
| 7 | @Entry | 8 | @Entry |
| 8 | @Component | 9 | @Component |
| @@ -44,8 +45,13 @@ struct OneKeyLoginPage { | @@ -44,8 +45,13 @@ struct OneKeyLoginPage { | ||
| 44 | return | 45 | return |
| 45 | } | 46 | } |
| 46 | HuaweiAuth.sharedInstance().oneKeyLogin().then((authorizeCode) => { | 47 | HuaweiAuth.sharedInstance().oneKeyLogin().then((authorizeCode) => { |
| 47 | - | ||
| 48 | //TODO: 调用服务端接口登录 | 48 | //TODO: 调用服务端接口登录 |
| 49 | + | ||
| 50 | + ToastUtils.shortToast("获取到授权code: " + authorizeCode + ",由于需要后台接口支持,暂时先跳转其他登录方式") | ||
| 51 | + setTimeout(() => { | ||
| 52 | + router.replaceUrl({url: WDRouterPage.loginPage.url()}) | ||
| 53 | + }, 3000) | ||
| 54 | + | ||
| 49 | }).catch((error: BusinessError) => { | 55 | }).catch((error: BusinessError) => { |
| 50 | 56 | ||
| 51 | }) | 57 | }) |
| @@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth" | @@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth" | ||
| 9 | export default class HuaweiAuth { | 9 | export default class HuaweiAuth { |
| 10 | 10 | ||
| 11 | // 是否开启 | 11 | // 是否开启 |
| 12 | - static enable = false | 12 | + static enable = true |
| 13 | // 匿名手机号 | 13 | // 匿名手机号 |
| 14 | private _anonymousPhone?: string | 14 | private _anonymousPhone?: string |
| 15 | get anonymousPhone() { | 15 | get anonymousPhone() { |
-
Please register or login to post a comment