pages-login-login.9055b175.js
7.8 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-login-login"],{"07ca":function(n,t,e){var a=e("24fb");t=a(!1),t.push([n.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.login[data-v-40ca6e6e]{padding:0 %?48?%;box-sizing:border-box}.login .icon .bgimg[data-v-40ca6e6e]{margin-top:%?100?%;margin-left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);margin-bottom:%?24?%;width:%?184?%;height:%?184?%}.login .icon .bar[data-v-40ca6e6e]{border-bottom:1px solid #f0f0f0;padding:%?40?% 0;color:#000;font-size:%?32?%;font-weight:500;font-family:PingFang SC}.login .icon .bar .name[data-v-40ca6e6e]{width:%?180?%}.login .icon .bar .last[data-v-40ca6e6e]{flex:1}.login .icon .loginbtn[data-v-40ca6e6e]{margin-top:%?100?%;width:%?654?%;height:%?88?%;border-radius:%?28?%;opacity:1;color:rgba(0,0,0,.9);font-size:%?32?%;font-weight:600;font-family:PingFang SC;text-align:center;line-height:%?88?%;background:#fed000}.login .icon .passway[data-v-40ca6e6e]{display:flex;align-items:center;justify-content:space-between;margin-top:%?16?%}.login .icon .passway uni-text[data-v-40ca6e6e]:first-child{color:rgba(0,0,0,.26);font-size:%?24?%;font-weight:400;font-family:PingFang SC}.login .icon .passway uni-text[data-v-40ca6e6e]:last-child{color:#fed000;font-size:%?26?%;font-weight:400;font-family:PingFang SC}',""]),n.exports=t},"14ba":function(n,t,e){"use strict";e("d3b7"),Object.defineProperty(t,"__esModule",{value:!0}),t.request=t.baseURL=void 0;var a="http://yuanjie.n.broing.cn/api/";t.baseURL=a;var o=function(n){return new Promise((function(t,e){uni.request({url:a+n.url,method:n.method||"GET",data:n.data||{},header:{"Content-Type":"application/x-www-form-urlencoded",token:uni.getStorageSync("token")||""},success:function(n){console.log(n,uni.getStorageSync("token")),1==n.data.code?t(n.data.data):(401==n.data.code&&(uni.navigateTo({url:"/login/login"}),uni.clearStorageSync()),e(n.data.msg))},fail:function(n){console.log(n),e(n)}})}))};t.request=o},"1a9f":function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAgreement=t.resetPassword=t.sendCode=t.register=t.login=void 0;var a=e("14ba"),o=function(n,t){return(0,a.request)({url:"user/login",method:"post",data:{account:n,password:t}})};t.login=o;var i=function(n,t,e,o){return(0,a.request)({url:"user/register",method:"post",data:{username:n,password:t,mobile:e,code:o}})};t.register=i;var r=function(n,t){return(0,a.request)({url:"sms/send",method:"post",data:{mobile:n,event:t}})};t.sendCode=r;var s=function(n,t,e,o){return(0,a.request)({url:"user/resetpwd",method:"post",data:{mobile:n,captcha:t,newpassword:e,confirmpassword:o}})};t.resetPassword=s;var c=function(n){return(0,a.request)({url:"common/agreement ",method:"post",data:{type:n}})};t.getAgreement=c},"54ce":function(n,t,e){"use strict";var a=e("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,e("96cf");var o=a(e("1da1")),i=e("1a9f"),r=e("bbe3"),s={data:function(){return{account:"",password:""}},methods:{forget:function(){uni.navigateTo({url:"/pages/login/password"})},register:function(){uni.navigateTo({url:"/pages/login/register"})},doLogin:function(){return this.account?this.password?void this.login():r.toa.toast("请输入密码"):r.toa.toast("请输入账号")},login:function(){var n=this;return(0,o.default)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,i.login)(n.account,n.password);case 3:e=t.sent,console.log("login",e),uni.setStorageSync("userInfo",e.userinfo),uni.setStorageSync("token",e.userinfo.token),setTimeout((function(){r.toa.success("登录成功")}),200),uni.reLaunch({url:"/pages/index/index"}),t.next=15;break;case 11:t.prev=11,t.t0=t["catch"](0),uni.showToast({title:t.t0,icon:"none"}),console.log("login",t.t0);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})))()}}};t.default=s},"66dc":function(n,t,e){"use strict";e.r(t);var a=e("54ce"),o=e.n(a);for(var i in a)"default"!==i&&function(n){e.d(t,n,(function(){return a[n]}))}(i);t["default"]=o.a},"6c8a":function(n,t,e){"use strict";var a=e("de00"),o=e.n(a);o.a},"71a1":function(n,t,e){n.exports=e.p+"static/img/ic_logo.1321f14a.png"},aaa6:function(n,t,e){"use strict";e.r(t);var a=e("b69d"),o=e("66dc");for(var i in o)"default"!==i&&function(n){e.d(t,n,(function(){return o[n]}))}(i);e("6c8a");var r,s=e("f0c5"),c=Object(s["a"])(o["default"],a["b"],a["c"],!1,null,"40ca6e6e",null,!1,a["a"],r);t["default"]=c.exports},b69d:function(n,t,e){"use strict";var a;e.d(t,"b",(function(){return o})),e.d(t,"c",(function(){return i})),e.d(t,"a",(function(){return a}));var o=function(){var n=this,t=n.$createElement,a=n._self._c||t;return a("v-uni-view",{staticClass:"login"},[a("v-uni-view",{staticClass:"icon"},[a("v-uni-image",{staticClass:"bgimg",attrs:{src:e("71a1"),mode:""}}),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[n._v("用户名:")]),a("v-uni-view",{staticClass:"last name"},[a("v-uni-input",{attrs:{maxlength:"16",type:"text",value:"",placeholder:"请输入用户名"},model:{value:n.account,callback:function(t){n.account=t},expression:"account"}})],1)],1),a("v-uni-view",{staticClass:"bar flexwrap"},[a("v-uni-view",{staticClass:"name"},[n._v("密码:")]),a("v-uni-view",{staticClass:"last name"},[a("v-uni-input",{attrs:{maxlength:"16",type:"text",value:"",placeholder:"密码:"},model:{value:n.password,callback:function(t){n.password=t},expression:"password"}})],1)],1),a("v-uni-view",{staticClass:"loginbtn",on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.doLogin.apply(void 0,arguments)}}},[n._v("登录")]),a("v-uni-view",{staticClass:"passway"},[a("v-uni-text",{on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.forget.apply(void 0,arguments)}}},[n._v("忘记密码")]),a("v-uni-text",{on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.register.apply(void 0,arguments)}}},[n._v("没有账号,去注册")])],1)],1)],1)},i=[]},bbe3:function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.router=t.toa=t.hideLoading=t.loading=t.success=t.toast=void 0;var a=function(n){return uni.showToast({title:n,icon:"none"})};t.toast=a;var o=function(n){return uni.showToast({title:n})};t.success=o;var i=function(n){return uni.showLoading({title:"加载中"})};t.loading=i;var r=function(){return uni.hideLoading()};t.hideLoading=r;var s={toast:function(n){return uni.showToast({title:n,icon:"none"})},success:function(n){return uni.showToast({title:n})},loading:function(n){return uni.showLoading({title:n||"加载中",mask:!0})},hideLoading:function(){return uni.hideLoading()}};t.toa=s;var c={back:function(n){return uni.navigateBack({delta:n||1})}};t.router=c},de00:function(n,t,e){var a=e("07ca");"string"===typeof a&&(a=[[n.i,a,""]]),a.locals&&(n.exports=a.locals);var o=e("4f06").default;o("333c4240",a,!0,{sourceMap:!1,shadowMode:!1})}}]);