xugenyuan

ref |> 开启一键登录功能

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -3,6 +3,7 @@ import { Params } from 'wdBean/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import HuaweiAuth from '../../utils/HuaweiAuth'
import { BusinessError } from '@kit.BasicServicesKit'
import { ToastUtils } from 'wdKit/Index'
@Entry
@Component
... ... @@ -44,8 +45,13 @@ struct OneKeyLoginPage {
return
}
HuaweiAuth.sharedInstance().oneKeyLogin().then((authorizeCode) => {
//TODO: 调用服务端接口登录
ToastUtils.shortToast("获取到授权code: " + authorizeCode + ",由于需要后台接口支持,暂时先跳转其他登录方式")
setTimeout(() => {
router.replaceUrl({url: WDRouterPage.loginPage.url()})
}, 3000)
}).catch((error: BusinessError) => {
})
... ...
... ... @@ -9,7 +9,7 @@ const TAG = "HuaweiOneKeyAuth"
export default class HuaweiAuth {
// 是否开启
static enable = false
static enable = true
// 匿名手机号
private _anonymousPhone?: string
get anonymousPhone() {
... ...