此错误的意思是Amplify无法找到已配置的网站。这通常是因为配置错误或缺少必要的文件导致的。要解决此问题,可以按照以下步骤进行操作:
以下是示例代码,用于在Amplify中配置Email SignUp:
import Amplify from 'aws-amplify'; import { withAuthenticator } from 'aws-amplify-react';
Amplify.configure({ Auth: { region: 'your-region', userPoolId: 'your-user-pool-id', userPoolWebClientId: 'your-app-client-id', mandatorySignIn: true, authenticationFlowType: 'USER_PASSWORD_AUTH', oauth: {} }, Email:{ region: 'your-region', smtp: { port: 587, sender: 'your-email-sender' }, verifyEmailSubject: 'Verify your email address', verifyEmailBody: 'Hello {username}, Thanks for signing up with us. Your verification code is {code}.', emailStyle: 'Simple', emailSenderName: 'your-sender-name' } });
export default withAuthenticator(App, true);