Commit abdcfd3d authored by LeeJiancong's avatar LeeJiancong
parents caf9a12a 50944c57
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":39,"typeName":"供货"}]}},"web":{"shopInfo":[{"id":302,"name":"云鲜采企业商城","type":1,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/5b19a059530a4060984fc045125da1f81597395561658.png","describe":null,"state":1,"url":"/"},{"id":303,"name":"云鲜采渠道商城","type":3,"environment":1,"logoUrl":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/a63c8c81e74947f88c64d4c72bfb565c1597395598958.png","describe":null,"state":1,"url":"/shop"}]},"global":{"siteId":502,"siteUrl":"http://localhost:4396","logo":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}} {"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"},{"id":2,"typeName":"个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":39,"typeName":"供货"},{"id":40,"typeName":"供货商消费者"},{"id":41,"typeName":"供货商消费者渠道会员"}]}},"web":{"shopInfo":[]},"global":{"siteId":502,"siteUrl":"http://localhost:4396","logo":"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png","countryList":[{"name":"简体中文-ZH","key":"zh-CN","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en-US","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
...@@ -38,12 +38,13 @@ const memberCenterRoute = { ...@@ -38,12 +38,13 @@ const memberCenterRoute = {
}, },
...routes, ...routes,
{ {
path: '/noAuth', path: '/memberCenter/noAuth',
auth: false, auth: false,
component: '@/pages/403', component: '@/pages/403',
}, },
// 能力中心的404页 // 能力中心的404页
{ {
path: '/*',
auth: false, auth: false,
component: '@/pages/404', component: '@/pages/404',
}, },
......
...@@ -22,13 +22,16 @@ const whiteLists = [ ...@@ -22,13 +22,16 @@ const whiteLists = [
'/user/login', '/user/login',
'/user/register', '/user/register',
'/memberCenter', '/memberCenter',
'/memberCenter/noAuth',
'/commodity', '/commodity',
'/shops', '/shops',
'/shop/commodity/detail', '/shop/commodity/detail',
'/shop/commodity', '/shop/commodity',
'/shop', '/shop',
'/infomation', '/infomation',
'/403',
'/404', '/404',
'/500',
'/noAuth' '/noAuth'
] ]
...@@ -70,10 +73,11 @@ export function render(oldRender: Function) { ...@@ -70,10 +73,11 @@ export function render(oldRender: Function) {
token: data.token token: data.token
}) })
setRouters(data.urls) setRouters(data.urls)
oldRender()
}) })
} } else {
oldRender() oldRender()
}
} }
/** /**
...@@ -84,21 +88,20 @@ export function render(oldRender: Function) { ...@@ -84,21 +88,20 @@ export function render(oldRender: Function) {
* @param {*} { routes, matchedRoutes, location, action } * @param {*} { routes, matchedRoutes, location, action }
*/ */
export function onRouteChange({ routes, matchedRoutes, location, action }) { export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log(`当前可访问的路由为`) console.log('onRouteChange')
console.log(routes, matchedRoutes, location)
if (isDev) { if (isDev) {
return; return;
} }
if (whiteLists.includes(location.pathname)) return; if (whiteLists.includes(location.pathname)) return;
const routeAuthUrls = getRouters() const routeAuthUrls = getRouters()
console.log(routeAuthUrls, "routeAuthUrls")
// 是否登录 // 是否登录
if (getAuth()) { if (getAuth()) {
if (routeAuthUrls.includes(location.pathname)) { if (routeAuthUrls.includes(location.pathname)) {
} else { } else {
// history.replace('/') // 无权限访问时
history.replace('/memberCenter/noAuth')
} }
} else { } else {
history.replace('/user/login') history.replace('/user/login')
......
...@@ -17,19 +17,8 @@ export interface UserRegister { ...@@ -17,19 +17,8 @@ export interface UserRegister {
useType: UseType; useType: UseType;
} }
export interface ShopInfo {
id: number;
name: string;
type: number;
environment: number;
logoUrl: string;
describe?: any;
state: number;
url: string;
}
export interface Web { export interface Web {
shopInfo: ShopInfo[]; shopInfo: any[];
} }
export interface CountryList { export interface CountryList {
......
...@@ -95,6 +95,11 @@ ...@@ -95,6 +95,11 @@
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 8px 0; margin: 8px 0;
border-top-width: 1px;
border-left-width: 1px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
& label:nth-child(odd) { & label:nth-child(odd) {
......
...@@ -14,7 +14,6 @@ const NoFoundPage: React.FC<{}> = () => { ...@@ -14,7 +14,6 @@ const NoFoundPage: React.FC<{}> = () => {
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<UserHeader logo={GlobalConfig.global.logo}/>
<div className={styles.errorBox}> <div className={styles.errorBox}>
<Row> <Row>
<Col span={12}> <Col span={12}>
......
...@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => { ...@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => {
const confirm = (record: any) => { const confirm = (record: any) => {
PublicApi.postProductCustomerUpdateCustomerAttributeValueStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{ PublicApi.postProductCustomerUpdateCustomerAttributeValueStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
const clickDelete = (record: any) => { const clickDelete = (record: any) => {
PublicApi.postProductCustomerDeleteCustomerAttributeValue({ id: record.id }).then(res=>{ PublicApi.postProductCustomerDeleteCustomerAttributeValue({ id: record.id }).then(res=>{
//@ts-ignore
ref.current.reload() ref.current.reload()
}) })
} }
......
...@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => {
}, []) }, [])
const onSave = () => { const onSave = () => {
console.log('点击保存') // console.log('点击保存')
console.log(formRefs, 'formrefs') // console.log(formRefs, 'formrefs')
if(formRefs.length > 0){ if(formRefs.length > 0){
try{ try{
let data = formRefs.map(async __ => { let data = formRefs.map(async __ => {
...@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => {
await __.current.validateFields() await __.current.validateFields()
) )
}) })
console.log(data,'data') // console.log(data,'data')
Promise.all(data).then((values) => { Promise.all(data).then((values) => {
// 提交的数据进行处理 // 提交的数据进行处理
console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据') // console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据')
productSelectAttribute.length>0 && productSelectAttribute.map(_itme => { productSelectAttribute.length>0 && productSelectAttribute.map(_itme => {
delete _itme.attributeName delete _itme.attributeName
delete _itme.isPrice delete _itme.isPrice
...@@ -112,7 +112,9 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -112,7 +112,9 @@ const AddProducts: React.FC<{}> = (props) => {
_params.logistics.weight = Number(_params.logistics.weight) _params.logistics.weight = Number(_params.logistics.weight)
// 处理地址 // 处理地址
let _commodityAreaList:any = [] let _commodityAreaList:any = []
// console.log(_params, '_params')
_params.commodityAreaList.length > 0 && _params.commodityAreaList.map(_itme => { _params.commodityAreaList.length > 0 && _params.commodityAreaList.map(_itme => {
if(_itme){
let _temp: any = {} let _temp: any = {}
let pobj = areaOption.filter(_=>_.code===_itme[0])[0] let pobj = areaOption.filter(_=>_.code===_itme[0])[0]
let cobj = pobj.areaResponses.filter(__=>__.code===_itme[1])[0] let cobj = pobj.areaResponses.filter(__=>__.code===_itme[1])[0]
...@@ -121,7 +123,8 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -121,7 +123,8 @@ const AddProducts: React.FC<{}> = (props) => {
_temp.cityCode = cobj.code, _temp.cityCode = cobj.code,
_temp.cityName = cobj.name, _temp.cityName = cobj.name,
_commodityAreaList.push(_temp) _commodityAreaList.push(_temp)
console.log(_itme, _temp, '地址的每一项') // console.log(_itme, _temp, '地址的每一项')
}
}) })
_params.commodityAreaList = _commodityAreaList _params.commodityAreaList = _commodityAreaList
const { id } = history.location.query const { id } = history.location.query
......
...@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => { ...@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => {
const [shopsOption, setShopsOption] = useState<GetProductCommodityGetShopResponse>([]) const [shopsOption, setShopsOption] = useState<GetProductCommodityGetShopResponse>([])
const [checkedValues, setCheckedValues] = useState<any>([]) const [checkedValues, setCheckedValues] = useState<any>([])
const [currentOptionId, setCurrentOptionId] = useState() const [currentOptionId, setCurrentOptionId] = useState()
const [isDisabledOKbtn, setIsDisabledOKbtn] = useState<boolean>(false)
let [isHighSearch, setIsHighSearch] = useState(false) let [isHighSearch, setIsHighSearch] = useState(false)
const [filterParams, setFilterParams] = useState<paramItem>({ const [filterParams, setFilterParams] = useState<paramItem>({
...@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => { ...@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => {
setCheckedValues(values) setCheckedValues(values)
} }
const clickUp = (param: any, id: any) => { // 0 下架 1上架 const clickUp = (param: any, id: any) => { // param: 0 下架 1上架
setCurrentOptionId(id) setCurrentOptionId(id)
PublicApi.getProductCommodityGetShop({id: id}).then(res => { PublicApi.getProductCommodityGetShop({id: id}).then(res => {
setShopsOption(res.data) setShopsOption(res.data)
...@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => { ...@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => {
} }
const handleUp = () => { const handleUp = () => {
setIsDisabledOKbtn(true)
let params = { let params = {
id: currentOptionId, id: currentOptionId,
shopList: checkedValues shopList: checkedValues
...@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => { ...@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => {
PublicApi.postProductCommodityPublishCommodity(params).then(res => { PublicApi.postProductCommodityPublishCommodity(params).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false)
}) })
else else
PublicApi.postProductCommodityOffPublishCommodity(params).then(res => { PublicApi.postProductCommodityOffPublishCommodity(params).then(res => {
setUpDownModal(false) setUpDownModal(false)
ref.current.reload() ref.current.reload()
setIsDisabledOKbtn(false)
}) })
} }
...@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => { ...@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => {
const handleBatchDelete = (ids: string[]) => { const handleBatchDelete = (ids: string[]) => {
console.log('删除', ids) console.log('删除', ids)
//@ts-ignore // @ts-ignore
PublicApi.postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => { PublicApi.postProductCommodityDeleteBatchCommodity({idList: ids}).then(res => {
if(res.code === 1000) if(res.code === 1000)
ref.current.reload() ref.current.reload()
...@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => { ...@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => {
setFilterParams(restObj) setFilterParams(restObj)
setBrandValue(undefined) setBrandValue(undefined)
setClassValue(undefined) setClassValue(undefined)
//@ts-ignore
ref.current.reload(restObj) ref.current.reload(restObj)
} }
...@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => { ...@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => {
console.log(val) console.log(val)
let obj = val ? {...filterParams, name: val} : { ...filterParams } let obj = val ? {...filterParams, name: val} : { ...filterParams }
setFilterParams(obj) setFilterParams(obj)
//@ts-ignore
ref.current.reload(obj) ref.current.reload(obj)
} }
...@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => { ...@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => {
onOk={handleUp} onOk={handleUp}
onCancel={handleCancelUp} onCancel={handleCancelUp}
forceRender={true} forceRender={true}
okButtonProps={{ disabled: isDisabledOKbtn }}
> >
<Form <Form
layout="vertical" layout="vertical"
......
...@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => { ...@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => {
}, },
]; ];
/* 商品属性显示 */ /* 商品属性显示 */
//以属性组和属性名称归档的数据 //以属性组和属性名称归档的数据
const renderDataByTab = (data: GetProductCommodityGetCommodityResponse) => { const renderDataByTab = (data: GetProductCommodityGetCommodityResponse) => {
...@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => {
{/* 视频区块 */} {/* 视频区块 */}
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
productDetail?.commodityRemark?.video.length>0 ? productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}> productDetail?.commodityRemark?.video?.length>0 ? productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}>
<video src={_item} controls={true}> <video src={_item} controls={true}>
您的浏览器不支持视频标签,请及时升级。 您的浏览器不支持视频标签,请及时升级。
</video> </video>
......
...@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => { ...@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => {
const handleSave = () => { const handleSave = () => {
form.validateFields().then((values:any) => { form.validateFields().then((values:any) => {
if(values?.proveUrl?.fileList&&fileList.length){ console.log(values,'vvv')
delete values.proveUrl.fileList
delete values.proveUrl.file
}
if(history.location.query.id){ if(history.location.query.id){
values.id = Number(history.location.query.id) values.id = Number(history.location.query.id)
let obj = {}; let obj = {};
fileList.forEach((item, index)=>{ fileList.forEach((item, index)=>{
obj[index] = item?.url obj[index] = item?.url || item?.response?.data
}) })
values.proveUrl = obj values.proveUrl = obj
} }
if(values?.proveUrl?.fileList&&fileList.length){
delete values.proveUrl.fileList
delete values.proveUrl.file
}
PublicApi.postProductBrandSaveOrUpdateBrand(values).then(res => { PublicApi.postProductBrandSaveOrUpdateBrand(values).then(res => {
setIsEnableCheck(false) setIsEnableCheck(false)
//@ts-ignore //@ts-ignore
......
...@@ -23,7 +23,8 @@ const LoginWrap: React.FC = () => { ...@@ -23,7 +23,8 @@ const LoginWrap: React.FC = () => {
token: data.token token: data.token
}) })
setRouters(data.urls) setRouters(data.urls)
history.push('/memberCenter/home') // 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
window.location.href = '/memberCenter/home'
}) })
} }
......
...@@ -41,7 +41,7 @@ const CustomCheckbox = props => { ...@@ -41,7 +41,7 @@ const CustomCheckbox = props => {
return ( return (
<Radio.Group value={props.value} onChange={props.onChange} className={layout === 'column' ? 'identityRadio' : 'businessRadio'} name={props.name}> <Radio.Group value={props.value} onChange={props.onChange} className={layout === 'column' ? 'identityRadio' : 'businessRadio'} name={props.name}>
{ {
props.dataSource && props.dataSource.map((v, i) => <Radio.Button value={v.value} key={v.value + i}>{v.label}</Radio.Button>) props.dataSource && props.dataSource.map((v, i) => <Tooltip title={v.label} placement='leftTop' key={v.value + i}><Radio.Button value={v.value} >{v.label}</Radio.Button></Tooltip>)
} }
</Radio.Group> </Radio.Group>
) )
...@@ -280,7 +280,15 @@ const UserRegistry = () => { ...@@ -280,7 +280,15 @@ const UserRegistry = () => {
name={field.fieldName} name={field.fieldName}
key={field.fieldName} key={field.fieldName}
title={field.fieldCNName} title={field.fieldCNName}
x-component-props={{ listType: 'text'}} x-component-props={{
name: 'file',
listType: 'text',
actions: "/api/file/file/upload",
data: {
fileType: 1
},
showUploadList: false,
}}
x-component='Upload' x-component='Upload'
> >
</Field> </Field>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,6 +4,7 @@ import { IRequestError, IRequestSuccess } from '..'; ...@@ -4,6 +4,7 @@ import { IRequestError, IRequestSuccess } from '..';
import { history } from 'umi' import { history } from 'umi'
import { message } from 'antd' import { message } from 'antd'
import { getAuth, removeAuth } from './auth'; import { getAuth, removeAuth } from './auth';
import { GlobalConfig } from '@/global/config';
export type CtlType = 'none' | 'message' export type CtlType = 'none' | 'message'
// 根前缀请求路径 // 根前缀请求路径
...@@ -52,7 +53,8 @@ const errorHandler = (error: ResponseError): IRequestError => { ...@@ -52,7 +53,8 @@ const errorHandler = (error: ResponseError): IRequestError => {
const defaultHeaders = { const defaultHeaders = {
'Content-Type': 'Application/json', 'Content-Type': 'Application/json',
'source': '1' 'source': '1',
'site': GlobalConfig.global.siteId.toString()
} }
/** /**
......
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