上传代码

This commit is contained in:
sunyu
2025-04-14 09:18:42 +08:00
parent 8e0732bddb
commit a1122897f8
5 changed files with 586 additions and 101 deletions

View File

@ -109,17 +109,336 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const userData: any = getSessionUserData();//当前登录人信息
useEffect(() => {
if (getSessionRoleData()?.roleId) {
let params = {
roleIdList: [getSessionRoleData()?.roleId]
// let params = {
// roleIdList: [getSessionRoleData()?.roleId]
// }
const res = {
"code": "1",
"success": true,
"message": "操作成功",
"data": [
{
"menuId": "2",
"path": "",
"name": "我的工作台",
"icon": "DesktopOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/workbench/files",
"name": "共享文档下载",
"frame": "N"
},
{
"path": "/SystemMessage/message",
"name": "系统消息",
"frame": "N"
},
{
"path": "/api/auth/oauth/authorize?response_type\u003dcode\u0026client_id\u003d3FjMVIzt\u0026redirect_uri\u003dhttps://10.242.31.158:18023/Expertlibraryworkbench/MyExpertHome/Extract?proxyCompanyNo\u003d{organizationId}\u0026sign\u003dprocure\u0026urlSign\u003dSubagenT\u0026mall3_token\u003d{mall3_token}",
"name": "代理机构信息管理",
"frame": "S"
},
{
"path": "/api/auth/oauth/authorize?response_type\u003dcode\u0026client_id\u003dCOsHJydx\u0026redirect_uri\u003dhttps://uat-uscm.chinaunicom.cn:8631/redirect?page\u003dcustomerservice/support/conversation/index\u0026mall3_token\u003d{mall3_token}",
"name": "我的客服",
"frame": "S"
},
{
"path": "/Lowcode/LowcodeRedirect",
"name": "我的服务单",
"frame": "Y"
},
{
"path": "/api/auth/oauth/authorize?response_type\u003dcode\u0026client_id\u003ds3FXwGQh\u0026redirect_uri\u003dhttps://uat-uscm.chinaunicom.cn:18024/supplierInfo/redirect?page\u003d/supplier-info-ordinary\u0026mall3_token\u003d{mall3_token}",
"name": "智企查",
"frame": "S"
}
],
"feignFlag": null
},
{
"menuId": "3",
"path": "",
"name": "通知公告",
"icon": "NotificationOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/notice/noticeList",
"name": "通知公告查看",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "41",
"path": "",
"name": "分派项目管理",
"icon": "BookOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Project/EntrustAssign/Operator",
"name": "分派给我的项目",
"frame": "N"
},
{
"path": "/Project/EntrustWithdraw",
"name": "委托撤回记录",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1000001",
"path": "",
"name": "招标项目管理",
"icon": "ProfileOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Bid/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1000006",
"path": "Negotiation",
"name": "谈判项目管理",
"icon": "CommentOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Negotiation/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1843567845937700866",
"path": "DirectProc",
"name": "直接采购管理",
"icon": "SelectOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/DirectProc/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "100009",
"path": "ComparisonProc",
"name": "询比采购管理",
"icon": "PartitionOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/ComparisonProc/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1000008",
"path": "Inquiry",
"name": "询价项目管理",
"icon": "ProjectOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Inquiry/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1000007",
"path": "Recruit",
"name": "招募项目管理",
"icon": "MacCommandOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Recruit/Manage",
"name": "项目管理",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "11111111",
"path": "Finance",
"name": "财务管理",
"icon": "PayCircleOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Finance/ProjectManager/RevenueRecognition",
"name": "招标收入确认",
"frame": "N"
},
{
"path": "/Finance/EnsureAmount",
"name": "投标保证金查询",
"frame": "N"
},
{
"path": "/Finance/EnsureAmountRefund",
"name": "保证金退还",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "11",
"path": "Invoice",
"name": "发票管理",
"icon": "WalletOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/Invoice/Manager",
"name": "发票列表",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1565509326829727746",
"path": "ExpertManage",
"name": "专家管理",
"icon": "IdcardOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/api/auth/oauth/authorize?response_type\u003dcode\u0026client_id\u003d3FjMVIzt\u0026redirect_uri\u003dhttps://10.242.31.158:18023/Expertlibraryworkbench/MyExpertHome/Extract?proxyCompanyNo\u003d{organizationId}\u0026sign\u003dprocure\u0026mall3_token\u003d{mall3_token}",
"name": "专家抽取",
"frame": "S"
},
{
"path": "/api/auth/oauth/authorize?response_type\u003dcode\u0026client_id\u003d3FjMVIzt\u0026redirect_uri\u003dhttps://10.242.31.158:18023/Expertlibraryworkbench/MyExpertHome/Extract?proxyCompanyNo\u003d{organizationId}\u0026sign\u003dprocure\u0026urlSign\u003dEvaluate\u0026mall3_token\u003d{mall3_token}",
"name": "专家评价",
"frame": "S"
},
{
"path": "/ExpertInfo/ExpertInformationManage",
"name": "专家信息管理",
"frame": "N"
},
{
"path": "/ExpertInfo/ExpertExtractionAvoidance",
"name": "专家抽取回避",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1565574276328947714",
"path": "VideoMonitor",
"name": "视频监控查询",
"icon": "PlaySquareOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/HistoryVideo",
"name": "历史视频上传列表",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1722061270189662209",
"path": "PurchaseReOffer",
"name": "采购复盘与检查",
"icon": "BookOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/PurchaseReOffer",
"name": "采购复盘与检查表",
"frame": "N"
}
],
"feignFlag": null
},
{
"menuId": "1767358998249476098",
"path": "UnbalancedBid",
"name": "不均衡报价分析",
"icon": "BookOutlined",
"menuScope": "EBTP",
"menuOu": null,
"isTop": 0,
"children": [
{
"path": "/UnbalancedBidList",
"name": "不均衡报价分析表",
"frame": "N"
}
],
"feignFlag": null
}
]
}
getMenu(params).then(res => {
if (res.code == 1) {
setMenuData(res.data || [])
setmenuShow(true)
} else {
message.error("数据错误请联系管理员")
}
})
setMenuData( res.data || [])
setmenuShow(true)
// getMenu(params).then(res => {
// if (res.code == 1) {
// setMenuData(res.data || [])
// setmenuShow(true)
// } else {
// message.error("数据错误请联系管理员")
// }
// })
}
}, []);

