完成签约之后直接添加人员,录入下发凭证
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

315 lines
11 KiB

  1. webpackJsonp([32],{
  2. /***/ "4fo2":
  3. /***/ (function(module, exports) {
  4. // removed by extract-text-webpack-plugin
  5. /***/ }),
  6. /***/ "lmfZ":
  7. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  11. var stringify = __webpack_require__("mvHQ");
  12. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  13. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  14. var api = __webpack_require__("gyMJ");
  15. // EXTERNAL MODULE: ./node_modules/axios/index.js
  16. var axios = __webpack_require__("mtWM");
  17. var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
  18. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/Login.vue
  19. //
  20. //
  21. //
  22. //
  23. //
  24. //
  25. //
  26. //
  27. //
  28. //
  29. //
  30. //
  31. //
  32. //
  33. //
  34. //
  35. //
  36. //
  37. //
  38. //
  39. //
  40. //
  41. //
  42. //
  43. //
  44. //
  45. //
  46. //
  47. //
  48. //
  49. //
  50. //
  51. //
  52. /* harmony default export */ var Login = ({
  53. data: function data() {
  54. return {
  55. param: {
  56. username: "",
  57. password: "",
  58. code: ""
  59. },
  60. signature: "",
  61. rules: {
  62. username: [{
  63. required: true,
  64. message: "请输入用户名",
  65. trigger: "blur"
  66. }],
  67. password: [{
  68. required: true,
  69. message: "请输入密码",
  70. trigger: "blur"
  71. }],
  72. code: [{
  73. required: true,
  74. message: "请输入验证码",
  75. trigger: "blur"
  76. }]
  77. },
  78. code: "",
  79. checkCode: "",
  80. options: [],
  81. value: '',
  82. tenantId: ''
  83. };
  84. },
  85. created: function created() {
  86. var _this2 = this;
  87. this.$store.commit("clearTags");
  88. Object(api["e" /* httpGet1 */])("", "/oauth/key").then(function (res) {
  89. _this2.code = res.data;
  90. });
  91. var data = {
  92. signature: this.signature
  93. };
  94. Object(api["e" /* httpGet1 */])(data, this.$api.getCheckCode).then(function (res) {
  95. _this2.checkCode = res.data;
  96. _this2.signature = res.data.signature;
  97. });
  98. },
  99. mounted: function mounted() {
  100. document.addEventListener('keydown', this.keyDown);
  101. },
  102. methods: {
  103. getuserid: function getuserid() {
  104. Object(api["d" /* httpGet */])('', this.$api.getUserid).then(function (res) {});
  105. },
  106. getConfig: function getConfig() {
  107. var _this3 = this;
  108. Object(api["e" /* httpGet1 */])('', this.$api.getConfig).then(function (res) {
  109. if (res.success) {
  110. _this3.options = res.data.list;
  111. } else {
  112. _this3.$message.error("获取失败");
  113. }
  114. });
  115. },
  116. selectTenantId: function selectTenantId(e) {
  117. this.tenantId = e;
  118. localStorage.setItem('tenantId', this.tenantId);
  119. this.$tenantId = e;
  120. },
  121. keyDown: function keyDown(e) {
  122. //如果是回车则执行登录方法
  123. if (e.keyCode == 13) {
  124. if (this.$route.name == 'Login') {
  125. this.submitForm();
  126. }
  127. }
  128. },
  129. // 刷新验证码
  130. codesx: function codesx() {
  131. var _this4 = this;
  132. var data = {
  133. signature: this.signature
  134. };
  135. Object(api["e" /* httpGet1 */])(data, this.$api.getCheckCode).then(function (res) {
  136. _this4.checkCode = res.data;
  137. _this4.signature = res.data.signature;
  138. });
  139. },
  140. // 回调-页面权限
  141. backfun: function backfun(i18n, callback) {
  142. if (i18n.subs) {
  143. callback(i18n.subs[0], callback);
  144. } else {
  145. return i18n.index;
  146. }
  147. },
  148. getChidlren: function getChidlren(data, key, value) {
  149. var hasFound = false,
  150. // 表示是否有找到id值
  151. result = null;
  152. var fn = function fn(data) {
  153. if (!hasFound) {
  154. // 判断是否是数组并且没有的情况下,
  155. data.forEach(function (item) {
  156. if (item[key] === value) {
  157. // 数据循环每个子项,并且判断子项下边是否有id值
  158. result = item; // 返回的结果等于每一项
  159. hasFound = true; // 并且找到id值
  160. } else if (item.subs) {
  161. fn(item.subs); // 递归调用下边的子项
  162. }
  163. });
  164. }
  165. };
  166. fn(data); // 调用一下
  167. return result;
  168. },
  169. submitForm: function submitForm() {
  170. var _this5 = this;
  171. localStorage.setItem('tenantId', '');
  172. // if (this.tenantId == '') {
  173. // this.$message.success("请选择客户");
  174. // return
  175. // }
  176. var loading = this.$loading({
  177. lock: true,
  178. text: "Loading",
  179. spinner: "el-icon-loading",
  180. background: "rgba(0, 0, 0, 0.7)"
  181. });
  182. var _this = this;
  183. var fd = new FormData();
  184. fd.append("client_id", "iot-client");
  185. fd.append("client_secret", Object(api["j" /* setCode */])(this.code, "iot-client"));
  186. fd.append("grant_type", "password");
  187. fd.append("scope", "all");
  188. fd.append("username", this.param.username);
  189. fd.append("password", Object(api["j" /* setCode */])(this.code, this.param.password));
  190. if (this.param.code == '' || this.signature == '') {
  191. loading.close();
  192. this.$message.error("请输入验证码");
  193. return;
  194. }
  195. var datacode = {
  196. code: this.param.code.toUpperCase(),
  197. signature: this.signature
  198. };
  199. var info = JSON.parse(localStorage.getItem('info'));
  200. // localStorage.setItem("ms_username", 'zw001');
  201. // _this.$router.push("/");
  202. Object(api["h" /* httpPost1 */])(datacode, this.$api.checkCodeMatches).then(function (res) {
  203. if (res.data.pass) {
  204. Object(api["g" /* httpPost */])(fd, _this5.$api.postLogin).then(function (res1) {
  205. if (res1.access_token) {
  206. // httpGet({}, '/oauth/revoke').then(res4 => { })
  207. _this.$message.success("登录成功");
  208. _this5.param.code = '';
  209. _this5.signature = '';
  210. localStorage.setItem("tokenkey", stringify_default()(res1));
  211. localStorage.setItem("ms_username", _this.param.username);
  212. Object(api["d" /* httpGet */])('', _this5.$api.userInfo).then(function (res3) {
  213. var tenantId = res3.data.tenantId.split(',');
  214. // localStorage.setItem('tenantId',tenantId[0])
  215. localStorage.setItem('info', stringify_default()(res3.data));
  216. // this.$store.commit("getselectoption")
  217. _this5.$store.commit('updateTenantId', tenantId[0]);
  218. if (res3.data.type == 0) {
  219. _this.$router.push("/home");
  220. } else {
  221. // if (tenantId[0] == '300' || tenantId[0] == '200') {
  222. var i18n = _this5.$language.cn.i18n;
  223. var data = '';
  224. var authoritiesList = res3.data.authorities.filter(function (item) {
  225. return item != 'BLUETOOTH_INPUT' && item != 'NORMALLY_OPEN_PERMISSION' && item != 'FREEZE_PERMISSION' && item != 'REMOTE_CONTROL_PERMISSION';
  226. });
  227. console.log(authoritiesList);
  228. if (authoritiesList[0] == 'BLUETOOTH_INPUT') {
  229. data = _this5.getChidlren(i18n.items, 'key', authoritiesList[1]);
  230. } else {
  231. data = _this5.getChidlren(i18n.items, 'key', authoritiesList[0]);
  232. }
  233. console.log(data);
  234. _this.$router.push("/" + data.index);
  235. }
  236. });
  237. loading.close();
  238. } else {
  239. _this.$message.error("登录失败");
  240. }
  241. });
  242. } else {
  243. loading.close();
  244. _this.$message.error("请输入正确验证码");
  245. _this5.checkCode = res.data;
  246. _this5.signature = res.data.signature;
  247. }
  248. });
  249. }
  250. }
  251. });
  252. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-33d9f35b","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/Login.vue
  253. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"login-wrap"},[_c('div',{staticClass:"ms-login"},[_c('el-form',{ref:"login",staticClass:"ms-content",attrs:{"model":_vm.param,"rules":_vm.rules,"label-width":"0px"}},[_c('div',{staticClass:"title"},[_c('div',[_c('img',{attrs:{"src":__webpack_require__("qvJq")}})]),_vm._v(" "),_c('p',[_vm._v("智慧公寓管理系统")])]),_vm._v(" "),_c('el-form-item',{attrs:{"prop":"username"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.param.username),expression:"param.username"}],staticClass:"dlinput",attrs:{"type":"text","placeholder":"请输入用户名"},domProps:{"value":(_vm.param.username)},on:{"input":function($event){if($event.target.composing){ return; }_vm.$set(_vm.param, "username", $event.target.value)}}}),_vm._v(" "),_c('i',{staticClass:"iconfont httpicon-zhanghao"})]),_vm._v(" "),_c('el-form-item',{attrs:{"prop":"password"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.param.password),expression:"param.password"}],staticClass:"dlinput",attrs:{"type":"password","placeholder":"请输入密码"},domProps:{"value":(_vm.param.password)},on:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.submitForm()},"input":function($event){if($event.target.composing){ return; }_vm.$set(_vm.param, "password", $event.target.value)}}}),_vm._v(" "),_c('i',{staticClass:"iconfont httpicon-mima"})]),_vm._v(" "),_c('el-form-item',{staticClass:"fromprop",attrs:{"prop":"code"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.param.code),expression:"param.code"}],staticClass:"dlinput",attrs:{"type":"txt","placeholder":"验证码"},domProps:{"value":(_vm.param.code)},on:{"input":function($event){if($event.target.composing){ return; }_vm.$set(_vm.param, "code", $event.target.value)}}}),_vm._v(" "),_c('i',{staticClass:"iconfont httpicon-yanzhengma"}),_vm._v(" "),(_vm.checkCode.image)?_c('img',{staticClass:"codeimg",attrs:{"src":'data:image/png;base64,' + _vm.checkCode.image,"alt":""},on:{"click":_vm.codesx}}):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"login-btn"},[_c('el-button',{staticClass:"dlbtn",attrs:{"type":"primary"},on:{"click":function($event){return _vm.submitForm()}}},[_vm._v("登录")])],1),_vm._v(" "),_c('p',{staticClass:"login-tips"})],1)],1)])}
  254. var staticRenderFns = []
  255. var esExports = { render: render, staticRenderFns: staticRenderFns }
  256. /* harmony default export */ var views_Login = (esExports);
  257. // CONCATENATED MODULE: ./src/views/Login.vue
  258. function injectStyle (ssrContext) {
  259. __webpack_require__("4fo2")
  260. }
  261. var normalizeComponent = __webpack_require__("VU/8")
  262. /* script */
  263. /* template */
  264. /* template functional */
  265. var __vue_template_functional__ = false
  266. /* styles */
  267. var __vue_styles__ = injectStyle
  268. /* scopeId */
  269. var __vue_scopeId__ = "data-v-33d9f35b"
  270. /* moduleIdentifier (server only) */
  271. var __vue_module_identifier__ = null
  272. var Component = normalizeComponent(
  273. Login,
  274. views_Login,
  275. __vue_template_functional__,
  276. __vue_styles__,
  277. __vue_scopeId__,
  278. __vue_module_identifier__
  279. )
  280. /* harmony default export */ var src_views_Login = __webpack_exports__["default"] = (Component.exports);
  281. /***/ }),
  282. /***/ "qvJq":
  283. /***/ (function(module, exports, __webpack_require__) {
  284. module.exports = __webpack_require__.p + "static/img/logo2.0754d14.png";
  285. /***/ })
  286. });