Commit c88d1f7d authored by 李明杰's avatar 李明杰

解决登陆问题

parent e66f93ce
webpackJsonp([2],{"7Otq":function(t,e,r){t.exports=r.p+"static/img/logo.1e6719b.png"},MWkZ:function(t,e){},vdVF:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("VkeE"),o={data:function(){return{form:{user:"",password:""},rules:{user:[{required:!0,message:"账号不能为空",trigger:"blur"}],password:[{required:!0,message:"密码不能为空",trigger:"blur"}]},loginLoading:!1}},methods:{handleSubmit:function(){var t=this;if(""===this.form.user||""===this.form.password)return console.log("error submit!"),!1;this.loginLoading=!0,this.$api.post(s.g,{user:this.form.user,password:this.form.password}).then(function(e){"error"!==e.data?(sessionStorage.setItem("token",e.data),setTimeout(function(){t.$router.push("/SPDAS/domain")},500)):(t.$Message.error("账户名或密码输入错误!"),t.loginLoading=!1)}).catch(function(e){t.$Message.error("登录失败!"),t.loginLoading=!1})}}},n={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"login pull-height"},[t._m(0),t._v(" "),r("div",{staticClass:"login-con"},[r("h2",[t._v("登录语义数据分析平台")]),t._v(" "),r("div",{staticClass:"form-con"},[r("i-form",{ref:"loginForm",attrs:{autocomplete:"on",model:t.form,rules:t.rules}},[r("FormItem",{attrs:{prop:"user"}},[r("Input",{attrs:{placeholder:"请输入用户名"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}},[r("span",{attrs:{slot:"prepend"},slot:"prepend"},[r("Icon",{attrs:{size:16,type:"ios-person"}})],1)])],1),t._v(" "),r("FormItem",{attrs:{prop:"password"}},[r("Input",{attrs:{type:"password",placeholder:"请输入密码"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSubmit(e)}},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}},[r("span",{attrs:{slot:"prepend"},slot:"prepend"},[r("Icon",{attrs:{size:14,type:"md-lock"}})],1)])],1),t._v(" "),r("FormItem",[r("Button",{attrs:{type:"primary",long:"",loading:t.loginLoading},on:{click:function(e){return t.handleSubmit("form")}}},[t._v("登录")])],1)],1)],1)])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"login-info text-white animated fadeInLeft"},[e("div",{staticClass:"logo"},[e("img",{staticStyle:{"vertical-align":"middle"},attrs:{src:r("7Otq"),width:"300px",height:"78px",alt:"logo"}})])])}]};var i=r("VU/8")(o,n,!1,function(t){r("MWkZ")},null,null);e.default=i.exports}});
\ No newline at end of file
webpackJsonp([2],{"7Otq":function(t,e,r){t.exports=r.p+"static/img/logo.1e6719b.png"},AA1p:function(t,e){},vdVF:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=r("VkeE"),o={data:function(){return{form:{user:"",password:""},rules:{user:[{required:!0,message:"账号不能为空",trigger:"blur"}],password:[{required:!0,message:"密码不能为空",trigger:"blur"}]},loginLoading:!1}},created:function(){},methods:{handleSubmit:function(){var t=this;if(""===this.form.user||""===this.form.password)return console.log("error submit!"),!1;this.loginLoading=!0,this.$api.post(s.g,{user:this.form.user,password:this.form.password}).then(function(e){console.log("res_token",e.data),sessionStorage.setItem("token",e.data),setTimeout(function(){t.$router.push("/SPDAS/domain")},1e3)}).catch(function(e){t.$Message.error("登录失败!"),t.loginLoading=!1})}}},n={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"login pull-height"},[t._m(0),t._v(" "),r("div",{staticClass:"login-con"},[r("h2",[t._v("登录语义数据分析平台")]),t._v(" "),r("div",{staticClass:"form-con"},[r("i-form",{ref:"loginForm",attrs:{autocomplete:"on",model:t.form,rules:t.rules}},[r("FormItem",{attrs:{prop:"user"}},[r("Input",{attrs:{placeholder:"请输入用户名"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}},[r("span",{attrs:{slot:"prepend"},slot:"prepend"},[r("Icon",{attrs:{size:16,type:"ios-person"}})],1)])],1),t._v(" "),r("FormItem",{attrs:{prop:"password"}},[r("Input",{attrs:{type:"password",placeholder:"请输入密码"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSubmit(e)}},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}},[r("span",{attrs:{slot:"prepend"},slot:"prepend"},[r("Icon",{attrs:{size:14,type:"md-lock"}})],1)])],1),t._v(" "),r("FormItem",[r("Button",{attrs:{type:"primary",long:"",loading:t.loginLoading},on:{click:function(e){return t.handleSubmit("form")}}},[t._v("登录")])],1)],1)],1)])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"login-info text-white animated fadeInLeft"},[e("div",{staticClass:"logo"},[e("img",{staticStyle:{"vertical-align":"middle"},attrs:{src:r("7Otq"),width:"300px",height:"78px",alt:"logo"}})])])}]};var i=r("VU/8")(o,n,!1,function(t){r("AA1p")},null,null);e.default=i.exports}});
\ No newline at end of file
webpackJsonp([9],{"+skl":function(e,n){},B774:function(e,n){},N1kN:function(e,n){},NHnr:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("7+uW"),a={render:function(){var e=this.$createElement,n=this._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},staticRenderFns:[]};var o=t("VU/8")({name:"App"},a,!1,function(e){t("B774")},null,null).exports,s=t("/ocq");r.default.use(s.a);var u=new s.a({routes:[{path:"/",redirect:"/login"},{path:"/login",name:"login",component:function(){return t.e(2).then(t.bind(null,"vdVF"))}},{path:"/SPDAS",name:"homePage",component:function(){return t.e(1).then(t.bind(null,"LE12"))},redirect:"/SPDAS/domain",meta:{requireAuth:!0},children:[{path:"/SPDAS/domain",name:"domain",component:function(){return Promise.all([t.e(0),t.e(6)]).then(t.bind(null,"SwKW"))},meta:{requireAuth:!0}},{path:"/SPDAS/seriesTime",name:"seriesTime",component:function(){return Promise.all([t.e(0),t.e(5)]).then(t.bind(null,"6NKR"))},meta:{requireAuth:!0}},{path:"/SPDAS/user",name:"user",component:function(){return Promise.all([t.e(0),t.e(7)]).then(t.bind(null,"ZeSV"))},meta:{requireAuth:!0}},{path:"/SPDAS/chat",name:"chat",component:function(){return Promise.all([t.e(0),t.e(4)]).then(t.bind(null,"M2d4"))},meta:{requireAuth:!0}},{path:"/SPDAS/responsive",name:"responsive",component:function(){return Promise.all([t.e(0),t.e(3)]).then(t.bind(null,"fKh/"))},meta:{requireAuth:!0}}]}]});u.beforeEach(function(e,n,t){var r=sessionStorage.getItem("token");console.log("token:",r),e.meta.requireAuth?(console.log(123),r?t():t({path:"/login"})):t()});var i=u,c=(t("j1ja"),t("//Fk")),l=t.n(c),p=t("mtWM"),d=t.n(p),f=t("VkeE"),m=this,h="http://120.79.171.145:5000/SPDAS",_=d.a.create();_.defaults.baseURL=h,_.defaults.timeout=6e5,_.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",_.defaults.headers.post["X-Request-With"]="XMLHttpRequest",_.defaults.headers.post.login_token="",_.interceptors.request.use(function(e){var n="";try{n=JSON.parse(localStorage.getItem(f.p))}catch(e){localStorage.removeItem(f.p),console.log(e)}return n&&(e.headers.login_token=n),e},function(e){return m.$Message.error("网络错误,请稍后再试"),l.a.reject(e)}),_.interceptors.response.use(function(e){return e.data&&200!==e.status?(m.$Message.error("登录信息过期,请重新登录!"),i.replace({name:"login"}),l.a.reject(e)):l.a.resolve(e)},function(e){if(e.response)switch(e.response.status){case 401:localStorage.removeItem(f.p),m.$Message.error("请重新授权登录"),i.replace({name:"login"});break;case 404:m.$Message.error("请求页面不存在");break;case 500:m.$Message.error("服务器错误,请稍后再试")}else m.$Message.error("请求超时,请稍后重试");return l.a.reject(e)});var g=_,S=t("BTaQ"),A=t.n(S),v=(t("+skl"),t("EAZf")),y=t.n(v);t("N1kN");r.default.use(A.a),r.default.config.productionTip=!1,r.default.prototype.$api=g,r.default.use(y.a,{defaultOptions:{zIndex:9999}}),new r.default({el:"#app",router:i,components:{App:o},template:"<App/>"})},VkeE:function(e,n,t){"use strict";t.d(n,"p",function(){return r}),t.d(n,"g",function(){return a}),t.d(n,"e",function(){return o}),t.d(n,"f",function(){return s}),t.d(n,"l",function(){return u}),t.d(n,"m",function(){return i}),t.d(n,"n",function(){return c}),t.d(n,"o",function(){return l}),t.d(n,"c",function(){return p}),t.d(n,"d",function(){return d}),t.d(n,"a",function(){return f}),t.d(n,"b",function(){return m}),t.d(n,"h",function(){return h}),t.d(n,"i",function(){return _}),t.d(n,"j",function(){return g}),t.d(n,"k",function(){return S});var r="",a="/login",o="/domain_structure_analysis1",s="/domain_structure_analysis2",u="/time_series_analysis1",i="/time_series_analysis2",c="/user_portrait_analysis1",l="/user_portrait_analysis2",p="/chat_function_analysis/choice1",d="/chat_function_analysis/choice2",f="/chat_function_analysis/chat1",m="/chat_function_analysis/chat2",h="/response_analysis1",_="/response_analysis2",g="/second_test1",S="/second_test2"}},["NHnr"]);
\ No newline at end of file
webpackJsonp([9],{"+skl":function(e,n){},B774:function(e,n){},N1kN:function(e,n){},NHnr:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("7+uW"),a={render:function(){var e=this.$createElement,n=this._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},staticRenderFns:[]};var o=t("VU/8")({name:"App"},a,!1,function(e){t("B774")},null,null).exports,s=t("/ocq");r.default.use(s.a);var u=new s.a({routes:[{path:"/",redirect:"/login"},{path:"/login",name:"login",component:function(){return t.e(2).then(t.bind(null,"vdVF"))}},{path:"/SPDAS",name:"homePage",component:function(){return t.e(1).then(t.bind(null,"LE12"))},redirect:"/SPDAS/domain",meta:{requireAuth:!0},children:[{path:"/SPDAS/domain",name:"domain",component:function(){return Promise.all([t.e(0),t.e(6)]).then(t.bind(null,"SwKW"))},meta:{requireAuth:!0}},{path:"/SPDAS/seriesTime",name:"seriesTime",component:function(){return Promise.all([t.e(0),t.e(5)]).then(t.bind(null,"6NKR"))},meta:{requireAuth:!0}},{path:"/SPDAS/user",name:"user",component:function(){return Promise.all([t.e(0),t.e(7)]).then(t.bind(null,"ZeSV"))},meta:{requireAuth:!0}},{path:"/SPDAS/chat",name:"chat",component:function(){return Promise.all([t.e(0),t.e(4)]).then(t.bind(null,"M2d4"))},meta:{requireAuth:!0}},{path:"/SPDAS/responsive",name:"responsive",component:function(){return Promise.all([t.e(0),t.e(3)]).then(t.bind(null,"fKh/"))},meta:{requireAuth:!0}}]}]});u.beforeEach(function(e,n,t){console.log("44444");var r=sessionStorage.getItem("token");console.log("token:",r),e.meta.requireAuth?"error"!==r?t():t({path:"/login"}):t()});var i=u,c=(t("j1ja"),t("//Fk")),l=t.n(c),p=t("mtWM"),d=t.n(p),f=t("VkeE"),m=this,h="http://120.79.171.145:5000/SPDAS",_=d.a.create();_.defaults.baseURL=h,_.defaults.timeout=6e5,_.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",_.defaults.headers.post["X-Request-With"]="XMLHttpRequest",_.defaults.headers.post.login_token="",_.interceptors.request.use(function(e){var n="";try{n=JSON.parse(localStorage.getItem(f.p))}catch(e){localStorage.removeItem(f.p),console.log(e)}return n&&(e.headers.login_token=n),e},function(e){return m.$Message.error("网络错误,请稍后再试"),l.a.reject(e)}),_.interceptors.response.use(function(e){return e.data&&200!==e.status?(m.$Message.error("登录信息过期,请重新登录!"),i.replace({name:"login"}),l.a.reject(e)):l.a.resolve(e)},function(e){if(e.response)switch(e.response.status){case 401:localStorage.removeItem(f.p),m.$Message.error("请重新授权登录"),i.replace({name:"login"});break;case 404:m.$Message.error("请求页面不存在");break;case 500:m.$Message.error("服务器错误,请稍后再试")}else m.$Message.error("请求超时,请稍后重试");return l.a.reject(e)});var g=_,S=t("BTaQ"),A=t.n(S),v=(t("+skl"),t("EAZf")),y=t.n(v);t("N1kN");r.default.use(A.a),r.default.config.productionTip=!1,r.default.prototype.$api=g,r.default.use(y.a,{defaultOptions:{zIndex:9999}}),new r.default({el:"#app",router:i,components:{App:o},template:"<App/>"})},VkeE:function(e,n,t){"use strict";t.d(n,"p",function(){return r}),t.d(n,"g",function(){return a}),t.d(n,"e",function(){return o}),t.d(n,"f",function(){return s}),t.d(n,"l",function(){return u}),t.d(n,"m",function(){return i}),t.d(n,"n",function(){return c}),t.d(n,"o",function(){return l}),t.d(n,"c",function(){return p}),t.d(n,"d",function(){return d}),t.d(n,"a",function(){return f}),t.d(n,"b",function(){return m}),t.d(n,"h",function(){return h}),t.d(n,"i",function(){return _}),t.d(n,"j",function(){return g}),t.d(n,"k",function(){return S});var r="",a="/login",o="/domain_structure_analysis1",s="/domain_structure_analysis2",u="/time_series_analysis1",i="/time_series_analysis2",c="/user_portrait_analysis1",l="/user_portrait_analysis2",p="/chat_function_analysis/choice1",d="/chat_function_analysis/choice2",f="/chat_function_analysis/chat1",m="/chat_function_analysis/chat2",h="/response_analysis1",_="/response_analysis2",g="/second_test1",S="/second_test2"}},["NHnr"]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var f,i,u,s=0,l=[];s<r.length;s++)i=r[s],t[i]&&l.push(t[i][0]),t[i]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)u=o(o.s=a[s]);return u};var r={},t={10:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"929eb24a6140a29a71e9",1:"7bc85965315ad5f725e9",2:"9e073194c7971f80ffb1",3:"ac8f0baf4212298750c4",4:"0b2eb810526861297b2f",5:"49d9f21e16f136fa71c7",6:"2eabc7342bc8bb97de0c",7:"931938d5b9ce23d1c7c9"}[e]+".js";var f=setTimeout(i,12e4);function i(){a.onerror=a.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=i,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,d=[];s<r.length;s++)u=r[s],t[u]&&d.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);d.length;)d.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={10:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"929eb24a6140a29a71e9",1:"7bc85965315ad5f725e9",2:"7f2d5d09ed7244a2aca4",3:"ac8f0baf4212298750c4",4:"0b2eb810526861297b2f",5:"49d9f21e16f136fa71c7",6:"2eabc7342bc8bb97de0c",7:"931938d5b9ce23d1c7c9"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -3,4 +3,4 @@
margin: 0;
height: 100%;
overflow:hidden;
}</style><link href=./static/css/app.9c4162e157000096832f7467b0da7465.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.ffddd6eb6c14b28fe19d.js></script><script type=text/javascript src=./static/js/vendor.e324bda0bd56a2f46d94.js></script><script type=text/javascript src=./static/js/app.d34b7f33f5584be04934.js></script></body></html>
\ No newline at end of file
}</style><link href=./static/css/app.9c4162e157000096832f7467b0da7465.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.df9ab60e233ab1eb0e5a.js></script><script type=text/javascript src=./static/js/vendor.e324bda0bd56a2f46d94.js></script><script type=text/javascript src=./static/js/app.7ca45aa2194aeff6ed82.js></script></body></html>
\ No newline at end of file
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