diff --git a/client/components/ProjectCard/ProjectCard.js b/client/components/ProjectCard/ProjectCard.js
index 1c16ca55..d5dc9aa6 100644
--- a/client/components/ProjectCard/ProjectCard.js
+++ b/client/components/ProjectCard/ProjectCard.js
@@ -7,9 +7,6 @@ import PropTypes from 'prop-types';
class ProjectCard extends Component {
constructor(props) {
super(props);
- this.state = {
-
- };
}
static propTypes = {
@@ -18,13 +15,12 @@ class ProjectCard extends Component {
render() {
const { projectData } = this.props;
- console.log(projectData);
return (
-
{projectData.name}
+
{projectData.name || projectData.projectname}
btns
diff --git a/client/containers/Follows/Follows.js b/client/containers/Follows/Follows.js
index d5a2c60a..00830127 100644
--- a/client/containers/Follows/Follows.js
+++ b/client/containers/Follows/Follows.js
@@ -1,10 +1,48 @@
import React, { Component } from 'react';
import './Follows.scss';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+import { Row, Col } from 'antd';
+import { getFollowList } from '../../reducer/modules/follow';
import Subnav from '../../components/Subnav/Subnav.js';
import ProjectCard from '../../components/ProjectCard/ProjectCard.js';
+
+@connect(
+ state => {
+ return {
+ data: state.follow.data
+ }
+ },
+ {
+ getFollowList
+ }
+)
class Follows extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ data: []
+ }
+ }
+ static propTypes = {
+ getFollowList: PropTypes.func
+ }
+
+ componentDidMount() {
+ this.props.getFollowList(107).then((res) => {
+ console.log(res);
+ if (res.payload.data.errcode === 0) {
+ this.setState({
+ data: res.payload.data.data.list
+ })
+ }
+ });
+ }
+
render () {
+ const data = this.state.data;
+ console.log(data);
return (
-
+
+ {data.map((item, index) => {
+ console.log(item);
+ return (
+
+
+ );
+ })}
+
)
diff --git a/client/containers/Follows/Follows.scss b/client/containers/Follows/Follows.scss
index 2ee476cc..8f5dabcb 100644
--- a/client/containers/Follows/Follows.scss
+++ b/client/containers/Follows/Follows.scss
@@ -3,10 +3,5 @@
.follow-box{
padding: 24px;
- background-color: #FFF;
- .follow-container{
- display: flex;
- display: -webkit-flex;
- }
-
-}
\ No newline at end of file
+ background-color: #fff;
+}
diff --git a/client/containers/Group/MemberList/MemberList.js b/client/containers/Group/MemberList/MemberList.js
index d1691ae8..a87062aa 100644
--- a/client/containers/Group/MemberList/MemberList.js
+++ b/client/containers/Group/MemberList/MemberList.js
@@ -6,8 +6,7 @@ class MemberList extends Component {
render() {
return (
- chengyuan 列表 成员
-
+
);
}
diff --git a/client/containers/Group/ProjectList/ProjectList.js b/client/containers/Group/ProjectList/ProjectList.js
index 04be893e..5828b950 100644
--- a/client/containers/Group/ProjectList/ProjectList.js
+++ b/client/containers/Group/ProjectList/ProjectList.js
@@ -133,17 +133,17 @@ class ProjectList extends Component {
})
}
- // 分页逻辑
- @autobind
- paginationChange(pageNum) {
- this.props.fetchProjectList(this.props.currGroup._id, pageNum).then((res) => {
- if (res.payload.data.errcode) {
- message.error(res.payload.data.errmsg);
- } else {
- this.props.changeTableLoading(false);
- }
- });
- }
+ // // 分页逻辑 取消分页
+ // @autobind
+ // paginationChange(pageNum) {
+ // this.props.fetchProjectList(this.props.currGroup._id, pageNum).then((res) => {
+ // if (res.payload.data.errcode) {
+ // message.error(res.payload.data.errmsg);
+ // } else {
+ // this.props.changeTableLoading(false);
+ // }
+ // });
+ // }
componentWillReceiveProps(nextProps) {
// 切换分组
diff --git a/client/reducer/modules/follow.js b/client/reducer/modules/follow.js
new file mode 100644
index 00000000..a7c4130b
--- /dev/null
+++ b/client/reducer/modules/follow.js
@@ -0,0 +1,34 @@
+import axios from 'axios';
+
+// Actions
+const GET_FOLLOW_LIST = 'yapi/follow/GET_FOLLOW_LIST';
+
+// Reducer
+const initialState = {
+ data: []
+};
+
+export default (state = initialState, action) => {
+ switch (action.type) {
+ case GET_FOLLOW_LIST: {
+ console.log(action);
+ return {
+ ...state,
+ data: action.payload.data.data
+ };
+ }
+
+ default:
+ return state;
+ }
+};
+
+// Action Creators
+export function getFollowList(uid) {
+ return {
+ type: GET_FOLLOW_LIST,
+ payload: axios.get('/api/follow/list', {
+ params: { uid }
+ })
+ }
+}
diff --git a/client/reducer/modules/reducer.js b/client/reducer/modules/reducer.js
index c3623d73..bc088920 100644
--- a/client/reducer/modules/reducer.js
+++ b/client/reducer/modules/reducer.js
@@ -6,6 +6,7 @@ import inter from './interface.js'
import news from './news.js'
import addInterface from './addInterface.js'
import menu from './menu.js'
+import follow from './follow.js'
export default combineReducers({
group,
@@ -14,5 +15,6 @@ export default combineReducers({
project,
news,
addInterface,
- menu
+ menu,
+ follow
})
diff --git a/server/controllers/project.js b/server/controllers/project.js
index 3f28aba6..295e83dd 100644
--- a/server/controllers/project.js
+++ b/server/controllers/project.js
@@ -579,6 +579,7 @@ class projectController extends baseController {
* @method GET
* @category project
* @foldnumber 10
+ * @author wenbo.dong
* @param {String} project_id
*/
async download(ctx) {
diff --git a/server_dist/controllers/project.js b/server_dist/controllers/project.js
index 62e5f276..eeb081f4 100644
--- a/server_dist/controllers/project.js
+++ b/server_dist/controllers/project.js
@@ -1284,6 +1284,7 @@ var projectController = function (_baseController) {
* @method GET
* @category project
* @foldnumber 10
+ * @author wenbo.dong
* @param {String} project_id
*/
diff --git a/static/doc/api.html b/static/doc/api.html
index f1cb19d4..2807a838 100644
--- a/static/doc/api.html
+++ b/static/doc/api.html
@@ -406,7 +406,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -443,7 +443,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": [
@@ -541,7 +541,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -637,7 +637,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -725,7 +725,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "logout success...",
"data": {
@@ -764,7 +764,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": "ok"
@@ -855,7 +855,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -951,7 +951,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "logout success...",
"data": {
@@ -1436,7 +1436,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "ok",
"data": [
@@ -1549,7 +1549,7 @@
源码位置:
- ./server/controllers/project.js:37
+ ./server/controllers/project.js:39
@@ -1661,7 +1661,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -1702,7 +1702,7 @@
源码位置:
- ./server/controllers/project.js:127
+ ./server/controllers/project.js:137
@@ -1756,7 +1756,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -1786,7 +1786,7 @@
源码位置:
- ./server/controllers/project.js:170
+ ./server/controllers/project.js:188
@@ -1840,7 +1840,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -1870,7 +1870,7 @@
源码位置:
- ./server/controllers/project.js:223
+ ./server/controllers/project.js:254
@@ -1912,7 +1912,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": [
@@ -1948,7 +1948,7 @@
源码位置:
- ./server/controllers/project.js:248
+ ./server/controllers/project.js:279
@@ -1990,7 +1990,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -2031,7 +2031,7 @@
源码位置:
- ./server/controllers/project.js:272
+ ./server/controllers/project.js:303
@@ -2073,7 +2073,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -2258,7 +2258,7 @@
源码位置:
- ./server/controllers/project.js:313
+ ./server/controllers/project.js:344
@@ -2300,7 +2300,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -2330,7 +2330,7 @@
源码位置:
- ./server/controllers/project.js:373
+ ./server/controllers/project.js:419
@@ -2448,7 +2448,7 @@
示例:
-
+
{
"id": 8,
@@ -2490,7 +2490,7 @@
源码位置:
- ./server/controllers/project.js:464
+ ./server/controllers/project.js:520
@@ -2532,7 +2532,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "ok",
"data": {
@@ -2585,7 +2585,7 @@
源码位置:
- ./server/controllers/project.js:519
+ ./server/controllers/project.js:575
@@ -2868,7 +2868,7 @@
示例:
-
+
@@ -3003,7 +3003,7 @@
示例:
- ./api/interface/get.json
+ ./api/interface/get.json
@@ -3068,7 +3068,7 @@
示例:
- ./api/interface/list.json
+ ./api/interface/list.json
@@ -3293,7 +3293,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -3366,7 +3366,7 @@
示例:
- {
+ {
"errcode": 0,
"errmsg": "success",
"data": {
@@ -3461,7 +3461,7 @@
示例:
- /follow/list
+ /follow/list
@@ -3526,7 +3526,7 @@
示例:
- /follow/del
+ /follow/del
@@ -3536,7 +3536,7 @@