index.js 1.78 KB
//获取平台定制API
const getPlateCustomApi = () => {
	return uni.$u.http.get("/yt/app_design/get")
};

//第三方账号登录API
const getThirdLoginApi = (code) => {
	return uni.$u.http.get(`/yt/third/login/${code}`)
};

//第三方账号绑定API
const postThirdLoginApi = (data = {}) => {
	return uni.$u.http
		.post("/yt/third/bind", data)
};

//设置个人信息API
const setUserInfoApi = () => {
	return uni.$u.http.get("/yt/user/me/info")
};

//获取平台信息API
const setPlateInfoApi = () => {
	return uni.$u.http.get("/yt/platform/get")
};

//获取告警徽标数API
const getAlarmTotalApi = () => {
	return uni.$u.http.get("/yt/homepage/app?login=true")
};

//登录API
const postLoginApi = (loginForm = {}) => {
	return uni.$u.http
		.post("/auth/login", loginForm)
};

//获取验证码API
const postCodeApi = (phone) => {
	return uni.$u.http
		.post(`/yt/noauth/reset_code/${phone}`)
}

//重置密码API
const postResetCodeApi = (phone, data = {}) => {
	return uni.$u.http
		.post(`/yt/noauth/reset/${phone}`, data)
}

//更新个人资料API
const postPersonalInfoApi = (data = {}) => {
	return uni.$u.http
		.put('/yt/user/center', data)
}

//第三方登录需要解绑API
const deleteBindApi = (data = {}) => {
	return uni.$u.http.delete('/yt/third', data)
}

//获取手机验证码API
const postPhoneCodeApi = (phone, data = {}) => {
	return uni.$u.http
		.post(`/yt/noauth/send_login_code/${phone}`, data)
}

//手机登录API
const postPhoneLoginApi = (data = {}) => {
	return uni.$u.http
		.post('/yt/auth/code/login', data)
}

export default {
	getPlateCustomApi,
	getThirdLoginApi,
	setUserInfoApi,
	setPlateInfoApi,
	getAlarmTotalApi,
	postLoginApi,
	postCodeApi,
	postResetCodeApi,
	postPersonalInfoApi,
	deleteBindApi,
	postPhoneCodeApi,
	postPhoneLoginApi,
	postThirdLoginApi
}