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.
ss-visit/public/cancel/static/js/pages-login-index.cb2bcdf5.js

1 line
9.0 KiB

11 months ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-login-index"],{"2dd9":function(a,t,e){"use strict";e.r(t);var n=e("da80"),i=e("31b8");for(var r in i)["default"].indexOf(r)<0&&function(a){e.d(t,a,(function(){return i[a]}))}(r);e("4b97");var o=e("828b"),s=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,"635058a8",null,!1,n["a"],void 0);t["default"]=s.exports},"31b8":function(a,t,e){"use strict";e.r(t);var n=e("9449"),i=e.n(n);for(var r in n)["default"].indexOf(r)<0&&function(a){e.d(t,a,(function(){return n[a]}))}(r);t["default"]=i.a},"35d1":function(a,t,e){var n=e("bcbe");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[a.i,n,""]]),n.locals&&(a.exports=n.locals);var i=e("967d").default;i("9c132bba",n,!0,{sourceMap:!1,shadowMode:!1})},"4b97":function(a,t,e){"use strict";var n=e("35d1"),i=e.n(n);i.a},9449:function(a,t,e){"use strict";e("6a54");var n=e("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(e("2634")),r=n(e("2fdc"));e("0c26");var o={data:function(){return{form:{username:"",password:""},loading:!1,errorMsg:""}},onLoad:function(){this.checkLoginStatus()},methods:{checkLoginStatus:function(){try{var a=uni.getStorageSync("mkwcancel_lifeData");a&&a.vuex_token&&uni.reLaunch({url:"/pages/index/index"})}catch(t){console.error("检查登录状态失败:",t)}},clearError:function(){this.errorMsg=""},validateForm:function(){return this.form.username.trim()?this.form.password.trim()?this.form.username.length<2?(this.errorMsg="用户名至少2个字符",!1):!(this.form.password.length<4)||(this.errorMsg="密码至少4个字符",!1):(this.errorMsg="请输入密码",!1):(this.errorMsg="请输入用户名",!1)},handleLogin:function(){var a=this;return(0,r.default)((0,i.default)().mark((function t(){var e,n,r;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a.loading){t.next=2;break}return t.abrupt("return");case 2:if(a.validateForm()){t.next=4;break}return t.abrupt("return");case 4:return a.loading=!0,a.errorMsg="",t.prev=6,t.next=9,a.$u.api.login({username:a.form.username,password:a.form.password});case 9:if(e=t.sent,console.log("登录结果:",e),!e||!e.access_token){t.next=29;break}return n=e.access_token,a.$u.vuex("vuex_token",n),t.prev=14,t.next=17,a.$u.api.user();case 17:r=t.sent,console.log("用户信息:",r),r&&r?(a.$u.vuex("vuex_user",r),uni.showToast({title:"登录成功",icon:"success"}),setTimeout((function(){uni.reLaunch({url:"/pages/index/index"})}),1500)):(a.errorMsg=(null===r||void 0===r?void 0:r.errmsg)||"获取用户信息失败",a.$u.vuex("vuex_token","")),t.next=27;break;case 22:t.prev=22,t.t0=t["catch"](14),console.error("获取用户信息失败:",t.t0),a.errorMsg="获取用户信息失败,请重试",a.$u.vuex("vuex_token","");case 27:t.next=30;break;case 29:a.errorMsg=(null===e||void 0===e?void 0:e.errmsg)||"登录失败,请检查用户名和密码";case 30:t.next=36;break;case 32:t.prev=32,t.t1=t["catch"](6),console.error("登录失败:",t.t1),a.errorMsg="网络错误,请检查网络连接后重试";case 36:return t.prev=36,a.loading=!1,t.finish(36);case 39:case"end":return t.stop()}}),t,null,[[6,32,36,39],[14,22]])})))()}}};t.default=o},bcbe:function(a,t,e){var n=e("c86c");t=n(!1),t.push([a.i,'@charset "UTF-8";\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n/* uni.scss */.login-container[data-v-635058a8]{min-height:100vh;background:linear-gradient(135deg,#667eea,#764ba2);display:flex;flex-direction:column;justify-content:center;align-items:center;padding:%?40?%;box-sizing:border-box}.login-card[data-v-635058a8]{background:#fff;border-radius:%?24?%;padding:%?60?% %?40?%;width:100%;max-width:%?600?%;box-shadow:0 %?20?% %?40?% rgba(0,0,0,.1)}@media (min-width:768px){.login-card[data-v-635058a8]{padding:%?80?% %?60?%;max-width:%?800?%}}.login-header[data-v-635058a8]{text-align:cente