View File

@ -63,19 +63,19 @@ const Loading: React.FC<{}> = () => {
}
//跳转
const redirect = async (userData: any, url: string, extra: any) => {
const roleCode = getURLInformation('roleCode');
if (isNotEmpty(roleCode)) {
const authIndex = userData.authorityList.findIndex((ite: any) => ite.roleCode == roleCode);
if (authIndex != -1) {
setUserData(userData, userData.authorityList[authIndex].roleCode, userData.authorityList[authIndex])//角色信息存储
} else {
setUserData(userData, userData.authorityList[0].roleCode, userData.authorityList[0]);
error('402');
return;
}
} else {
// const roleCode = getURLInformation('roleCode');
// if (isNotEmpty(roleCode)) {
// const authIndex = userData.authorityList.findIndex((ite: any) => ite.roleCode == roleCode);
// if (authIndex != -1) {
// setUserData(userData, userData.authorityList[authIndex].roleCode, userData.authorityList[authIndex])//角色信息存储
// } else {
// setUserData(userData, userData.authorityList[0].roleCode, userData.authorityList[0]);
// error('402');
// return;
// }
// } else {
setUserData(userData, userData.authorityList[0].roleCode, userData.authorityList[0]);
}
// }
await setDict();//存字典
setTimeout(() => {
history.push({
@ -89,43 +89,185 @@ const Loading: React.FC<{}> = () => {
//获取用户信息
async function getUserData(token: string, url: string, extra: any, status: number) {
await fgetUserMsg(token).then(async res => {
if (res) {
if (res?.userType == null) {
error('401');
} else {
if (res?.authorityList == null || res?.authorityList?.length == 0) {
if (url == 'ExamineAndApprove/Announcement' ||
url == 'ExamineAndApprove/ChangeTheAnnouncement' ||
url == 'ExamineAndApprove/Publicity' ||
url == 'ExamineAndApprove/InvitationLetter' ||
url == 'ExamineAndApprove/ExternalReference' ||
url == 'ExamineAndApprove/FailureAnnouncement') {
let newAuthority: any[] = []
newAuthority.push({
authorities: [null, "system:user:test", "system:user:test", "system:user:test", "system:user:test", null, null],
roleCode: "ebtp-unicom-default",
roleId: "20004",
roleName: "联通普通用户",
roleScope: "EBTP"
})
res.authorityList = [...newAuthority];
await redirect(res, url, extra);
} else {
if (status == 0) {
await refreshUserData(res?.userType, token, url, extra);
} else {
error('401');
}
}
} else {
await redirect(res, url, extra);
}
}
} else {
message.error("登录信息有误,请重新登录")
const res = {
"userId": "ex-linjp29",
"lastName": null,
"firstName": null,
"fullName": "林剑萍",
"emailAddress": null,
"loginName": "ex-linjp29",
"mobilePhone": null,
"officePhone": null,
"sex": null,
"employeeCategory": null,
"userType": "1",
"dateOfBirth": null,
"age": null,
"employeeNumber": "1743164896",
"nationalityId": null,
"nationality": null,
"nationalIdentifier": null,
"supervisorId": null,
"organizationId": "101058278",
"organizationName": "湖北信通通信有限公司",
"orgCategory": null,
"deptId": "101058278",
"deptName": "湖北信通通信有限公司",
"roleIds": null,
"bussiGroupId": null,
"positionId": null,
"currentRoleCode": "undefined",
"province": null,
"authorityList": [
{
"roleId": "000009",
"roleName": "代理机构业务经理",
"roleCode": "ebtp-agency-project-manager",
"roleScope": "EBTP",
"authorities": [
"ebtp-agency-project-manager",
null,
"ebtp-agency-project-manager",
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier,ebtp-agency-admin",
"ebtp-agency-project-manager",
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier,ebtp-agency-admin",
"ebtp-agency-project-manager",
"ebtp-agency-project-manager",
null,
"ebtp-agency-project-manager",
null,
"ebtp-agency-project-manager",
"ebtp-agency-project-manager",
null,
"ebtp-agency-project-manager,ebtp-expert,ebtp-agency-admin",
null,
null,
"ebtp-agency-admin",
null,
null,
null,
null,
null,
null,
null,
"ebtp-agency-project-manager",
"ebtp-agency-project-manager,ebtp-purchase",
"ebtp-agency-project-manager,ebtp-purchase",
"ebtp-agency-project-manager,ebtp-purchase",
"ebtp-agency-project-manager,ebtp-purchase",
"ebtp-agency-project-manager,ebtp-purchase",
null,
null,
null,
null,
null,
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier",
"ebtp-agency-project-manager,ebtp-supplier",
"ebtp-agency-project-manager",
"ebtp-agency-project-manager",
null
]
},
{
"roleId": "000006",
"roleName": "供应商",
"roleCode": "ebtp-supplier",
"roleScope": "EBTP",
"authorities": [
"system:user:test",
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier,ebtp-agency-admin",
"system:user:test",
"ebtp-agency-project-manager",
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier,ebtp-agency-admin",
"ebtp-supplier",
"ebtp-supplier",
"system:user:test",
"system:user:test",
"ebtp-agency-project-manager,ebtp-expert,ebtp-agency-admin",
"ebtp-supplier",
"system:user:test",
"ebtp-supplier",
"system:user:test",
"ebtp-supplier",
"ebtp-supplier",
"ebtp-supplier",
"ebtp-supplier",
"ebtp-supplier",
"ebtp-supplier",
"ebtp-supplier",
null,
null,
null,
"ebtp-agency-project-manager,ebtp-expert,ebtp-supplier",
"ebtp-agency-project-manager,ebtp-supplier",
"ebtp-supplier",
"system:user:test",
"system:user:test",
"system:user:test",
"ebtp-agency-project-manager",
"system:user:test"
]
}
]
}
if (res?.authorityList == null || res?.authorityList?.length == 0) {
if (url == 'ExamineAndApprove/Announcement' ||
url == 'ExamineAndApprove/ChangeTheAnnouncement' ||
url == 'ExamineAndApprove/Publicity' ||
url == 'ExamineAndApprove/InvitationLetter' ||
url == 'ExamineAndApprove/ExternalReference' ||
url == 'ExamineAndApprove/FailureAnnouncement') {
let newAuthority: any[] = []
newAuthority.push({
authorities: [null, "system:user:test", "system:user:test", "system:user:test", "system:user:test", null, null],
roleCode: "ebtp-unicom-default",
roleId: "20004",
roleName: "联通普通用户",
roleScope: "EBTP"
})
res.authorityList = [...newAuthority];
await redirect(res, url, extra);
}
})
}else {
await redirect(res, url, extra);
}
// await fgetUserMsg(token).then(async res => {
// if (res) {
// if (res?.userType == null) {
// error('401');
// } else {
// if (res?.authorityList == null || res?.authorityList?.length == 0) {
// if (url == 'ExamineAndApprove/Announcement' ||
// url == 'ExamineAndApprove/ChangeTheAnnouncement' ||
// url == 'ExamineAndApprove/Publicity' ||
// url == 'ExamineAndApprove/InvitationLetter' ||
// url == 'ExamineAndApprove/ExternalReference' ||
// url == 'ExamineAndApprove/FailureAnnouncement') {
// let newAuthority: any[] = []
// newAuthority.push({
// authorities: [null, "system:user:test", "system:user:test", "system:user:test", "system:user:test", null, null],
// roleCode: "ebtp-unicom-default",
// roleId: "20004",
// roleName: "联通普通用户",
// roleScope: "EBTP"
// })
// res.authorityList = [...newAuthority];
// await redirect(res, url, extra);
// } else {
// if (status == 0) {
// await refreshUserData(res?.userType, token, url, extra);
// } else {
// error('401');
// }
// }
// } else {
// await redirect(res, url, extra);
// }
// }
// } else {
// message.error("登录信息有误,请重新登录")
// }
// })
}
//通过code取token
async function getToken(code: string, data: any) {
@ -189,4 +331,4 @@ const Loading: React.FC<{}> = () => {
</div>
);
}
export default Loading;
export default Loading;

View File

@ -198,7 +198,7 @@ const Index: React.FC<{}> = () => {
const genRandomString = (len: number) => {
const text = 'abcdefghijklmnopqrstuvwxyz0123456789';
const rdmIndex = (text: string | any[]) => Math.random() * text.length | 0;
let rdmString = '';
let rdmString = '';
for(; rdmString.length < len; rdmString += text.charAt(rdmIndex(text)));
return rdmString;
}
@ -213,13 +213,13 @@ const Index: React.FC<{}> = () => {
setImgUrl(url);
}
const login = (val: any) => {
let captcha = form.getFieldValue("captcha");
if(captcha==undefined||captcha==null||captcha==""){
message.error('请输入验证码!');
return;
}
// if(captcha==undefined||captcha==null||captcha==""){
// message.error('请输入验证码!');
// return;
// }
/*
testLogin({ userName: val.loginName, password: val.psw,captcha:captcha,tmpToken:tmpToken }).then(res => {
if(res?.success){
@ -256,7 +256,7 @@ const Index: React.FC<{}> = () => {
}
})
}
}
useEffect(() => {

View File

@ -105,22 +105,22 @@ const Login: React.FC<LoginProps> = (props) => {
}
})
} else {
disSet(true);
await CooperfakeAccountLogin({ ...values }).then((res) => {
if (res?.success) {
if (moment(res?.data?.expiration).diff(moment(), 'hours') < remainingTime) {
refreshToken(res?.data)
} else {
sessionStorage.setItem('Authorization', res?.data?.value);
// disSet(true);
// await CooperfakeAccountLogin({ ...values }).then((res) => {
// if (res?.success) {
// if (moment(res?.data?.expiration).diff(moment(), 'hours') < remainingTime) {
// refreshToken(res?.data)
// } else {
sessionStorage.setItem('Authorization', "2ecb7a57-61ed-4406-9063-5d85a26a18eb");
// sessionStorage.setItem('refreshToken', res?.data?.refreshToken.value);
sessionStorage.setItem('scope', res?.data?.scope);
sessionStorage.setItem('scope', "all");
history.push('/redirect');
}
}
changeCaptcha();
}).finally(() => {
disSet(false);
});
// }
// }
// changeCaptcha();
// }).finally(() => {
// disSet(false);
// });
}
};
@ -212,18 +212,20 @@ const Login: React.FC<LoginProps> = (props) => {
]}
/>
</>
) : (
)
: (
<Row>
<Col span={12}>
<Form.Item name="captcha" rules={[{ required: true, message: '请输入验证码' }]}>
<Input size='large' placeholder="验证码" />
</Form.Item>
</Col>
<Col span={12} style={{ lineHeight: '33.11px' }}>
<Image src={imgUrl} preview={false} onClick={() => changeCaptcha()} />
</Col>
{/*<Col span={12}>*/}
{/* <Form.Item name="captcha" rules={[{ required: true, message: '请输入验证码' }]}>*/}
{/* <Input size='large' placeholder="验证码" />*/}
{/* </Form.Item>*/}
{/*</Col>*/}
{/*<Col span={12} style={{ lineHeight: '33.11px' }}>*/}
{/* <Image src={imgUrl} preview={false} onClick={() => changeCaptcha()} />*/}
{/*</Col>*/}
</Row>
)}
)
}
</Tab>
<Submit loading={submitting} disabled={dis}>