/**
 * 登录
 * @param data
 */
export  function loginFront(data:any) {
	frontRequest.post("/api/user/login", data).then(response =>{
		const user = userStore()
		user.frontToken = response.data.token
		frontRequest.get("/api/user/userInfo").then(response =>{
			user.frontUserInfo = response.data
		})
	})
}
/**
 * 注册
 * @param data
 */
export  function registerFront(data: any) {
	return adminRequest.post("/api/user/register", data)
}

/**
 * 获取用户信息
 * @param userId
 */
export  function userInfoFront(userId: any) {
	return frontRequest.get("/api/user/userInfo", {
		params: { userId: userId }
	})
}

/**
 * 修改用户信息
 * @param data
 */
export  function userUpdateFront(data:any) {
	return frontRequest.put("/api/user/update", data)
}


/**
 * 退出
 */
export  function logoutFront() {
	return frontRequest.post("/api/user/logout")
}
