{"id":48267,"date":"2023-07-07T18:04:39","date_gmt":"2023-05-09T12:45:12","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/"},"modified":"2024-04-30T12:28:54","modified_gmt":"2024-04-30T04:28:54","slug":"%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/","title":{"rendered":"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a"},"content":{"rendered":"<p>\u6211\u6b63\u5728\u7b80\u5355\u5730\u8bb0\u5f55\u7740React + AWS Amplify\u7684\u6559\u7a0b\u7b14\u8bb0\u3002\u57fa\u672c\u4e0a\uff0c\u6211\u6309\u7167\u4e0a\u8ff0\u6587\u7ae0\u4e2d\u7684\u6b65\u9aa4\u8fdb\u884c\uff0c\u540c\u65f6\u5c06\u9047\u5230\u7684\u95ee\u9898\u8bb0\u5f55\u4e0b\u6765\u3002\u6587\u7ae0\u94fe\u63a5\uff1ahttps:\/\/www.cresco.co.jp\/blog\/entry\/20393\/<\/p>\n<h2>\u521b\u5efaReact\u5e94\u7528\u7a0b\u5e8f<\/h2>\n<ul class=\"post-ul\">\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30d7\u30ea\u3092\u4f5c\u6210<\/ul>\n<pre class=\"post-pre\"><code>npx create-react-app todo\r\n<\/code><\/pre>\n<h3>\u6253\u5f00\u5e94\u7528<\/h3>\n<pre class=\"post-pre\"><code>cd todo\r\nnpm start\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/6-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 0.00.18.png\" \/><\/div>\n<h3>\u5173\u95ed\u5e94\u7528\u7a0b\u5e8f<\/h3>\n<p>\u300c\u590d\u5236\u300d<\/p>\n<h2>\u521b\u5efaGitHub\u4ed3\u5e93<\/h2>\n<p>\u5728GitHub\u4e0a\u521b\u5efa\u4e00\u4e2a\u5b58\u50a8\u5e93\uff0c\u5e76\u5c06\u5e94\u7528\u7a0b\u5e8f\u63a8\u9001\u5230\u8be5\u5b58\u50a8\u5e93\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>git init\r\ngit remote add origin https:\/\/github.com\/xxxxx\/todo.git\r\ngit remote -v\r\ngit add .\r\ngit commit -m 'init'\r\ngit push origin main\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u3010GitHub\u3011 authentication failed\u3067\u5931\u6557\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u30c8\u30fc\u30af\u30f3\u3092\u8a2d\u5b9a\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">https:\/\/donachikiblog.com\/github-authentication-failed\/<\/ul>\n<h2>\u589e\u5f3a\u90e8\u7f72<\/h2>\n<p>\u4f7f\u7528AWS\u8d26\u53f7\u767b\u5f55\uff0c\u4eceAmplify\u63a7\u5236\u53f0\u90e8\u7f72\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/15-1.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 0.44.22.png\" \/><\/div>\n<h2>\u653e\u5927\u5e94\u7528\u7a0b\u5e8f\u7684\u521d\u59cb\u5316<\/h2>\n<p>\u5b89\u88c5 Amplify CLI<\/p>\n<pre class=\"post-pre\"><code>npm install -g @aws-amplify\/cli\r\n<\/code><\/pre>\n<p>\u8bbe\u7f6eAmplify<\/p>\n<ul class=\"post-ul\">\u3053\u306e\u969b\u3001AWS\u306b\u3066Amplify\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308bIAM\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u30a2\u30ca\u30a6\u30f3\u30b9\u306b\u8a18\u8f09\u3055\u308c\u308bURL\u3092\u3082\u3068\u306bIAM\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u3001accessKeyId\u3068SecretAccessKey\u3092\u767a\u884c\u5f8c\u3001\u30ed\u30fc\u30ab\u30eb\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306b\u5165\u529b\u3059\u308b<\/ul>\n<pre class=\"post-pre\"><code>amplify configure\r\n\u30fb\r\n\u30fb\r\n\u30fb\r\nSign in to your AWS administrator account:\r\nhttps:\/\/console.aws.amazon.com\/\r\nPress Enter to continue\r\n\r\nSpecify the AWS Region\r\n? region:  ap-northeast-1\r\nSpecify the username of the new IAM user:\r\n? user name:  todoAdmin\r\nComplete the user creation using the AWS console\r\nhttps:\/\/console.aws.amazon.com\/iam\/home?region=*****\r\nPress Enter to continue\r\n\r\nEnter the access key of the newly created user:\r\n? accessKeyId:  ********\r\n? secretAccessKey:  ********\r\nThis would update\/create the AWS Profile in your local machine\r\n? Profile Name:  default\r\n\r\nSuccessfully set up the new user.\r\n<\/code><\/pre>\n<p>\u521d\u59cb\u5316Amplify\u9879\u76ee<\/p>\n<pre class=\"post-pre\"><code>amplify init --appId \u3010Amplify\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ARN\u3011\r\n<\/code><\/pre>\n<h2>\u589e\u52a0\u8ba4\u8bc1<\/h2>\n<p>\u5b89\u88c5amplify\u5e93<\/p>\n<pre class=\"post-pre\"><code>npm install aws-amplify @aws-amplify\/ui-react\r\n<\/code><\/pre>\n<p>\u5c06\u8ba4\u8bc1\u670d\u52a1\u6dfb\u52a0\u5230Amplify\u9879\u76ee\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>amplify add auth\r\n<\/code><\/pre>\n<p>\u90e8\u7f72\u8eab\u4efd\u9a8c\u8bc1\u670d\u52a1<\/p>\n<ul class=\"post-ul\">\u300c&#8211;y\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5168\u3066\u306e\u8cea\u554f\u306b\u300cyew\u300d\u3092\u8a2d\u5b9a\u3059\u308b<\/ul>\n<pre class=\"post-pre\"><code>amplify push --y\r\n<\/code><\/pre>\n<h2>\u4fee\u6539React\u5e94\u7528<\/h2>\n<p>src\/index.js \u7684\u6e90\u4ee3\u7801<\/p>\n<pre class=\"post-pre\"><code>import React from 'react';\r\nimport ReactDOM from 'react-dom\/client';\r\nimport '.\/index.css';\r\nimport App from '.\/App';\r\nimport reportWebVitals from '.\/reportWebVitals';\r\nimport { Amplify } from 'aws-amplify'\r\nimport config from '.\/aws-exports';\r\nAmplify.configure(config);\r\n\r\nconst root = ReactDOM.createRoot(document.getElementById('root'));\r\nroot.render(\r\n  &lt;React.StrictMode&gt;\r\n    &lt;App \/&gt;\r\n  &lt;\/React.StrictMode&gt;\r\n);\r\n\r\n\/\/ If you want to start measuring performance in your app, pass a function\r\n\/\/ to log results (for example: reportWebVitals(console.log))\r\n\/\/ or send to an analytics endpoint. Learn more: https:\/\/bit.ly\/CRA-vitals\r\nreportWebVitals();\r\n\r\n<\/code><\/pre>\n<p>src\/App.js:<br \/>\n\u4e3b\u8981\u539f\u59cb\u78bc\/src\/App.js<\/p>\n<pre class=\"post-pre\"><code>import React from 'react';\r\nimport logo from '.\/logo.svg';\r\nimport '.\/App.css';\r\nimport { withAuthenticator } from '@aws-amplify\/ui-react'\r\nimport '@aws-amplify\/ui-react\/styles.css';\r\n\r\nfunction App({ signOut, user }) {\r\nreturn (\r\n&lt;div className=\"App\"&gt;\r\n&lt;header&gt;\r\n&lt;img src={logo} className=\"App-logo\" alt=\"logo\" \/&gt;\r\n&lt;h1&gt;Hello {user.username}&lt;\/h1&gt;\r\n&lt;button onClick={signOut}&gt;Sign out&lt;\/button&gt;\r\n&lt;\/header&gt;\r\n&lt;\/div&gt;\r\n);\r\n}\r\nexport default withAuthenticator(App);\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/37-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 1.29.03.png\" \/><\/div>\n<h2>\u521b\u9020GraphQL<\/h2>\n<p>\u5c06GraphQL API\u6dfb\u52a0\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>amplify add api\r\n? Select from one of the below mentioned services: GraphQL\r\n? Here is the GraphQL API that we will create. Select a setting to edit or continue Continue\r\n? Choose a schema template: Single object with fields (e.g., \u201cTodo\u201d with ID, name, description)\r\n\u2714 Do you want to edit the schema now? (Y\/n) \u00b7 yes\r\n? Try opening with system-default editor instead? Yes\r\n<\/code><\/pre>\n<p>\u4fee\u6539GraphQL\u6587\u4ef6<br \/>\n&#8211; \u4fee\u6539amplify\/backend\/api\/todo\/schema.graphql\u6587\u4ef6<\/p>\n<pre class=\"post-pre\"><code>type Note @model {\r\n  id: ID!\r\n  name: String!\r\n  description: String\r\n}\r\n<\/code><\/pre>\n<p>\u64b0\u5199\u7528\u4e8e\u4f7f\u7528API\u7684\u524d\u7aef\u4ee3\u7801\u3002<\/p>\n<ul class=\"post-ul\">src\/App.js\u3092\u66f4\u65b0<\/ul>\n<pre class=\"post-pre\"><code>import React, { useState, useEffect } from 'react';\r\nimport logo from '.\/logo.svg';\r\nimport '.\/App.css';\r\nimport { withAuthenticator } from '@aws-amplify\/ui-react'\r\nimport '@aws-amplify\/ui-react\/styles.css';\r\nimport { API } from 'aws-amplify';\r\nimport { listNotes } from '.\/graphql\/queries';\r\nimport { createNote as createNoteMutation, deleteNote as deleteNoteMutation } from '.\/graphql\/mutations';\r\n\r\nconst initialFormState = { name: '', description: '' }\r\n\r\nfunction App({ signOut, user }) {\r\n  const [notes, setNotes] = useState([]);\r\n  const [formData, setFormData] = useState(initialFormState);\r\n\r\n  useEffect(() =&gt; {\r\n    fetchNotes();\r\n  }, []);\r\n\r\n  async function fetchNotes() {\r\n    const apiData = await API.graphql({ query: listNotes });\r\n    setNotes(apiData.data.listNotes.items);\r\n  }\r\n\r\n  async function createNote() {\r\n    if (!formData.name || !formData.description) return;\r\n    await API.graphql({ query: createNoteMutation, variables: { input: formData } });\r\n    setNotes([ ...notes, formData ]);\r\n    setFormData(initialFormState);\r\n  }\r\n\r\n  async function deleteNote({ id }) {\r\n    const newNotesArray = notes.filter(note =&gt; note.id !== id);\r\n    setNotes(newNotesArray);\r\n    await API.graphql({ query: deleteNoteMutation, variables: { input: { id } }});\r\n  }\r\n  return (\r\n    &lt;div className=\"App\"&gt;\r\n      &lt;h1&gt;My Notes App&lt;\/h1&gt;\r\n      &lt;input\r\n        onChange={e =&gt; setFormData({ ...formData, 'name': e.target.value})}\r\n        placeholder=\"Note name\"\r\n        value={formData.name}\r\n      \/&gt;\r\n      &lt;input\r\n        onChange={e =&gt; setFormData({ ...formData, 'description': e.target.value})}\r\n        placeholder=\"Note description\"\r\n        value={formData.description}\r\n      \/&gt;\r\n      &lt;button onClick={createNote}&gt;Create Note&lt;\/button&gt;\r\n      &lt;div style={{marginBottom: 30}}&gt;\r\n        {\r\n          notes.map(note =&gt; (\r\n            &lt;div key={note.id || note.name}&gt;\r\n              &lt;h2&gt;{note.name}&lt;\/h2&gt;\r\n              &lt;p&gt;{note.description}&lt;\/p&gt;\r\n              &lt;button onClick={() =&gt; deleteNote(note)}&gt;Delete note&lt;\/button&gt;\r\n            &lt;\/div&gt;\r\n          ))\r\n        }\r\n      &lt;\/div&gt;\r\n      &lt;img src={logo} className=\"App-logo\" alt=\"logo\" \/&gt;\r\n      &lt;h1&gt;Hello {user.username}&lt;\/h1&gt;\r\n      &lt;button onClick={signOut}&gt;Sign out&lt;\/button&gt;\r\n    &lt;\/div&gt;\r\n  );\r\n}\r\n\r\nexport default withAuthenticator(App);\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/46-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 1.53.29.png\" \/><\/div>\n<h2>\u589e\u52a0\u4f9b\u56fe\u7247\u4f7f\u7528\u7684\u5b58\u50a8\u7a7a\u95f4<\/h2>\n<pre class=\"post-pre\"><code>amplify add storage\r\n? Select from one of the below mentioned services: Content (Images, audio, video, etc.)\r\n\u2714 Provide a friendly name for your resource that will be used to label this category in the project: \u00b7 imageStorage\r\n\u2714 Provide bucket name: \u00b7 test-amplify-image-storage-xxx\r\n\u2714 Who should have access: \u00b7 Auth users only\r\n\u2714 What kind of access do you want for Authenticated users? \u00b7 create\/update, read, delete\r\n\u2714 Do you want to add a Lambda Trigger for your S3 Bucket? (y\/N) \u00b7 no\r\n\u2705 Successfully added resource imageStorage locally\r\n\u26a0\ufe0f If a user is part of a user pool group, run \"amplify update storage\" to enable IAM group policies for CRUD operations\r\n\u2705 Some next steps:\r\n\"amplify push\" builds all of your local backend resources and provisions them in the cloud\r\n\"amplify publish\" builds all of your local backend and front-end resources (if you added hosting category) and provisions them in the cloud\r\n<\/code><\/pre>\n<h2>\u4fee\u6539GraphQL\u6587\u4ef6<\/h2>\n<pre class=\"post-pre\"><code>type Note @model {\r\n  id: ID!\r\n  name: String!\r\n  description: String\r\n  image: String\r\n}\r\n<\/code><\/pre>\n<h2>\u90e8\u7f72API\u548c\u5b58\u50a8\u3002<\/h2>\n<pre class=\"post-pre\"><code>amplify push --y\r\n<\/code><\/pre>\n<h2>\u786e\u8ba4\u52a8\u4f5c<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/54-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 2.04.59.png\" \/><\/div>\n<h2>\u5c06\u7a0b\u5e8f\u90e8\u7f72\u5230\u6b63\u5f0f\u73af\u5883<\/h2>\n<p>\u9996\u5148\u5c06\u66f4\u6539\u63a8\u9001\u5230 GitHub \u4e0a\u7684 main \u5206\u652f\uff0c\u5373\u53ef\u81ea\u52a8\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u3002<\/p>\n<pre class=\"post-pre\"><code>git add -A\r\ngit commit -m 'main push'\r\ngit push origin main\r\n<\/code><\/pre>\n<p>\u7279\u6027\u6807\u5fd7\u5728 &#8220;amplify\/cli.json&#8221; \u914d\u7f6e\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff0c\u5e76\u4e14\u5bf9\u5f53\u524d\u8fd0\u884c\u7684 Amplify CLI \u662f\u672a\u77e5\u7684\u95ee\u9898\u3002<br \/>\n\u5f53\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u65f6\uff0c\u4e0a\u8ff0\u9519\u8bef\u4f1a\u53d1\u751f\uff0c\u5e76\u5bfc\u81f4\u90e8\u7f72\u5931\u8d25\u3002<br \/>\n\u56e0\u6b64\uff0c\u5728 Amplify \u63a7\u5236\u53f0\u7684 &#8220;\u5e94\u7528\u7a0b\u5e8f\u8bbe\u7f6e&#8221; &gt; &#8220;\u6784\u5efa\u8bbe\u7f6e&#8221; &gt; &#8220;\u4f7f\u7528\u5e94\u7528\u7a0b\u5e8f\u6784\u5efa&#8221; \u4e2d\uff0c\u6211\u4fee\u6539\u4e86 amplify.yml \u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"d7ZgPHiJ6U\"><p><a href=\"https:\/\/weblion303.net\/2610\">AWS Amplify Studio\u3067\u306edeploy\u6642\u306e\u3064\u307e\u305a\u304d\u30dd\u30a4\u30f3\u30c8<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;AWS Amplify Studio\u3067\u306edeploy\u6642\u306e\u3064\u307e\u305a\u304d\u30dd\u30a4\u30f3\u30c8&#8221; &#8212; tech1000+\" src=\"https:\/\/weblion303.net\/2610\/embed#?secret=P4haJiEbGr#?secret=d7ZgPHiJ6U\" data-secret=\"d7ZgPHiJ6U\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<pre class=\"post-pre\"><code>version: 1\r\nbackend:\r\n  phases:\r\n    build:\r\n      commands:\r\n        - '# Execute Amplify CLI with the helper script'\r\n        - amplifyPush --simple\r\nfrontend:\r\n  phases:\r\n    preBuild:\r\n      commands:\r\n        - nvm install 16.13.1\r\n        - nvm use  16.13.1\r\n        - npm install @aws-amplify\/cli --force\r\n        - npm install\r\n    build:\r\n      commands:\r\n        - npm run build\r\n  artifacts:\r\n    baseDirectory: build\r\n    files:\r\n      - '**\/*'\r\n  cache:\r\n    paths:\r\n      - node_modules\/**\/*\r\n<\/code><\/pre>\n<p>\u53e6\u5916\uff0c\u5728\u201c\u6784\u5efa\u8bbe\u7f6e\u201d\u4e2d\u7684\u201c\u6784\u5efa\u955c\u50cf\u8bbe\u7f6e\u201d\u4e2d\uff0c\u6211\u4eec\u6dfb\u52a0\u4e86\u5305\u540d\u4e3aAmplify CLI\uff0c\u7248\u672c\u4e3alatest\u7684\u5305\u66f4\u65b0\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/61-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 15.57.07.png\" \/><\/div>\n<p>\u518d\u6b21\u901a\u8fc7Amplify\u63a7\u5236\u53f0\u8fdb\u884c\u6784\u5efa\uff0c\u90e8\u7f72\u5b8c\u6210\uff0c\u5e76\u53ef\u4ee5\u901a\u8fc7Amplify\u4e0a\u7684\u57df\u540d\u8fdb\u884c\u8bbf\u95ee\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/63-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-01-22 15.59.39.png\" \/><\/div>\n<h2>\u6700\u540e<\/h2>\n<p>\u4e00\u65e6\u5b8c\u6210\u4e86\u6559\u7a0b\uff0c\u4ee5\u540e\u5c06\u6df1\u5165\u63a2\u8ba8React\u7f16\u7801\u5e76\u8fdb\u884c\u8bb0\u5f55\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u6b63\u5728\u7b80\u5355\u5730\u8bb0\u5f55\u7740React + AWS Amplify\u7684\u6559\u7a0b\u7b14\u8bb0\u3002\u57fa\u672c\u4e0a\uff0c\u6211\u6309\u7167\u4e0a\u8ff0\u6587\u7ae0\u4e2d\u7684\u6b65\u9aa4\u8fdb\u884c\uff0c\u540c\u65f6\u5c06 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-48267","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u53cd\u5e94-aws-amplify\u7684\u521d\u521b\u4f01\u4e1a\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a\" \/>\n<meta property=\"og:description\" content=\"\u6211\u6b63\u5728\u7b80\u5355\u5730\u8bb0\u5f55\u7740React + AWS Amplify\u7684\u6559\u7a0b\u7b14\u8bb0\u3002\u57fa\u672c\u4e0a\uff0c\u6211\u6309\u7167\u4e0a\u8ff0\u6587\u7ae0\u4e2d\u7684\u6b65\u9aa4\u8fdb\u884c\uff0c\u540c\u65f6\u5c06 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u53cd\u5e94-aws-amplify\u7684\u521d\u521b\u4f01\u4e1a\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-09T12:45:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T04:28:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/6-0.png\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/\",\"name\":\"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-05-09T12:45:12+00:00\",\"dateModified\":\"2024-04-30T04:28:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u53cd\u5e94-aws-amplify\u7684\u521d\u521b\u4f01\u4e1a\/","og_locale":"zh_CN","og_type":"article","og_title":"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a","og_description":"\u6211\u6b63\u5728\u7b80\u5355\u5730\u8bb0\u5f55\u7740React + AWS Amplify\u7684\u6559\u7a0b\u7b14\u8bb0\u3002\u57fa\u672c\u4e0a\uff0c\u6211\u6309\u7167\u4e0a\u8ff0\u6587\u7ae0\u4e2d\u7684\u6b65\u9aa4\u8fdb\u884c\uff0c\u540c\u65f6\u5c06 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u53cd\u5e94-aws-amplify\u7684\u521d\u521b\u4f01\u4e1a\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-05-09T12:45:12+00:00","article_modified_time":"2024-04-30T04:28:54+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d846c913a08637a6b6417\/6-0.png"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/","name":"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-05-09T12:45:12+00:00","dateModified":"2024-04-30T04:28:54+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u53cd\u5e94 + AWS Amplify\u7684\u521d\u521b\u4f01\u4e1a"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%8f%8d%e5%ba%94-aws-amplify%e7%9a%84%e5%88%9d%e5%88%9b%e4%bc%81%e4%b8%9a\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=48267"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48267\/revisions"}],"predecessor-version":[{"id":91917,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48267\/revisions\/91917"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=48267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=48267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=48267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}