Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadData(year) {
if (this.state.years.indexOf(parseInt(year, 10)) === -1) {
hashHistory.push('/');
return;
}
/* eslint-disable */
const data = require(`../data/${year}.json`);
/* eslint-enable */
this.setState({
loading: false,
data: dataTransformer(data)
});
}
WMApp.pay.doPay(params, data => {
if (data.status) {
let {globalActions} = this.props
globalActions.savePayResult({
payResult: 'success'
})
hashHistory.push('/home')
} else {
console.log('支付失败')
}
})
}
componentDidMount () {
if (!this.props.user) {
hashHistory.push('/dashboard')
return
}
this.setState({ fetching: true })
firebaseDB.ref('/users/' + this.props.user.clubID).on('value',
function (snapshot) {
this.setState({ fetching: false })
let events = snapshot.val().my_publicity
for (let event in events) {
firebaseDB.ref('publicity/' + events[event]).on('value',
function (snapshot) {
if (snapshot.val().FA_appr === 'pending') {
const { myArrx } = this.state
myArrx[snapshot.key] = snapshot.val()
myArrx[snapshot.key].key = snapshot.key
this.setState({ myArrx })
this.setState({ originalArr: myArrx })
redirectToActivityDetail() {
if (ActivityStore.newActivity() !== {}) {
hashHistory.push({
pathname: "/new-activity",
query: { from: "creator" }
});
}
},
handleSearchClick() {
hashHistory.push('/search');
}
submitSearch(event) {
if (event.which == 13) {
const val = this.refs.keyword.value;
hashHistory.push('search/' + val);
}
}
onEditButton = () => {
if (this.state.verse.isCustom()) {
this.setState({editing: true});
} else {
hashHistory.push(CUSTOM_SLUG);
}
}
getSystemHealthInfo(healthObject) {
this.props.systemHealthInfo(healthObject);
hashHistory.push('/admin/health-detail');
}
pressedNext() {
hashHistory.push('/generateFiles/' + this.props.submission.id);
}
componentWillMount () {
if (!this.props.user) {
hashHistory.push('/dashboard')
return
} else {
if (this.props.user.isSC) {
hashHistory.replace('/dashboard/scPublicity')
return
}
if (this.props.user.isFA) {
hashHistory.replace('/dashboard/faPublicity')
return
}
if (this.props.user.isAD) {
hashHistory.replace('/dashboard/adPublicity')
return
}
if (this.props.user.isSO) {
hashHistory.replace('/dashboard/soPublicity')