import request from '@/utils/request'
import wechath5 from '@/utils/wechath5'
import {client} from '@/utils/tools'

//账号登录
export function authLogin(data) {
    return request.post("/auth/login", {...data, client})
}
export function authLogout(data) {
    return request.post("/auth/logout", {...data, client})
}
//忘记密码
export function forgetPwd(data) {
    return request.post("/myCenter/updatepwd", {...data, client})
}

//common
export function getConfig(data) {
    return request.get("/common/config", {...data, client})
}

//人才分类
export function getCategoryTree(params) {
	return request.get('/category', {params})
}
//分类详情
export function getCategoryDetail(params) {
	return request.get('/category/'+ params.id)
}
//标签
export function getTagList(params) {
	return request.get('/tag', {params})
}
//提交意见反馈
export function postSuggest(params) {
	return request.post('/suggest', params)
}


//人才列表
export function getTalentsList(params) {
	return request.get('article', {params})
}

export function postTalents(params) {
	return request.post('article', params)
}

//足迹
export function getTalentsFootprintList(params) {
	return request.get('article/footprint', {params})
}

//历史搜索
export function getHistorySearch(params) {
	return request.get('article/history-search', {params})
}

// 清空历史搜索
export function clearSearch() {
	return request.post('article/clear-search');
}

//人才详情
export function getTalentsDetail(params) {
	return request.get('article/' + params.id)
}
export function getTalentsCount(params) {
	return request.get('article/count', {params})
}
//数据类型
export function getTalentsModule(params) {
	return request.get('article/module', {params})
}


//反馈
export function feedback(data) {
	return request.post('/user/feedback', data)
}


//聚才网获取用户信息
export function getInfoByToken(data) {
	return request.post('https://www.jucai.gov.cn/api/auth/getInfoByToken', data)
}

//人才政策计算器
export function getSurvey (params) {
	return request.get('survey', {params})
}
export function submitSurvey (data) {
	return request.post('survey/submit', data)
}
export function submitSurveyEnterprise (data) {
	return request.post('survey/enterprise', data)
}

export function policyDetail (params) {
	return request.get('policy/details', {params})
}
export function policyCategory (params) {
	return request.get('policy/category', {params})
}

export function policyList (params) {
	return request.get('policy', {params})
}
