cordova-11/www/js/3.js

1 line
3.2 KiB
JavaScript
Raw Normal View History

2022-05-25 07:48:07 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[3],{"013f":function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"Login"},[n("div",{staticClass:"info_box"},[n("div",{staticClass:"left_box"}),n("div",{staticClass:"right_box"},[n("div",{staticClass:"right_form"},[t._m(0),n("div",{staticClass:"form"},[n("q-form",{ref:"myForm",staticClass:"q-gutter-md",on:{submit:t.login}},[n("q-input",{attrs:{label:"账号",rounded:"","lazy-rules":"",standout:"","bg-color":"grey-11","input-style":{color:"#000000"},rules:[function(t){return t&&t.length>0||"请输入账号"}]},scopedSlots:t._u([{key:"append",fn:function(){return[""!==t.userInfo.username?n("q-icon",{staticClass:"cursor-pointer",attrs:{name:"close"},on:{click:function(e){t.userInfo.username=""}}}):t._e()]},proxy:!0}]),model:{value:t.userInfo.username,callback:function(e){t.$set(t.userInfo,"username",e)},expression:"userInfo.username"}}),n("q-input",{staticStyle:{"margin-top":"6px"},attrs:{label:"密码",rounded:"",standout:"","bg-color":"grey-11",rules:[function(t){return t&&t.length>0||"请输入密码"}],"input-style":{color:"#000000"}},scopedSlots:t._u([{key:"append",fn:function(){return[""!==t.userInfo.password?n("q-icon",{staticClass:"cursor-pointer",attrs:{name:"close"},on:{click:function(e){t.userInfo.password=""}}}):t._e()]},proxy:!0}]),model:{value:t.userInfo.password,callback:function(e){t.$set(t.userInfo,"password",e)},expression:"userInfo.password"}}),n("div",{staticClass:"login_button",on:{click:t.login}},[t._v("\n 登录\n ")])],1)],1)])])])])},s=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"logo"},[o("img",{attrs:{src:n("9d64"),alt:""}}),o("p",[t._v("晶盛 智能制造执行系统")])])}],a=n("758b");function r(){return new Promise((t=>{Object(a["b"])({url:"/index/info",method:"get"}).then((e=>{t(!0)})).catch((e=>{t(!1)}))}))}async function c(t){r(),sessionStorage.setItem("token",t.token);try{await new Promise((e=>{db.transaction((function(n){n.executeSql("DROP TABLE IF EXISTS MyTable"),n.executeSql("CREATE TABLE IF NOT EXISTS MyTable (token)"),n.executeSql("INSERT INTO MyTable VALUES (?)",[t.token]),e()}),(function(t){console.log("Open database ERROR: "+JSON.stringify(t))}),(function(){console.log("Populated database OK")}))}))}catch(e){console.log(e)}}var i={name:"",data(){return{userInfo:{username:"admin",password:"jr.com"}}},methods:{login(){const t=this;cloudSky.zBar.scan({text_title:"扫码",text_instructions:"请把相机对准二维码",camera:"red",flash:"auto",drawSight:!0},(function(e){console.log(e,"success1"),t.value=e.text,t.$emit("update:model",e.text)}),(function(t){console.log(t,"error")}))},handleLogin(){this.$http({url:"/index/login",method:"get",params:this.userInfo}).then((async t=>{await c({token:t.result}),this.$router.push({path:"/dashboard"})})).catch((()=>{}))}}},u=i,l=(n("c3aa"),n("2877")),d=n("0378"),f=n("27f9"),p=n("0016"),m=n("eebe"),b=n.n(m),g=Object(l["a"])(u,o,s,!1,null,"50a3b867",null);e["default"]=g.exports;b()(g,"components",{QForm:d["a"],QInput:f["a"],QIcon:p["a"]})},b1b3:function(t,e,n){},c3aa:function(t,e,n){"use strict";n("b1b3")}}]);