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