功能:完善登录安全与客服手动下单
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Form, Input, Button, Typography, message, Space, Tag } from 'antd'
|
||||
import { Form, Input, Button, Typography, message, Space } from 'antd'
|
||||
import { UserOutlined, LockOutlined, RightOutlined } from '@ant-design/icons'
|
||||
import { useAuth } from '../store/auth'
|
||||
|
||||
@@ -23,11 +23,6 @@ export default function Login() {
|
||||
}
|
||||
}
|
||||
|
||||
const fillCredentials = (user: string, pass: string) => {
|
||||
form.setFieldsValue({ username: user, password: pass })
|
||||
message.info(`已填入账号: ${user}`)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="login-wrapper">
|
||||
<div className="login-card">
|
||||
@@ -46,7 +41,6 @@ export default function Login() {
|
||||
form={form}
|
||||
layout="vertical"
|
||||
onFinish={onFinish}
|
||||
initialValues={{ username: 'admin', password: 'admin123' }}
|
||||
requiredMark={false}
|
||||
>
|
||||
<Form.Item
|
||||
@@ -97,33 +91,10 @@ export default function Login() {
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
{/* 快捷测试账号填充 */}
|
||||
<div
|
||||
style={{
|
||||
padding: '12px 14px',
|
||||
borderRadius: 8,
|
||||
background: 'rgba(255, 255, 255, 0.04)',
|
||||
border: '1px solid rgba(255, 255, 255, 0.08)',
|
||||
}}
|
||||
>
|
||||
<div style={{ fontSize: 12, color: '#94a3b8', marginBottom: 8, textAlign: 'center' }}>
|
||||
快速体验(演示账号列表):
|
||||
</div>
|
||||
<Space style={{ width: '100%', justifyContent: 'center' }} wrap>
|
||||
<Tag
|
||||
color="blue"
|
||||
style={{ cursor: 'pointer', padding: '4px 10px', borderRadius: 4 }}
|
||||
onClick={() => fillCredentials('admin', 'admin123')}
|
||||
>
|
||||
管理员 (admin)
|
||||
</Tag>
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
<Typography.Paragraph
|
||||
style={{ fontSize: 12, margin: 0, textAlign: 'center', color: '#64748b' }}
|
||||
>
|
||||
商户账号与成员密钥请联系平台管理员统一配置与创建
|
||||
请使用平台管理员或商户负责人分配的账号登录
|
||||
</Typography.Paragraph>
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
@@ -294,25 +294,18 @@ export default function MerchantCenter({ fixedTab, title = '商户中心' }: Mer
|
||||
})
|
||||
}, [loadWallet, merchantPermissions, walletFilterForm])
|
||||
|
||||
const newManualClientOrderNo = () => {
|
||||
const suffix = window.crypto?.randomUUID?.().replaceAll('-', '') || `${Date.now()}${Math.random().toString(36).slice(2)}`
|
||||
return `manual-${suffix.slice(0, 32)}`
|
||||
}
|
||||
|
||||
const openManualOrderCreate = () => {
|
||||
manualOrderForm.resetFields()
|
||||
manualOrderForm.setFieldsValue({
|
||||
client_order_no: newManualClientOrderNo(),
|
||||
quantity: 1,
|
||||
})
|
||||
setManualOrderOpen(true)
|
||||
setManualOrderProductsLoading(true)
|
||||
merchantApi.products({ page: 1, size: 100 })
|
||||
merchantApi.manualOrderProducts()
|
||||
.then((data) => {
|
||||
const activeProducts = (data.list || []).filter((item) => item.status === 'active')
|
||||
setManualOrderProducts(activeProducts)
|
||||
if (activeProducts.length > 0) {
|
||||
manualOrderForm.setFieldsValue({ sku: activeProducts[0].sku })
|
||||
setManualOrderProducts(data || [])
|
||||
if (data.length > 0) {
|
||||
manualOrderForm.setFieldsValue({ sku: data[0].sku })
|
||||
} else {
|
||||
message.warning('没有可用商品')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user