我正在尝试在本地计算机上设置后端我已经安装了 v6 dotnet 一切都已安装,但是当我运行时dotnet run
出现此错误
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application 'run' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet-download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
Run Code Online (Sandbox Code Playgroud)
点网--信息
PS C:\Users\Az\bazaar-online\Server\Src\BazaarOnline.API> dotnet --info
global.json file:
Not found
Host:
Version: 6.0.7
Architecture: x86
Commit: 0ec02c8c96
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.AspNetCore.App …Run Code Online (Sandbox Code Playgroud) 我有一个注册模式,有 3 个步骤。
填写信息、获取激活码和成功消息。
我希望当用户填写输入并单击提交按钮时,如果没有错误,则移动到下一步,但如果有错误,则会React Toastify显示消息。
我的问题是为什么try catch阻止MyComponent不起作用?
PS:我正在使用Formik和Yup
http服务
const handleExpectedError = (response: any) => {
if (response?.status >= 400 && response?.status < 500) {
const errors = response?.data?.errors;
const errPropertyName: string[] = Object.keys(errors);
toast.error(errors?.[errPropertyName?.[0]]?.[0]);
}
};
export const handleRegister = async (user: User): Promise<void> => {
try {
await axios.post(`${config.apiEndPoint}/auth/register`, user, header);
} catch ({ response }) {
handleExpectedError(response);
}
};
Run Code Online (Sandbox Code Playgroud)
我的组件
const [step, setStep] = useState(1);
const formik …Run Code Online (Sandbox Code Playgroud) .net ×1
.net-core ×1
asp.net ×1
c# ×1
javascript ×1
next.js ×1
react-hooks ×1
reactjs ×1
typescript ×1