Alibaba Cloud Cloud Development Web Application Training Camp-Detailed explanation of the third check-in task

Alibaba Cloud Cloud Development Web Application Training Camp-Detailed explanation of the third check-in task

Don't talk nonsense, just start

1. Preparation stage

  1. Download sample script
https://pubbucket-hy3298.oss-cn-shanghai.aliyuncs.com/week3/sample.zip
  1. Modify the sample script and
    log in to the Aliyun console https://homenew.console.aliyun.com/

Move the mouse to the avatar in the upper right corner, click AccessKey management, click enter
Find AccessKey management
or directly visit the AccessKey management page
Access address: https://ram.console.aliyun.com/manage/ak
AK management page

Click the [] button to create AccessKey phone verification, successfully created the pop-pop
IF
note: AK ID and AK Secret all necessary permissions for the account Note safekeeping
Note: AK ID and AK Secret all necessary permissions for the account Note safekeeping
note : AK ID and AK Secret must keep all permissions of the account properly

The important thing is to say three times
. Unzip the just downloaded script and get the sample.js file. Open the file to find the fourth and fifth lines, and replace the AssessKeyId and AssessKeySecret just generated to the corresponding positions in the file.

var client = new Core({
    
    
  accessKeyId: '你的AK ID',
  accessKeySecret: '你的AK Secret',
  endpoint: 'https://workbench-ide.cn-shanghai.aliyuncs.com',
  apiVersion: '2020-08-28'
});

Log in to the Aliyun cloud development platform https://workbench.aliyun.com/application,
Log in to the cloud development platform
open the sidebar of the application, click to enter [Enterprise Management Backstage], find the enterprise ID in the payment information under the basic information, and
Find company ID
find the thirteenth in the file you just modified Replace the company ID in the file fromSolId

var params = {
    
    
  "ApplicationCreateRequest": JSON.stringify({
    
    
    "fromSolId": 1,
    "orgId": "企业ID",
    "appName": "OpenAPI_自己填写的应用名称", 
    "appDesc": "OpenAPI_自己填写的应用描述",
  })
}

Modify appname and appDesc ​​to names beginning with OpenAPI.
Save the file after the modification is completed, and other contents in the file do not need to be modified.

Second, execute the script

After saving successfully, open a command window (or terminal) in the directory where the file is located and execute the following two lines of commands in turn

  npm i @alicloud/pop-core -g --registry=https://registry.npm.taobao.org
  node ./Sample.js

After the command is executed, if the command window or terminal reports the following error,
Error message
modify the command to install the dependencies directly in the current folder.
Re-execute the following command

  npm i @alicloud/pop-core --registry=https://registry.npm.taobao.org
  node ./Sample.js

The command is executed successfully, and the result is as follows.
execution succeed

Three, finally

The screenshot is uploaded and opened.

Guess you like

Origin blog.csdn.net/qq_21739761/article/details/108732351