import { http } from '@/util'

/**
 * 根据微信静默登录code登录 
 * @Author : J.L.Zhou
 * @Tel : 151 1104 7708
 * @CreateTime : 2023-05-22 16:01:52
 * @LastEditos : J.L.Zhou
 * @LastEditTime : 2023-05-22 16:01:52
 */
export const loginByCode = (xcxCode) => http.post("/xcxLogin",{xcxCode},{custom:{type:'form',auth:false,showError:false}});
export const regLogin = (data) => http.upload("/xcxRegLogin",{
	custom:{type:'none',auth:false},
	filePath:data.avatar,
	name:"avatar",
	timeout: 60000,
	formData:{nickname:data.nickname,code:data.code,regCode:data.regCode}
});

export const loginInfo = () => http.get("/getInfo",{custom:{showError:false}});
export const logout = () => http.get("/logout",{custom:{showError:false}});

/**
 * 微信小程序授权获取手机号码
 */
export const getPhoneInfo = (code) => http.post("/xcxPhone",{code},{custom:{type:'form',auth:false,loading:false}})