mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-30 13:20:24 +08:00
fix: 修改footer样式
This commit is contained in:
parent
fa283088dc
commit
e320308393
@ -3,25 +3,28 @@ import {
|
||||
FETCH_MORE_NEWS
|
||||
} from '../constants/action-types.js';
|
||||
|
||||
export function fetchNewsData (logId) {
|
||||
const data = {
|
||||
newsList:[
|
||||
{ key: 1,title: '日志标题', username: 'John Brown', content: '您好!亲爱的用户:您已成功申请接口:实时空气质量数据查询,请于两个月内进行应用验证,逾期接口将不能正常使用。如果您在使用的过程中遇到任何问题,欢迎前往交流社区反馈意见,谢谢!',time: '2014-12-01' },
|
||||
{ key: 2,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' },
|
||||
{ key: 3,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' }
|
||||
],
|
||||
totalPage: 34
|
||||
};
|
||||
console.log(logId);
|
||||
import axios from 'axios';
|
||||
import variable from '../constants/variable';
|
||||
|
||||
export function fetchNewsData (uid,page,limit) {
|
||||
// const data = {
|
||||
// newsList:[
|
||||
// { key: 1,title: '日志标题', username: 'John Brown', content: '您好!亲爱的用户:您已成功申请接口:实时空气质量数据查询,请于两个月内进行应用验证,逾期接口将不能正常使用。如果您在使用的过程中遇到任何问题,欢迎前往交流社区反馈意见,谢谢!',time: '2014-12-01' },
|
||||
// { key: 2,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' },
|
||||
// { key: 3,title: '日志标题', username: 'John Brown', content: 'My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park.',time: '2014-12-01' }
|
||||
// ],
|
||||
// totalPage: 34
|
||||
// };
|
||||
|
||||
const param = {
|
||||
uid: uid,
|
||||
page: page,
|
||||
limit: variable.PAGE_LIMIT?variable.PAGE_LIMIT:limit
|
||||
}
|
||||
console.log(param);
|
||||
return {
|
||||
type: FETCH_NEWS_DATA,
|
||||
payload: new Promise(function(reslove,reject){
|
||||
if(data){
|
||||
reslove(data);
|
||||
}else{
|
||||
reject("chucuole");
|
||||
}
|
||||
})
|
||||
payload: axios.get('/log/list',param)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
.footer{
|
||||
// max-width: 12rem;
|
||||
margin: 20px auto;
|
||||
margin: 0px auto;
|
||||
clear: both;
|
||||
font-size: 12px;
|
||||
background: #000c15;
|
||||
|
@ -10,6 +10,7 @@ import { fetchNewsData } from '../../actions/news.js'
|
||||
@connect(
|
||||
state => {
|
||||
return {
|
||||
uid: state.user.curUid,
|
||||
newsData: state.news.newsData?state.news.newsData:[]
|
||||
}
|
||||
},
|
||||
@ -27,7 +28,8 @@ class News extends Component {
|
||||
}
|
||||
static propTypes = {
|
||||
newsData: PropTypes.object,
|
||||
fetchNewsData: PropTypes.func
|
||||
fetchNewsData: PropTypes.func,
|
||||
uid: PropTypes.string
|
||||
}
|
||||
setLoading(bool){
|
||||
this.setState({
|
||||
@ -35,7 +37,10 @@ class News extends Component {
|
||||
})
|
||||
}
|
||||
componentWillMount(){
|
||||
this.props.fetchNewsData()
|
||||
console.log(this.props.uid);
|
||||
this.props.fetchNewsData(1,1,10).then(function(data){
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
render () {
|
||||
const data = this.props.newsData
|
||||
|
@ -18,7 +18,9 @@ const logList = [{
|
||||
}];
|
||||
@connect(
|
||||
state => {
|
||||
// console.log(state);
|
||||
return {
|
||||
uid: state.user.curUid,
|
||||
newsData: state.news.newsData
|
||||
}
|
||||
},
|
||||
@ -31,7 +33,8 @@ class NewsList extends Component {
|
||||
|
||||
static propTypes = {
|
||||
fetchNewsData: PropTypes.func,
|
||||
setLoading: PropTypes.func
|
||||
setLoading: PropTypes.func,
|
||||
uid: PropTypes.string
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@ -48,7 +51,8 @@ class NewsList extends Component {
|
||||
})
|
||||
const that = this;
|
||||
this.props.setLoading(true);
|
||||
this.props.fetchNewsData(+e.key).then(function(){
|
||||
this.props.fetchNewsData(+this.props.uid,0,5).then(function(data){
|
||||
console.log(data.data);
|
||||
that.props.setLoading(false);
|
||||
})
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class NewsTimeline extends Component {
|
||||
<section className="news-timeline">
|
||||
<span className='removeAllNews'>
|
||||
<Popconfirm title="你确定要清空所有消息吗?" onConfirm={removeConfirm} okText="删除" cancelText="取消">
|
||||
清空消息
|
||||
项目日志
|
||||
</Popconfirm>
|
||||
</span>
|
||||
<Table
|
||||
|
@ -10,6 +10,7 @@ const initialState = {
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case FETCH_NEWS_DATA: {
|
||||
// console.log(action.payload);
|
||||
return {
|
||||
...state,
|
||||
newsData: action.payload
|
||||
|
Loading…
Reference in New Issue
Block a user