Skip to content

Commit

Permalink
start deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mtianyan committed Jul 25, 2020
1 parent 744ea32 commit 3b51c7a
Show file tree
Hide file tree
Showing 82 changed files with 251 additions and 43 deletions.
1 change: 0 additions & 1 deletion Mxonline3/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# STATIC_ROOT = os.path.join(BASE_DIR, 'static')
X_FRAME_OPTIONS = 'sameorigin'

REST_FRAMEWORK = {
Expand Down
2 changes: 0 additions & 2 deletions Mxonline3/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@

# 富文本相关url
path('ueditor/', include('DjangoUeditor.urls')),
path('xadmin/', AdminIndexView.as_view(), name="admin_index"),

path('api/v1/', include(router.urls)),
path('api/v1/user/currentUser', CurrentUserView.as_view(), name='user_current_user'),
path('api/v1/captcha-generate/', CaptchaView.as_view(), name='captcha'),
Expand Down
38 changes: 19 additions & 19 deletions front_end/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export default defineConfig({
// umi routes: https://umijs.org/docs/routing
routes: [
{
path: '/user',
path: '/xadmin/user',
component: '../layouts/UserLayout',
routes: [
{
name: 'login',
path: '/user/login',
path: '/xadmin/user/login',
component: './UserLogin',
},
],
Expand All @@ -53,100 +53,100 @@ export default defineConfig({
routes: [
{
name: '首页',
path: '/xadmin',
path: '/xadmin/index',
icon: 'smile',
component: './DashBoard',
},
{
path: '/',
redirect: '/xadmin',
redirect: '/xadmin/index',
},
{
name: '所在城市',
icon: 'smile',
path: '/city/list',
path: '/xadmin/city/list',
component: './CityList',
},
{
name: '机构信息',
icon: 'smile',
path: '/org/list',
path: '/xadmin/org/list',
component: './OrgList',
},
{
name: '机构讲师',
icon: 'smile',
path: '/teacher/list',
path: '/xadmin/teacher/list',
component: './TeacherList',
},
{
name: '课程信息',
icon: 'user',
path: '/course/list',
path: '/xadmin/course/list',
component: './CourseList',
},
{
name: '章节信息',
icon: 'user',
path: '/lesson/list',
path: '/xadmin/lesson/list',
component: './LessonList',
},
{
name: '视频信息',
icon: 'user',
path: '/video/list',
path: '/xadmin/video/list',
component: './VideoList',
},
{
name: '课程资源',
icon: 'user',
path: '/resource/list',
path: '/xadmin/resource/list',
component: './ResourceList',
},
{
name: '课程评论',
icon: 'user',
path: '/comment/list',
path: '/xadmin/comment/list',
component: './CommentList',
},
{
name: '用户信息',
icon: 'user',
path: '/users/list',
path: '/xadmin/users/list',
component: './UserList',
},
{
path: '/code/list',
path: '/xadmin/code/list',
name: '用户验证',
icon: 'ApartmentOutlined',
component: './CodeList', // authority: ['system:department'],
},
{
path: '/users/course',
path: '/xadmin/users/course',
name: '用户课程',
icon: 'ApartmentOutlined',
component: './UserCourseList', // authority: ['system:department'],
},
{
path: '/users/fav',
path: '/xadmin/users/fav',
name: '用户收藏',
icon: 'ApartmentOutlined',
component: './UserFav', // authority: ['system:department'],
},
{
path: '/users/message',
path: '/xadmin/users/message',
name: '用户消息',
icon: 'ApartmentOutlined',
component: './UserMessage', // authority: ['system:department'],
},
{
path: '/users/ask',
path: '/xadmin/users/ask',
name: '用户咨询',
icon: 'ApartmentOutlined',
component: './UserAskList', // authority: ['system:department'],
},
{
path: '/banner/ask',
path: '/xadmin/banner/ask',
name: '首页轮播',
icon: 'ApartmentOutlined',
component: './BannerList', // authority: ['system:department'],
Expand Down
38 changes: 19 additions & 19 deletions front_end/src/.umi/core/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { plugin } from './plugin';

const routes = [
{
"path": "/user",
"path": "/xadmin/user",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'layouts__UserLayout' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/layouts/UserLayout'), loading: require('@/components/PageLoading/index').default}),
"routes": [
{
"name": "login",
"path": "/user/login",
"path": "/xadmin/user/login",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserLogin' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserLogin'), loading: require('@/components/PageLoading/index').default}),
"exact": true
}
Expand All @@ -25,116 +25,116 @@ const routes = [
"routes": [
{
"name": "首页",
"path": "/xadmin",
"path": "/xadmin/index",
"icon": "smile",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__DashBoard' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/DashBoard'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/",
"redirect": "/xadmin",
"redirect": "/xadmin/index",
"exact": true
},
{
"name": "所在城市",
"icon": "smile",
"path": "/city/list",
"path": "/xadmin/city/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__CityList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/CityList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "机构信息",
"icon": "smile",
"path": "/org/list",
"path": "/xadmin/org/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__OrgList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/OrgList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "机构讲师",
"icon": "smile",
"path": "/teacher/list",
"path": "/xadmin/teacher/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__TeacherList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/TeacherList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "课程信息",
"icon": "user",
"path": "/course/list",
"path": "/xadmin/course/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__CourseList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/CourseList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "章节信息",
"icon": "user",
"path": "/lesson/list",
"path": "/xadmin/lesson/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__LessonList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/LessonList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "视频信息",
"icon": "user",
"path": "/video/list",
"path": "/xadmin/video/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__VideoList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/VideoList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "课程资源",
"icon": "user",
"path": "/resource/list",
"path": "/xadmin/resource/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__ResourceList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/ResourceList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "课程评论",
"icon": "user",
"path": "/comment/list",
"path": "/xadmin/comment/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__CommentList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/CommentList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"name": "用户信息",
"icon": "user",
"path": "/users/list",
"path": "/xadmin/users/list",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/code/list",
"path": "/xadmin/code/list",
"name": "用户验证",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__CodeList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/CodeList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/users/course",
"path": "/xadmin/users/course",
"name": "用户课程",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserCourseList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserCourseList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/users/fav",
"path": "/xadmin/users/fav",
"name": "用户收藏",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserFav' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserFav'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/users/message",
"path": "/xadmin/users/message",
"name": "用户消息",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserMessage' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserMessage'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/users/ask",
"path": "/xadmin/users/ask",
"name": "用户咨询",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__UserAskList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/UserAskList'), loading: require('@/components/PageLoading/index').default}),
"exact": true
},
{
"path": "/banner/ask",
"path": "/xadmin/banner/ask",
"name": "首页轮播",
"icon": "ApartmentOutlined",
"component": dynamic({ loader: () => import(/* webpackChunkName: 'p__BannerList' */'/Users/mtianyan/Desktop/Github/Mxonline3/front_end/src/pages/BannerList'), loading: require('@/components/PageLoading/index').default}),
Expand Down
52 changes: 52 additions & 0 deletions front_end/src/.umi/umi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-nocheck
import './core/polyfill';
import '@@/core/devScripts';
import '../global.jsx';
import { plugin } from './core/plugin';
import { createHistory } from './core/history';
Expand All @@ -10,6 +11,38 @@ import { renderClient } from '/Users/mtianyan/Desktop/Github/Mxonline3/front_end
require('../global.less');
require('./plugin-locale/locale')._onCreate();

(() => {
// Runtime block add component
window.GUmiUIFlag = require('/Users/mtianyan/Desktop/Github/Mxonline3/front_end/node_modules/@umijs/plugin-ui-blocks/lib/sdk/flagBabelPlugin/GUmiUIFlag.js').default;

// Enable/Disable block add edit mode
window.addEventListener('message', (event) => {
try {
const { action, data } = JSON.parse(event.data);
switch (action) {
case 'umi.ui.checkValidEditSection':
const haveValid = !!document.querySelectorAll('div.g_umiuiBlockAddEditMode').length;
const frame = document.getElementById('umi-ui-bubble');
if (frame && frame.contentWindow) {
frame.contentWindow.postMessage(
JSON.stringify({
action: 'umi.ui.checkValidEditSection.success',
payload: {
haveValid,
},
}),
'*',
);
}
default:
break;
}
} catch(e) {
}
}, false);
})();


const getClientRender = (args: { hot?: boolean } = {}) => plugin.applyPlugins({
key: 'render',
type: ApplyPluginsType.compose,
Expand All @@ -35,6 +68,25 @@ export default clientRender();
};


(() => {
try {
const ua = window.navigator.userAgent;
const isIE = ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;
if (isIE) return;

// Umi UI Bubble
require('/Users/mtianyan/Desktop/Github/Mxonline3/front_end/node_modules/@umijs/preset-ui/lib/bubble').default({
port: 3000,
path: '/Users/mtianyan/Desktop/Github/Mxonline3/front_end',
currentProject: '',
isBigfish: undefined,
});
} catch (e) {
console.warn('Umi UI render error:', e);
}
})();


// hot module replacement
// @ts-ignore
if (module.hot) {
Expand Down
2 changes: 1 addition & 1 deletion static/asset-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"/p__VideoList.css": "../static/p__VideoList.eab8c72b.chunk.css",
"/p__VideoList.js": "../static/p__VideoList.ffe290f5.async.js",
"/umi.css": "../static/umi.a5056b76.css",
"/umi.js": "../static/umi.6474b709.js",
"/umi.js": "../static/umi.e9088fe0.js",
"/vendors~p__UserLogin.css": "../static/vendors~p__UserLogin.fd04645f.chunk.css",
"/vendors~p__UserLogin.js": "../static/vendors~p__UserLogin.de383516.async.js",
"/29.ac673366.chunk.css": "../static/29.ac673366.chunk.css",
Expand Down
1 change: 1 addition & 0 deletions static/umi.3506e9be.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/umi.e9088fe0.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3b51c7a

Please sign in to comment.