Merge branch 'yueyixin'
This commit is contained in:
commit
a090bc1dfd
|
|
@ -52,10 +52,7 @@ export interface EditUsernameParams {
|
|||
|
||||
// 验证码修改密码参数类型
|
||||
export interface UpdatePwdByCaptchaParams {
|
||||
reg_type: number
|
||||
email?: string
|
||||
mobile?: string
|
||||
mobile_area?: string
|
||||
verify_type: number
|
||||
code: string
|
||||
login_password1: string
|
||||
login_password2: string
|
||||
|
|
|
|||
|
|
@ -28,16 +28,13 @@ export interface RegisterParams {
|
|||
export interface ForgotPasswordParams {
|
||||
mobile?: string // 手机号(可选)
|
||||
email?: string // 邮箱(可选)
|
||||
reg_type: number // 1-邮箱登录 2-手机登录
|
||||
code: string
|
||||
login_password1: string
|
||||
login_password2: string
|
||||
}
|
||||
// 修改密码参数类型
|
||||
export interface ChangePasswordParams {
|
||||
mobile?: string // 手机号(可选)
|
||||
email?: string // 邮箱(可选)
|
||||
reg_type: number // 1-邮箱登录 2-手机登录
|
||||
verify_type: number // 1-邮箱登录 2-手机登录
|
||||
code: string
|
||||
login_password1: string
|
||||
login_password2: string
|
||||
|
|
@ -46,6 +43,5 @@ export interface ChangePasswordParams {
|
|||
export interface SendCodeParams {
|
||||
mobile?: string // 手机号(可选)
|
||||
email?: string // 邮箱(可选)
|
||||
reg_type: number // 1-邮箱登录 2-手机登录
|
||||
type: string // 验证码类型
|
||||
}
|
||||
|
|
@ -102,9 +102,11 @@ let dynamicRoutesReady = false
|
|||
router.beforeEach(async (to, _from) => {
|
||||
const userStore = useUserStore()
|
||||
const isLoggedIn = !!userStore.token
|
||||
const isRealNameVerified = userStore.userInfo?.real_check === 3
|
||||
|
||||
console.log('dynamicRoutesReady', dynamicRoutesReady)
|
||||
console.log('dynamicRoutesReady', userStore.userInfo)
|
||||
console.log('isLoggedIn', isLoggedIn)
|
||||
console.log('isRealNameVerified', isRealNameVerified)
|
||||
console.log('to.meta.requiresAuth', to.meta.requiresAuth)
|
||||
console.log('to.meta.isAuthPage', to.meta.isAuthPage)
|
||||
|
||||
|
|
@ -127,12 +129,27 @@ router.beforeEach(async (to, _from) => {
|
|||
}
|
||||
}
|
||||
|
||||
// 3. 已登录访问登录/注册页 → 首页
|
||||
// 3. 已登录但未完成实名认证 → 跳转到实名认证页面
|
||||
// 白名单:实名认证页面、活体认证页面、登录/注册页
|
||||
const authPages = ['/realName', '/livenessVerification', '/user/login', '/user/register', '/user/forgot-password']
|
||||
const isAuthPage = authPages.some(path => to.path.startsWith(path))
|
||||
|
||||
if (isLoggedIn && !isRealNameVerified && !isAuthPage) {
|
||||
// 已登录但未认证,访问非认证页面时重定向到实名认证
|
||||
return '/realName'
|
||||
}
|
||||
|
||||
// 4. 已登录访问登录/注册页 → 首页(如果已认证)或实名认证页(如果未认证)
|
||||
if (isLoggedIn && to.meta.isAuthPage) {
|
||||
return isRealNameVerified ? '/' : '/realName'
|
||||
}
|
||||
|
||||
// 5. 已完成认证的用户访问实名认证或活体认证页 → 首页
|
||||
if (isLoggedIn && isRealNameVerified && (to.path === '/realName' || to.path === '/livenessVerification')) {
|
||||
return '/'
|
||||
}
|
||||
|
||||
// 4. 其他情况正常放行
|
||||
// 6. 其他情况正常放行
|
||||
return true
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,23 @@ export const search = [
|
|||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
// 状态
|
||||
{ prop: 'status', label: '状态', type: 'select' as const, placeholder: '请选择状态', width: 100},
|
||||
// {
|
||||
// prop: 'status',
|
||||
// label: '状态',
|
||||
// type: 'select' as const,
|
||||
// options: [
|
||||
// {
|
||||
// label: '正常',
|
||||
// value: '1'
|
||||
// },
|
||||
// {
|
||||
// label: '封禁',
|
||||
// value: '2'
|
||||
// },
|
||||
// ],
|
||||
// placeholder: '请选择状态',
|
||||
// width: '100px'
|
||||
// },
|
||||
]
|
||||
|
||||
export const tableColumns = [
|
||||
|
|
|
|||
|
|
@ -289,7 +289,6 @@ const sendCodeApi = async (receiver: string) => {
|
|||
// 发送验证码参数
|
||||
const type = verifyForm.value.verifyType
|
||||
const params: any = {
|
||||
reg_type: userStore.userInfo!.reg_type,
|
||||
type: 'transfer_code',
|
||||
}
|
||||
if (type === 'email') {
|
||||
|
|
|
|||
|
|
@ -524,9 +524,7 @@ const handlePasswordConfirm = async () => {
|
|||
await passwordFormRef.value.validate();
|
||||
|
||||
const params: UpdatePwdByCaptchaParams = {
|
||||
reg_type: userStore.userInfo!.reg_type,
|
||||
email: passwordForm.verifyType === 'email' ? userInfo.email : undefined,
|
||||
mobile: passwordForm.verifyType === 'mobile' ? userInfo.mobile : undefined,
|
||||
verify_type: passwordForm.verifyType === 'email'?1:2,
|
||||
code: passwordForm.code,
|
||||
login_password1: passwordForm.login_password1,
|
||||
login_password2: passwordForm.login_password2
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export const clientSearch = [
|
|||
dateType: 'date' as const, // 时间范围选择器
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
// minWidth: '200px'
|
||||
width: '180px',
|
||||
width: '180',
|
||||
disabledDate
|
||||
},
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@ export const clientSearch = [
|
|||
dateType: 'date' as const, // 时间范围选择器
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
// minWidth: '200px'
|
||||
width: '180px',
|
||||
width: '180',
|
||||
disabledDate
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ const sendCodeApi = async () => {
|
|||
const sendParams = {
|
||||
email: changePasswordForm.value.email,
|
||||
mobile: changePasswordForm.value.phone,
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
type:'resetPass_code'
|
||||
}
|
||||
return userStore.sendCode(sendParams)
|
||||
|
|
@ -181,9 +180,7 @@ const handleChangePassword = async () => {
|
|||
|
||||
// 重置密码参数
|
||||
const changePasswordParams = {
|
||||
mobile: changePasswordForm.value.phone,
|
||||
email: changePasswordForm.value.email,
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
verify_type: activeTab.value === 'email' ? 1 : 2,
|
||||
code: changePasswordForm.value.code,
|
||||
login_password1: md5Encrypt(changePasswordForm.value.password),
|
||||
login_password2: md5Encrypt(changePasswordForm.value.confirmPassword),
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ const sendCodeApi = async () => {
|
|||
const sendParams = {
|
||||
email: forgotPasswordForm.value.email,
|
||||
mobile: forgotPasswordForm.value.phone,
|
||||
reg_type: getStorage('forgotType', 'session') === 'email' ? 1 : 2,
|
||||
type:'transfer_code'
|
||||
}
|
||||
return userStore.sendCode(sendParams)
|
||||
|
|
@ -274,11 +273,9 @@ const handleForgotPassword = async () => {
|
|||
await forgotPasswordFormRef.value.validateField(['password', 'confirmPassword'])
|
||||
|
||||
// 重置密码参数
|
||||
const getForgotType = getStorage('forgotType', 'session') || 'email'
|
||||
const forgotParams = {
|
||||
mobile: forgotPasswordForm.value.phone,
|
||||
email: forgotPasswordForm.value.email,
|
||||
reg_type: getForgotType === 'email' ? 1 : 2,
|
||||
code: forgotPasswordForm.value.code,
|
||||
// login_password1: md5Encrypt(forgotPasswordForm.value.password),
|
||||
// login_password2: md5Encrypt(forgotPasswordForm.value.confirmPassword),
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@ const sendCodeApi = async () => {
|
|||
email: registerForm.value.email,
|
||||
mobile: registerForm.value.countryCode + registerForm.value.phone,
|
||||
mobile_area: registerForm.value.countryCode,
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
type: 'reg_code',
|
||||
}
|
||||
return userStore.sendCode(sendParams)
|
||||
|
|
@ -225,6 +224,7 @@ const handleRegister = async () => {
|
|||
// 注册参数
|
||||
const registerParams = {
|
||||
email: registerForm.value.email,
|
||||
mobile_area: registerForm.value.countryCode,
|
||||
mobile: registerForm.value.countryCode + registerForm.value.phone,
|
||||
reg_type: activeTab.value === 'email' ? 1 : 2,
|
||||
invite_code: registerForm.value.inviteCode,
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ const sendCodeApi = async () => {
|
|||
// 发送验证码参数
|
||||
const sendParams = {
|
||||
email: bindEmailForm.value.email,
|
||||
reg_type: 1,
|
||||
type:'resetPass_code'
|
||||
}
|
||||
return userStore.sendCode(sendParams)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ const sendCodeApi = async () => {
|
|||
// 发送验证码参数
|
||||
const sendParams = {
|
||||
mobile: bindPhoneForm.value.phone,
|
||||
reg_type: 2,
|
||||
type: 'resetPass_code'
|
||||
}
|
||||
return userStore.sendCode(sendParams)
|
||||
|
|
|
|||
Loading…
Reference in New Issue