diff --git a/config/config.dev.ts b/config/config.dev.ts index 16dd11d..d2201f0 100644 --- a/config/config.dev.ts +++ b/config/config.dev.ts @@ -1,5 +1,5 @@ export default { define: { - 'process.env.API_SERVER': "http://localhost:8899", // 接口服务器地址 + 'process.env.API_SERVER': "http://47.92.229.12:8888", // 接口服务器地址 } }; \ No newline at end of file diff --git a/config/config.ts b/config/config.ts index 765aa50..9bacc65 100644 --- a/config/config.ts +++ b/config/config.ts @@ -21,27 +21,27 @@ export default defineConfig({ loading: '@/components/PageLoading/index', }, define: { - 'process.env.API_SERVER': 'http://localhost:8899', + 'process.env.API_SERVER': 'http://47.92.229.12:8888', }, targets: { ie: 11, }, // umi routes: https://umijs.org/docs/routing routes: [ - // { - // path: '/user', - // component: '../layouts/UserLayout', - // routes: [ - // { - // name: 'login', - // path: '/user/login', - // component: './user/login', - // }, - // ], - // }, + { + path: '/user', + component: '../layouts/UserLayout', + routes: [ + { + name: 'login', + path: '/user/login', + component: './user/login', + }, + ], + }, { name: 'page', - path: '/', + path: '/front', component: './Front', }, { @@ -49,69 +49,69 @@ export default defineConfig({ path: '/home/detail/:id?', component: './Front/detail', }, - // { - // path: '/', - // component: '../layouts/SecurityLayout', - // routes: [ - // { - // path: '/', - // component: '../layouts/BasicLayout', - // authority: ['admin', 'user'], - // routes: [ - // { - // path: '/', - // redirect: '/article/article-page', - // }, - // { - // hideInMenu: true, - // name: 'list.caseUpdate', - // path: 'article/article-page/update/:id?', - // component: './Case/CasePage/update', - // }, - // { - // name: 'list.case', - // icon: 'fileSearch', - // path: 'article', - // routes: [ - // { - // name: 'casePage', - // path: 'article-page', - // component: './Case/CasePage', - // }, - // { - // name: 'level', - // path: 'level', - // component: './Case/level', - // }, - // { - // name: 'category', - // path: 'category', - // component: './Case/Category', - // }, - // ], - // }, - // { - // name: 'list.maintain', - // icon: 'idcard', - // path: 'maintain', - // routes: [ - // { - // name: 'user', - // path: 'user', - // component: './MainTain/User', - // }, - // ], - // }, - // { - // component: './404', - // }, - // ], - // }, - // { - // component: './404', - // }, - // ], - // }, + { + path: '/', + component: '../layouts/SecurityLayout', + routes: [ + { + path: '/', + component: '../layouts/BasicLayout', + authority: ['admin', 'user'], + routes: [ + { + path: '/', + redirect: '/article/article-page', + }, + { + hideInMenu: true, + name: 'list.caseUpdate', + path: 'article/article-page/update/:id?', + component: './Case/CasePage/update', + }, + { + name: 'list.case', + icon: 'fileSearch', + path: 'article', + routes: [ + { + name: 'casePage', + path: 'article-page', + component: './Case/CasePage', + }, + { + name: 'level', + path: 'level', + component: './Case/level', + }, + { + name: 'category', + path: 'category', + component: './Case/Category', + }, + ], + }, + { + name: 'list.maintain', + icon: 'idcard', + path: 'maintain', + routes: [ + { + name: 'user', + path: 'user', + component: './MainTain/User', + }, + ], + }, + { + component: './404', + }, + ], + }, + { + component: './404', + }, + ], + }, { component: './404', }, diff --git a/src/pages/Front/index.tsx b/src/pages/Front/index.tsx index a968a05..417746c 100644 --- a/src/pages/Front/index.tsx +++ b/src/pages/Front/index.tsx @@ -168,7 +168,7 @@ const Front: React.FC<{}> = () => { for (let i = 0; i < arr.length; i++) { const element = arr[i]; console.log(element.url) - arr[i].url = element.url.replace("http://dj-law.oss-cn-shanghai.aliyuncs.com", "http://localhost:8899/upload") + arr[i].url = element.url.replace("http://dj-law.oss-cn-shanghai.aliyuncs.com", "http://47.92.229.12:8888/upload") } setFileList(arr) setIsModalOpen(true); diff --git a/src/utils/request.ts b/src/utils/request.ts index e2536ff..ee7a13e 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -61,7 +61,7 @@ request.interceptors.response.use(async (response, options) => { return response } const res = await response.clone().json(); - if(res.retcode === 401 || (response.status === 500 && response.url === 'http://localhost:8899/user')) { + if(res.retcode === 401 || (response.status === 500 && response.url === 'http://47.92.229.12:8888/user')) { const { redirect } = getPageQuery(); if (window.location.pathname !== '/user/login' && !redirect) { localStorage.clear()