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.
1 line
8.0 KiB
1 line
8.0 KiB
3 years ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-setting-setUserInfo"],{2129:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ApiPutUser=n.ApiGetCurrentUser=void 0;var a=t("5767"),r="/uc",u=function(){return(0,a.ToAsyncAwait)(a.MsbRequestTk.get("".concat(r,"/user/current")))};n.ApiGetCurrentUser=u;var s=function(e){return(0,a.ToAsyncAwait)(a.MsbRequestTk.put("".concat(r,"/user/"),e))};n.ApiPutUser=s},"49d1":function(e,n,t){"use strict";t.r(n);var a=t("76ae"),r=t.n(a);for(var u in a)"default"!==u&&function(e){t.d(n,e,(function(){return a[e]}))}(u);n["default"]=r.a},"69cc":function(e,n,t){var a=t("793c");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=t("4f06").default;r("eb0aac14",a,!0,{sourceMap:!1,shadowMode:!1})},"6da9":function(e,n,t){"use strict";t.r(n);var a=t("bff1"),r=t("49d1");for(var u in r)"default"!==u&&function(e){t.d(n,e,(function(){return r[e]}))}(u);t("adf2"),t("9da2");var s,o=t("f0c5"),c=Object(o["a"])(r["default"],a["b"],a["c"],!1,null,"054f85a6",null,!1,a["a"],s);n["default"]=c.exports},7084:function(e,n,t){e.exports=t.p+"static/img/tx.71ed472a.png"},"745a":function(e,n,t){var a=t("e8de");"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=t("4f06").default;r("7efac475",a,!0,{sourceMap:!1,shadowMode:!1})},"76ae":function(e,n,t){"use strict";var a=t("4ea4");t("99af"),t("7db0"),t("c740"),t("ac1f"),t("1276"),Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(t("5530"));t("96cf");var u=a(t("1da1")),s=a(t("359f")),o=a(t("f196")),c=(t("5767"),t("2129")),i=t("ed1e"),f={components:{UiCell:o.default,UiButton:s.default},data:function(){return{sexShow:!1,sexData:[[{label:"女",val:2},{label:"男",val:1}]]}},computed:{userInfo:function(){return this.$store.state.userInfo},sexName:function(){var e=this,n=this.sexData[0].find((function(n){return n.val===e.userInfo.gender}));return n?n.label:"未知"},sexDefault:function(){var e=this.userInfo.gender||1;return[this.sexData[0].findIndex((function(n){return n.val===e}))]}},onShow:function(){},methods:{sexChange:function(e){var n=this;return(0,u.default)(regeneratorRuntime.mark((function t(){var a,u,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.value[0],a=a?a.val:n.sexData[0][0].val,t.next=4,(0,c.ApiPutUser)({gender:a});case 4:if(u=t.sent,s=u.error,u.result,!s){t.next=10;break}return ui.$u.totas(s.message),t.abrupt("return",!1);case 10:n.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},n.userInfo),{},{gender:a})),n.sexShow=!1;case 12:case"end":return t.stop()}}),t)})))()},getOssCon:function(){return(0,u.default)(regeneratorRuntime.mark((function e(){var n,t,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,i.ApiPostGetOssConfig)({configId:"account-avatar/",serviceName:"uc"});case 2:if(n=e.sent,t=n.error,a=n.result,!t){e.next=8;break}return uni.$u.toast(t.message),e.abrupt("return",!1);case 8:return e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})))()},updateAvatar:function(e){var n=this;return(0,u.default)(regeneratorRuntime.mark((function t(){var a,s,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.file,s=a.url.split("/"),o=a.name||s[s.length-1],t.next=5,n.getOssCon();case 5:i=t.sent,uni.uploadFile({name:"file",filePath:a.url,url:i.host,formData:{name:o,key:"".concat(i.dir,"${filename}"),policy:i.policy,OSSAccessKeyId:i.accessId,success_action_status:200,signature:i.signature},success:function(){var e=(0,u.default)(regeneratorRuntime.mark((function e(t){var a,u,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a="".concat(i.host,"/").concat(i.dir).concat(o),e.next=3,(0,c.ApiPutUser)({avatar:a});case 3:if(u=e.sent,s=u.error,u.result,!s){e.next=9;break}return ui.$u.totas(s.message),e.abrupt("return",!1);case 9:n.$store.commit("SET_USER_INFO",(0,r.default)((0,r.default)({},n.userInfo),{},{avatar:a}));case 10:case"end":return e.stop()}}),e
|