小编Hem*_*a S的帖子

MaxRequestBodySize 无法在具有 Azure 应用服务的 Web 服务器中工作

当使用 Azure 应用服务部署到 Web 服务器时,MaxRequestBodySize 不起作用,但它在我的本地工作。我尝试对 .net core 3.1 的program.cs 和startup.cs 进行以下更改,但没有一个起作用。仍然收到 413(请求实体太大)错误。

Program.cs:
1. webBuilder.ConfigureKestrel(serverOptions =>
                       {
                           serverOptions.Limits.MaxRequestBodySize = long.MaxValue;
                       })


2. .UseKestrel(options =>
{
    options.Limits.MaxRequestBodySize = long.MaxValue;
}

Startup.cs
services.Configure<IISServerOptions>(options => options.MaxRequestBodySize = long.MaxValue);
Run Code Online (Sandbox Code Playgroud)

.net-core asp.net-core-3.1

5
推荐指数
1
解决办法
5623
查看次数

如何在 antd 模式中隐藏顶部的 X 按钮

如何从 ant d 模态隐藏顶部的 X 按钮,以及如何禁用使用 ESC 键关闭模态的行为

return (
<Modal
title={modalHeader}
okText="EXIT"
cancelText="CONTINUE"
visible={visible}
onCancel={onCancelHandler}
onOk={exitUser}
width={600}
cancelButtonProps={{hidden:isExFlag}}
>
<DescriptionParagraph>
{modalBodyText}
</DescriptionParagraph>
</Modal>
);
Run Code Online (Sandbox Code Playgroud)

antd ant-design-pro react-typescript

3
推荐指数
1
解决办法
1万
查看次数

如何使用按钮道具动态禁用antd modal的按钮

我有一个 antd Modal,我正在尝试验证一个字段并为其提供验证。如何根据验证启用/禁用“确定”按钮。如果验证成功,则应启用按钮,否则应禁用。

<Form>
    <Modal
      title={modalHeader}
      okText="ADD FIELD"
      cancelText="CANCEL"
      visible={visible}
      onCancel={onCancelHandler}
      onOk={() => onAddFieldHandler(fieldName)}
      width={600}
      okButtonProps={{disabled:true}}
    >
      <p>Please provide name</p>
      <Form.Item
      name="fieldName"
      rules={[{ required: true, message: 'Please enter name' }]}
      >
      <FieldNameInput
        placeholder="Field name..."
        value={fieldName}
        onChange={(event) => setFieldName(event.target.value)}

      />
      </Form.Item>
    </Modal>
    </Form>
Run Code Online (Sandbox Code Playgroud)

antd react-typescript

2
推荐指数
1
解决办法
2134
查看次数