我是个新手。我已经有了亚马逊网络服务的设置,还有accessKeyId和secretAccessKey。当我运行查看器时,我得到一个"ConfigError: Missing region in config“
出于某种奇怪的原因,甚至删除了客户id和客户机密。但是它没有说明任何关于客户端ID和客户端密钥的信息
const awsParamStore = require( 'aws-param-store' );
awsParamStore.getParametersByPath(" https://s3aecshare.s3.af-south-1.amazonaws.com/RVT_Test/rac_basic_sample_project.rvt");
const awsFlag = process.env.FORGE_AWS_FLAG;
//const paramStore = {"region": process.env.AWS_REGION}
const paramStore = {"region": "af-south-1"}
const clientId = process.env.FORGE_CLIENT_ID;
//const clientId ="-----------------------------";
//const clientSecret = process.env.FORGE_CLIENT_SECRET;
const clientSecret = "---------------------------";
// Autodesk Forge AWS configuration for SSM service
module.exports = {
// Required scopes for your application on server-side
scopeInternal: ['bucket:create', 'bucket:read', 'data:read', 'data:create', 'data:write'],
// Required scope of the token sent to the client
scopePublic: ['viewables:read'],
getParamStore: function() {
// If not running on AWS, paramStore requires access and secret AWS Keys
if (awsFlag){
return paramStore;
}else{
paramStore.credentials =
{
"accessKeyId" : "-------------------------------------",
"secretAccessKey" :"--------------------------------------"
};
}
return paramStore;
},
forgeAWSClientId: async function() {
let parameter = await awsParamStore.getParameter( clientId , this.getParamStore());
return parameter.Value;
},
forgeAWSClientSecret: async function() {
let parameter = await awsParamStore.getParameter( clientSecret ,this.getParamStore());
return parameter.Value;
}发布于 2021-03-19 18:10:00
请注意,Forge Viewer本身是一个JavaScript库。您不需要将其部署到任何地方,只需在您的HTML标记的<head>中包含以下标记:
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.min.css" type="text/css">
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>https://stackoverflow.com/questions/66598988
复制相似问题