diff --git a/src/config/env.development.js b/src/config/env.development.js index 5fdf3f0..a8001a7 100644 --- a/src/config/env.development.js +++ b/src/config/env.development.js @@ -3,8 +3,8 @@ module.exports = { env: 'development', title: 'e联社区', baseUrl: 'http://192.168.1.144/', // 项目地址 - // baseApi: 'http://192.168.1.144/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' - baseApi: 'http://219.146.91.110:30801/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' + baseApi: 'http://192.168.1.144/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' + // baseApi: 'http://219.146.91.110:30801/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' APPID: 'xxx', APPSECRET: 'xxx', } diff --git a/src/plugins/vant.js b/src/plugins/vant.js index 15af4b7..a6fa8e3 100644 --- a/src/plugins/vant.js +++ b/src/plugins/vant.js @@ -25,7 +25,7 @@ import { ActionSheet, Checkbox, CellGroup, - Form + Form, } from 'vant' Vue.use(Button) diff --git a/src/views/mine/changePassword.vue b/src/views/mine/changePassword.vue index 5d0fb83..61d3991 100644 --- a/src/views/mine/changePassword.vue +++ b/src/views/mine/changePassword.vue @@ -97,27 +97,24 @@ export default { if (this.errorMessages.oldPasswordError || this.errorMessages.newPasswordError || this.errorMessages.confirmPasswordError) { return; } - try { - let parms = { - oldPassword: encryptedData(this.pubKey, this.dataForm.oldPassword), - newPassword: encryptedData(this.pubKey, this.dataForm.newPassword), - confirmPassword: encryptedData(this.pubKey, this.dataForm.confirmPassword), - } - let { code, data, msg } = changePassword(parms); - console.log(code, data, msg); - if (code === 0) { - localStorage.setItem("token", data.token); - this.$router.replace({ name: 'mine' }); - } else { - throw new Error(msg); - } - } catch (error) { - console.log(error.message); + let parms = { + oldPassword: encryptedData(this.pubKey, this.dataForm.oldPassword), + newPassword: encryptedData(this.pubKey, this.dataForm.newPassword), + confirmNewPassword: encryptedData(this.pubKey, this.dataForm.confirmPassword), } + changePassword(parms).then(response => { + let { data, code, msg } = response; + if(code === 0){ + console.log('data111'); + this.$toast('修改成功!请重新登录'); + this.$router.replace({name:'login'}) + } + }).catch(error => { + console.error('Error:', error); + }); } } }; - \ No newline at end of file + \ No newline at end of file