qauMaWeb/node_modules/.cache/babel-loader/4aef077c8e3f7a9776deb907551...

1 line
10 KiB
JSON
Raw Normal View History

2024-10-13 18:02:27 +08:00
{"ast":null,"code":"import \"core-js/modules/es.string.trim.js\";\nimport \"core-js/modules/es.json.stringify.js\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport md5 from \"js-md5\";\nimport { toLoad } from \"../utils/initialize\";\nexport default {\n name: \"Person\",\n data: function data() {\n return {\n form: {},\n baseApi: this.$store.state.baseApi,\n user: localStorage.getItem(\"user\") ? JSON.parse(localStorage.getItem(\"user\")) : {},\n resetPsw: {\n newPassword: \"\",\n confirmPassword: \"\"\n }\n };\n },\n methods: {\n toResetPassword: function toResetPassword() {\n var _this = this;\n\n // 重置密码\n if (this.resetPsw.newPassword.trim() == \"\") {\n this.$message.error(\"新密码不能为空\");\n return;\n }\n\n if (this.resetPsw.confirmPassword != this.resetPsw.newPassword) {\n this.$message.error(\"两次密码不一致\");\n return;\n }\n\n this.request.get(\"/user/resetPassword?id=\" + this.user.id + \"&newPassword=\" + md5(this.resetPsw.newPassword)).then(function (res) {\n if (res.code === \"200\") {\n _this.$message.success(\"修改成功\");\n\n _this.resetPsw = {\n newPassword: \"\",\n confirmPassword: \"\"\n };\n } else {\n alert(res.msg);\n }\n });\n },\n //图片上传成功钩子\n handleAvatarSuccess: function handleAvatarSuccess(res) {\n this.imageUrl = res.data;\n this.form.avatarUrl = this.imageUrl;\n },\n //提交事件\n save: function save() {\n var _this2 = this;\n\n //把表格传给后台,保存到数据库\n this.request.post(\"/user\", this.form).then(function (res) {\n if (res.code === \"200\") {\n _this2.$message.success(\"保存成功\"); //把表格的数据更新到user中\n\n\n for (var key in _this2.form) {\n _this2.user[key] = _this2.form[key];\n } //更新localstorage的user\n\n\n localStorage.setItem(\"user\", JSON.stringify(_this2.user));\n\n _this2.$emit(\"refresh\");\n\n _this2.$router.go(0);\n } else {\n _this2.$message.error(res.msg);\n }\n });\n }\n },\n created: function created() {\n var _this3 = this;\n\n this.request.get(\"/userinfo/\" + this.user.username).then(function (res) {\n if (res.code === \"200\") {\n _this3.form = res.data;\n } else {\n alert(res.msg);\n }\n }); // this.form = this.user;\n },\n mounted: function mounted() {\n toLoad([\"商品分类\"]);\n },\n computed: {\n token: function token() {\n return {\n token: this.user.token\n };\n }\n }\n};","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA;AACA;AAEA;AACAA,gBADA;AAEAC,MAFA,kBAEA;AACA;AACAC,cADA;AAEAC,wCAFA;AAGAC,2CACAC,wCADA,GAEA,EALA;AAMAC;AACAC,uBADA;AAEAC;AAFA;AANA;AAWA,GAdA;AAeAC;AACAC,mBADA,6BACA;AAAA;;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA,mBACAC,GADA,CAEA,4BACA,YADA,GAEA,eAFA,GAGAC,8BALA,EAOAC,IAPA,CAOA;AACA;AACA;;AACA;AACAN,2BADA;AAEAC;AAFA;AAIA,SANA,MAMA;AACAM;AACA;AACA,OAjBA;AAkBA,KA7BA;AA8BA;AACAC,uBA/BA,+BA+BAC,GA/BA,EA+BA;AACA;AACA;AACA,KAlCA;AAmCA;AACAC,QApCA,kBAoCA;AAAA;;AACA;AACA;AACA;AACA,0CADA,CAEA;;;AACA;AACA;AACA,WALA,CAMA;;;AACAC;;AACA;;AACA;AACA,SAVA,MAUA;AACA;AACA;AACA,OAdA;AAeA;AArDA,GAfA;AAsEAC,SAtEA,qBAsEA;AAAA;;AACA;AACA;AACA;AACA,OAFA,MAEA;AACAL;AACA;AACA,KANA,EADA,CAQA;AACA,GA/EA;AAgFAM,SAhFA,qBAgFA;AACAC;AACA,GAlFA;AAmFAC;AACAC,SADA,mBACA;AACA;AAAAA;AAAA;AACA;AAHA;AAnFA","names":["name","data","form","baseApi","user","JSON","resetPsw","newPassword","confirmPassword","methods","toResetPassword","get","md5","then","alert","handl