Commit d1eeaa9c authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents 0c7c0a40 07253302
......@@ -23,6 +23,7 @@ const config: any = {
},
nodeModulesTransform: {
type: 'none',
exclude: []
},
routes,
extraBabelPlugins: [
......
......@@ -102,7 +102,7 @@
"rgbaster": "^2.1.1",
"sortablejs": "^1.12.0",
"typescript": "^3.9.7",
"umi": "^3.2.28",
"umi": "~3.2.28",
"video-react": "^0.14.1",
"yorkie": "^2.0.0"
},
......
......@@ -64,7 +64,15 @@ export function patchRoutes({ routes }: IRoutes) {
if (isDev) {
return;
}
asyncRouter(getRouters(), routes)
const authInfo = getAuth()
if (authInfo) {
PublicApi.getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
const { data, code } = res
if (code === 1000) {
asyncRouter(data.urls, routes)
}
})
}
}
/**
......@@ -83,7 +91,7 @@ export function render(oldRender: Function) {
}
const authInfo = getAuth()
if (authInfo) {
PublicApi.getMemberLoginReget().then(res => {
PublicApi.getMemberLoginReget({}, { useCache: true, ttl: 1000 }).then(res => {
const { data, code } = res
if (code === 1000) {
setAuth(data as any)
......@@ -136,7 +144,6 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
const authInfo = getAuth()
// 是否登录
if (authInfo) {
let routeAuthUrls = getRouters()
if (!routeAuthUrls || routeAuthUrls.length === 0) {
......
......@@ -134,6 +134,9 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
shopId,
...filterParam
}
if (params.idInList) {
_params.idInList = [params.idInList]
}
if (selectId) {
_params.idNotInList = Array.isArray(selectId) ? selectId : [selectId]
}
......
......@@ -26,7 +26,7 @@ const CommoditySchema: ISchema = {
},
},
properties: {
id: {
idInList: {
type: 'string',
'x-component-props': {
placeholder: '商品ID',
......
......@@ -273,6 +273,7 @@ export const marketingConfig_8 = {
'11-8': {
title: '活动-赠商品',
componentName: 'MarketingCard',
canDrag: false,
props: {
style: {
margin: '8px',
......@@ -283,6 +284,8 @@ export const marketingConfig_8 = {
},
'11-8-1': {
canEdit: true,
canDelete: false,
canDrag: false,
title: '标题栏',
componentName: 'MarketingCard.ShopHeader',
componentType: PROPS_SETTING_TYPES.marketingCardHeader,
......@@ -294,7 +297,9 @@ export const marketingConfig_8 = {
title: '活动商品容器',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.VerticalContainer',
canDelete: false,
canDrag: false,
componentName: 'MarketingCard.CommonContainer',
maxLength: 3,
props: {
type: 6,
......@@ -305,6 +310,43 @@ export const marketingConfig_8 = {
},
};
// export const marketingConfig_8 = {
// '11-8': {
// title: '活动-赠商品',
// componentName: 'MarketingCard',
// props: {
// style: {
// margin: '8px',
// },
// shopColorType: 8
// },
// childNodes: ['11-8-1', '11-8-2'],
// },
// '11-8-1': {
// canEdit: true,
// title: '标题栏',
// componentName: 'MarketingCard.ShopHeader',
// componentType: PROPS_SETTING_TYPES.marketingCardHeader,
// props: {
// type: 8,
// },
// },
// '11-8-2': {
// title: '活动商品容器',
// canEdit: true,
// canHide: false,
// componentName: 'MarketingCard.VerticalContainer',
// maxLength: 3,
// props: {
// type: 6,
// },
// childNodes: [],
// childComponentName: 'MarketingCard.GoodsItem',
// addBtnText: '添加商品',
// },
// };
export const marketingConfig_9 = {
'11-9': {
title: '活动-赠优惠券',
......@@ -330,11 +372,13 @@ export const marketingConfig_9 = {
title: '活动优惠券容器',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.VerticalContainer',
canDelete: false,
canDrag: false,
componentName: 'MarketingCard.CommonContainer',
props: {
type: 6,
span: 10,
containerScorll: true
containerScorll: true,
},
childNodes: [],
childComponentName: 'MarketingCard.CouponsItem',
......
......@@ -102,6 +102,11 @@ export const removeAuth = () => {
removeRouters()
}
const HOME_URL = [
'/',
'/memberCenter/home'
]
export const asyncRouter = async (routeLists: string[], routes: any[]) => {
for (let i = 0; i < routes.length; i++) {
const item = routes[i]
......@@ -110,7 +115,7 @@ export const asyncRouter = async (routeLists: string[], routes: any[]) => {
} else {
// 参与权限校验的页面
// fix: 修复左侧菜单首页无法显示
if (item.path && !routeLists.includes(item.path) && item.path !== '/memberCenter/home') {
if (item.path && !routeLists.includes(item.path) && !HOME_URL.includes(item.path)) {
item.hideInMenu = true
item.noAuth = true
}
......
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"jsx": "react",
"esModuleInterop": true,
"noImplicitAny": false,
"sourceMap": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"],
"@mock/*": ["mockStatic/*"],
"@@/*": ["src/.umi/*"]
},
"allowSyntheticDefaultImports": true
},
"include": [
"mock/**/*",
"src/**/*",
"config/**/*",
".umirc.ts",
"typings.d.ts"
],
"exclude": [
"node_modules/**/*"
]
}
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"noImplicitAny": false,
"sourceMap": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"],
"@mock/*": ["mockStatic/*"],
"@@/*": ["src/.umi/*"]
},
"allowSyntheticDefaultImports": true
},
"include": [
"mock/**/*",
"src/**/*",
"config/**/*",
".umirc.ts",
"typings.d.ts"
],
"exclude": [
"node_modules/**/*"
]
}
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