请在此详细描述你所遇到的问题
使用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
});
});
},