当前位置:网站首页>低代码平台中的数据连接方式(上)
低代码平台中的数据连接方式(上)
2022-07-06 18:34:00 【InfoQ】
1. 前言
- 在(上)篇中,我们将介绍经典的单 API 通信数据连接方式 - 简单的单 API 连接方式存在的问题 - 相应解决方案。
- 在(下)篇中,我们将介绍在低代码时代发展起来的 API 编排 - FaaS - 数据库直连等新型方案。
2. 传统手工模式下动态数据的获取和渲染
var menuId = $( "ul.nav" ).first().attr( "id" );
var request = $.ajax({
url: "script.php",
method: "POST",
data: { id : menuId },
dataType: "html"
});
request.done(function( msg ) {
$( "#log" ).html( msg );
});
request.fail(function( jqXHR, textStatus ) {
alert( "Request failed: " + textStatus );
});// 1. Import *useState* and *useEffect*
import React, {useState, useEffect} from 'react';
import './App.css';
function App() {
// 2. Create our *dogImage* variable as well as the *setDogImage* function via useState
// We're setting the default value of dogImage to null, so that while we wait for the
// fetch to complete, we dont attempt to render the image
let [dogImage, setDogImage] = useState(null)
// 3. Create out useEffect function
useEffect(() => {
fetch("https://dog.ceo/api/breeds/image/random")
.then(response => response.json())
// 4. Setting *dogImage* to the image url that we received from the response above
.then(data => setDogImage(data.message))
},[])
return (
<div className="App">
{/* 5. Using *dogImage as* the *src* for our image*/}
{dogImage && <img src={dogImage}></img>}
</div>
);
}
export default App;new Vue({
el: '#app',
data () {
return {
info: null
}
},
mounted () {
axios
.get('https://api.coindesk.com/v1/bpi/currentprice.json')
.then(response => (this.info = response))
}
})3. 低代码最初的数据连接方式 —— 通过 API URL 进行数据通信
4. 问题产生 —— 低代码平台实际落地中的阻碍
4.1 前后端数据格式不匹配问题

{
"status":0,
"msg":"",
"data":{
...其他字段
}
}4.2 跨域问题

5. 浏览器端的数据映射机制

6. 浏览器端请求 / 接收适配器

7. API 代理
7.1 统一 API 代理方案


7.2 后端数据映射及后端请求 / 接收适配器


- AMIS 作为一个开源项目,在许多时候可能会被作为独立依赖引入到项目中,在没有 API 代理机制的情况下前端方案可以解决一部分问题。
- 如果在配置项中指定请求为 raw: 则网络请求不会经过 API 代理发送,这时如果需要对数据进行格式化,则需要借助前端方案。
8. 小结
边栏推荐
- 开发中对集合里面的数据根据属性进行合并数量时犯的错误
- Blackfly s usb3 industrial camera: buffer processing
- ROS學習(23)action通信機制
- Introduction to microservice architecture
- 【唯一】的“万字配图“ | 讲透【链式存储结构】是什么?
- How can reinforcement learning be used in medical imaging? A review of Emory University's latest "reinforcement learning medical image analysis", which expounds the latest RL medical image analysis co
- ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
- 组合导航:中海达iNAV2产品描述及接口描述
- 3D激光SLAM:Livox激光雷达硬件时间同步
- Redis tool class redisutil (tool class III)
猜你喜欢

【唯一】的“万字配图“ | 讲透【链式存储结构】是什么?

Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 1)

ROS learning (26) dynamic parameter configuration

FLIR blackfly s industrial camera: synchronous shooting of multiple cameras through external trigger

Cisp-pte practice explanation (II)

BigDecimal 的正确使用方式

@Before, @after, @around, @afterreturning execution sequence

企业中台建设新路径——低代码平台

张平安:加快云上数字创新,共建产业智慧生态

How can I code for 8 hours without getting tired.
随机推荐
ROS学习(21)机器人SLAM功能包——orbslam的安装与测试
MySQL's most basic select statement
How did partydao turn a tweet into a $200million product Dao in one year
Integrated navigation: product description and interface description of zhonghaida inav2
JS Es5 can also create constants?
FLIR blackfly s industrial camera: explanation and configuration of color correction and code setting method
String or binary data will be truncated
C language [23] classic interview questions [Part 2]
@Before, @after, @around, @afterreturning execution sequence
Date processing tool class dateutils (tool class 1)
sql中批量删除数据---实体中的集合
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
Cisp-pte practice explanation (II)
ROS learning (22) TF transformation
Jacob Steinhardt, assistant professor of UC Berkeley, predicts AI benchmark performance: AI has made faster progress in fields such as mathematics than expected, but the progress of robustness benchma
Basic introduction and use of dvajs
Redis tool class redisutil (tool class III)
蓝桥杯2022年第十三届省赛真题-积木画
ROS学习(26)动态参数配置