mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-16 10:44:30 +01:00
new api integrated
This commit is contained in:
@@ -12,7 +12,8 @@ var Sui = {
|
||||
let update = function(endpoint, method, props) {
|
||||
Sui.http.ajax({
|
||||
method: method,
|
||||
endpoint: node.api[endpoint] + (props ? props.join('/') : ''),
|
||||
endpoint: node.api[endpoint],
|
||||
data: props,
|
||||
cache: false
|
||||
}, actuator.onResponse || null);
|
||||
};
|
||||
@@ -20,7 +21,7 @@ var Sui = {
|
||||
let handle = function(event) {
|
||||
update.call(this,
|
||||
actuator.api,
|
||||
'GET',
|
||||
actuator.method,
|
||||
actuator.data ?
|
||||
actuator.data.call(this) : [this.value]
|
||||
);
|
||||
@@ -60,7 +61,7 @@ var Sui = {
|
||||
if(!cache) {
|
||||
data['_'] = new Date().getTime();
|
||||
}
|
||||
var serializedData = Sui.util.serialize(data);
|
||||
var serializedData = data; //Sui.util.serialize(data);
|
||||
var endPointUrl = (config.method === 'GET' || config.method === 'DELETE') && data ? config.endpoint+'?'+serializedData : config.endpoint;
|
||||
var postData = config.method === 'POST' || config.method === 'PUT' ? serializedData : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user