mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-24 10:27:28 +08:00
[improvement][project] supersonic 0.6.0 version update (#16)
Co-authored-by: lexluo <lexluo@tencent.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// https://umijs.org/config/
|
||||
import { defineConfig } from 'umi';
|
||||
import defaultSettings from './defaultSettings';
|
||||
import defaultSettings, { publicPath } from './defaultSettings';
|
||||
import themeSettings from './themeSettings';
|
||||
import proxy from './proxy';
|
||||
import routes from './routes';
|
||||
@@ -9,8 +9,6 @@ import ENV_CONFIG from './envConfig';
|
||||
|
||||
const { REACT_APP_ENV, RUN_TYPE } = process.env;
|
||||
|
||||
const publicPath = '/webapp/';
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
// 添加这个自定义的环境变量
|
||||
@@ -71,14 +69,6 @@ export default defineConfig({
|
||||
base: publicPath,
|
||||
publicPath,
|
||||
outputPath: RUN_TYPE === 'local' ? 'supersonic-webapp' : 'dist',
|
||||
// https://github.com/zthxxx/react-dev-inspector
|
||||
plugins: ['react-dev-inspector/plugins/umi/react-inspector'],
|
||||
inspectorConfig: {
|
||||
// loader options type and docs see below
|
||||
exclude: [],
|
||||
babelPlugins: [],
|
||||
babelOptions: {},
|
||||
},
|
||||
resolve: {
|
||||
includes: ['src/components'],
|
||||
},
|
||||
|
||||
@@ -21,5 +21,6 @@ const Settings: LayoutSettings & {
|
||||
ignoreFlatMenu: true,
|
||||
},
|
||||
};
|
||||
export const publicPath = '/webapp/';
|
||||
|
||||
export default Settings;
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
export default {
|
||||
dev: {
|
||||
'/api/chat/': {
|
||||
target: 'http://localhost:9080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api/semantic/': {
|
||||
target: 'http://localhost:9081',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api/': {
|
||||
target: 'http://localhost:9080',
|
||||
changeOrigin: true,
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
export const ROUTE_AUTH_CODES = {
|
||||
export const ROUTE_AUTH_CODES = {};
|
||||
|
||||
const ENV_KEY = {
|
||||
CHAT: 'chat',
|
||||
CHAT_SETTING: 'chatSetting',
|
||||
SEMANTIC: 'semantic',
|
||||
};
|
||||
|
||||
const { APP_TARGET } = process.env;
|
||||
|
||||
const ROUTES = [
|
||||
...(APP_TARGET !== 'inner'
|
||||
? [
|
||||
{
|
||||
path: '/chat',
|
||||
name: 'chat',
|
||||
component: './Chat',
|
||||
envEnableList: [ENV_KEY.CHAT],
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
path: '/chat',
|
||||
name: 'chat',
|
||||
component: './Chat',
|
||||
access: ROUTE_AUTH_CODES.CHAT,
|
||||
},
|
||||
{
|
||||
path: '/chatSetting',
|
||||
path: '/chatSetting/:modelId?/:menuKey?',
|
||||
name: 'chatSetting',
|
||||
component: './SemanticModel/ChatSetting',
|
||||
access: ROUTE_AUTH_CODES.CHAT_SETTING,
|
||||
envEnableList: [ENV_KEY.CHAT],
|
||||
},
|
||||
{
|
||||
path: '/semanticModel',
|
||||
path: '/semanticModel/:modelId?/:menuKey?',
|
||||
name: 'semanticModel',
|
||||
component: './SemanticModel/ProjectManager',
|
||||
access: ROUTE_AUTH_CODES.SEMANTIC,
|
||||
envEnableList: [ENV_KEY.SEMANTIC],
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
@@ -32,7 +39,11 @@ const ROUTES = [
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/chat',
|
||||
redirect: APP_TARGET === 'inner' ? '/semanticModel' : '/chat',
|
||||
envRedirect: {
|
||||
[ENV_KEY.CHAT]: '/chat',
|
||||
[ENV_KEY.SEMANTIC]: '/semanticModel',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
|
||||
Reference in New Issue
Block a user