1 |
- {"version":3,"sources":["uni-app:///main.js","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/App.vue?1115","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/App.vue?aa6d","uni-app:///App.vue","webpack:////Users/yangxiaohai/Desktop/boyuan/iot-test-app/App.vue?844e"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","uni","$http","baseUrl","beforeRequest","options","header","Token","getStorageSync","afterRequest","err","console","log","errMsg","showToast","icon","title","data","code","removeStorageSync","duration","redirectTo","url","$showMsg","mask","Vue","use","uView","config","productionTip","App","mpType","app","store","$mount","render","staticRenderFns","components","renderjs","component","__file","onLaunch","onShow","onHide","methods","UpdateManager","updateManager","content","success","downLoadAndUpdate","showCancel","confirmText"],"mappings":"iJAAA,MAE2D,eAG3D,WACA,WACA,MACA,eACA,MACA,aAEoC,2kBAVpCA,EAAGC,kCAAoCC,EAWvCC,EAAIC,MAAQA,QAEZA,QAAMC,QAAU,0CAGhBD,QAAME,cAAgB,SAASC,GAM9BA,EAAQC,OAAS,CAChBC,MAAON,EAAIO,eAAe,WAI5BN,QAAMO,aAAe,SAASC,GAmB7B,GAlBAC,QAAQC,IAAIF,EAAIG,QACE,iBAAdH,EAAIG,SACPF,QAAQC,IAAI,GACZX,EAAIa,UAAU,CACbC,KAAM,QACNC,MAAO,SAaa,MAAlBN,EAAIO,KAAKC,KAYZ,OAXAjB,EAAIkB,kBAAkB,SACtBlB,EAAIa,UAAU,CACbE,MAAO,aACPD,KAAM,OACNK,SAAU,MAEXnB,EAAIkB,kBAAkB,cAEtBlB,EAAIoB,WAAW,CACdC,IAAK,wBA0CRrB,EAAIsB,SAAW,WAA6C,IAApCP,EAAQ,UAAH,6CAAG,UAAWI,EAAW,UAAH,6CAAG,KACrDnB,EAAIa,UAAU,CACbE,QACAI,WACAL,KAAM,OACNS,MAAM,KAIRC,UAAIC,IAAIC,WACRF,UAAIG,OAAOC,eAAgB,EAC3BC,UAAIC,OAAS,MACb,IAAMC,EAAM,IAAIP,UAAI,EAAD,KACfK,WAAG,IACNG,mBAED,EAAAD,GAAIE,W,8FCpHJ,yHAAIC,EAAQC,EAAmCC,EAC3CC,EADJ,QASIC,EAAY,qBACd,aACAJ,EACAC,GACA,EACA,KACA,KACA,MACA,EACAC,EACAC,GAGFC,EAAUlC,QAAQmC,OAAS,UACZ,aAAAD,E,yCCvBf,wHAAmzB,eAAG,G,sJCCtzB,aACA,CACAE,oBAAA,0IACA,sBACA,qEACA,qDAHAA,GAIAC,kBACA/B,yBAEAgC,kBACAhC,yBAEAiC,SACAC,yBACA,kCAEA,2BAEAC,gCAEA,aAEAhD,aAEAkB,aAEA+B,gCAEAC,oBAEA,UAIAC,qBAEA,UAIAnD,aAEAkB,cAEA+B,uCAEAG,cAEAC,mBAEAH,oBAEA,WAIAC,mCAsBAhD,aAEAe,WAEA+B,+CAUA,c,4EC7FA,wHAA0/C,eAAG,G","file":"common/main.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;import App from './App'\n\n\nimport Vue from 'vue'\nimport store from \"@/store/index.js\"\nimport './uni.promisify.adaptor'\nimport uView from '@/uni_modules/uview-ui'\nimport \"./utils/permission.js\"\nimport {\n\t$http\n} from \"@escook/request-miniprogram\"\nuni.$http = $http\n// 请求的根路径\n$http.baseUrl = \"https://pro.cloud.boyuantech.net/manage\"\n// $http.baseUrl = \"https://test.cloud.boyuantech.net/manage\"\n// 请求拦截器\n$http.beforeRequest = function(options) {\n\t// uni.showLoading({\n\t// \ttitle: '数据加载中...',\n\t// \tmask: true,\n\t// })\n\t// console.log(options);\n\toptions.header = {\n\t\tToken: uni.getStorageSync('Token')\n\t}\n}\n// 响应拦截器\n$http.afterRequest = function(err) {\n\tconsole.log(err.errMsg);\n\tif (err.errMsg == 'request:fail ') {\n\t\tconsole.log(1)\n\t\tuni.showToast({\n\t\t\ticon: 'error',\n\t\t\ttitle: '无网络'\n\t\t})\n\t}\n\t// if (err.errMsg) {\n\t// \tconsole.log('无网络');\n\t// \tuni.showToast({\n\t// \t\ticon: 'error',\n\t// \t\ttitle: '无网络'\n\t// \t})\n\t// \tuni.hideLoading()\n\t// \treturn\n\t// }\n\t// uni.hideLoading()\n\tif (err.data.code === 2000) {\n\t\tuni.removeStorageSync('Token')\n\t\tuni.showToast({\n\t\t\ttitle: '令牌过期,请重新登录',\n\t\t\ticon: 'none',\n\t\t\tduration: 2000\n\t\t})\n\t\tuni.removeStorageSync('Token')\n\t\t// uni.hideLoading()\n\t\tuni.redirectTo({\n\t\t\turl: \"/pages/login/login\"\n\t\t})\n\t\treturn\n\t}\n}\n// (response) => {\n// \t// console.log(response,'1');\n// \tconst {\n// \t\tsuccess,\n// \t\tmsg,\n// \t\tdata\n// \t} = response.data\n// \t// 要根据success的成功与否决定下面的操作\n// console.log(success,msg,data);\n// \tif (success) {\n// \t\treturn data\n// \t} else {\n// \t\t// 业务已经错误了 还能进then ? 不能 ! 应该进catch\n// \t\tconsole.log(response.data.msg);\n// \t\treturn Promise.reject(new Error(message))\n// \t}\n\n// }, error => {\n// error 信息 里面 response的对象\n// \tif (err.data.code === 2000) {\n// \t\tuni.showToast({\n// \t\t\ttitle: '令牌过期,请重新登录',\n// \t\t\ticon: 'none',\n// \t\t\tduration: 2000\n// \t\t})\n// \t\t// uni.hideLoading()\n// \t\tuni.redirectTo({\n// \t\t\turl: \"/pages/login/login\"\n// \t\t})\n\n// \t} else {\n// \t\tconsole.log(error.msg); // 提示错误信息\n// \t}\n// \treturn Promise.reject(error)\n// }\n\n// 封装弹框的方法\nuni.$showMsg = function(title = '数据请求失败!', duration = 1500) {\n\tuni.showToast({\n\t\ttitle,\n\t\tduration,\n\t\ticon: 'none',\n\t\tmask: true\n\n\t})\n}\nVue.use(uView);\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n\t...App,\n\tstore\n})\napp.$mount()","var render, staticRenderFns, recyclableRender, components\nvar renderjs\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"App.vue\"\nexport default component.exports","import mod from \"-!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"","<script>\n\timport routingIntercept from '@/utils/permission.js'\n\texport default {\n\t\tonLaunch: async function() {\n\t\t\tawait routingIntercept()\n\t\t\t this.UpdateManager()\n\t\t},\n\t\tonShow: function() {\n\t\t\tconsole.log('App Show')\n\t\t},\n\t\tonHide: function() {\n\t\t\tconsole.log('App Hide')\n\t\t},\n\t\tmethods:{\n\t\t\tUpdateManager () {\n\t\t\t if ( uni.canIUse('getUpdateManager') ) {\n\t\t\t\t\t\n\t\t\t const updateManager = uni.getUpdateManager();\n\t\t\t\t\t\n\t\t\t updateManager.onCheckForUpdate ( res => {\n\t\t\t\t\t\n\t\t\t if ( res.hasUpdate ) {\n\t\t\t\t\t\n\t\t\t wx.showModal({\n\t\t\t\t\t\n\t\t\t title: '更新提示',\n\t\t\t\t\t\n\t\t\t content: '检测到新版本,是否下载新版本并重启小程序?',\n\t\t\t\t\t\n\t\t\t success: function (res) {\n\t\t\t\t\t\n\t\t\t if (res.confirm) {\n\t\t\t\t\t\n\t\t\t //2. 用户确定下载更新小程序,小程序下载及更新静默进行\n\t\t\t\t\t\n\t\t\t downLoadAndUpdate(updateManager)\n\t\t\t\t\t\n\t\t\t } else if (res.cancel) {\n\t\t\t\t\t\n\t\t\t //用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了\n\t\t\t\t\t\n\t\t\t wx.showModal({\n\t\t\t\t\t\n\t\t\t title: '温馨提示~',\n\t\t\t\t\t\n\t\t\t content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',\n\t\t\t\t\t\n\t\t\t showCancel: false,//隐藏取消按钮\n\t\t\t\t\t\n\t\t\t confirmText: \"确定更新\",//只保留确定更新按钮\n\t\t\t\t\t\n\t\t\t success: function (res) {\n\t\t\t\t\t\n\t\t\t if (res.confirm) {\n\t\t\t\t\t\n\t\t\t //下载新版本,并重新应用\n\t\t\t\t\t\n\t\t\t downLoadAndUpdate(updateManager)\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t })\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t })\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t })\n\t\t\t\t\t\n\t\t\t } else {\n\t\t\t\t\t\n\t\t\t // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示\n\t\t\t\t\t\n\t\t\t uni.showModal({\n\t\t\t\t\t\n\t\t\t title: '提示',\n\t\t\t\t\t\n\t\t\t content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'\n\t\t\t\t\t\n\t\t\t })\n\t\t\t\t\t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t }\n\t\t}\n\t\t \n\n\t}\n</script>\n<style lang=\"scss\">\n\t/* 注意要写在第一行,同时给style标签加入lang=\"scss\"属性 */\n\t@import \"./uni_modules/uview-ui/index.scss\";\n</style>","import mod from \"-!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=scss&\""],"sourceRoot":""}
|