/**
 * Web-zdx
 * moduleName: 登录（手机号）
 */

import { request } from '../index'

// 手机号登陆接口
const login = (data) => {
	return request({
		url: 'user/socialite/login/wechat/mini',
		method: 'POST',
		data: data
	})
}
// 修改用户信息
const wechatbind = (data) => {
	return request({
		url: 'user/socialite/wechatbind',
		method: 'PUT',
		data: data
	})
}

// 修改用户头像或昵称
const resetUserInfo = (data) => {
	return request({
		url: 'user/' + data.key,
		method: 'PUT',
		data: {
			value: data.value
		}
	})
}

// 获取用户的Openid
const getOpenid = (code) => {
	return request({
		url: 'user/socialite/login/wechat/openid',
		method: 'GET',
		data: {
			code: code
		}
	})

}
// 隐私条款
const agreementSecret = (data) => {
	return request({
		url: 'articles/agreement/secret'
	})
}

// 注册协议
const agreementLogin = (data) => {
	return request({
		url: 'articles/agreement/login'
	})
}

// 获取用户设置中心的信息
const getUserSettingInfo = () => {
  return request({
    url: 'user/setting'
  })
}

// 关于我们
const aboutUs = () => {
  return request({
    url: 'articles/about'
  })
}
// 获取企业认证状态 -1.未认证，0.审核中，1.审核通过，2.驳回
const companyStatus = () => {
  return request({
    url: 'companies/applies/query'
  })
}


export {
	login,
	wechatbind,
	getOpenid,
	agreementSecret,
	agreementLogin,
	resetUserInfo,
	getUserSettingInfo,
	aboutUs,
	companyStatus
}
