This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
SXS20240115/SRC/iMES_PAD/module/system/service/MMWServiceOffline.js

23 lines
839 B
JavaScript
Raw Permalink Normal View History

2024-01-24 16:47:50 +08:00
define(["app"], function (app) {
app.config(function($provide, config){
$provide.decorator('MMWService', function ($delegate, $rootScope, $filter, $timeout) {
$delegate.Modules = {};
$delegate.Methods = {};
var sendToWMMServer = $delegate.sendToWMMServer;
$delegate.sendToWMMServer = function(sendData, showLoading){
console.log(sendData.content);
var data = {Result: JSON.stringify({Result:'success'})};
if($delegate.Methods[sendData.uri]){
data.Result = JSON.stringify($delegate.Methods[sendData.uri](sendData.content));
$timeout(function(){
sendData.success(data);
});
} else {
sendToWMMServer(sendData, showLoading);
}
}
return $delegate;
});
});
});