feat(dealer): 优化经销商相关功能与代码细节
- 移除客户添加表单中公司名称输入框的maxLength限制 - 更新联系方式1标签为联系方式 - 在提现管理中引入Image组件并替换原生img标签 - 实现上传打款凭证的新逻辑,支持选择和上传图片 - 配置开发环境API基础URL为本地地址 - 修改订单查询条件,管理员可查看所有用户订单 - 注释掉不再使用的getResourceId方法 - 启用request.ts中的本地开发环境baseUrl配置
This commit is contained in:
@@ -63,18 +63,22 @@ const DealerOrder: React.FC = () => {
|
||||
} else {
|
||||
setLoadingMore(true)
|
||||
}
|
||||
console.log(selectedUserId, selectedFirstUserId, selectedSecondUserId,'selectedUserIds...')
|
||||
|
||||
let where = {
|
||||
userId: selectedUserId,
|
||||
firstUserId: selectedSecondUserId,
|
||||
secondUserId: selectedSecondUserId,
|
||||
isInvalid: 0,
|
||||
isSettled: 1,
|
||||
resourceId: getResourceId(),
|
||||
resourceId: user?.userId,
|
||||
month: date,
|
||||
page,
|
||||
limit: 10
|
||||
};
|
||||
if (hasRole('superAdmin') || hasRole('admin')) {
|
||||
console.log('>>>>>>>>>>>>是管理员')
|
||||
where = {...where, resourceId: undefined}
|
||||
}
|
||||
if(selectedUserId){
|
||||
where = {...where,userId: selectedUserId}
|
||||
}
|
||||
@@ -127,14 +131,15 @@ const DealerOrder: React.FC = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const getResourceId = () => {
|
||||
if (hasRole('superAdmin')) {
|
||||
return undefined
|
||||
}
|
||||
if (hasRole('admin')) {
|
||||
return user?.userId
|
||||
}
|
||||
}
|
||||
// const getResourceId = () => {
|
||||
// if (hasRole('superAdmin')) {
|
||||
// return undefined
|
||||
// }
|
||||
// if (hasRole('admin')) {
|
||||
// return user?.userId
|
||||
// }
|
||||
// return user?.userId;
|
||||
// }
|
||||
|
||||
// 检查是否有特定角色
|
||||
const hasRole = (roleCode: string) => {
|
||||
|
||||
Reference in New Issue
Block a user