Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get validatePassed() {
// forbid gd
if (this.state.school_id === 1) {
Toast.fail('请输入正确的密码', 1)
return false
}
if (this.state.school_id === -1) {
Toast.offline('请选择你的学校噢~', 1)
return false
}
if (!this.state.account) {
Toast.offline('请输入学号噢~', 1)
return false
}
if (!this.state.password) {
Toast.offline('请输入密码噢~', 1)
return false
}
return true
}
get validatePassed() {
// forbid gd
if (this.state.school_id === 1) {
Toast.fail('请输入正确的密码', 1)
return false
}
if (this.state.school_id === -1) {
Toast.offline('请选择你的学校噢~', 1)
return false
}
if (!this.state.account) {
Toast.offline('请输入学号噢~', 1)
return false
}
if (!this.state.password) {
Toast.offline('请输入密码噢~', 1)
return false
}
return true
}
let params = {
list_name: this.state.list_name,
list_content: this.state.list_content
}
let response = (await HttpUtils.post(URL, params)) || {}
if (response.status === 0) {
Toast.success('创建书单成功!', 1)
let result = (await HttpUtils.post(URL_SHOW)) || {}
if (result.msg === '请求成功') {
let lists = result.data
await Storage.set('book_list', lists)
this.props.onCallBack()
Actions.pop()
}
} else {
Toast.offline(response.msg, 1)
}
}
Toast.fail('请输入正确的密码', 1)
return false
}
if (this.state.school_id === -1) {
Toast.offline('请选择你的学校噢~', 1)
return false
}
if (!this.state.account) {
Toast.offline('请输入学号噢~', 1)
return false
}
if (!this.state.password) {
Toast.offline('请输入密码噢~', 1)
return false
}
return true
}