Auth.signIn({
username, // Required, the username
password, // Optional, the password
validationData, // Optional, a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication
}).then(user => console.log(user))
.catch(err => console.log(err));
Run Code Online (Sandbox Code Playgroud)
所以我使用 AWS Amplify Auth.signIn
我成功登录并获取 id 令牌,看到正确的用户名和池
但会话为空...
这阻止我使用...Auth.VerifyCurrentUser
// To initiate the process of verifying the attribute like 'phone_number' or 'email'
Auth.verifyCurrentUserAttribute(attr)
.then(() => {
console.log('a verification code is …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 S3 存储桶上托管一个具有多个路径的网站。这是一个可用的选项吗?
本地主机:3000
本地主机:3000/政策
example.com <-- 有效
example.com/policy <-- 没有密钥错误时不起作用
404 未找到代码:NoSuchKey
消息:指定的密钥不存在。
关键词:政策
我正在本地主机上运行的应用程序上使用 React-Router-Dom 开关
<Switch>
<Route path="/policy"><PolicyComponent><Route>
<Route path="/"><HomePageComponent><Route>
<Switch>
Run Code Online (Sandbox Code Playgroud) 你如何传递索引号?
arrayOfObj = [ {},{},{} ]
{this.arrayOfObj.map(user => (
<Comp index={user.index}/>
))}
Run Code Online (Sandbox Code Playgroud)
输出应该是
0
1
2
Run Code Online (Sandbox Code Playgroud)