diff --git a/package.nw/app/dist/common/assdk/networkSdk.js b/package.nw/app/dist/common/assdk/networkSdk.js index 1667a1fbd..83870f0b5 100644 --- a/package.nw/app/dist/common/assdk/networkSdk.js +++ b/package.nw/app/dist/common/assdk/networkSdk.js @@ -1 +1 @@ -"use strict";function init(){function e(e){var o=e.apphash,r=t.getProjectByHash(o),n=r.isTourist,i=r.urlCheck,a=!0;return n?a=!1:i||(a=!1),a}function o(o,r){var n=o.args,a=t.getCurrentProjectConfig();return u>=a.Setting.MaxUploadConcurrent?void r({errMsg:"uploadFile:fail exceed max upload connection count "+a.Setting.MaxUploadConcurrent}):(u++,n.tlsVersionCheck=e(o),n.callback=function(e,o,t){r(e?e&&"EPROTO"===e.code?{errMsg:"uploadFile:fail 小程序要求的 TLS 版本必须大于等于 1.2"}:{errMsg:"uploadFile:fail "+e}:{errMsg:"uploadFile:ok",data:t,statusCode:o.statusCode}),u--},void i.uploadFileToServer(n))}function r(o,r){var u=o.args,f=t.getCurrentProject(),g=t.getCurrentProjectConfig(),p=1024*d.DownloadFileSizeLimit*1024;if(c>=g.Setting.MaxDownloadConcurrent)return void r({errMsg:"downloadFile:fail exceed max download connection count "+g.Setting.MaxDownloadConcurrent});c++;var x=0,C=200,v=i.createNewLocalId(f)+n.extname(u.url.split("?")[0]),h=i.getRealPath(v),F=function(e){"function"==typeof r&&(r(e),c--,r=void 0)},w={method:"get",url:u.url,encoding:null,headers:u.header||{},followRedirect:function(e){var o=!1;(f.urlCheck||f.isTourist)&&(o=!0);var r=e.statusCode;if(r>=300&&r<400&&(302==r||301==r))for(var t=e.caseless.get("location"),n=g.Network.DownloadDomain,i=0;ip&&(m.abort(),F({errMsg:"downloadFile:fail exceed max file size"}))}}).on("error",function(e){F(e&&"EPROTO"===e.code?{errMsg:"downloadFile:fail 小程序要求的 TLS 版本必须大于等于 1.2"}:{errMsg:"downloadFile:fail "+e})}).on("data",function(e){x+=e.length,x>p&&(m.abort(),F({errMsg:"downloadFile:fail exceed max file size"}))}).on("end",function(e){F({errMsg:"downloadFile:ok",tempFilePath:v,statusCode:C})}).pipe(a.createWriteStream(h))}var t=require("../../stores/projectStores.js"),n=require("path"),i=require("../../utils/file"),a=require("fs"),l=require("request"),s=require("../../utils/tools.js"),d=require("../../config/appServiceConfig.js"),u=0,c=0;_exports={downloadFile:r,uploadFile:o}}var _exports;init(),module.exports=_exports; \ No newline at end of file +"use strict";function init(){function e(e){var o=e.apphash,r=t.getProjectByHash(o),n=r.isTourist,i=r.urlCheck,a=!0;return n?a=!1:i||(a=!1),a}function o(o,r){var n=o.args,a=t.getCurrentProjectConfig();return u>=a.Setting.MaxUploadConcurrent?void r({errMsg:"uploadFile:fail exceed max upload connection count "+a.Setting.MaxUploadConcurrent}):(u++,n.tlsVersionCheck=e(o),n.callback=function(e,o,t){r(e?e&&"EPROTO"===e.code?{errMsg:"uploadFile:fail 小程序要求的 TLS 版本必须大于等于 1.2"}:{errMsg:"uploadFile:fail "+e}:{errMsg:"uploadFile:ok",data:t,statusCode:o.statusCode}),u--},void i.uploadFileToServer(n))}function r(o,r){var u=o.args,f=t.getCurrentProject(),g=t.getCurrentProjectConfig(),p=1024*d.DownloadFileSizeLimit*1024;if(c>=g.Setting.MaxDownloadConcurrent)return void r({errMsg:"downloadFile:fail exceed max download connection count "+g.Setting.MaxDownloadConcurrent});c++;var x=0,C=200,v=i.createNewLocalId(f)+n.extname(u.url.split("?")[0]),h=i.getRealPath(v),F=function(e){"function"==typeof r&&(r(e),c--,r=void 0)},w={method:"get",url:u.url,encoding:null,headers:u.header||{},followRedirect:function(e){var o=!1;(f.urlCheck||f.isTourist)&&(o=!0);var r=e.statusCode;if(r>=300&&r<400&&(302==r||301==r))for(var t=e.caseless.get("location"),n=g.Network.DownloadDomain,i=0;ip&&(m.abort(),F({errMsg:"downloadFile:fail exceed max file size"}))}}).on("error",function(e){F(e&&"EPROTO"===e.code?{errMsg:"downloadFile:fail 小程序要求的 TLS 版本必须大于等于 1.2"}:{errMsg:"downloadFile:fail "+e})}).on("data",function(e){x+=e.length,x>p&&(m.abort(),F({errMsg:"downloadFile:fail exceed max file size"}))}).on("end",function(e){F({errMsg:"downloadFile:ok",tempFilePath:v,statusCode:C})}).pipe(a.createWriteStream(h))}var t=require("../../stores/projectStores.js"),n=require("path"),i=require("../../utils/file"),a=require("fs"),l=require("request"),s=require("../../utils/tools.js"),d=require("../../config/appserviceConfig.js"),u=0,c=0;_exports={downloadFile:r,uploadFile:o}}var _exports;init(),module.exports=_exports; \ No newline at end of file diff --git a/package.nw/app/dist/components/ContainController.js b/package.nw/app/dist/components/ContainController.js index 58790e0ef..db7d271ec 100644 --- a/package.nw/app/dist/components/ContainController.js +++ b/package.nw/app/dist/components/ContainController.js @@ -1 +1 @@ -"use strict";function init(){var t=require("../lib/react.js"),e=require("../actions/windowActions.js"),s=require("../stores/windowStores.js"),i=require("../stores/webviewStores.js"),o=require("../stores/projectStores.js"),n=(require("../actions/projectActions.js"),require("../common/log/log.js")),r=require("./setting/setting.js"),a=require("./lunch/lunch.js"),c=require("./Create/create.js"),h=require("./confirm/confirm.js"),u=require("./toast/toast.js"),l=require("./main.js"),m=require("../utils/newReport.js"),p=require("../config/config.js"),v=p.SELECT_URL_TYPE,g=p.SELECT_UNKNOW_TYPE,_=function(t){e.showTipsMsg({msg:t,type:"error"})},S=global.Win,L=void 0,f=void 0,j=void 0,T=void 0,w=t.createClass({displayName:"ContainController",getInitialState:function(){var t=!!Object.keys(s.getUserInfo()).length,e=o.getLastSelect(),i=e===v,n="",r=!1;e!==v&&e!==g&&(n=e);var a=s.getLastWinStatus()||{};return{hasLogin:t,commonUrl:i,project:n,type:e,showSetting:r,lastWinStatus:a}},componentDidMount:function(){this.state.hasLogin&&(this.state.project||this.state.commonUrl)&&this.appToMax(),s.on("UPDATA_USER_INFO",this._upDataUserInfo),i.on("NOT_LOGIN",this.goToLogin),i.on("INVALID_LOGIN",this.goToLogin),o.on("CLOSE_PROJECT",this._closeProject),o.on("DEL_PROJECT",this._delProject),s.on("SHOW_SETTING",this._showSetting),S.on("maximize",this._maximize),S.on("restore",this._restore),S.on("enter-fullscreen",this._enterFullscreen),S.on("resize",this._resize),S.on("move",this._move)},componentWillUnmount:function(){s.removeListener("UPDATA_USER_INFO",this._upDataUserInfo),i.removeListener("NOT_LOGIN",this.goToLogin),i.removeListener("INVALID_LOGIN",this.goToLogin),o.removeListener("CLOSE_PROJECT",this._closeProject),o.removeListener("DEL_PROJECT",this._delProject),s.removeListener("SHOW_SETTING",this._showSetting),S.removeListener("maximize",this._maximize),S.removeListener("restore",this._restore),S.removeListener("enter-fullscreen",this._enterFullscreen),S.removeListener("resize",this._resize),S.removeListener("move",this._move)},setLastWinStatus:function(t){this.setState({lastWinStatus:t}),(this.state.commonUrl||this.state.project)&&s.setLastWinStatus(t)},restore:function(t){var e=this,i=S.isFullscreen;clearTimeout(j),clearTimeout(T);var o=function o(){if(S.removeListener("move",e._move),S.removeListener("resize",e._resize),S.removeListener("restore",e._restore),"init"===t)S.resizeTo(nw.App.manifest.window.width,nw.App.manifest.window.height),setTimeout(function(){S.setPosition("center"),setTimeout(function(){S.on("resize",e._resize),S.on("move",e._move),S.on("restore",e._restore)},300)},500);else{var n=s.getLastWinStatus();n.isFullscreen=!1,n.status="restore";var r=void 0===n.x?100:n.x,a=void 0===n.y?100:n.y;r=r<-300?0:r,a=a<-300?0:a,S.moveTo(r,a);var c=void 0===n.width?nw.App.manifest.window.width:n.width,h=void 0===n.height?nw.App.manifest.window.height:n.height;S.resizeTo(c,h),e.setLastWinStatus(n),setTimeout(function(){S.on("resize",e._resize),S.on("move",e._move),S.on("restore",e._restore)},300)}i&&S.removeListener("restore",o)};i?(S.on("restore",o),S.leaveFullscreen()):o()},_move:function(){var t=this;clearTimeout(T),T=setTimeout(function(){var e=Object.assign({},t.state.lastWinStatus);e.x=S.x,e.y=S.y,t.setLastWinStatus(e)},500)},_resize:function(){var t=this;clearTimeout(j),j=setTimeout(function(){var e=Object.assign({},t.state.lastWinStatus);e.width=S.width,e.height=S.height,console.log("hahaha"),t.setLastWinStatus(e)},500)},_enterFullscreen:function(){var t=Object.assign({},this.state.lastWinStatus);t.isFullscreen=!0,this.setLastWinStatus(t)},_maximize:function(){clearTimeout(j),clearTimeout(T);var t=Object.assign({},this.state.lastWinStatus);t.status="max",L=S.height,f=S.width,this.setLastWinStatus(t)},_restore:function(){var t=Object.assign({},this.state.lastWinStatus);t.status="restore",t.isFullscreen=!1,S.width===f&&S.height===L&&(t.status="max"),this.setLastWinStatus(t)},_upDataUserInfo:function(t){var e=this,s=!!Object.keys(t).length;s?(this.setState({hasLogin:!0}),(this.state.project||this.state.commonUrl)&&this.appToMax()):setTimeout(function(){e.goToLogin()},50)},_delProject:function(){this.setState({project:"",commonUrl:""}),this.restore("init")},_closeProject:function(){i.setCurrentWebviewID(0),this.setState({project:"",commonUrl:""}),this.restore("init")},goToLogin:function(){this.setState({hasLogin:!1,commonUrl:"",project:""}),this.restore("init")},handleOnClick:function(t){e.bodyClick(t)},appQuit:function(){n.info("ContainController.js exit"),nw.App.quit()},appToMax:function(){var t=this.state.lastWinStatus,e=t.status;t.isFullscreen?S.enterFullscreen():"max"===e||void 0===e?S.maximize():this.restore()},appMax:function(){var t=this.state.lastWinStatus,e=t.status;"max"!==e?S.maximize():this.restore()},appMin:function(){global.Win.minimize()},goMain:function(t){var e=this;t?o.setProjectConfig(t,function(s){return s?void _(s):(e.setState({commonUrl:!1,project:t,type:t}),o.setProjectType(t.hash),void e.appToMax())}):(this.setState({commonUrl:!0,project:"",type:v}),o.setProjectType(v),this.appToMax());t?m("project_open",t.appid):m("url_open")},_showSetting:function(){this.setState({showSetting:!this.state.showSetting})},render:function(){var e=void 0;return e=this.state.hasLogin?this.state.commonUrl||this.state.project?t.createElement(l,{lastWinStatus:this.state.lastWinStatus,project:this.state.project,appQuit:this.appQuit,appMax:this.appMax,appMin:this.appMin}):t.createElement(c,{appQuit:this.appQuit,goMain:this.goMain,type:this.state.type}):t.createElement(a,{appQuit:this.appQuit}),t.createElement("div",{onClick:this.handleOnClick},e,t.createElement(r,{show:this.state.showSetting,showSetting:this._showSetting}),t.createElement(u,null),t.createElement(h,null))}});_exports=w}var _exports;init(),module.exports=_exports; \ No newline at end of file +"use strict";function init(){var t=require("../lib/react.js"),e=require("../actions/windowActions.js"),s=require("../stores/windowStores.js"),i=require("../stores/webviewStores.js"),o=require("../stores/projectStores.js"),n=(require("../actions/projectActions.js"),require("../common/log/log.js")),r=require("./setting/setting.js"),a=require("./lunch/lunch.js"),c=require("./create/create.js"),h=require("./confirm/confirm.js"),u=require("./toast/toast.js"),l=require("./Main.js"),m=require("../utils/newReport.js"),p=require("../config/config.js"),v=p.SELECT_URL_TYPE,g=p.SELECT_UNKNOW_TYPE,_=function(t){e.showTipsMsg({msg:t,type:"error"})},S=global.Win,L=void 0,f=void 0,j=void 0,T=void 0,w=t.createClass({displayName:"ContainController",getInitialState:function(){var t=!!Object.keys(s.getUserInfo()).length,e=o.getLastSelect(),i=e===v,n="",r=!1;e!==v&&e!==g&&(n=e);var a=s.getLastWinStatus()||{};return{hasLogin:t,commonUrl:i,project:n,type:e,showSetting:r,lastWinStatus:a}},componentDidMount:function(){this.state.hasLogin&&(this.state.project||this.state.commonUrl)&&this.appToMax(),s.on("UPDATA_USER_INFO",this._upDataUserInfo),i.on("NOT_LOGIN",this.goToLogin),i.on("INVALID_LOGIN",this.goToLogin),o.on("CLOSE_PROJECT",this._closeProject),o.on("DEL_PROJECT",this._delProject),s.on("SHOW_SETTING",this._showSetting),S.on("maximize",this._maximize),S.on("restore",this._restore),S.on("enter-fullscreen",this._enterFullscreen),S.on("resize",this._resize),S.on("move",this._move)},componentWillUnmount:function(){s.removeListener("UPDATA_USER_INFO",this._upDataUserInfo),i.removeListener("NOT_LOGIN",this.goToLogin),i.removeListener("INVALID_LOGIN",this.goToLogin),o.removeListener("CLOSE_PROJECT",this._closeProject),o.removeListener("DEL_PROJECT",this._delProject),s.removeListener("SHOW_SETTING",this._showSetting),S.removeListener("maximize",this._maximize),S.removeListener("restore",this._restore),S.removeListener("enter-fullscreen",this._enterFullscreen),S.removeListener("resize",this._resize),S.removeListener("move",this._move)},setLastWinStatus:function(t){this.setState({lastWinStatus:t}),(this.state.commonUrl||this.state.project)&&s.setLastWinStatus(t)},restore:function(t){var e=this,i=S.isFullscreen;clearTimeout(j),clearTimeout(T);var o=function o(){if(S.removeListener("move",e._move),S.removeListener("resize",e._resize),S.removeListener("restore",e._restore),"init"===t)S.resizeTo(nw.App.manifest.window.width,nw.App.manifest.window.height),setTimeout(function(){S.setPosition("center"),setTimeout(function(){S.on("resize",e._resize),S.on("move",e._move),S.on("restore",e._restore)},300)},500);else{var n=s.getLastWinStatus();n.isFullscreen=!1,n.status="restore";var r=void 0===n.x?100:n.x,a=void 0===n.y?100:n.y;r=r<-300?0:r,a=a<-300?0:a,S.moveTo(r,a);var c=void 0===n.width?nw.App.manifest.window.width:n.width,h=void 0===n.height?nw.App.manifest.window.height:n.height;S.resizeTo(c,h),e.setLastWinStatus(n),setTimeout(function(){S.on("resize",e._resize),S.on("move",e._move),S.on("restore",e._restore)},300)}i&&S.removeListener("restore",o)};i?(S.on("restore",o),S.leaveFullscreen()):o()},_move:function(){var t=this;clearTimeout(T),T=setTimeout(function(){var e=Object.assign({},t.state.lastWinStatus);e.x=S.x,e.y=S.y,t.setLastWinStatus(e)},500)},_resize:function(){var t=this;clearTimeout(j),j=setTimeout(function(){var e=Object.assign({},t.state.lastWinStatus);e.width=S.width,e.height=S.height,console.log("hahaha"),t.setLastWinStatus(e)},500)},_enterFullscreen:function(){var t=Object.assign({},this.state.lastWinStatus);t.isFullscreen=!0,this.setLastWinStatus(t)},_maximize:function(){clearTimeout(j),clearTimeout(T);var t=Object.assign({},this.state.lastWinStatus);t.status="max",L=S.height,f=S.width,this.setLastWinStatus(t)},_restore:function(){var t=Object.assign({},this.state.lastWinStatus);t.status="restore",t.isFullscreen=!1,S.width===f&&S.height===L&&(t.status="max"),this.setLastWinStatus(t)},_upDataUserInfo:function(t){var e=this,s=!!Object.keys(t).length;s?(this.setState({hasLogin:!0}),(this.state.project||this.state.commonUrl)&&this.appToMax()):setTimeout(function(){e.goToLogin()},50)},_delProject:function(){this.setState({project:"",commonUrl:""}),this.restore("init")},_closeProject:function(){i.setCurrentWebviewID(0),this.setState({project:"",commonUrl:""}),this.restore("init")},goToLogin:function(){this.setState({hasLogin:!1,commonUrl:"",project:""}),this.restore("init")},handleOnClick:function(t){e.bodyClick(t)},appQuit:function(){n.info("ContainController.js exit"),nw.App.quit()},appToMax:function(){var t=this.state.lastWinStatus,e=t.status;t.isFullscreen?S.enterFullscreen():"max"===e||void 0===e?S.maximize():this.restore()},appMax:function(){var t=this.state.lastWinStatus,e=t.status;"max"!==e?S.maximize():this.restore()},appMin:function(){global.Win.minimize()},goMain:function(t){var e=this;t?o.setProjectConfig(t,function(s){return s?void _(s):(e.setState({commonUrl:!1,project:t,type:t}),o.setProjectType(t.hash),void e.appToMax())}):(this.setState({commonUrl:!0,project:"",type:v}),o.setProjectType(v),this.appToMax());t?m("project_open",t.appid):m("url_open")},_showSetting:function(){this.setState({showSetting:!this.state.showSetting})},render:function(){var e=void 0;return e=this.state.hasLogin?this.state.commonUrl||this.state.project?t.createElement(l,{lastWinStatus:this.state.lastWinStatus,project:this.state.project,appQuit:this.appQuit,appMax:this.appMax,appMin:this.appMin}):t.createElement(c,{appQuit:this.appQuit,goMain:this.goMain,type:this.state.type}):t.createElement(a,{appQuit:this.appQuit}),t.createElement("div",{onClick:this.handleOnClick},e,t.createElement(r,{show:this.state.showSetting,showSetting:this._showSetting}),t.createElement(u,null),t.createElement(h,null))}});_exports=w}var _exports;init(),module.exports=_exports; \ No newline at end of file diff --git a/replace.sh b/replace.sh index 832e80a45..bd3159fdd 100755 --- a/replace.sh +++ b/replace.sh @@ -1,7 +1,8 @@ #! /bin/sh -files=find ./package.nw/app/dist -type f -name '*.js' +files=$(find ./package.nw/app/dist -type f -name '*.js') -$files | xargs sed -i 's/\.\/main\.js/.\/Main\.js/g' -#find ./package.nw/app/dist -type f -name '*.js' | xargs sed -i 's/config\/appServiceConfig\.js/config\/appserviceConfig\.js/g' +echo $files | xargs sed -i 's/\.\/main\.js/.\/Main\.js/g' +echo $files | xargs sed -i 's/Create\/create/create\/create/g' +echo $files | xargs sed -i 's/config\/appServiceConfig\.js/config\/appserviceConfig\.js/g'