Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
refreshToken() {
request({
url: config.api.getOperationToken,
method: 'GET'
}).then(token => {
this.setState({ token: token })
})
}
initFileName(props) {
if (util.string.isEmpty(props.url) || !props.queryFileName) {
this.setState({ fileName: props.url })
} else {
request({
url: config.api.getFileName + this.props.url,
method: 'GET'
}).then(fileName => {
this.setState({ fileName: fileName })
})
}
}
componentDidMount() {
if (this.props.data.length > 0) {
this.initData(this.props.data);
} else if (this.props.url) {
request({
url: this.props.url,
method: 'GET'
}).then(data => {
this.initData(data);
})
}
}