Skip to content

Commit

Permalink
add message-tip callback
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiyuan committed Aug 7, 2018
1 parent 005b971 commit c212d66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions web/src/index/component/trend.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,19 @@ export default class Trend extends Component {

getThumbDate(props) {
let dataName = props.dataName || this.props.dataName;
if (!dataName) {
dataName = props.list[0].name;
eventProxy.trigger('messageTip', {
messageType: 'error',
messageContent: 'No ' + dataName + ' data, just jump to the first data',
messageShow: true,
messageDuration: 2.5,
messageCallback: function () {
let nextUrl = '/home/' + dataName;
hashHistory.push(nextUrl);
}
});
}
let url = api.getThumbTrend + dataName + '/thumb';
axiosInstance.get(url).then(response => {
const data = response.data;
Expand Down

0 comments on commit c212d66

Please sign in to comment.