Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!tenancyName) {
abp.multiTenancy.setTenantIdCookie(undefined);
window.location.href = '/';
return;
} else {
await this.props.accountStore!.isTenantAvailable(tenancyName);
const { tenant } = this.props.accountStore!;
switch (tenant.state) {
case TenantAvailabilityState.Available:
abp.multiTenancy.setTenantIdCookie(tenant.tenantId);
loginModel.tenancyName = tenancyName;
loginModel.toggleShowModal();
window.location.href = '/';
return;
case TenantAvailabilityState.InActive:
Modal.error({ title: L('Error'), content: L('TenantIsNotActive') });
break;
case TenantAvailabilityState.NotFound:
Modal.error({ title: L('Error'), content: L('ThereIsNoTenantDefinedWithName{0}', tenancyName) });
break;
}
}
};
.then((res) => {
if(method!='GET'){hide();}
if(res.ok){
return res.json();
}
else{
if(window.modal==undefined){
window.modal=Modal.error({
title: '系统错误',
content: '请检查是否有参数配置错误',
onOk:()=>{
window.modal=undefined;
}
});
}
}
})
.then((data)=>{
const wsError = () => {
Modal.error({
closable: false,
title: 'Unable to connect to Websocket server!',
content: 'In order to use this interface, the Redis<->Websocket proxy must be running. \n\n' +
'To start it, run.sh in the project root directory and refresh this page.'
});
}
handleError = () => {
const that = this;
Modal.error({
title: 'Error',
content: this.state.deploymentError,
onOk() {
that.setState({
showError: false,
});
},
});
};
(error: any) => {
reject(error);
Modal.error({ title: error.message, centered: true, okType: 'danger' })
}
);
this.update(draft => {
if (result.success) {
draft.session = result.data
} else {
Modal.error({title: '获取当前登入状态异常', content: result.message})
}
})
}).then(null, (data)=> {
//code 为 3 表示用户名已被注册
if(!data.success && data.code == 3){
Modal.error({
title: '错误提示',
content: <p style="{{fontSize:">该用户名已被注册!</p>
});
}
});
},
const handleOk = async (values) => {
switch (modalInfo.type) {
case 'editTable':
try {
await xcClient.renameTable(db, modalInfo.tableName, values.tableName)
Modal.success({
content: t('data_manager.update_success_txt'),
})
} catch (e) {
Modal.error({
title: t('data_manager.update_failed_txt'),
content: <pre>{e.message}</pre>,
})
}
break
case 'deleteTable':
try {
await xcClient.dropTable(db, modalInfo.tableName)
Modal.success({
content: t('data_manager.delete_success_txt'),
})
} catch (e) {
Modal.error({
title: t('data_manager.delete_failed_txt'),
content: <pre>{e.message}</pre>,
})
draft.sideDrawerOpen = true
break
case ACTION_HIDE_SIDE_DRAWER:
draft.sideDrawerOpen = false
break
case ACTION_SHOW_LOGIN_FRAME:
draft.loginFrameOpen = true
break
case ACTION_HIDE_LOGIN_FRAME:
draft.loginFrameOpen = false
break
case ACTION_ALERT_INFO:
Modal.info({title: action.title, content: action.content})
break
case ACTION_ALERT_ERROR:
Modal.error({title: action.title, content: action.content})
break
case ACTION_ALERT_WARNING:
Modal.warning({title: action.title, content: action.content})
break
case ACTION_ALERT_SUCCESS:
Modal.success({title: action.title, content: action.content})
break
default:
}
})
}