edit.js 3.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["my/edit/edit"],{"0e8e":function(e,t,n){"use strict";(function(e){var a=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("8a83"),c=a(n("a820")),i=n("2a1c"),s={data:function(){return{headImg:"",defaultImg:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fci.xiaohongshu.com%2Fc34b7b74-ba38-0456-982a-43c0f97522fe%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fci.xiaohongshu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1693532127&t=a2e186c12aecaab7723611cb52a6778f",userId:"",userInfo:null}},methods:{chooseHead:function(){var t=this;e.chooseImage({count:1,success:function(n){console.log(n),(0,o.uploadImg)({fineName:n.tempFilePaths[0].substr(n.tempFilePaths[0].lastIndexOf("/")+1)}).then((function(a){if("Success"==a.state){var s=new Date;s.setHours(s.getHours()+1);var u={expiration:s.toISOString(),conditions:[["content-length-range",0,1073741824]]},r=(n.tempFilePaths[0].substr(n.tempFilePaths[0].lastIndexOf("/")+1),"http://"+a.content.bucket+"."+a.content.endPoint),f=i.Base64.encode(JSON.stringify(u)),l=c.default.enc.Base64.stringify(c.default.HmacSHA1(f,a.content.token.accessKeySecret)),d=n.tempFilePaths[0],g=a.content.paths[0];e.uploadFile({url:r,filePath:d,name:"file",formData:{key:g.join("/"),policy:f,success_action_status:"200",OSSAccessKeyId:a.content.token.accessKeyId,signature:l,"x-oss-security-token":a.content.token.securityToken},success:function(n){200===n.statusCode&&(console.log("上传成功"),(0,o.finishUploadImg)([{path:a.content.paths[0]}]).then((function(n){t.headImg=r+"/"+g.join("/");var a=JSON.parse(e.getStorageSync("userInfo"));a.imgPath=t.headImg,e.getStorageSync("userInfo",JSON.stringify(a))})))},fail:function(e){console.log(e)}})}}))}})},loginOut:function(){var t=e.getStorageSync("location"),n=e.getStorageSync("goodsTypeObj"),a=e.getStorageSync("inviteCode");e.clearStorageSync(),e.setStorageSync("location",t),e.setStorageSync("goodsTypeObj",n),e.setStorageSync("inviteCode",a),e.switchTab({url:"/pages/index/index"})}},created:function(){this.userInfo=JSON.parse(e.getStorageSync("userInfo")),this.headImg=this.userInfo.imgPath||"",this.userId=this.userInfo.userId||""}};t.default=s}).call(this,n("543d")["default"])},"1d18":function(e,t,n){"use strict";var a=n("d4cc"),o=n.n(a);o.a},"58b7":function(e,t,n){"use strict";n.r(t);var a=n("0e8e"),o=n.n(a);for(var c in a)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(c);t["default"]=o.a},cfa9:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return a}));var a={uCell:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-cell/u-cell")]).then(n.bind(null,"e8c3"))}},o=function(){var e=this.$createElement;this._self._c},c=[]},d4cc:function(e,t,n){},e8d8:function(e,t,n){"use strict";(function(e,t){var a=n("4ea4");n("b7d7");a(n("66fd"));var o=a(n("ea5e"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},ea5e:function(e,t,n){"use strict";n.r(t);var a=n("cfa9"),o=n("58b7");for(var c in o)["default"].indexOf(c)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(c);n("1d18");var i=n("f0c5"),s=Object(i["a"])(o["default"],a["b"],a["c"],!1,null,"0b350bf4",null,!1,a["a"],void 0);t["default"]=s.exports}},[["e8d8","common/runtime","common/vendor"]]]);