我尝试使用 cloudinary API_URL 直接从我的前端(Angular 8)上传文件,但仍然收到相同的错误请求(400)和相同的错误“上传预设必须列入未签名上传的白名单”,即使我尝试了不同的解决方案,例如在 FormData 中提供预设名称,并在我的 cloudinary 设置中将预设设置为无符号,但仍然无法正常工作。有什么解决办法吗?
我的上传代码:
const images = new FormData();
images.append('images', file);
images.append('upload_preset', [presetName]);
this.progressBar = true
const req = new HttpRequest('POST', 'https://api.cloudinary.com/v1_1/[cloudName]/image/upload', images,
{
reportProgress: true,
});
this.http.request(req).subscribe(event => {
if (event.type === HttpEventType.UploadProgress) {
const percentDone = Math.round(100 * event.loaded / event.total);
console.log(`File is ${percentDone}% uploaded.`);
} else if (event instanceof HttpResponse) {
console.log('File is completely uploaded!');
}
});
Run Code Online (Sandbox Code Playgroud) 我想创建一个简单的输入文本,以某个选定的前缀开头,并在该前缀之后立即开始写入,当用户删除输入文本时,它不会删除它保留在那里的前缀,是否有解决方案可以实现这一点?
<div className="position-relative form-group">
<img src="./redRisk.png" style={{ width: '2%' }}
/>
<input
name="titre"
id="exampleEmail"
type="text"
className="form-control"
onChange={()=>{}}
/>
</div>
Run Code Online (Sandbox Code Playgroud) 我有使用 MUI-Data-Table 组件在数据表中显示的文本列表,但我面临的问题是不是在列中显示单个项目,而是显示项目列表。我有一个叫做系统的项目。它包含一个国家数组,所以我想只在一列中显示该数组,但我不知道该怎么做。
这是我的json:
systeme:{
archived: 0
id: 1
nomSysteme: "Environnement Tn"
systeme_country: Array(1)
{
0: {id: 1}
length: 1
}
}
Run Code Online (Sandbox Code Playgroud)
这就是我自定义专栏的方式,因为我需要遵循某种模式:
{
name: "titre",
label: "Titre",
options: {
filter: true,
sort: false,
}
},
{
name: "theme.systeme.systeme_country",
label: "Countries",
options: {
filter: true,
sort: false,
}
},
Run Code Online (Sandbox Code Playgroud)
有关更多解释,选项名称必须与 json 中的相同,并且它只呈现一个对象,但 theme.systeme.system_country 是我想要显示的一组国家/地区 ID,但它不会让我不知道如何自定义我的专栏来做这样的事情,或者我可以做些什么来实现它