import request from '../utils/request'
import Qs from 'qs';

//根据code换取openid
export function getDataByCode(code) {
	return request({
		url: '/wechat/findUserInfo/' + code,
		params: {},
		method: 'get',
	})
}

//获取微信配置
export function getConfig(url) {
	return request({
		url: '/wechat/getConfig',
		params: {
			url: url
		},
		method: 'get',
	})
}

//根据openId获取当前用户角色
export function getPopedom(openId, type) {
	return request({
		url: '/mobile/personInfoApi/findPopedomByOpenId',
		data: Qs.stringify({
			openId: openId,
			type: type
		}),
		method: 'post',
	})
}
