|
@@ -2,24 +2,26 @@
|
|
|
<view class="u-page content">
|
|
|
<u-icon class="back-btn" name="arrow-left" color="black" size="20" @click="navBack"></u-icon>
|
|
|
<view class="wrapper">
|
|
|
- <h2 class="Semibold">重置密码</h2>
|
|
|
+ <h2 class="Semibold">重置密码</h2>
|
|
|
<u--form labelPosition="left" :model="registerData" ref="registerForm" labelWidth="80">
|
|
|
<u-form-item label="手机号" prop="phone" borderBottom>
|
|
|
- <u--input v-model="registerData.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
|
|
+ <u--input v-model="registerData.phone" border="none" maxlength="11" placeholder="请输入手机号码">
|
|
|
+ </u--input>
|
|
|
</u-form-item>
|
|
|
-
|
|
|
- <u-form-item label="验证码" prop="code"borderBottom>
|
|
|
+
|
|
|
+ <u-form-item label="验证码" prop="code" borderBottom>
|
|
|
<u--input v-model="registerData.verifyCode" border="none" placeholder="请填写验证码"></u--input>
|
|
|
- <button :disabled="disabled1" class="code-style code-small" @tap="getCode">{{tips}}</button>
|
|
|
+ <button :disabled="disabled1" class="code-style code-small" @tap="getCode">{{tips}}</button>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="新密码" prop="password" borderBottom>
|
|
|
<u--input v-model="registerData.password" border="none" placeholder="请输入新密码,6-16位字符"></u--input>
|
|
|
</u-form-item>
|
|
|
-
|
|
|
- <u-code ref="uCode" @change="codeChange" seconds="60" @start="disabled1 = true" @end="disabled1 = false">
|
|
|
+
|
|
|
+ <u-code ref="uCode" @change="codeChange" seconds="60" @start="disabled1 = true"
|
|
|
+ @end="disabled1 = false">
|
|
|
</u-code>
|
|
|
</u--form>
|
|
|
- <button class="code-style reset">重置密码</button>
|
|
|
+ <button class="code-style reset" @click="reset">重置密码</button>
|
|
|
</view>
|
|
|
|
|
|
|
|
@@ -124,39 +126,39 @@
|
|
|
//修改密码
|
|
|
reset() {
|
|
|
uni.showLoading({
|
|
|
- title: '加载中1'
|
|
|
+ title: '加载中'
|
|
|
})
|
|
|
this.$refs.registerForm.validate().then(res => {
|
|
|
uni.$u.toast('校验通过')
|
|
|
_this.isLoading = true
|
|
|
_this.registerData.identification = 2
|
|
|
_this.$request.baseRequest('post', '/commonUser/resetPassword', _this.registerData).then(
|
|
|
- res => {
|
|
|
- // 获得数据
|
|
|
- if (res.code == 200) {
|
|
|
- uni.clearStorageSync();
|
|
|
- this.$request.baseRequest('post', '/auth/api/logout').then(res => {
|
|
|
-
|
|
|
- })
|
|
|
- this.$store.commit('logout')
|
|
|
- // this.$api.logout()
|
|
|
+ res => {
|
|
|
+ // 获得数据
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.clearStorageSync();
|
|
|
+ this.$request.baseRequest('post', '/auth/api/logout').then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ this.$store.commit('logout')
|
|
|
+ // this.$api.logout()
|
|
|
uni.showToast({
|
|
|
title: '修改成功',
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/public/login`
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/public/login`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "系统异常或验证码已过期,请退出重试",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.hideLoading()
|
|
|
})
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: "系统异常或验证码已过期,请退出重试",
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message)
|
|
|
});
|
|
@@ -199,15 +201,18 @@
|
|
|
background: #2772FB;
|
|
|
color: white;
|
|
|
}
|
|
|
- .reset{
|
|
|
+
|
|
|
+ .reset {
|
|
|
margin-top: 50rpx;
|
|
|
}
|
|
|
- .Semibold{
|
|
|
+
|
|
|
+ .Semibold {
|
|
|
margin-bottom: 50rpx;
|
|
|
}
|
|
|
- .code-small{
|
|
|
- width:200rpx;
|
|
|
- height:60rpx;
|
|
|
- font-size:24rpx;
|
|
|
+
|
|
|
+ .code-small {
|
|
|
+ width: 200rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
}
|
|
|
</style>
|