yapi/client/actions/project.js

25 lines
452 B
JavaScript
Raw Normal View History

2017-07-14 18:02:01 +08:00
import {
PROJECT_ADD
} from '../constants/action-types.js';
import axios from 'axios';
const addProject = (data) => {
const { name, prd_host, basepath, desc } = data;
const param = {
name,
prd_host,
basepath,
desc
}
console.log(param);
return {
type: PROJECT_ADD,
// payload 可以返回 Promise异步请求使用 axios 即可
payload: axios.get('/project/add', param)
}
}
export default {
addProject
}