Xiao_123 1 mese fa
parent
commit
b92d33899c
5 ha cambiato i file con 90 aggiunte e 2 eliminazioni
  1. 13 0
      api/enterprise.js
  2. 6 0
      pages.json
  3. 1 0
      pages/index/my.vue
  4. 2 2
      pages/register/contact.vue
  5. 68 0
      pagesA/editPassword/index.vue

+ 13 - 0
api/enterprise.js

@@ -113,4 +113,17 @@ export const getEnterpriseRegisterApply = (email) => {
       auth: false
     }
   })
+}
+
+// 重置密码
+export const entUpdatePassword = (data) => {
+  return request({
+    url: '/app-api/menduner/system/recruit/user/update-password',
+    method: 'PUT',
+    data,
+    custom: {
+      showLoading: false,
+      auth: true
+    }
+  })
 }

+ 6 - 0
pages.json

@@ -100,6 +100,12 @@
 					"style": {
 						"navigationBarTitleText": "简历管理"
 					}
+				},
+				{
+					"path": "editPassword/index",
+					"style": {
+						"navigationBarTitleText": "修改登录密码"
+					}
 				}
 			]
 		},

+ 1 - 0
pages/index/my.vue

@@ -81,6 +81,7 @@ const popup = ref()
 const defaultList = [
 	{ title: '简历管理', path: '/pagesA/resume/index' },
 	{ title: '面试管理', path: '/pagesA/interview/index' },
+	{ title: '修改密码', path: '/pagesA/editPassword/index' },
 	{ title: '联系我们', path: '/pagesB/contactUs/index' },
 	{ title: '协议中心', path: '/pagesB/agreement/index', open: true },
 	{ title: '我要求职', appId: 'wx5dd538ccc752b03a' },

+ 2 - 2
pages/register/contact.vue

@@ -19,10 +19,10 @@
 					<uni-easyinput v-model="val.email" placeholder="请输入企业邮箱(用于日后“登录邮箱”)"></uni-easyinput>
 				</uni-forms-item>
 				<uni-forms-item name="password" label="账户登录密码" required>
-					<uni-easyinput v-model="val.password" placeholder="请输入"></uni-easyinput>
+					<uni-easyinput v-model="val.password" placeholder="请输入" type="password"></uni-easyinput>
 				</uni-forms-item>
 				<uni-forms-item name="passwordConfirm" label="密码二次确认" required>
-					<uni-easyinput v-model="val.passwordConfirm" placeholder="请输入"></uni-easyinput>
+					<uni-easyinput v-model="val.passwordConfirm" placeholder="请输入" type="password"></uni-easyinput>
 				</uni-forms-item>
 			</uni-forms>
 		</view>

+ 68 - 0
pagesA/editPassword/index.vue

@@ -0,0 +1,68 @@
+<template>
+	<view style="padding: 30rpx;">
+		<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" validateTrigger="bind" label-width="80px" label-align="right" label-position="left">
+			<uni-forms-item name="password" label="新密码" required>
+				<uni-easyinput v-model="formData.password" type="password" placeholder="请输入新密码"></uni-easyinput>
+			</uni-forms-item>
+			<uni-forms-item name="passwordConfirm" label="二次确认" required>
+				<uni-easyinput v-model="formData.passwordConfirm" type="password" placeholder="请再次输入新密码"></uni-easyinput>
+			</uni-forms-item>
+		</uni-forms>
+
+		<button class="send-button" @tap="handleSubmit">提 交</button>
+	</view>
+</template>
+
+<script setup>
+import { ref, unref } from 'vue'
+import { password } from '@/utils/validate'
+import { userStore } from '@/store/user'
+import { entUpdatePassword } from '@/api/enterprise'
+
+const user = userStore()
+const formRef = ref(null)
+const formData = ref({
+	id: user?.userInfo?.id,
+	password: null,
+	passwordConfirm: null
+})
+const formRules = {
+	password,
+	passwordConfirm: {
+		rules: [
+			{ required: true, errorMessage: '请再次输入密码' },
+			{ 
+				validateFunction: function(rule, value, data, callback) {
+					if (value !== data.password) callback('两次输入的密码不一致')
+					return true
+				}
+			}
+		]
+	}
+}
+
+// 提交
+const handleSubmit = async () => {
+	const valid = await unref(formRef).validate()
+	if (!valid) return
+
+	uni.showLoading({ title: '提交中' })
+	try {
+		await entUpdatePassword(formData.value)
+		uni.hideLoading()
+		uni.showToast({
+			title: '修改成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch {
+		uni.hideLoading()
+	}
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>