Commit e7548b1b authored by 前端-许佳敏's avatar 前端-许佳敏

fix:设置cookie无效

parent 12d44049
...@@ -74,28 +74,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => { ...@@ -74,28 +74,6 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
setLoading(false) setLoading(false)
}) })
} }
<<<<<<< HEAD
useEffect(() => {
if (id && type === 2) {
handleGetDetails();
setCount('3');
} else if (id && type === 3) {
const data: any = getCookie(spam_id);
const inquiryGoods: any[] = [];
inquiryGoods.push({
commodityId: id,
productId: data.id,
productName: data.name,
category: data.category,
brand: data.brand.name,
unit: data.unitName,
purchaseCount: 1,
logistics: data.logistics,
memberId: data.memberId,
memberRoleId: data.memberRoleId
})
=======
>>>>>>> dev-srm
const getMemberInfo = (value) => { const getMemberInfo = (value) => {
form.setFieldsValue({ "memberName": value.name }); form.setFieldsValue({ "memberName": value.name });
......
...@@ -85,50 +85,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => { ...@@ -85,50 +85,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
}, [memb]) }, [memb])
return ( return (
<<<<<<< HEAD
<>
<Form
{...layout}
form={basicform}
className={styles.revise_style}
>
<Form.Item label='询价单摘要' name='details' rules={[{ required: true, message: '请输入询价单摘要' }]}>
<Input />
</Form.Item>
<Form.Item label='被询价会员' name='memberId' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Search disabled={type === 3 || type === 2} value={memberName ? memberName : undefined} readOnly enterButton={<><LinkOutlined /> 选择</>} onSearch={() => setVisibleChannelMember(true)} />
{memberName && <Button type='link' onClick={() => window.open(`${ENTERPRISE_CENTER_URL}/shop/${memberId}_${roleId}`)}>查看会员详情</Button>}
</Form.Item>
<Form.Item label='询价单号' name='orderNumber'>
<span>{(Object.keys(editData).length > 0 && editData.inquiryListNo) ? editData.inquiryListNo : '-'}</span>
</Form.Item>
<Form.Item label='单据时间' name='time'>
<span>{(Object.keys(editData).length > 0 && editData.voucherTime) ? format(editData.voucherTime) : '-'}</span>
</Form.Item>
<Form.Item label='外部状态' name='external'>
<span>{(Object.keys(editData).length > 0 && editData.externalState) ? <Tag color={EXTERNALSTATE_COLOR[editData.externalState]}>{editData.externalStateName}</Tag> : '-'}</span>
</Form.Item>
<Form.Item label='内部状态' name='internal'>
<span>{(Object.keys(editData).length > 0 && editData.interiorState) ? <Badge status={INTERNALSTATE_COLOR[editData.interiorState]} text={editData.interiorStateName} /> : '-'}</span>
</Form.Item>
</Form>
{/* 选择会员弹框 */}
<ModalTable
modalTitle='选择会员'
confirm={handleOkAddMember}
cancel={handleCancelAddMember}
visible={visibleChannelMember}
forceRender={visibleChannelMember}
resetModal={{ destroyOnClose: true, forceRender: true }}
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
formilyProps={
{
ctx: { schema: formSearch }
}
}
=======
<Card <Card
id="basicInfoLayout" id="basicInfoLayout"
title="基本信息" title="基本信息"
...@@ -150,7 +106,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => { ...@@ -150,7 +106,6 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
visible={visible} visible={visible}
title="选择会员" title="选择会员"
mode="radio" mode="radio"
>>>>>>> dev-srm
tableProps={{ tableProps={{
rowKey: 'id', rowKey: 'id',
}} }}
......
...@@ -30,11 +30,11 @@ const LoginWrap: React.FC = () => { ...@@ -30,11 +30,11 @@ const LoginWrap: React.FC = () => {
// 设置同域名cookie缓存 // 设置同域名cookie缓存
setAuth(data) setAuth(data)
// 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验 // 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
if (redirect) { // if (redirect) {
window.location.replace(decodeURIComponent(atob(redirect))) // window.location.replace(decodeURIComponent(atob(redirect)))
} else { // } else {
window.location.replace('/memberCenter/home') // window.location.replace('/memberCenter/home')
} // }
} else { } else {
setLoginLoading(false) setLoginLoading(false)
} }
......
...@@ -32,7 +32,6 @@ export const setAuth = (info: AuthInfo) => { ...@@ -32,7 +32,6 @@ export const setAuth = (info: AuthInfo) => {
memberRoleType: info.memberRoleType, memberRoleType: info.memberRoleType,
memberRoleId: info.memberRoleId memberRoleId: info.memberRoleId
} }
console.log(getTopDomainByHost(TOP_DOMAIN, true))
setCookie(AUTH_KEY, JSON.stringify(auth), { domain: getTopDomainByHost(TOP_DOMAIN, true) }) setCookie(AUTH_KEY, JSON.stringify(auth), { domain: getTopDomainByHost(TOP_DOMAIN, true) })
setCookie(AUTH_ROLES_KEY, JSON.stringify(info.roles), { domain: getTopDomainByHost(TOP_DOMAIN, true) }) setCookie(AUTH_ROLES_KEY, JSON.stringify(info.roles), { domain: getTopDomainByHost(TOP_DOMAIN, true) })
setLocalAuth(info) setLocalAuth(info)
......
...@@ -645,7 +645,7 @@ export const getIChannelInfo = () => { ...@@ -645,7 +645,7 @@ export const getIChannelInfo = () => {
export const getTopDomainByHost = (url: string, isPort = false): string => { export const getTopDomainByHost = (url: string, isPort = false): string => {
if (!url) return '' if (!url) return ''
// 如果后缀带有端口号, 可通过第二个参数把端口去掉 // 如果后缀带有端口号, 可通过第二个参数把端口去掉
const splitUrl = url.split(':') const splitUrl = url.replace(/(http|https)\:\/\//, '').split(':')
if (splitUrl.length > 1 && isPort) { if (splitUrl.length > 1 && isPort) {
return `${splitUrl[0].split('.').slice(-2).join('.')}` return `${splitUrl[0].split('.').slice(-2).join('.')}`
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment