請在此詳細描述你所遇到的問題
使用UniApp進行兼容鴻蒙元服務的一鍵登錄,參考這個鏈接 https://uniapp.dcloud.net.cn/tutorial/app-oauth-huawei.html ,我拿到了 res.code,這個code也可以是被v2/routine/auth_type這個接口識別到,這是華為的一鍵登錄流程嗎?還是說這只是第三方賬號登錄,UniApp兼容鴻蒙元服務的一鍵登錄有什么參考文檔嗎?
uni.login({
provider: 'huawei', // 登錄提供商為華為
success(res) {
// 登錄成功后,打印返回的登錄結果
console.log('華為返回值', JSON.stringify(res.code))
authType({
code: res.code,
spread_spid: app.globalData.spid,
spread_code: app.globalData.code
}).then(res => {
uni.hideLoading();
authKey.value = res.data.key;
bindPhone.value = res.data.bindPhone;
// 授權登錄
getAuthLogin()
// 獲取用戶信息
// getUserInfoHm()
})
.catch(err => {
uni.hideLoading();
uni.showToast({
title: err.message || err.toString(),
icon: 'none',
duration: 2000
});
});
},