Commit 21da8e70 by 朱建香

1120

parent 49697cd8
...@@ -345,12 +345,14 @@ function unbindButtonTap(self){ ...@@ -345,12 +345,14 @@ function unbindButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'), uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}}, {text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () { {text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true); alert(self.extras.account);
// iot.business.sds.unbindDevice({ // iot.business.sds.unbindByManager({
// data: { // data: {
// uuid: self.extras.uuid // uuid: self.extras.uuid,
// destAuid: self.extras.account
// }, // },
// success: (response) => { // success: (response) => {
//// alert(JSON.stringify(response));
iot.business.api.sendCustom('lock/unbindUser',{ iot.business.api.sendCustom('lock/unbindUser',{
data: { data: {
user_id: self.getInfo().user_id, user_id: self.getInfo().user_id,
...@@ -359,6 +361,7 @@ function unbindButtonTap(self){ ...@@ -359,6 +361,7 @@ function unbindButtonTap(self){
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
// alert(JSON.stringify(response));
self.setStateShowFlag(true); self.setStateShowFlag(true);
getUserInfo(self); getUserInfo(self);
}, },
...@@ -382,16 +385,19 @@ function unbindButtonTap(self){ ...@@ -382,16 +385,19 @@ function unbindButtonTap(self){
// }, // },
// error: (error) => { // error: (error) => {
// console.log(error); // console.log(error);
// // if(window.iotDebug){ // alert(error);
// // iotDebug.push('end: sds解绑设备失败'+JSON.stringify(error)); //// if(window.iotDebug){
// // } //// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
// // if (window.iotDebug) { //// }
// // iotDebug.upload(iot,'sds解绑设备失败'); //// if (window.iotDebug) {
// // } //// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self); // uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// }, // },
// complete: () => { // complete: () => {
// uComponents.hideLoading(self);
// } // }
// }); // });
}} }}
......
...@@ -246,6 +246,7 @@ function onTapUserList(self, listIndex) { ...@@ -246,6 +246,7 @@ function onTapUserList(self, listIndex) {
extras: { extras: {
id: self.getUserListData()[listIndex].id, id: self.getUserListData()[listIndex].id,
uuid: self.extras.uuid, uuid: self.extras.uuid,
account: self.getUserListData()[listIndex].account,
lockId: self.extras.lockId, lockId: self.extras.lockId,
role: self.extras.role role: self.extras.role
} }
......
...@@ -20,6 +20,13 @@ function init() { ...@@ -20,6 +20,13 @@ function init() {
clientId: null clientId: null
}, },
mounted(){ mounted(){
if (plus.os.name == 'Android') {
iot.permission.checkPermission(['READ_EXTERNAL_STORAGE', 'CAMERA','ACCESS_FINE_LOCATION'], function (res) {
console.log('success', res);
}, function (err) {
console.log('error', err);
});
}
var clientInfo = plus.push.getClientInfo(); var clientInfo = plus.push.getClientInfo();
this.setClientId(clientInfo.clientid); this.setClientId(clientInfo.clientid);
loginButtonTap(this); loginButtonTap(this);
......
...@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = ""; /******/ __webpack_require__.p = "";
/******/ /******/
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 69); /******/ return __webpack_require__(__webpack_require__.s = 73);
/******/ }) /******/ })
/************************************************************************/ /************************************************************************/
/******/ ([ /******/ ([
...@@ -216,7 +216,7 @@ function flush() { ...@@ -216,7 +216,7 @@ function flush() {
function attemptVertx() { function attemptVertx() {
try { try {
var r = require; var r = require;
var vertx = __webpack_require__(5); var vertx = __webpack_require__(7);
vertxNext = vertx.runOnLoop || vertx.runOnContext; vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer(); return useVertxTimer();
} catch (e) { } catch (e) {
...@@ -1239,37 +1239,10 @@ return Promise; ...@@ -1239,37 +1239,10 @@ return Promise;
}))); })));
//# sourceMappingURL=es6-promise.map //# sourceMappingURL=es6-promise.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(0), __webpack_require__(1))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0), __webpack_require__(2)))
/***/ }), /***/ }),
/* 1 */ /* 1 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -1283,7 +1256,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -1283,7 +1256,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var CheckParams = __webpack_require__(7); var CheckParams = __webpack_require__(5);
var Ready = function (_CheckParams) { var Ready = function (_CheckParams) {
_inherits(Ready, _CheckParams); _inherits(Ready, _CheckParams);
...@@ -1319,7 +1292,74 @@ var Ready = function (_CheckParams) { ...@@ -1319,7 +1292,74 @@ var Ready = function (_CheckParams) {
module.exports = Ready; module.exports = Ready;
/***/ }), /***/ }),
/* 2 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 3 */ /* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Plugin = function () {
function Plugin() {
_classCallCheck(this, Plugin);
this.readyFn = [];
}
_createClass(Plugin, [{
key: "needReady",
value: function needReady() {
return null;
}
}, {
key: "ready",
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: "getReadyFn",
value: function getReadyFn() {
return this.readyFn;
}
}]);
return Plugin;
}();
module.exports = Plugin;
/***/ }),
/* 4 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
// shim for using process in browser // shim for using process in browser
...@@ -1509,94 +1549,7 @@ process.umask = function() { return 0; }; ...@@ -1509,94 +1549,7 @@ process.umask = function() { return 0; };
/***/ }), /***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Plugin = function () {
function Plugin() {
_classCallCheck(this, Plugin);
this.readyFn = [];
}
_createClass(Plugin, [{
key: "needReady",
value: function needReady() {
return null;
}
}, {
key: "ready",
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: "getReadyFn",
value: function getReadyFn() {
return this.readyFn;
}
}]);
return Plugin;
}();
module.exports = Plugin;
/***/ }),
/* 5 */ /* 5 */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var EventEmitter = __webpack_require__(13).EventEmitter;
var BaseEvent = function (_EventEmitter) {
_inherits(BaseEvent, _EventEmitter);
function BaseEvent() {
_classCallCheck(this, BaseEvent);
return _possibleConstructorReturn(this, (BaseEvent.__proto__ || Object.getPrototypeOf(BaseEvent)).apply(this, arguments));
}
_createClass(BaseEvent, [{
key: 'getEventName',
value: function getEventName() {
return this.constructor.name.toUpperCase();
}
}, {
key: 'onEvent',
value: function onEvent() {}
}]);
return BaseEvent;
}(EventEmitter);
module.exports = BaseEvent;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -1644,7 +1597,7 @@ CheckParams.checkKeyExists = function (map) { ...@@ -1644,7 +1597,7 @@ CheckParams.checkKeyExists = function (map) {
module.exports = CheckParams; module.exports = CheckParams;
/***/ }), /***/ }),
/* 8 */ /* 6 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -1654,8 +1607,8 @@ var _createClass = function () { function defineProperties(target, props) { for ...@@ -1654,8 +1607,8 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = __webpack_require__(17); var PromiseSequence = __webpack_require__(13);
var CheckParams = __webpack_require__(7); var CheckParams = __webpack_require__(5);
/** /**
* @class * @class
...@@ -1806,185 +1759,64 @@ var Utils = function () { ...@@ -1806,185 +1759,64 @@ var Utils = function () {
module.exports = Utils; module.exports = Utils;
/***/ }), /***/ }),
/* 9 */ /* 7 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports) {
"use strict"; /* (ignored) */
/* WEBPACK VAR INJECTION */(function(Promise) {
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/** var __WEBPACK_AMD_DEFINE_RESULT__;/*
* Created by Ugen on 16/12/12. * JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/ */
__webpack_require__(14);
var IOTEvents = __webpack_require__(12);
var NetWork = function NetWork() { /* global define */
_classCallCheck(this, NetWork);
};
/** ;(function ($) {
* url 请求url 'use strict'
* params:
* /*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/ */
function safeAdd (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF)
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bitRotateLeft (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
NetWork.send = function (url, params) { /*
var opts = { * These functions implement the four basic operations the algorithm uses.
method: 'POST' */
}; function md5cmn (q, a, b, x, s, t) {
if (params.data) { return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
opts.body = params.data;
} }
if (params.type) { function md5ff (a, b, c, d, x, s, t) {
opts.method = params.type; return md5cmn((b & c) | ((~b) & d), a, b, x, s, t)
}
if (params.headers) {
opts.headers = params.headers;
if (opts.headers.Accept == 'application/json') {
opts.body = JSON.stringify(opts.body);
}
}
if (params.timeout) {
opts.timeout = params.timeout;
}
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).beforeSend();
var fetchPromise = _uFetch(url, opts).then(function (res) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.dataType == 'text') return res.text();
return res.json();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
throw err;
});
if (params.success) {
fetchPromise.then(function (res) {
params.success(res);
if (params.complete) params.complete();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.error) params.error(err);
if (params.complete) params.complete();
});
} else {
return fetchPromise;
}
};
//超时
var _uFetch = function _uFetch(url, params) {
var abort_fn = null;
var abortPromise = new Promise(function (resolve, reject) {
abort_fn = function abort_fn() {
reject({ code: 'timeout' });
};
});
var fetchPromise = new Promise(function (resolve, reject) {
fetch(url, params).then(checkStatus).then(function (res) {
resolve(res);
}).catch(function (err) {
reject(err);
});
});
var abortable_promise = Promise.race([fetchPromise, abortPromise]);
setTimeout(function () {
abort_fn();
}, (params.timeout || 30) * 1000);
return abortable_promise;
};
//检查请求返回的状态
var checkStatus = function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
}
};
module.exports = NetWork;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
logConfig: {
type: ['uploadOperationLog', 'uploadSystemLog', 'uploadDebugLog']
},
keys: {
"uToken": "utoken",
"USER_INFO": "userinfo",
"signPerfix": "ugen_iot",
"groupCache": "IOT_GROUP_CACHE"
},
thirdParty: {
appId: 'wxcc1ee78ae256be1f'
}
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*
* JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/* global define */
;(function ($) {
'use strict'
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF)
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bitRotateLeft (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5cmn (q, a, b, x, s, t) {
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
}
function md5ff (a, b, c, d, x, s, t) {
return md5cmn((b & c) | ((~b) & d), a, b, x, s, t)
} }
function md5gg (a, b, c, d, x, s, t) { function md5gg (a, b, c, d, x, s, t) {
return md5cmn((b & d) | (c & (~d)), a, b, x, s, t) return md5cmn((b & d) | (c & (~d)), a, b, x, s, t)
...@@ -2221,7 +2053,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* ...@@ -2221,7 +2053,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*
/***/ }), /***/ }),
/* 12 */ /* 9 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -2231,104 +2063,435 @@ var _createClass = function () { function defineProperties(target, props) { for ...@@ -2231,104 +2063,435 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var BaseEvent = __webpack_require__(6); function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var EventNetWork = __webpack_require__(16);
var EventManager = function () { function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function EventManager() {
_classCallCheck(this, EventManager);
this.type = {}; var EventEmitter = __webpack_require__(15).EventEmitter;
this.events = {};
}
_createClass(EventManager, [{ var BaseEvent = function (_EventEmitter) {
key: 'on', _inherits(BaseEvent, _EventEmitter);
value: function on(event, fn) {
if (event in this.type) { function BaseEvent() {
this.events[event].onEvent(fn); _classCallCheck(this, BaseEvent);
}
} return _possibleConstructorReturn(this, (BaseEvent.__proto__ || Object.getPrototypeOf(BaseEvent)).apply(this, arguments));
}, {
key: 'getSendMsgObj',
value: function getSendMsgObj(event) {
if (event in this.type) {
return this.events[event];
} }
return null;
_createClass(BaseEvent, [{
key: 'getEventName',
value: function getEventName() {
return this.constructor.name.toUpperCase();
} }
}, { }, {
key: 'loadEvent', key: 'onEvent',
value: function loadEvent(eventObj) { value: function onEvent() {}
if (eventObj instanceof BaseEvent) {
var eventName = eventObj.getEventName();
this.type[eventName] = eventName;
this.events[eventName] = eventObj;
} else {
throw Error(eventObj.constructor.name + ' is not extend Class BaseEvent');
}
}
}]); }]);
return EventManager; return BaseEvent;
}(); }(EventEmitter);
var event = new EventManager();
event.loadEvent(EventNetWork);
module.exports = event; module.exports = BaseEvent;
/***/ }), /***/ }),
/* 13 */ /* 10 */
/***/ (function(module, exports) { /***/ (function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors. "use strict";
// /* WEBPACK VAR INJECTION */(function(Promise) {
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
// Backwards-compat with node 0.10.x /**
EventEmitter.EventEmitter = EventEmitter; * Created by Ugen on 16/12/12.
*/
__webpack_require__(16);
var IOTEvents = __webpack_require__(14);
EventEmitter.prototype._events = undefined; var NetWork = function NetWork() {
EventEmitter.prototype._maxListeners = undefined; _classCallCheck(this, NetWork);
};
// By default EventEmitters will print a warning if more than 10 listeners are /**
// added to it. This is a useful default which helps finding memory leaks. * url 请求url
EventEmitter.defaultMaxListeners = 10; * params:
*
*/
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
};
EventEmitter.prototype.emit = function(type) { NetWork.send = function (url, params) {
var opts = {
method: 'POST'
};
if (params.data) {
opts.body = params.data;
}
if (params.type) {
opts.method = params.type;
}
if (params.headers) {
opts.headers = params.headers;
if (opts.headers.Accept == 'application/json') {
opts.body = JSON.stringify(opts.body);
}
}
if (params.timeout) {
opts.timeout = params.timeout;
}
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).beforeSend();
var fetchPromise = _uFetch(url, opts).then(function (res) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.dataType == 'text') return res.text();
return res.json();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
throw err;
});
if (params.success) {
fetchPromise.then(function (res) {
params.success(res);
if (params.complete) params.complete();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.error) params.error(err);
if (params.complete) params.complete();
});
} else {
return fetchPromise;
}
};
//超时
var _uFetch = function _uFetch(url, params) {
var abort_fn = null;
var abortPromise = new Promise(function (resolve, reject) {
abort_fn = function abort_fn() {
reject({ code: 'timeout' });
};
});
var fetchPromise = new Promise(function (resolve, reject) {
fetch(url, params).then(checkStatus).then(function (res) {
resolve(res);
}).catch(function (err) {
reject(err);
});
});
var abortable_promise = Promise.race([fetchPromise, abortPromise]);
setTimeout(function () {
abort_fn();
}, (params.timeout || 30) * 1000);
return abortable_promise;
};
//检查请求返回的状态
var checkStatus = function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
}
};
module.exports = NetWork;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
logConfig: {
type: ['uploadOperationLog', 'uploadSystemLog', 'uploadDebugLog']
},
keys: {
"uToken": "utoken",
"USER_INFO": "userinfo",
"signPerfix": "ugen_iot",
"groupCache": "IOT_GROUP_CACHE"
},
thirdParty: {
appId: 'wxcc1ee78ae256be1f'
}
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Ready = __webpack_require__(1);
var Plugin = __webpack_require__(3);
var md5 = __webpack_require__(8);
var IOTBase = function () {
function IOTBase() {
_classCallCheck(this, IOTBase);
this.readyFn = [];
this.readyList = [];
this.pluginList = [];
this.timeout = setTimeout(function () {
//window.location.reload();
}, 4000);
}
_createClass(IOTBase, [{
key: 'loadReady',
value: function loadReady(items) {
// console.log('loadReady 2', items);
if (items instanceof Array) {
for (var i in items) {
this.doLoad(items[i]);
}
} else {
this.doLoad(items);
}
}
}, {
key: 'loadPlugin',
value: function loadPlugin(plugin) {
// console.log('loadPlugin 1', plugin);
if (plugin instanceof Plugin) {
this.pluginList.push(plugin);
// console.log('loadPlugin 1', plugin.needReady());
this.loadReady(plugin.needReady());
} else if (plugin instanceof Ready) {
this.loadReady(plugin);
} else {
console.error(plugin.constructor.name + ' is not extend Class Plugin');
}
}
}, {
key: 'doLoad',
value: function doLoad(obj) {
var _this = this;
// console.log('doLoad 3', obj);
if (obj instanceof Ready) {
var key = obj.register(md5(Date.now() + Math.random()).slice(-8));
// console.log('doLoad 3', key);
var map = {
key: key,
isReady: false
};
this.readyList.push(map);
window.addEventListener(key, function () {
var readyObj = obj.onReady();
// console.log('doLoad 3', readyObj);
if (readyObj != null) {
obj.obj = readyObj;
// console.log('doLoad 3', obj.obj);
}
_this.updateAndCheck(key);
}, false);
} else {
console.error(obj.constructor.name + ' is not extend Class Ready');
}
}
}, {
key: 'updateAndCheck',
value: function updateAndCheck(key) {
var isReady = true;
for (var i in this.readyList) {
var item = this.readyList[i];
if (item.key == key) {
item.isReady = true;
}
isReady = isReady && item.isReady;
}
if (isReady) {
clearTimeout(this.timeout);
for (var _i in this.pluginList) {
this.addReadyArray(this.pluginList[_i].getReadyFn());
}
for (var _i2 = 0; _i2 < this.readyFn.length; _i2++) {
this.readyFn[_i2]();
}
}
}
}, {
key: 'ready',
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: 'addReadyArray',
value: function addReadyArray(list) {
this.readyFn = this.readyFn.concat(list);
}
}]);
return IOTBase;
}();
module.exports = IOTBase;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = function () {
function PromiseSequence() {
_classCallCheck(this, PromiseSequence);
}
_createClass(PromiseSequence, null, [{
key: "sequence",
value: function sequence() {
var p = Promise.resolve();
for (var _len = arguments.length, list = Array(_len), _key = 0; _key < _len; _key++) {
list[_key] = arguments[_key];
}
for (var i in list[0]) {
p = PromiseSequence._do(p, list[0][i]);
}
return p;
}
}, {
key: "_do",
value: function _do(p, fn) {
return p.then(fn).catch(function (err) {
throw err;
});
}
}]);
return PromiseSequence;
}();
module.exports = PromiseSequence;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var BaseEvent = __webpack_require__(9);
var EventNetWork = __webpack_require__(17);
var EventManager = function () {
function EventManager() {
_classCallCheck(this, EventManager);
this.type = {};
this.events = {};
}
_createClass(EventManager, [{
key: 'on',
value: function on(event, fn) {
if (event in this.type) {
this.events[event].onEvent(fn);
}
}
}, {
key: 'getSendMsgObj',
value: function getSendMsgObj(event) {
if (event in this.type) {
return this.events[event];
}
return null;
}
}, {
key: 'loadEvent',
value: function loadEvent(eventObj) {
if (eventObj instanceof BaseEvent) {
var eventName = eventObj.getEventName();
this.type[eventName] = eventName;
this.events[eventName] = eventObj;
} else {
throw Error(eventObj.constructor.name + ' is not extend Class BaseEvent');
}
}
}]);
return EventManager;
}();
var event = new EventManager();
event.loadEvent(EventNetWork);
module.exports = event;
/***/ }),
/* 15 */
/***/ (function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() {
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10;
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
};
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners; var er, handler, len, args, i, listeners;
if (!this._events) if (!this._events)
...@@ -2587,7 +2750,7 @@ function isUndefined(arg) { ...@@ -2587,7 +2750,7 @@ function isUndefined(arg) {
/***/ }), /***/ }),
/* 14 */ /* 16 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Promise) {(function(self) { /* WEBPACK VAR INJECTION */(function(Promise) {(function(self) {
...@@ -3003,178 +3166,59 @@ function isUndefined(arg) { ...@@ -3003,178 +3166,59 @@ function isUndefined(arg) {
return new Response(null, {status: status, headers: {location: url}}) return new Response(null, {status: status, headers: {location: url}})
} }
self.Headers = Headers self.Headers = Headers
self.Request = Request self.Request = Request
self.Response = Response self.Response = Response
self.fetch = function(input, init) { self.fetch = function(input, init) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
var request = new Request(input, init) var request = new Request(input, init)
var xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.onload = function() { xhr.onload = function() {
var options = { var options = {
status: xhr.status, status: xhr.status,
statusText: xhr.statusText, statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '') headers: parseHeaders(xhr.getAllResponseHeaders() || '')
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Ready = __webpack_require__(2);
var Plugin = __webpack_require__(4);
var md5 = __webpack_require__(11);
var IOTBase = function () {
function IOTBase() {
_classCallCheck(this, IOTBase);
this.readyFn = [];
this.readyList = [];
this.pluginList = [];
this.timeout = setTimeout(function () {
//window.location.reload();
}, 4000);
}
_createClass(IOTBase, [{
key: 'loadReady',
value: function loadReady(items) {
// console.log('loadReady 2', items);
if (items instanceof Array) {
for (var i in items) {
this.doLoad(items[i]);
}
} else {
this.doLoad(items);
}
}
}, {
key: 'loadPlugin',
value: function loadPlugin(plugin) {
// console.log('loadPlugin 1', plugin);
if (plugin instanceof Plugin) {
this.pluginList.push(plugin);
// console.log('loadPlugin 1', plugin.needReady());
this.loadReady(plugin.needReady());
} else if (plugin instanceof Ready) {
this.loadReady(plugin);
} else {
console.error(plugin.constructor.name + ' is not extend Class Plugin');
}
}
}, {
key: 'doLoad',
value: function doLoad(obj) {
var _this = this;
// console.log(obj);
// console.log('doLoad 3', obj);
if (obj instanceof Ready) {
var key = obj.register(md5(Date.now() + Math.random()).slice(-8));
// console.log('doLoad 3', key);
var map = {
key: key,
isReady: false
};
this.readyList.push(map);
window.addEventListener(key, function () {
var readyObj = obj.onReady();
// console.log('doLoad 3', readyObj);
if (readyObj != null) {
obj.obj = readyObj;
// console.log('doLoad 3', obj.obj);
}
_this.updateAndCheck(key);
}, false);
} else {
console.error(obj.constructor.name + ' is not extend Class Ready');
}
}
}, {
key: 'updateAndCheck',
value: function updateAndCheck(key) {
var isReady = true;
for (var i in this.readyList) {
var item = this.readyList[i];
if (item.key == key) {
item.isReady = true;
}
isReady = isReady && item.isReady;
}
if (isReady) {
clearTimeout(this.timeout);
for (var _i in this.pluginList) {
this.addReadyArray(this.pluginList[_i].getReadyFn());
}
for (var _i2 = 0; _i2 < this.readyFn.length; _i2++) {
this.readyFn[_i2]();
} }
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
} }
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
} }
}, {
key: 'ready', xhr.ontimeout = function() {
value: function ready(fn) { reject(new TypeError('Network request failed'))
this.readyFn.push(fn);
} }
}, {
key: 'addReadyArray', xhr.open(request.method, request.url, true)
value: function addReadyArray(list) {
this.readyFn = this.readyFn.concat(list); if (request.credentials === 'include') {
xhr.withCredentials = true
} }
}]);
return IOTBase; if ('responseType' in xhr && support.blob) {
}(); xhr.responseType = 'blob'
}
module.exports = IOTBase; request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }), /***/ }),
/* 16 */ /* 17 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3188,7 +3232,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -3188,7 +3232,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var BaseEvent = __webpack_require__(6); var BaseEvent = __webpack_require__(9);
var NetWork = function (_BaseEvent) { var NetWork = function (_BaseEvent) {
_inherits(NetWork, _BaseEvent); _inherits(NetWork, _BaseEvent);
...@@ -3227,59 +3271,251 @@ var NetWork = function (_BaseEvent) { ...@@ -3227,59 +3271,251 @@ var NetWork = function (_BaseEvent) {
module.exports = new NetWork(); module.exports = new NetWork();
/***/ }), /***/ }),
/* 17 */ /* 18 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(44);
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = function () { /**
function PromiseSequence() { * Log.js
_classCallCheck(this, PromiseSequence); * Version: 0.1
} * User: shz
* Date: 2017-07-21
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Log
*/
var config = __webpack_require__(11);
var NetWork = __webpack_require__(10);
_createClass(PromiseSequence, null, [{ // const Utils = require('../../utils/Utils');
key: "sequence",
value: function sequence() {
var p = Promise.resolve();
for (var _len = arguments.length, list = Array(_len), _key = 0; _key < _len; _key++) { var Log = function () {
list[_key] = arguments[_key]; function Log(params) {
_classCallCheck(this, Log);
var log = params.plugin.log;
this.checkKeyExists(params, 'appId');
this.checkKeyExists(log, 'url');
this.appId = params.appId;
this.baseUrl = log.url;
} }
for (var i in list[0]) { _createClass(Log, [{
p = PromiseSequence._do(p, list[0][i]); key: 'upload',
value: function upload(params) {
var data = params.data;
data.cloud_app_id = this.appId;
// 系统log 调试log 运行环境信息 日志上报类型(1:Android 2:iOS 3:Javascript)
if (data.environment && data.code_type) {
this.checkKeyExists(params.data, 'log_type', 'code_type', 'environment', 'title', 'log_data');
params.interface = config.logConfig.type[data.log_type];
// 业务log 自定义动作
} else if (data.action) {
this.checkKeyExists(params.data, 'log_type', 'action', 'log_data');
params.interface = config.logConfig.type[0];
} }
return p; console.log(params);
this.send(params);
} }
}, { }, {
key: "_do", key: 'send',
value: function _do(p, fn) { value: function send(opts) {
return p.then(fn).catch(function (err) { var params = {};
throw err; var headers = {
}); 'Accept': 'application/json',
'Content-Type': 'application/json; charset=UTF-8'
};
params.headers = headers;
params.success = function (ret) {
if (ret.code && ret.code != 0) {
opts.error(ret);
} else {
opts.success(ret);
}
};
params.interface = opts.interface;
params.data = opts.data;
params.timeout = opts.timeout;
params.error = opts.error;
params.complete = opts.complete;
NetWork.send(this.baseUrl + '/' + params.interface, params);
}
}, {
key: 'checkKeyExists',
value: function checkKeyExists(map) {
for (var _len = arguments.length, keys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
keys[_key - 1] = arguments[_key];
}
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (!(key in map)) {
throw new Error(key + ' is undefined');
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
} }
}]); }]);
return PromiseSequence; return Log;
}(); }();
module.exports = PromiseSequence; module.exports = Log;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* index.js
* Version: 0.1
* User: shz
* Date: 2017-11-15
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* index
*/
var Ready = __webpack_require__(1);
var PermissionBridge = function (_Ready) {
_inherits(PermissionBridge, _Ready);
function PermissionBridge() {
_classCallCheck(this, PermissionBridge);
var _this = _possibleConstructorReturn(this, (PermissionBridge.__proto__ || Object.getPrototypeOf(PermissionBridge)).call(this));
document.addEventListener("plusready", function () {
_this.onPlusready();
_this.dispatch();
}, false);
return _this;
}
_createClass(PermissionBridge, [{
key: 'onPlusready',
value: function onPlusready() {
var _PERMISSIONCODE = 'UgenPermission',
B = window.plus.bridge,
callbackID = void 0;
var UgenPermission = {
//开始扫描ble设备
checkPermission: function checkPermission(permission, successCallback, errorCallback) {
// alert('api js function scan init');
var success = typeof successCallback !== 'function' ? null : function (args) {
successCallback(args);
},
fail = typeof errorCallback !== 'function' ? null : function (code) {
errorCallback(code);
};
callbackID = B.callbackId(success, fail);
return B.exec(_PERMISSIONCODE, "checkPermission", [callbackID, permission]);
}
};
this.UgenPermission = UgenPermission;
}
}, {
key: 'onReady',
value: function onReady() {
return this.UgenPermission;
}
}]);
return PermissionBridge;
}(Ready);
module.exports = PermissionBridge;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(3);
var Permission = __webpack_require__(22);
var Utils = __webpack_require__(6);
var Main = function (_Plugin) {
_inherits(Main, _Plugin);
function Main() {
_classCallCheck(this, Main);
var _this = _possibleConstructorReturn(this, (Main.__proto__ || Object.getPrototypeOf(Main)).call(this));
_this.permission = new Permission();
return _this;
}
/***/ }), _createClass(Main, [{
/* 18 */ key: 'needReady',
/***/ (function(module, exports, __webpack_require__) { value: function needReady() {
if (Utils.getBrowserInfo().mobile != null) {
return [this.permission.bridge];
} else {
return [];
}
}
}]);
module.exports = __webpack_require__(40); return Main;
}(Plugin);
module.exports = Main;
/***/ }), /***/ }),
/* 19 */ /* 22 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3290,112 +3526,62 @@ var _createClass = function () { function defineProperties(target, props) { for ...@@ -3290,112 +3526,62 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/** /**
* Log.js * method.js
* Version: 0.1 * Version: 0.1
* User: shz * User: shz
* Date: 2017-07-21 * Date: 2017-09-14
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Log * permission 调用bridge方法
*/ */
var config = __webpack_require__(10); var Bridge = __webpack_require__(20);
var NetWork = __webpack_require__(9); var READ_FILE = "READ_EXTERNAL_STORAGE";
var SMS = "SEND_SMS";
// const Utils = require('../../utils/Utils'); var SENSORS = "SENSORS";
var PHONE = "PHONE";
var CALENDAR = "READ_CALENDAR";
var CONTACTS = "READ_CONTACTS";
var CAMERA = "CAMERA";
var LOCATION = "ACCESS_FINE_LOCATION";
var Log = function () { /**
function Log(params) { * @class
_classCallCheck(this, Log); * Permission
*/
var log = params.plugin.log; var PermissionMethod = function () {
this.checkKeyExists(params, 'appId'); function PermissionMethod() {
this.checkKeyExists(log, 'url'); _classCallCheck(this, PermissionMethod);
this.appId = params.appId;
this.baseUrl = log.url;
}
_createClass(Log, [{ this.map = [];
key: 'upload', this.bridge = new Bridge();
value: function upload(params) {
var data = params.data;
data.cloud_app_id = this.appId;
// 系统log 调试log 运行环境信息 日志上报类型(1:Android 2:iOS 3:Javascript)
if (data.environment && data.code_type) {
this.checkKeyExists(params.data, 'log_type', 'code_type', 'environment', 'title', 'log_data');
params.interface = config.logConfig.type[data.log_type];
// 业务log 自定义动作
} else if (data.action) {
this.checkKeyExists(params.data, 'log_type', 'action', 'log_data');
params.interface = config.logConfig.type[0];
}
console.log(params);
this.send(params);
}
}, {
key: 'send',
value: function send(opts) {
var params = {};
var headers = {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=UTF-8'
};
params.headers = headers;
params.success = function (ret) {
if (ret.code && ret.code != 0) {
opts.error(ret);
} else {
opts.success(ret);
}
};
params.interface = opts.interface;
params.data = opts.data;
params.timeout = opts.timeout;
params.error = opts.error;
params.complete = opts.complete;
NetWork.send(this.baseUrl + '/' + params.interface, params);
}
}, {
key: 'checkKeyExists',
value: function checkKeyExists(map) {
for (var _len = arguments.length, keys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
keys[_key - 1] = arguments[_key];
} }
var _iteratorNormalCompletion = true; /**
var _didIteratorError = false; * 申请Android权限
var _iteratorError = undefined; * @param permission 由需要申请的权限组成的数组
* @param success
* @param error
*/
try {
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (!(key in map)) { _createClass(PermissionMethod, [{
throw new Error(key + ' is undefined'); key: "checkPermission",
} value: function checkPermission(permission, success, error) {
} this.bridge.obj.checkPermission(permission, function (ret) {
} catch (err) { success(ret);
_didIteratorError = true; }, function (err) {
_iteratorError = err; error(err);
} finally { });
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
} }
}]); }]);
return Log; return PermissionMethod;
}(); }();
module.exports = Log; module.exports = PermissionMethod;
/***/ }), /***/ }),
/* 20 */ /* 23 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3409,9 +3595,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -3409,9 +3595,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(4); var Plugin = __webpack_require__(3);
var Ready = __webpack_require__(2); var Ready = __webpack_require__(1);
var Utils = __webpack_require__(8); var Utils = __webpack_require__(6);
var Main = function (_Plugin) { var Main = function (_Plugin) {
_inherits(Main, _Plugin); _inherits(Main, _Plugin);
...@@ -3530,21 +3716,21 @@ var I18NInit = function (_Ready) { ...@@ -3530,21 +3716,21 @@ var I18NInit = function (_Ready) {
module.exports = Main; module.exports = Main;
/***/ }), /***/ }),
/* 21 */ /* 24 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
if (!__webpack_require__(46)()) { if (!__webpack_require__(50)()) {
Object.defineProperty(__webpack_require__(27), 'Symbol', Object.defineProperty(__webpack_require__(31), 'Symbol',
{ value: __webpack_require__(48), configurable: true, enumerable: false, { value: __webpack_require__(52), configurable: true, enumerable: false,
writable: true }); writable: true });
} }
/***/ }), /***/ }),
/* 22 */ /* 25 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3560,7 +3746,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de ...@@ -3560,7 +3746,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var WebSqlTool = __webpack_require__(52); /*let websql;
try {
const WebSqlTool = require('./webSqlTool');
websql = new WebSqlTool('UIOT', '1.0', 'ugen', 1024 * 1024 * 5);
} catch (error) {
const LocalStorageTool = require('./localStorageTool');
websql = new LocalStorageTool();
}*/
var WebSqlTool = __webpack_require__(56);
var websql = new WebSqlTool('UIOT', '1.0', 'ugen', 1024 * 1024 * 5); var websql = new WebSqlTool('UIOT', '1.0', 'ugen', 1024 * 1024 * 5);
var PublicStore = function () { var PublicStore = function () {
...@@ -3820,7 +4015,7 @@ module.exports = PublicStore; ...@@ -3820,7 +4015,7 @@ module.exports = PublicStore;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }), /***/ }),
/* 23 */ /* 26 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3830,7 +4025,7 @@ var _createClass = function () { function defineProperties(target, props) { for ...@@ -3830,7 +4025,7 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var qs = __webpack_require__(44); var qs = __webpack_require__(48);
var Base = function () { var Base = function () {
function Base() { function Base() {
...@@ -3862,6 +4057,21 @@ var Base = function () { ...@@ -3862,6 +4057,21 @@ var Base = function () {
value: function back() { value: function back() {
window.history.back(); window.history.back();
} }
}, {
key: "closeOthers",
value: function closeOthers() {
console.log('iot.navigator.closeOthers');
}
}, {
key: "backToHomePage",
value: function backToHomePage() {
console.log('iot.navigator.backToHomePage');
}
}, {
key: "fire",
value: function fire() {
console.log('iot.navigator.fire');
}
}]); }]);
return Base; return Base;
...@@ -3870,7 +4080,7 @@ var Base = function () { ...@@ -3870,7 +4080,7 @@ var Base = function () {
module.exports = Base; module.exports = Base;
/***/ }), /***/ }),
/* 24 */ /* 27 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3882,11 +4092,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -3882,11 +4092,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
__webpack_require__(21); __webpack_require__(24);
var IOTMain = __webpack_require__(50); var IOTMain = __webpack_require__(54);
var Business = __webpack_require__(61); var Business = __webpack_require__(65);
var vueI18N = __webpack_require__(20); var Permission = __webpack_require__(21);
var Navigator = __webpack_require__(56); var vueI18N = __webpack_require__(23);
var Navigator = __webpack_require__(60);
var IOT = function (_IOTMain) { var IOT = function (_IOTMain) {
_inherits(IOT, _IOTMain); _inherits(IOT, _IOTMain);
...@@ -3900,6 +4111,10 @@ var IOT = function (_IOTMain) { ...@@ -3900,6 +4111,10 @@ var IOT = function (_IOTMain) {
_this.loadPlugin(businessPlugin); _this.loadPlugin(businessPlugin);
_this.business = businessPlugin.business; _this.business = businessPlugin.business;
var permissionPlugin = new Permission();
_this.loadPlugin(permissionPlugin);
_this.permission = permissionPlugin.permission;
var i18n = new vueI18N(params.lang || ["zh"], params.vue, params.i18n); var i18n = new vueI18N(params.lang || ["zh"], params.vue, params.i18n);
_this.loadPlugin(i18n); _this.loadPlugin(i18n);
...@@ -3914,9 +4129,10 @@ var IOT = function (_IOTMain) { ...@@ -3914,9 +4129,10 @@ var IOT = function (_IOTMain) {
module.exports = IOT; module.exports = IOT;
/***/ }), /***/ }),
/* 25 */, /* 28 */,
/* 26 */, /* 29 */,
/* 27 */ /* 30 */,
/* 31 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3926,19 +4142,19 @@ module.exports = new Function("return this")(); ...@@ -3926,19 +4142,19 @@ module.exports = new Function("return this")();
/***/ }), /***/ }),
/* 28 */ /* 32 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
module.exports = __webpack_require__(29)() module.exports = __webpack_require__(33)()
? Object.assign ? Object.assign
: __webpack_require__(30); : __webpack_require__(34);
/***/ }), /***/ }),
/* 29 */ /* 33 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3954,14 +4170,14 @@ module.exports = function () { ...@@ -3954,14 +4170,14 @@ module.exports = function () {
/***/ }), /***/ }),
/* 30 */ /* 34 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
var keys = __webpack_require__(32) var keys = __webpack_require__(36)
, value = __webpack_require__(36) , value = __webpack_require__(40)
, max = Math.max; , max = Math.max;
...@@ -3983,7 +4199,7 @@ module.exports = function (dest, src/*, …srcn*/) { ...@@ -3983,7 +4199,7 @@ module.exports = function (dest, src/*, …srcn*/) {
/***/ }), /***/ }),
/* 31 */ /* 35 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -3995,19 +4211,19 @@ module.exports = function (obj) { return typeof obj === 'function'; }; ...@@ -3995,19 +4211,19 @@ module.exports = function (obj) { return typeof obj === 'function'; };
/***/ }), /***/ }),
/* 32 */ /* 36 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
module.exports = __webpack_require__(33)() module.exports = __webpack_require__(37)()
? Object.keys ? Object.keys
: __webpack_require__(34); : __webpack_require__(38);
/***/ }), /***/ }),
/* 33 */ /* 37 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4022,7 +4238,7 @@ module.exports = function () { ...@@ -4022,7 +4238,7 @@ module.exports = function () {
/***/ }), /***/ }),
/* 34 */ /* 38 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4036,7 +4252,7 @@ module.exports = function (object) { ...@@ -4036,7 +4252,7 @@ module.exports = function (object) {
/***/ }), /***/ }),
/* 35 */ /* 39 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4060,7 +4276,7 @@ module.exports = function (options/*, …options*/) { ...@@ -4060,7 +4276,7 @@ module.exports = function (options/*, …options*/) {
/***/ }), /***/ }),
/* 36 */ /* 40 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4073,19 +4289,19 @@ module.exports = function (value) { ...@@ -4073,19 +4289,19 @@ module.exports = function (value) {
/***/ }), /***/ }),
/* 37 */ /* 41 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
module.exports = __webpack_require__(38)() module.exports = __webpack_require__(42)()
? String.prototype.contains ? String.prototype.contains
: __webpack_require__(39); : __webpack_require__(43);
/***/ }), /***/ }),
/* 38 */ /* 42 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4100,7 +4316,7 @@ module.exports = function () { ...@@ -4100,7 +4316,7 @@ module.exports = function () {
/***/ }), /***/ }),
/* 39 */ /* 43 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4114,7 +4330,7 @@ module.exports = function (searchString/*, position*/) { ...@@ -4114,7 +4330,7 @@ module.exports = function (searchString/*, position*/) {
/***/ }), /***/ }),
/* 40 */ /* 44 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be /* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be
...@@ -4135,7 +4351,7 @@ var oldRuntime = hadRuntime && g.regeneratorRuntime; ...@@ -4135,7 +4351,7 @@ var oldRuntime = hadRuntime && g.regeneratorRuntime;
// Force reevalutation of runtime.js. // Force reevalutation of runtime.js.
g.regeneratorRuntime = undefined; g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(41); module.exports = __webpack_require__(45);
if (hadRuntime) { if (hadRuntime) {
// Restore the original runtime. // Restore the original runtime.
...@@ -4149,10 +4365,10 @@ if (hadRuntime) { ...@@ -4149,10 +4365,10 @@ if (hadRuntime) {
} }
} }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
/***/ }), /***/ }),
/* 41 */ /* 45 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, Promise) {/** /* WEBPACK VAR INJECTION */(function(global, Promise) {/**
...@@ -4892,10 +5108,10 @@ if (hadRuntime) { ...@@ -4892,10 +5108,10 @@ if (hadRuntime) {
typeof self === "object" ? self : this typeof self === "object" ? self : this
); );
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0)))
/***/ }), /***/ }),
/* 42 */ /* 46 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -4986,7 +5202,7 @@ var isArray = Array.isArray || function (xs) { ...@@ -4986,7 +5202,7 @@ var isArray = Array.isArray || function (xs) {
/***/ }), /***/ }),
/* 43 */ /* 47 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5078,27 +5294,27 @@ var objectKeys = Object.keys || function (obj) { ...@@ -5078,27 +5294,27 @@ var objectKeys = Object.keys || function (obj) {
/***/ }), /***/ }),
/* 44 */ /* 48 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
exports.decode = exports.parse = __webpack_require__(42); exports.decode = exports.parse = __webpack_require__(46);
exports.encode = exports.stringify = __webpack_require__(43); exports.encode = exports.stringify = __webpack_require__(47);
/***/ }), /***/ }),
/* 45 */ /* 49 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
var assign = __webpack_require__(28) var assign = __webpack_require__(32)
, normalizeOpts = __webpack_require__(35) , normalizeOpts = __webpack_require__(39)
, isCallable = __webpack_require__(31) , isCallable = __webpack_require__(35)
, contains = __webpack_require__(37) , contains = __webpack_require__(41)
, d; , d;
...@@ -5159,7 +5375,7 @@ d.gs = function (dscr, get, set/*, options*/) { ...@@ -5159,7 +5375,7 @@ d.gs = function (dscr, get, set/*, options*/) {
/***/ }), /***/ }),
/* 46 */ /* 50 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5183,7 +5399,7 @@ module.exports = function () { ...@@ -5183,7 +5399,7 @@ module.exports = function () {
/***/ }), /***/ }),
/* 47 */ /* 51 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5199,7 +5415,7 @@ module.exports = function (x) { ...@@ -5199,7 +5415,7 @@ module.exports = function (x) {
/***/ }), /***/ }),
/* 48 */ /* 52 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5207,8 +5423,8 @@ module.exports = function (x) { ...@@ -5207,8 +5423,8 @@ module.exports = function (x) {
var d = __webpack_require__(45) var d = __webpack_require__(49)
, validateSymbol = __webpack_require__(49) , validateSymbol = __webpack_require__(53)
, create = Object.create, defineProperties = Object.defineProperties , create = Object.create, defineProperties = Object.defineProperties
, defineProperty = Object.defineProperty, objPrototype = Object.prototype , defineProperty = Object.defineProperty, objPrototype = Object.prototype
...@@ -5324,13 +5540,13 @@ defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, ...@@ -5324,13 +5540,13 @@ defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
/***/ }), /***/ }),
/* 49 */ /* 53 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
var isSymbol = __webpack_require__(47); var isSymbol = __webpack_require__(51);
module.exports = function (value) { module.exports = function (value) {
if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
...@@ -5339,7 +5555,7 @@ module.exports = function (value) { ...@@ -5339,7 +5555,7 @@ module.exports = function (value) {
/***/ }), /***/ }),
/* 50 */ /* 54 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5367,15 +5583,15 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" ...@@ -5367,15 +5583,15 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* IOTSuper * IOTSuper
*/ */
__webpack_require__(21); __webpack_require__(24);
var error = __webpack_require__(51); var error = __webpack_require__(55);
var IOTBase = __webpack_require__(15); var IOTBase = __webpack_require__(12);
var IOTEvents = __webpack_require__(12); var IOTEvents = __webpack_require__(14);
var Log = __webpack_require__(19); var Log = __webpack_require__(19);
var network = __webpack_require__(9); var network = __webpack_require__(10);
var PublicStore = __webpack_require__(22); var PublicStore = __webpack_require__(25);
var Utils = __webpack_require__(8); var Utils = __webpack_require__(6);
var config = __webpack_require__(10); var config = __webpack_require__(11);
var keys = config.keys; var keys = config.keys;
var IOTMain = function (_IOTBase) { var IOTMain = function (_IOTBase) {
...@@ -5496,7 +5712,7 @@ var IOTMain = function (_IOTBase) { ...@@ -5496,7 +5712,7 @@ var IOTMain = function (_IOTBase) {
module.exports = IOTMain; module.exports = IOTMain;
/***/ }), /***/ }),
/* 51 */ /* 55 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5510,7 +5726,7 @@ module.exports = IOTMain; ...@@ -5510,7 +5726,7 @@ module.exports = IOTMain;
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Error * Error
*/ */
var Utils = __webpack_require__(8); var Utils = __webpack_require__(6);
var LOG_URL = 'https://admin.iot.u-gen.net/admin/api/debug/uploadDebugLog'; var LOG_URL = 'https://admin.iot.u-gen.net/admin/api/debug/uploadDebugLog';
window.onerror = function (message, source, lineNo, columnNo, error) { window.onerror = function (message, source, lineNo, columnNo, error) {
console.log('window on error'); console.log('window on error');
...@@ -5540,7 +5756,7 @@ window.onerror = function (message, source, lineNo, columnNo, error) { ...@@ -5540,7 +5756,7 @@ window.onerror = function (message, source, lineNo, columnNo, error) {
}; };
/***/ }), /***/ }),
/* 52 */ /* 56 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5626,10 +5842,10 @@ module.exports = WebSqlTool; ...@@ -5626,10 +5842,10 @@ module.exports = WebSqlTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }), /***/ }),
/* 53 */, /* 57 */,
/* 54 */, /* 58 */,
/* 55 */, /* 59 */,
/* 56 */ /* 60 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5637,9 +5853,9 @@ module.exports = WebSqlTool; ...@@ -5637,9 +5853,9 @@ module.exports = WebSqlTool;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Utils = __webpack_require__(8); var Utils = __webpack_require__(6);
var Web = __webpack_require__(58); var Web = __webpack_require__(62);
var App = __webpack_require__(57); var App = __webpack_require__(61);
var Loader = function Loader(type) { var Loader = function Loader(type) {
_classCallCheck(this, Loader); _classCallCheck(this, Loader);
...@@ -5666,7 +5882,7 @@ Loader.type = { ...@@ -5666,7 +5882,7 @@ Loader.type = {
module.exports = Loader; module.exports = Loader;
/***/ }), /***/ }),
/* 57 */ /* 61 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5682,7 +5898,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -5682,7 +5898,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Base = __webpack_require__(23); var Base = __webpack_require__(26);
var App = function (_Base) { var App = function (_Base) {
_inherits(App, _Base); _inherits(App, _Base);
...@@ -5822,7 +6038,7 @@ var App = function (_Base) { ...@@ -5822,7 +6038,7 @@ var App = function (_Base) {
module.exports = App; module.exports = App;
/***/ }), /***/ }),
/* 58 */ /* 62 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -5834,7 +6050,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -5834,7 +6050,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Base = __webpack_require__(23); var Base = __webpack_require__(26);
var Web = function (_Base) { var Web = function (_Base) {
_inherits(Web, _Base); _inherits(Web, _Base);
...@@ -5851,7 +6067,7 @@ var Web = function (_Base) { ...@@ -5851,7 +6067,7 @@ var Web = function (_Base) {
module.exports = Web; module.exports = Web;
/***/ }), /***/ }),
/* 59 */ /* 63 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6025,7 +6241,7 @@ var Device = function () { ...@@ -6025,7 +6241,7 @@ var Device = function () {
module.exports = Device; module.exports = Device;
/***/ }), /***/ }),
/* 60 */ /* 64 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6043,7 +6259,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons ...@@ -6043,7 +6259,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSPlugin * SDSPlugin
*/ */
var Bridge = __webpack_require__(64); var Bridge = __webpack_require__(68);
var SDS = function () { var SDS = function () {
function SDS() { function SDS() {
...@@ -6410,12 +6626,24 @@ var SDS = function () { ...@@ -6410,12 +6626,24 @@ var SDS = function () {
}); });
} }
}, { }, {
key: 'unbindByManager',
value: function unbindByManager(params) {
var _this25 = this;
this.checkKeyExists(params.data, 'uuid', 'destAuid');
this.bridge.obj.unbindByManager(params.data.uuid, params.data.destAuid, function (ret) {
_this25.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
}
}, {
key: 'getSSId', key: 'getSSId',
value: function getSSId(params) { value: function getSSId(params) {
var _this25 = this; var _this26 = this;
this.bridge.obj.getSSId(function (ret) { this.bridge.obj.getSSId(function (ret) {
_this25.handleSuccess(params, ret); _this26.handleSuccess(params, ret);
}, function (err) { }, function (err) {
params.error(err); params.error(err);
}); });
...@@ -6423,10 +6651,10 @@ var SDS = function () { ...@@ -6423,10 +6651,10 @@ var SDS = function () {
}, { }, {
key: 'findDevices', key: 'findDevices',
value: function findDevices(params) { value: function findDevices(params) {
var _this26 = this; var _this27 = this;
this.bridge.obj.findDevices(function (ret) { this.bridge.obj.findDevices(function (ret) {
_this26.handleSuccess(params, ret); _this27.handleSuccess(params, ret);
}, function (err) { }, function (err) {
params.error(err); params.error(err);
}); });
...@@ -6434,10 +6662,10 @@ var SDS = function () { ...@@ -6434,10 +6662,10 @@ var SDS = function () {
}, { }, {
key: 'stopFindDevices', key: 'stopFindDevices',
value: function stopFindDevices(params) { value: function stopFindDevices(params) {
var _this27 = this; var _this28 = this;
this.bridge.obj.stopFindDevices(function (ret) { this.bridge.obj.stopFindDevices(function (ret) {
_this27.handleSuccess(params, ret); _this28.handleSuccess(params, ret);
}, function (err) { }, function (err) {
params.error(err); params.error(err);
}); });
...@@ -6445,11 +6673,11 @@ var SDS = function () { ...@@ -6445,11 +6673,11 @@ var SDS = function () {
}, { }, {
key: 'findWifi', key: 'findWifi',
value: function findWifi(params) { value: function findWifi(params) {
var _this28 = this; var _this29 = this;
this.checkKeyExists(params.data, 'model', 'ssid', 'wifiPwd', 'timeout'); this.checkKeyExists(params.data, 'model', 'ssid', 'wifiPwd', 'timeout');
this.bridge.obj.startFindWIFI(params.data.model, params.data.ssid, params.data.wifiPwd, params.data.timeout, function (ret) { this.bridge.obj.startFindWIFI(params.data.model, params.data.ssid, params.data.wifiPwd, params.data.timeout, function (ret) {
_this28.handleSuccess(params, ret); _this29.handleSuccess(params, ret);
}, function (err) { }, function (err) {
params.error(err); params.error(err);
}); });
...@@ -6457,10 +6685,10 @@ var SDS = function () { ...@@ -6457,10 +6685,10 @@ var SDS = function () {
}, { }, {
key: 'stopFindWifi', key: 'stopFindWifi',
value: function stopFindWifi(params) { value: function stopFindWifi(params) {
var _this29 = this; var _this30 = this;
this.bridge.obj.stopFindWIFI(function (ret) { this.bridge.obj.stopFindWIFI(function (ret) {
_this29.handleSuccess(params, ret); _this30.handleSuccess(params, ret);
}, function (err) { }, function (err) {
params.error(err); params.error(err);
}); });
...@@ -6473,7 +6701,7 @@ var SDS = function () { ...@@ -6473,7 +6701,7 @@ var SDS = function () {
module.exports = SDS; module.exports = SDS;
/***/ }), /***/ }),
/* 61 */ /* 65 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6487,11 +6715,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -6487,11 +6715,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(4); var Plugin = __webpack_require__(3);
var Bridge = __webpack_require__(67); var Bridge = __webpack_require__(71);
var SDS = __webpack_require__(60); var SDS = __webpack_require__(64);
var User = __webpack_require__(63); var User = __webpack_require__(67);
var Device = __webpack_require__(62); var Device = __webpack_require__(66);
var SDSBusiness = function (_Plugin) { var SDSBusiness = function (_Plugin) {
_inherits(SDSBusiness, _Plugin); _inherits(SDSBusiness, _Plugin);
...@@ -6522,7 +6750,7 @@ var SDSBusiness = function (_Plugin) { ...@@ -6522,7 +6750,7 @@ var SDSBusiness = function (_Plugin) {
module.exports = SDSBusiness; module.exports = SDSBusiness;
/***/ }), /***/ }),
/* 62 */ /* 66 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6546,7 +6774,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" ...@@ -6546,7 +6774,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSUser * SDSUser
*/ */
var Device = __webpack_require__(59); var Device = __webpack_require__(63);
var SDSDevice = function (_Device) { var SDSDevice = function (_Device) {
_inherits(SDSDevice, _Device); _inherits(SDSDevice, _Device);
...@@ -6589,7 +6817,6 @@ var SDSDevice = function (_Device) { ...@@ -6589,7 +6817,6 @@ var SDSDevice = function (_Device) {
}, { }, {
key: 'setNickname', key: 'setNickname',
value: function setNickname(params) { value: function setNickname(params) {
console.log('setNickname', params.data);
var sds = params.data.sds === true; var sds = params.data.sds === true;
if (sds) { if (sds) {
this.business.sds.updateDeviceInfo({ this.business.sds.updateDeviceInfo({
...@@ -6655,6 +6882,27 @@ var SDSDevice = function (_Device) { ...@@ -6655,6 +6882,27 @@ var SDSDevice = function (_Device) {
}); });
}*/ }*/
}, {
key: 'removeUser',
value: function removeUser(params) {
var _this3 = this;
var sds = params.data.sds === true;
if (sds) {
this.business.sds.unbindByManager({
data: {
uuid: params.data.uuid,
destAuid: params.data.destAuid
},
success: function success() {
_get(SDSDevice.prototype.__proto__ || Object.getPrototypeOf(SDSDevice.prototype), 'removeUser', _this3).call(_this3, params);
},
error: params.error
});
} else {
_get(SDSDevice.prototype.__proto__ || Object.getPrototypeOf(SDSDevice.prototype), 'removeUser', this).call(this, params);
}
}
}]); }]);
return SDSDevice; return SDSDevice;
...@@ -6663,7 +6911,7 @@ var SDSDevice = function (_Device) { ...@@ -6663,7 +6911,7 @@ var SDSDevice = function (_Device) {
module.exports = SDSDevice; module.exports = SDSDevice;
/***/ }), /***/ }),
/* 63 */ /* 67 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6687,7 +6935,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" ...@@ -6687,7 +6935,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSUser * SDSUser
*/ */
var User = __webpack_require__(65); var User = __webpack_require__(69);
var SDSUser = function (_User) { var SDSUser = function (_User) {
_inherits(SDSUser, _User); _inherits(SDSUser, _User);
...@@ -6768,7 +7016,7 @@ var SDSUser = function (_User) { ...@@ -6768,7 +7016,7 @@ var SDSUser = function (_User) {
module.exports = SDSUser; module.exports = SDSUser;
/***/ }), /***/ }),
/* 64 */ /* 68 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -6782,7 +7030,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -6782,7 +7030,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Ready = __webpack_require__(2); var Ready = __webpack_require__(1);
var SDSBridge = function (_Ready) { var SDSBridge = function (_Ready) {
_inherits(SDSBridge, _Ready); _inherits(SDSBridge, _Ready);
...@@ -7101,6 +7349,16 @@ var SDSBridge = function (_Ready) { ...@@ -7101,6 +7349,16 @@ var SDSBridge = function (_Ready) {
callbackID = B.callbackId(success, fail); callbackID = B.callbackId(success, fail);
return B.exec(_SDSCODE, "wifiDeviceConfig", [callbackID]); return B.exec(_SDSCODE, "wifiDeviceConfig", [callbackID]);
}, },
unbindByManager: function unbindByManager(uuid, destAuid, successCallback, errorCallback) {
var success = typeof successCallback !== 'function' ? null : function (args) {
successCallback(args);
},
fail = typeof errorCallback !== 'function' ? null : function (code) {
errorCallback(code);
};
callbackID = B.callbackId(success, fail);
return B.exec(_SDSCODE, "unbindByManager", [callbackID, uuid, destAuid]);
},
/******************** 设备自定义配网API ******************************/ /******************** 设备自定义配网API ******************************/
//获取ssid //获取ssid
getSSId: function getSSId(successCallback, errorCallback) { getSSId: function getSSId(successCallback, errorCallback) {
...@@ -7173,7 +7431,7 @@ var SDSBridge = function (_Ready) { ...@@ -7173,7 +7431,7 @@ var SDSBridge = function (_Ready) {
module.exports = SDSBridge; module.exports = SDSBridge;
/***/ }), /***/ }),
/* 65 */ /* 69 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -7189,7 +7447,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de ...@@ -7189,7 +7447,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var config = __webpack_require__(10); var config = __webpack_require__(11);
var keys = config.keys; var keys = config.keys;
var User = function () { var User = function () {
...@@ -7520,7 +7778,7 @@ var User = function () { ...@@ -7520,7 +7778,7 @@ var User = function () {
module.exports = User; module.exports = User;
/***/ }), /***/ }),
/* 66 */ /* 70 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -7532,10 +7790,10 @@ var _createClass = function () { function defineProperties(target, props) { for ...@@ -7532,10 +7790,10 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var md5 = __webpack_require__(11); var md5 = __webpack_require__(8);
var config = __webpack_require__(10); var config = __webpack_require__(11);
var keys = config.keys; var keys = config.keys;
var NetWork = __webpack_require__(9); var NetWork = __webpack_require__(10);
var CloudAPI = function () { var CloudAPI = function () {
function CloudAPI(params) { function CloudAPI(params) {
...@@ -8020,14 +8278,26 @@ var CloudAPI = function () { ...@@ -8020,14 +8278,26 @@ var CloudAPI = function () {
} }
params.headers = headers; params.headers = headers;
params.data = opts.data; params.data = opts.data;
if (window.iotDebug) {
iotDebug.push('start: ' + url);
}
params.success = function (ret) { params.success = function (ret) {
if (ret.code && ret.code != 0) { if (ret.code && ret.code != 0) {
opts.error(ret); opts.error(ret);
} else { } else {
if (window.iotDebug) {
iotDebug.push('end: ' + url);
}
opts.success(ret); opts.success(ret);
} }
}; };
params.error = opts.error; params.error = function (err) {
if (window.iotDebug) {
iotDebug.push('end: ' + url);
}
opts.error(err);
};
// params.error = opts.error;
params.complete = opts.complete; params.complete = opts.complete;
params.timeout = opts.timeout; params.timeout = opts.timeout;
var time = Date.now(); var time = Date.now();
...@@ -8051,7 +8321,7 @@ var CloudAPI = function () { ...@@ -8051,7 +8321,7 @@ var CloudAPI = function () {
module.exports = CloudAPI; module.exports = CloudAPI;
/***/ }), /***/ }),
/* 67 */ /* 71 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -8065,10 +8335,10 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen ...@@ -8065,10 +8335,10 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Ready = __webpack_require__(2); var Ready = __webpack_require__(1);
var CloudAPI = __webpack_require__(66); var CloudAPI = __webpack_require__(70);
var PublicStore = __webpack_require__(22); var PublicStore = __webpack_require__(25);
var config = __webpack_require__(10); var config = __webpack_require__(11);
var keys = config.keys; var keys = config.keys;
var BusinessReady = function (_Ready) { var BusinessReady = function (_Ready) {
...@@ -8126,11 +8396,11 @@ var BusinessReady = function (_Ready) { ...@@ -8126,11 +8396,11 @@ var BusinessReady = function (_Ready) {
module.exports = BusinessReady; module.exports = BusinessReady;
/***/ }), /***/ }),
/* 68 */, /* 72 */,
/* 69 */ /* 73 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(24); module.exports = __webpack_require__(27);
/***/ }) /***/ })
......
...@@ -1193,12 +1193,14 @@ function bindTap(self) { ...@@ -1193,12 +1193,14 @@ function bindTap(self) {
//tap 解绑 //tap 解绑
function unbindButtonTap(self) { function unbindButtonTap(self) {
_public.uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'), { text: Vue.t('dialog.cancel'), callback: function callback() {} }, { text: Vue.t('dialog.unbind'), callback: function callback() { _public.uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'), { text: Vue.t('dialog.cancel'), callback: function callback() {} }, { text: Vue.t('dialog.unbind'), callback: function callback() {
self.setStateShowFlag(true); alert(self.extras.account);
// iot.business.sds.unbindDevice({ // iot.business.sds.unbindByManager({
// data: { // data: {
// uuid: self.extras.uuid // uuid: self.extras.uuid,
// destAuid: self.extras.account
// }, // },
// success: (response) => { // success: (response) => {
//// alert(JSON.stringify(response));
_public.iot.business.api.sendCustom('lock/unbindUser', { _public.iot.business.api.sendCustom('lock/unbindUser', {
data: { data: {
user_id: self.getInfo().user_id, user_id: self.getInfo().user_id,
...@@ -1207,6 +1209,7 @@ function unbindButtonTap(self) { ...@@ -1207,6 +1209,7 @@ function unbindButtonTap(self) {
}, },
success: function success(response) { success: function success(response) {
console.log(response); console.log(response);
// alert(JSON.stringify(response));
self.setStateShowFlag(true); self.setStateShowFlag(true);
getUserInfo(self); getUserInfo(self);
}, },
...@@ -1230,16 +1233,19 @@ function unbindButtonTap(self) { ...@@ -1230,16 +1233,19 @@ function unbindButtonTap(self) {
// }, // },
// error: (error) => { // error: (error) => {
// console.log(error); // console.log(error);
// // if(window.iotDebug){ // alert(error);
// // iotDebug.push('end: sds解绑设备失败'+JSON.stringify(error)); //// if(window.iotDebug){
// // } //// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
// // if (window.iotDebug) { //// }
// // iotDebug.upload(iot,'sds解绑设备失败'); //// if (window.iotDebug) {
// // } //// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self); // uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// }, // },
// complete: () => { // complete: () => {
// uComponents.hideLoading(self);
// } // }
// }); // });
} }); } });
......
...@@ -1069,6 +1069,7 @@ function _onTapUserList(self, listIndex) { ...@@ -1069,6 +1069,7 @@ function _onTapUserList(self, listIndex) {
extras: { extras: {
id: self.getUserListData()[listIndex].id, id: self.getUserListData()[listIndex].id,
uuid: self.extras.uuid, uuid: self.extras.uuid,
account: self.getUserListData()[listIndex].account,
lockId: self.extras.lockId, lockId: self.extras.lockId,
role: self.extras.role role: self.extras.role
} }
......
...@@ -27,6 +27,13 @@ function init() { ...@@ -27,6 +27,13 @@ function init() {
clientId: null clientId: null
}, },
mounted: function mounted() { mounted: function mounted() {
if (plus.os.name == 'Android') {
_public.iot.permission.checkPermission(['READ_EXTERNAL_STORAGE', 'CAMERA', 'ACCESS_FINE_LOCATION'], function (res) {
console.log('success', res);
}, function (err) {
console.log('error', err);
});
}
var clientInfo = plus.push.getClientInfo(); var clientInfo = plus.push.getClientInfo();
this.setClientId(clientInfo.clientid); this.setClientId(clientInfo.clientid);
loginButtonTap(this); loginButtonTap(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment