From 744ea326df30213ac2f31ebdcd679a63cf47a140 Mon Sep 17 00:00:00 2001 From: mtianyan <1147727180@qq.com> Date: Sat, 25 Jul 2020 22:42:29 +0800 Subject: [PATCH] start deploy --- README.md | 2 +- front_end/src/.umi/umi.ts | 52 -------------------------------- front_end/src/pages/document.ejs | 2 +- templates/admin/index.html | 2 +- 4 files changed, 3 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 851f1a58..ea26d07f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ cd OnlineMooc docker-compose up # 导入数据 -docker exec -it mxonline3_mtianyan_mysql_1 bash +docker exec -it onlinemooc_mtianyan_mysql_1 bash mysql -u root -p -D mxonline3 < sql/mxonline3.sql # 输入密码: mtianyanroot ``` diff --git a/front_end/src/.umi/umi.ts b/front_end/src/.umi/umi.ts index b97dc9ae..322750ec 100644 --- a/front_end/src/.umi/umi.ts +++ b/front_end/src/.umi/umi.ts @@ -1,6 +1,5 @@ // @ts-nocheck import './core/polyfill'; -import '@@/core/devScripts'; import '../global.jsx'; import { plugin } from './core/plugin'; import { createHistory } from './core/history'; @@ -11,38 +10,6 @@ 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, @@ -68,25 +35,6 @@ 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) { diff --git a/front_end/src/pages/document.ejs b/front_end/src/pages/document.ejs index 9af4adb5..9616c495 100644 --- a/front_end/src/pages/document.ejs +++ b/front_end/src/pages/document.ejs @@ -36,7 +36,7 @@ padding: 0; } #root { - background-image: url('/home_bg.png'); + background-image: url('/static/home_bg.png'); background-repeat: no-repeat; background-size: 100% auto; } diff --git a/templates/admin/index.html b/templates/admin/index.html index eb31cd14..0815c1e2 100644 --- a/templates/admin/index.html +++ b/templates/admin/index.html @@ -43,7 +43,7 @@ padding: 0; } #root { - background-image: url("/home_bg.png"); + background-image: url("/static/home_bg.png"); background-repeat: no-repeat; background-size: 100% auto; }