(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/user/user"],{"0032":function(t,n,e){"use strict";var o=e("f25f"),a=e.n(o);a.a},"4d85":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e={data:function(){return{skin:!1,loginBtn:!0,login:!1,avatar:"",account:"",roleArr:[]}},onShow:function(){t.getStorageSync("token")||(this.loginBtn=!0,this.account="")},onLoad:function(){},methods:{SwitchSex:function(t){this.skin=t.detail.value},wxGetUserInfo:function(){var n=this;t.login({success:function(e){var o=e.code;t.getUserInfo({provider:"weixin",success:function(e){n.userInfo=e.userInfo;var a={code:o,encryptedData:e.encryptedData,iv:e.iv,identify:0};n.$http.post("/apiHrmsAuth/hrms/auth/userlogin/wxAuthLogin",a).then((function(e){console.log(e,"看下res"),n.login=!0,n.loginBtn=!1,n.account=e.data.account,n.avatar=e.data.headPortaritUrl,t.setStorageSync("account",e.data.account),t.setStorageSync("headPortaritUrl",e.data.headPortaritUrl),t.setStorageSync("token",e.data.token),n.getNowRole(),n.getRouter(),t.showToast({title:"登录成功!"})})).catch((function(n){console.log(n.data.data,"抛出错误"),t.showToast({title:n.data.data,icon:"none"})}))},fail:function(n){t.showToast({title:"登录授权失败",icon:"none"})}})}})},isLogin:function(){if(!this.login)return t.showToast({title:"请先登录后在进行操作",icon:"none"})},getNowRole:function(){return this.$http.get("/api-guarantee/dg-apply-amount-info/getRoles").then((function(n){t.setStorageSync("roleArr",n.data),console.log(t.getStorageSync("roleArr"),"角色权限")})).catch((function(t){}))},getName:function(t){var n=this;t&&0!=t.length&&t.map((function(t){n.roleArr.push(t.name),t.children&&n.getName(t.children)}))},getRouter:function(){var n=this;return this.$http.get("/api-hrms/hrms/permission/getPermission").then((function(e){console.log(e,"路由权限");var o=[];e.data.map((function(t){"客户资源管理系统"!==t.name&&"担保业务管理系统"!==t.name||o.push(t)})),n.getName(o),t.setStorageSync("routerArr",n.roleArr),console.log(n.roleArr,"获取所有的name")}))},ChooseImage:function(){var n=this;if(!t.getStorageSync("token"))return t.showToast({title:"请先登录后在进行操作!",icon:"none"});t.chooseImage({count:4,sizeType:["original","compressed"],sourceType:["album"],success:function(e){t.uploadFile({url:"https://www.huorantech.cn/dqwg/api-guarantee/dg-apply-amount-info/uploadFile",filePath:e.tempFilePaths[0],name:"file",header:{"Content-Type":"multipart/form-data",token:t.getStorageSync("token")},success:function(e){var o=JSON.parse(e.data),a=o.data;n.$http.get("/api-hrms/hrms/user/update/url",{headPortraitUrl:o.data[0]}).then((function(e){n.avatar=a[0],t.showToast({title:"更换头像成功!"})}))}})}})}}};n.default=e}).call(this,e("543d")["default"])},"50b8":function(t,n,e){"use strict";e.r(n);var o=e("94d5"),a=e("e9ed");for(var r in a)"default"!==r&&function(t){e.d(n,t,(function(){return a[t]}))}(r);e("0032");var i,c=e("f0c5"),u=Object(c["a"])(a["default"],o["b"],o["c"],!1,null,"367cb0a4",null,!1,o["a"],i);n["default"]=u.exports},"94d5":function(t,n,e){"use strict";var o;e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return r})),e.d(n,"a",(function(){return o}));var a=function(){var t=this,n=t.$createElement;t._self._c},r=[]},d7fc:function(t,n,e){"use strict";(function(t){e("3364"),e("921b");o(e("66fd"));var n=o(e("50b8"));function o(t){return t&&t.__esModule?t:{default:t}}t(n.default)}).call(this,e("543d")["createPage"])},e9ed:function(t,n,e){"use strict";e.r(n);var o=e("4d85"),a=e.n(o);for(var r in o)"default"!==r&&function(t){e.d(n,t,(function(){return o[t]}))}(r);n["default"]=a.a},f25f:function(t,n,e){}},[["d7fc","common/runtime","common/vendor"]]]);