<!-- api.js 文件内容 -->
<script>
import axios from 'axios';

export const fetchData = async () => {
  const response = await axios.post('https://soilgd.com:5000/table', { table: 'Datasets' });
  return response.data.rows;
};

export const trainAndSaveModel = async (trainData) => {
  const response = await axios.post('https://soilgd.com:5000/train-and-save-model', trainData);
  return response;
};
</script>