admin管理员组

文章数量:1558044

要在uniapp中实现QQ一键登录,主要步骤:

1、manifest.json的模块设置中,启用QQ登录,并填入appid

3、新建登录页

<template>
	<view>
	正在进行QQ第三方登录……
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res: '',
			}
		},
		onLoad: function(options) {
			console.log(options);
			uni.login({
				provider: "qq",
				success: (resp) => {
					var access_token = resp.authResult.access_token;
					uni.getUserInfo({
						provider: 'qq',
						success: function(infoRes) {
							console.log(infoRes)
							var formdata = {
								nickName: infoRes.userInfo.nickname,
								test: 'test',
								unionId: infoRes.userInfo.unionid,
								openId: infoRes.userInfo.openId,

							};
							console.log(formdata);
							uni.request({
								url: 'https://*/login/appqqlogin',
								method: 'post',
								header: {
									'content-type': 'applicat

本文标签: 一键方法uniappqq