diff --git a/pages/me/aboutUs.vue b/pages/me/aboutUs.vue
index c648d0a..7f3e1c7 100644
--- a/pages/me/aboutUs.vue
+++ b/pages/me/aboutUs.vue
@@ -5,9 +5,8 @@
- {{ i18n.Consulting }}
- A Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
- Ipsum has been the industry's standard dummy text ever since the 1500s,
+ {{ item.title }}
+
diff --git a/pages/me/changeLoginPassword.vue b/pages/me/changeLoginPassword.vue
index d7c98ab..8c38316 100644
--- a/pages/me/changeLoginPassword.vue
+++ b/pages/me/changeLoginPassword.vue
@@ -6,12 +6,14 @@
-
-
-
-
+
+
+
+
{{ i18n.Confirm }}
@@ -25,10 +27,13 @@ export default {
name: "changeLoginPassword",
data() {
return {
- oldPassword: '',
- password: '',
- confirmPassword:'',
+ oldPassword: '',
+ password: '',
+ confirmPassword:'',
+
disabled: true,
+ // 密码格式对不对
+ isCanPassword: false,
};
},
computed: {
@@ -36,11 +41,58 @@ export default {
return this.$t("me");
},
},
+ watch: {
+ 'password': {
+ handler(newValue) {
+ const numberReg = /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[A-Za-z0-9 _]{6,20}$/
+ this.isCanPassword = numberReg.test(newValue)
+ }
+ },
+ },
onLoad() {
},
onShow() { },
methods: {
-
+ // 输入密码
+ changePassword() {
+ if (!this.password) {
+ uni.$u.toast(this.$t("login").passwordInputMessage)
+ return
+ }
+ if (!this.isCanPassword) {
+ let message = this.$t("login").passwordRule
+ uni.$u.toast(message)
+ return
+ }
+ // 验证重复输入的密码
+ if (this.password !== this.confirmPassword) {
+ uni.$u.toast(this.$t("login").passwordConfirm)
+ return
+ }
+
+ if (!this.oldPassword) {
+ uni.$u.toast(this.$t("login").PleaseEnterTheOldPassword)
+ return
+ }
+ let userInfo = {
+ oldPassword:md5(this.oldPassword),
+ password: md5(this.password),
+ confirmPassword: md5(this.confirmPassword),
+ }
+ api.updatePassword(userInfo).then(res => {
+ setTimeout(() => {
+ uni.showToast({
+ title: this.$t("me").ModifiedSuccessfully
+ })
+ }, 600)
+ uni.setStorageSync('ticket',null)
+ uni.reLaunch({
+ url: '/pages/login/index'
+ })
+ })
+
+
+ },
},
}
diff --git a/utils/api.js b/utils/api.js
index 3de8b17..c4b478e 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -84,7 +84,7 @@ const api = {
aboutus: (params) => Vue.prototype.$axios.post('/api/index/aboutus',params),//关于我们
loginOut: (params) => Vue.prototype.$axios.post('/api/user/loginOut',params),//退出登录
forgotPassword: (params) => Vue.prototype.$axios.post('/api/user/forgotPassword',params),//忘记密码
- updatePassword: () => Vue.prototype.$axios.get('/api/user/updatePassword'),//修改登录密码
+ updatePassword: (params) => Vue.prototype.$axios.post('/api/user/updatePassword',params),//修改登录密码
userAccount: (params) => Vue.prototype.$axios.post('/api/user/userAccount',params),//用户余额信息
bankCardInfo: (params) => Vue.prototype.$axios.post('/api/user/bankCardInfo',params),//获取银行卡信息
bindBank: (params) => Vue.prototype.$axios.post('/api/user/bindBank',params),//绑定/修改银行卡
diff --git a/utils/axios.js b/utils/axios.js
index 05fb449..4e22068 100644
--- a/utils/axios.js
+++ b/utils/axios.js
@@ -41,7 +41,9 @@ service.interceptors.request.use(
const ticket = uni.getStorageSync('ticket')
if (ticket) {
- config.data = {};
+ if(!config.data){
+ config.data = {};
+ }
config.data['ticket'] = ticket
}
if (Vue.prototype.$showDialog) {
@@ -71,7 +73,6 @@ service.interceptors.request.use(
}
//console.log(config.url,111111,config.data,dataStr)
config.data = {};
-
dataStr.forEach(function(e) {
config.data[e.split('=')[0]] = e.split('=')[1];
});
diff --git a/utils/language/en_US.js b/utils/language/en_US.js
index b59a52d..7aafc6d 100644
--- a/utils/language/en_US.js
+++ b/utils/language/en_US.js
@@ -327,6 +327,7 @@ export default {
isLogOut:'Are you sure you want to log out?',
account: 'account',
Recharge: 'Recharge',
+ confirmPassword: 'Confirm Password',
Withdrawal: 'Withdrawal',
Transfer: 'Transfer',
Balance: 'Balance(U)',
@@ -361,7 +362,7 @@ export default {
Cancel: 'Cancel',
ModifyWithdrawalPassword: 'Modify Withdrawal Password',
CreateNewPassword: 'Create new password',
-
+ ModifiedSuccessfully:'Modified successfully',
Fresh: 'Fresh',
Release: 'Release',
@@ -380,9 +381,6 @@ export default {
TransferNumber: 'Transfer number',
PleaseEnterNumber: 'Please enter number',
Usable: 'Usable :',
-
ALL: 'ALL',
-
- Consulting:'Consulting',
}
}