Browse Source

2024.03.12
- 代码完善

zweiqin 1 year ago
parent
commit
5ddefa9338
4 changed files with 15 additions and 11 deletions
  1. 3 0
      api/anotherTFInterface/index.js
  2. 6 6
      pages/login/login.vue
  3. 4 4
      pages/login/register.vue
  4. 2 1
      store/modules/auth.js

+ 3 - 0
api/anotherTFInterface/index.js

@@ -72,3 +72,6 @@ export const getUserInfoApi = (data) => AnotherTFRequest('/user/getUser', data)
 
 // 个人系信息修改
 export const updateUserInfoApi = (data) => AnotherTFRequest('/user/update', data, 'POST')
+
+// 重置密码
+export const updateForgetPasswordUserApi = (data) => AnotherTFRequest('/user/forgetPassword', data, 'POST')

+ 6 - 6
pages/login/login.vue

@@ -118,7 +118,7 @@
 				<tui-input v-model="resettingFormData.phone" label="手机号" type="number" placeholder="请输入手机号"></tui-input>
 				<tui-input v-model="resettingFormData.password" label="密码" type="password" placeholder="请输入密码"></tui-input>
 				<tui-input
-					v-model="resettingFormData.passwordAgain" label="确认密码" type="password"
+					v-model="resettingFormData.newPassword" label="确认密码" type="password"
 					placeholder="请再次输入密码"
 				></tui-input>
 				<tui-input v-model="resettingFormData.verificationCode" label="验证码" type="number" placeholder="请输入验证码">
@@ -137,7 +137,7 @@
 <script>
 import { mapGetters } from 'vuex'
 import { T_REDIRECT_TYPE, USER_ID, T_STORAGE_KEY } from '../../constant'
-import { getVerifyCodeApi, updatePasswordUserApi } from '../../api/anotherTFInterface'
+import { getVerifyCodeApi, updateForgetPasswordUserApi } from '../../api/anotherTFInterface'
 import { CHANGE_IS_IN_MINIPROGRAM } from '../../store/modules/type'
 import { getUrlCode } from '../../utils'
 
@@ -154,7 +154,7 @@ export default {
 			resettingFormData: {
 				phone: '',
 				password: '',
-				passwordAgain: '',
+				newPassword: '',
 				verificationCode: ''
 			},
 			isShowResettingPasswordDialog: false
@@ -274,11 +274,11 @@ export default {
 				if (!this.resettingFormData.phone) return this.$showToast('请填写手机号')
 				if (!this.resettingFormData.verificationCode) return this.$showToast('请填写验证码')
 				if (!this.resettingFormData.password) return this.$showToast('请设置密码!')
-				if (this.resettingFormData.password !== this.resettingFormData.passwordAgain) return this.$showToast('密码不一致')
+				if (this.resettingFormData.password !== this.resettingFormData.newPassword) return this.$showToast('密码不一致')
 				uni.showLoading({
 					title: '操作中'
 				})
-				updatePasswordUserApi({ ...this.resettingFormData })
+				updateForgetPasswordUserApi({ ...this.resettingFormData })
 					.then(({ data }) => {
 						uni.hideLoading()
 						this.$showToast('重置成功')
@@ -290,7 +290,7 @@ export default {
 			this.resettingFormData.phone = ''
 			this.resettingFormData.verificationCode = ''
 			this.resettingFormData.password = ''
-			this.resettingFormData.passwordAgain = ''
+			this.resettingFormData.newPassword = ''
 			this.isShowResettingPasswordDialog = false
 		}
 	}

+ 4 - 4
pages/login/register.vue

@@ -37,7 +37,7 @@
 				</view>
 				<view class="formItem">
 					<tui-input
-						v-model="registerQuery.passwordAgain" placeholder-class="inputs" type="password"
+						v-model="registerQuery.newPassword" placeholder-class="inputs" type="password"
 						border-color="#EA5B1D" placeholder="请再次确认密码" :border-top="false" color="#222229"
 						clearable
 						size="34"
@@ -48,7 +48,7 @@
 		</view>
 		<button
 			class="loginBtn"
-			:class="{ disbleds: !!(registerQuery.password && registerQuery.passwordAgain && registerQuery.phone && registerQuery.verificationCode) }"
+			:class="{ disbleds: !!(registerQuery.password && registerQuery.newPassword && registerQuery.phone && registerQuery.verificationCode) }"
 			@click="addAcount"
 		>
 			确定
@@ -108,7 +108,7 @@ export default {
 		return {
 			registerQuery: {
 				password: '',
-				passwordAgain: '',
+				newPassword: '',
 				phone: '',
 				verificationCode: ''
 			},
@@ -155,7 +155,7 @@ export default {
 					msg: ['请输入密码', '密码为8~20位英文和数字组合']
 				},
 				{
-					name: 'passwordAgain',
+					name: 'newPassword',
 					rule: ['required', 'isSame:password'],
 					msg: ['请再次确认密码', '两次密码不一致']
 				}

+ 2 - 1
store/modules/auth.js

@@ -79,7 +79,8 @@ export default {
 					headImage: '',
 					code: ''
 				}
-				if (loginData.terminal === 3) {
+				if ((loginData.terminal === 6) || (loginData.terminal === 3)) {
+					loginData.terminal = 3
 					const appid = 'wxb19ccb829623be12' // 团蜂wxb19ccb829623be12,新巨蜂wx603b04a561e4683e,别的wxdf390bb4f8a67641
 					const local = store.state.app.isInMiniProgram ? `${A_TF_MAIN}/#${pageUrl || '/pages/login/login'}?miniProgram=1` : `${A_TF_MAIN}/#${pageUrl || '/pages/login/login'}`
 					const code = getUrlCode().code