mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
25 lines
452 B
JavaScript
25 lines
452 B
JavaScript
|
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
|
|||
|
}
|