Merge branch 'yueyixin'

This commit is contained in:
2026-05-21 17:52:57 +08:00
commit a090bc1dfd
12 changed files with 71 additions and 56 deletions

View File

@ -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

View File

@ -27,17 +27,14 @@ export interface RegisterParams {
//忘记密码参数类型
export interface ForgotPasswordParams {
mobile?: string // 手机号(可选)
email?: string // 邮箱(可选)
reg_type: number // 1-邮箱登录 2-手机登录
email?: string // 邮箱(可选)
code: string
login_password1: string
login_password2: string
}
// 修改密码参数类型
export interface ChangePasswordParams {
mobile?: string // 手机号(可选)
email?: string // 邮箱(可选)
reg_type: number // 1-邮箱登录 2-手机登录
export interface ChangePasswordParams {
verify_type: number // 1-邮箱登录 2-手机登录
code: string
login_password1: string
login_password2: string
@ -45,7 +42,6 @@ export interface ChangePasswordParams {
// 发送验证码参数类型
export interface SendCodeParams {
mobile?: string // 手机号(可选)
email?: string // 邮箱(可选)
reg_type: number // 1-邮箱登录 2-手机登录
email?: string // 邮箱(可选)
type: string // 验证码类型
}

View File

@ -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
})

View File

@ -3,21 +3,37 @@ export const search = [
{ prop: 'accountName', label: '账号名称', type: 'input' as const, placeholder: '请输入账号名称', width: '150px' },
// 开始时间
{
prop: "startTime", label: '注册开始时间', type: 'date' as const, dateType: 'date' as const,placeholder: '请选择注册开始时间', width: '270px', // 时间范围选择器
prop: "startTime", label: '注册开始时间', type: 'date' as const, dateType: 'date' as const, placeholder: '请选择注册开始时间', width: '270px', // 时间范围选择器
valueFormat: 'YYYY-MM-DD',
},
// 结束时间
{
prop: "endTime", label: '注册结束时间', type: 'date' as const, dateType: 'date' as const,placeholder: '请选择注册结束时间', width: '270px', // 时间范围选择器
prop: "endTime", label: '注册结束时间', type: 'date' as const, dateType: 'date' as const, placeholder: '请选择注册结束时间', width: '270px', // 时间范围选择器
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 = [
// 账号名称
{ label: '账号名称', prop: 'accountName', },
{ label: '账号名称', prop: 'accountName', },
// 账号id
{ prop: 'userId', label: '账号id' },
// 状态
@ -27,34 +43,34 @@ export const tableColumns = [
// 账号数量
{ prop: 'accountQty', label: '账号数量', width: 100 },
// 点差分配比例
{ prop: 'marginRatio', label: '点差分配比例', slotName: 'marginRatio' , width: 140},
{ prop: 'marginRatio', label: '点差分配比例', slotName: 'marginRatio', width: 140 },
// 手续费分成比例
{ prop: 'commissionRatio', label: '手续费分成比例', slotName: 'commissionRatio' , width: 140},
{ prop: 'commissionRatio', label: '手续费分成比例', slotName: 'commissionRatio', width: 140 },
// 注册时间
{ prop: 'createTime', label: '注册时间', sortable: true , minWidth: 180},
{ prop: 'createTime', label: '注册时间', sortable: true, minWidth: 180 },
// 操作
{ label: '操作', slotName: 'action', width: 200}
{ label: '操作', slotName: 'action', width: 200 }
]
// 点差表格配置
export const marginRatioTableColumns = [
// 品种名称
{ prop: 'varietyName', label: '名称', align: 'center' as const },
// 品种编号
{ prop: 'varietyCode', label: '编号', align: 'center' as const },
// 可分配点差
{ prop: 'pointDifference', label: '可分配点差', align: 'center' as const },
// 已分配点差
{
prop: 'assignedPointDifference',
label: '已分配点差',
align: 'center' as const,
slotName: 'assignedPointDiff',
},
// 品种名称
{ prop: 'varietyName', label: '名称', align: 'center' as const },
// 品种编号
{ prop: 'varietyCode', label: '编号', align: 'center' as const },
// 可分配点差
{ prop: 'pointDifference', label: '可分配点差', align: 'center' as const },
// 已分配点差
{
prop: 'assignedPointDifference',
label: '已分配点差',
align: 'center' as const,
slotName: 'assignedPointDiff',
},
]
// 手续费分成比例form配置
export const commissionRatioFormItem = [
// 手续费分成比例
{ prop: 'commissionRatio', label: '手续费分成比例', type: 'input' as const, placeholder: '请输入手续费分成比例',labelWidth: '140px'},
{ prop: 'commissionRatio', label: '手续费分成比例', type: 'input' as const, placeholder: '请输入手续费分成比例', labelWidth: '140px' },
]

View File

@ -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') {

View File

@ -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

View File

@ -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
},
{

View File

@ -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)
@ -180,10 +179,8 @@ const handleChangePassword = async () => {
await changePasswordFormRef.value.validate();
//
const changePasswordParams = {
mobile: changePasswordForm.value.phone,
email: changePasswordForm.value.email,
reg_type: activeTab.value === 'email' ? 1 : 2,
const changePasswordParams = {
verify_type: activeTab.value === 'email' ? 1 : 2,
code: changePasswordForm.value.code,
login_password1: md5Encrypt(changePasswordForm.value.password),
login_password2: md5Encrypt(changePasswordForm.value.confirmPassword),

View File

@ -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)
@ -273,12 +272,10 @@ 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,
email: forgotPasswordForm.value.email,
code: forgotPasswordForm.value.code,
// login_password1: md5Encrypt(forgotPasswordForm.value.password),
// login_password2: md5Encrypt(forgotPasswordForm.value.confirmPassword),

View File

@ -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,

View File

@ -89,7 +89,6 @@ const sendCodeApi = async () => {
//
const sendParams = {
email: bindEmailForm.value.email,
reg_type: 1,
type:'resetPass_code'
}
return userStore.sendCode(sendParams)

View File

@ -99,7 +99,6 @@ const sendCodeApi = async () => {
//
const sendParams = {
mobile: bindPhoneForm.value.phone,
reg_type: 2,
type: 'resetPass_code'
}
return userStore.sendCode(sendParams)