Commit 16a2e3b2 by liangkaiping

copy

parent 4da4693b

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# wmypcWeb
### 公共组件介绍
组件|路径|描述
---|---|---|
Fetching|/src/components/Fetching/index.jsx|页面初始化加载组件
NoData|/src/components/noData/index.jsx|列表暂无数据展示组件
Pagination|/src/components/Pagination/index.jsx|列表分页页码组件
SiteFooter|/src/components/SiteFooter/index.jsx|页面底部组件
Header|/src/containers/Home/component/header/index.jsx|页面顶部header组件
### 公共less变量介绍
变量|路径|描述
---|---|---|
@default_blue|/src/styles/variable.less|系统通用蓝色色号
.singleOverflow|/src/styles/variable.less|单行溢出省略号样式类
.someOverflow(@len)|/src/styles/variable.less|多行溢出省略号样式类,行数可传入
### 常用公共方法介绍
公共方法名称|路径|描述
---|---|---|
getRouterBefore|/src/utils/commonFunc.js|获取站点的companycode和sitecode组合,样例:"/companycode/sitecode"
strCutByLen|/src/utils/commonFunc.js|字符串超出长度显示省略号
numberCutByMax|/src/utils/commonFunc.js|数字大小超出限制以+代之
changeLanguage|/src/utils/commonFunc.js|切换系统语言
dateFormat|/src/utils/commonFunc.js|时间戳转日期格式显示
jumpToLive|/src/utils/jumperToLive.js|跳转至保利威视直播页面,封装用户观看权限验证,需传入直播频道号
<cross-domain-policy>
<allow-access-from domain="*.polyv.net"/>
</cross-domain-policy>
<?php
$username = "daying";
$secretkey = "oj0LfU5fwB";
$vid=$_GET["vid"];
$t = $_GET["t"];
$code = $_GET["code"];
$fontSize="40";
$fontColor="0xFFE900";
$speed="200";
$filter="on";
$setting="3";
$alpha="1";
$filterAlpha="1";
$filterColor="0x3914AF";
$blurX="2";
$blurY="2";
$tweenTime="1";
$interval="5";
$lifeTime="3";
$strength="4";
$show="on";
$msg="Errormessage!";
$status = 1;
if(!empty($_GET["callback"])){
$callback = $_GET["callback"];
}else{
$callback = '';
}
if($callback!=''){
$sign=md5("vid=$vid&secretkey=$secretkey&username=$username&code=$code&status=$status&t=$t");
$array=Array("status"=>$status,"username"=>$username,"sign"=>$sign);
//若需要在PC端h5播放器中显示跑马灯,则$array改为:
//$array = Array("status"=>$status,"username"=>$username,"sign"=>$sign,"msg"=>$msg,"fontSize"=>$fontSize,"fontColor"=>$fontColor,"speed"=>$speed,"filter"=>$filter,"setting"=>$setting,"alpha"=>$alpha,"filterAlpha"=>$filterAlpha,"filterColor"=>$filterColor,"blurX"=>$blurX,"blurY"=>$blurY,"tweenTime"=>$tweenTime,"interval"=>$interval,"lifeTime"=>$lifeTime,"strength"=>$strength,"show"=>$show,);
$Json = json_encode($array);
echo $callback."(".$Json.")";
} else{
$sign = md5("vid=$vid&secretkey=$secretkey&username=$username&code=$code&status=$status&t=$t&msg=$msg&fontSize=$fontSize&fontColor=$fontColor&speed=$speed&filter=$filter&setting=$setting&alpha=$alpha&filterAlpha=$filterAlpha&filterColor=$filterColor&blurX=$blurX&blurY=$blurY&interval=$interval&lifeTime=$lifeTime&tweenTime=$tweenTime&strength=$strength&show=$show");
$array = Array("status"=>$status,"username"=>$username,"sign"=>$sign,"msg"=>$msg,"fontSize"=>$fontSize,"fontColor"=>$fontColor,"speed"=>$speed,"filter"=>$filter,"setting"=>$setting,"alpha"=>$alpha,"filterAlpha"=>$filterAlpha,"filterColor"=>$filterColor,"blurX"=>$blurX,"blurY"=>$blurY,"tweenTime"=>$tweenTime,"interval"=>$interval,"lifeTime"=>$lifeTime,"strength"=>$strength,"show"=>$show,);
$Json = json_encode($array);
echo $Json;
}
?>
var path = require('path');
var express = require('express');
var app = express();
var rootPath = path.resolve(__dirname, '..');
// 这句必须在解决跨域问题之前,否则会导致css文件加载但样式无效的问题
app.use(express.static(rootPath+"/dist"))
app.all('*',function(req,res,next){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
res.header("X-Powered-By",' 3.2.1')
res.header("Content-Type", "text/html");
next();
})
app.get('*', function (req, res) {
res.sendFile(path.join(rootPath, 'dist/index.html'));
});
app.listen(3003, function (err) {
if (err) {
return console.error(err);
}
console.log('Listeningpc at http://localhost:3003/shyz/shyz/login');
});
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");
const ProgressBarPlugin = require("progress-bar-webpack-plugin");
const ENV = process.env.NODE_ENV || "development";
const enrtyBasePath = "/";
// const fileName = "demo";
function generateHtml(name, title) {
return {
title: title,
template: `./${name}.template.html`,
filename: `${name}.html`,
// chunks: [`${name}`],
// favicon: "./static/images/favicon.ico",
inject: true,
minify:
ENV === "production"|| ENV == undefined
? {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
minifyJS: true
}
: {}
};
}
module.exports = {
mode: ENV,
context: path.resolve(__dirname, "../src/"),
entry: {
index: "./index.jsx",
vendor: ["react", "react-dom", "redux", "react-redux", "react-router-dom"]
},
output: {
filename: "js/[name].[hash:6].js",
chunkFilename: "js/[name].[hash:6].js",
publicPath: "/",
path: path.resolve(__dirname, "../dist/")
},
resolve: {
extensions: ['.web.js', '.jsx', '.js', '.json','.less'],
mainFiles:["index", "default"],
alias: {
Utils: path.resolve(__dirname, "../src/utils"),
Components: path.resolve(__dirname, "../src/components"),
Static: path.resolve(__dirname, "../src/static")
}
},
plugins: [
new HtmlWebpackPlugin(generateHtml("index", "未木云学习平台")),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
routerMode: JSON.stringify("hash")
}),
// new ProgressBarPlugin()
],
optimization: {
splitChunks: {
cacheGroups: {
styles: {
name: "styles",
test: /\.less$/,
chunks: "all",
enforce: true
},
commons: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
chunks: "all"
}
}
}
}
};
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");
const ENV = !process.env.NODE_ENV?"production":"development";
// const fileName = "demo";
console.log(ENV,"ENV=========ENV")
function generateHtml(name, title) {
return {
title: title,
template: `./${name}.template.html`,
filename: `${name}.html`,
// chunks: [`${name}`],
// favicon: "./static/images/favicon.ico",
inject: true,
minify:
ENV !== "production"|| ENV == undefined
? {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
minifyJS: true
}
: {}
};
}
module.exports = {
mode: ENV,
context: path.resolve(__dirname, "../src/"),
entry: {
index: "./index.jsx",
vendor: ["react", "react-dom", "redux", "react-redux", "react-router-dom"]
},
output: {
filename: "js/[name].[hash:6].js",
chunkFilename: "js/[name].[hash:6].js",
publicPath: "/",
path: path.resolve(__dirname, "../dist/")
},
resolve: {
extensions: ['.web.js', '.jsx', '.js', '.json','.less'],
mainFiles:["index", "default"],
alias: {
Utils: path.resolve(__dirname, "../src/utils"),
Components: path.resolve(__dirname, "../src/components"),
Static: path.resolve(__dirname, "../src/static")
}
},
plugins: [
new HtmlWebpackPlugin(generateHtml("index", "未木云学习平台")),
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
routerMode: JSON.stringify("hash")
}),
],
optimization: {
splitChunks: {
chunks: 'async',
minSize: 30000,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
automaticNameDelimiter: '~',
name: true,
cacheGroups: {
styles: {
name: "styles",
test: /\.less$/,
chunks: "all",
enforce: true
},
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10
},
default: {
minChunks: 2,
priority: -20,
reuseExistingChunk: true
}
}
}
}
};
/**
* webpack dev config
*/
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const common = require("./webpack.base.config.js");
const ENV = process.env.NODE_ENV || "development";
module.exports = merge(common, {
mode: ENV=="production"||ENV==undefined?"production":"development",
devtool: ENV=="production"?"none":"source-map",
module: {
rules: [{
enforce: "pre",
test: /\.jsx?$/,
exclude: /node_modules/,
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ["babel-loader"]
},
{
test: /\.(css|less)$/,
use: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: [
require("autoprefixer")(),
require("cssnano")({
preset: "default"
})
]
}
},
"less-loader"
]
},
{
test: /\.(png|svg|jpg|gif|jpeg)$/,
use: [
{
loader: "file-loader",
options: {
limit: 8192,
name: "[name].[hash:6].[ext]",
outputPath: "static/images/"
}
}
]
}
]
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: "./dist",
hot: true,
compress: true,
host: "localhost",
disableHostCheck: true,
historyApiFallback: true,
overlay: {
errors: true,
warnings: false
}
},
optimization: ENV=="production"||ENV==undefined?{
minimizer: [
new TerserPlugin({
terserOptions: {
parallel: true,
cache: true,
compress: { warnings: false, drop_console: true },
output: {
// comments: false
}
}
})
]
}:{}
});
/**
* webpack dev config
*/
const path = require("path");
const webpack = require("webpack");
const merge = require("webpack-merge");
const common = require("./webpack.base.config.js");
const ENV = process.env.NODE_ENV || "development";
module.exports = merge(common, {
mode: "development",
devtool:"source-map",
module: {
rules: [{
enforce: "pre",
test: /\.jsx?$/,
exclude: /node_modules/,
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ["babel-loader"]
},
{
test: /\.(css|less)$/,
use: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: [
require("autoprefixer")(),
require("cssnano")({
preset: "default"
})
]
}
},
"less-loader"
]
},
{
test: /\.(png|svg|jpg|gif|jpeg|ttf|otf)$/,
use: [
{
loader: "file-loader",
options: {
limit: 8192,
name: "[name].[hash:6].[ext]",
outputPath: "static/images/"
}
}
]
}
]
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: "./dist",
hot: true,
compress: true,
host: "localhost",
disableHostCheck: true,
historyApiFallback: true,
overlay: {
errors: true,
warnings: false
}
},
optimization:{}
});
/**
* webpack dev config
*/
const path = require("path");
const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
// const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const merge = require("webpack-merge");
const common = require("./webpack.base.config.js");
module.exports = merge(common, {
mode: "production",
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.less$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: "../"
}
},
"css-loader",
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: [
require("autoprefixer")(),
require("cssnano")({
preset: "default"
})
]
}
},
"less-loader"
]
},
{
test: /\.(png|jpg|gif|jpeg)$/,
use: [
{
loader: "url-loader",
options: {
limit: 8192,
name: "[name].[hash:6].[ext]",
outputPath: "image/"
}
}
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "css/[name].[hash:5].css"
// publicPath: "/"
}),
],
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
parallel: true,
cache: true,
compress: { warnings: false, drop_console: true },
output: {
// comments: false
}
}
})
]
}
});
/**
* auth: 陈万军
* webpack prod config
*/
const merge = require("webpack-merge");
const TerserPlugin = require("terser-webpack-plugin");
const common = require("./webpack.base.config.js");
const ProgressBarPlugin = require("progress-bar-webpack-plugin");
module.exports = merge(common, {
mode: "production",
module: {
rules: [{
enforce: "pre",
test: /\.jsx?$/,
exclude: /node_modules/,
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ["babel-loader"]
},
{
test: /\.(css|less)$/,
use: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: [
require("autoprefixer")(),
require("cssnano")({
preset: "default"
})
]
}
},
"less-loader"
]
},
{
test: /\.(png|svg|jpg|gif|jpeg|ttf|otf)$/,
use: [
{
loader: "file-loader",
options: {
limit: 8192,
name: "[name].[hash:6].[ext]",
outputPath: "static/images/"
}
}
]
}
]
},
performance: {
hints: "warning",
maxAssetSize: 30000000,
maxEntrypointSize: 50000000,
assetFilter: function(assetFilename) {
return assetFilename.endsWith(".css") || assetFilename.endsWith(".js");
},
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
output: {
},
parallel: true,
cache: true,
drop_console: true,
drop_debugger: false,
pure_funcs: ['console.log','Warning','warnings','debugger'], // 移除console
}
})
]
}
});
git checkout $1
git pull
npm run build
./pushFromMac.sh package
<cross-domain-policy>
<allow-access-from domain="*.polyv.net"/>
</cross-domain-policy>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link id="faviconLink" rel="shortcut icon" href="/static/favicon.ico">
<link href="/static/lib/antd.min.css" rel="stylesheet" type="text/css">
<!--需要title 国际化 代码在/src/index.jsx 中获取修改-->
<title id="htmlTitle"></title>
<!--<title id="htmlTitle">未木云学习平台</title>-->
</head>
<body>
<div id="root"></div>
<script>
//30分钟不操作退回登陆页
var move = document.getElementById('root')
function onmove() {
console.log(window.location)
var path = window.location.pathname
var login = '/' + window.location.pathname.split("/")[1] + '/' + window.location.pathname.split("/")[2] + '/login'
if (path.substring(path.length - 5) !== 'login') {
sessionStorage.clear()
window.location.href = window.location.origin + login
}
}
function debounce(func, wait) {
var timeout;
return function () {
var context = this;
var args = arguments;
if (timeout) clearTimeout(timeout);
timeout = window.setTimeout(function () {
func.apply(context, args)
}, wait);
}
}
move.onmousemove = debounce(onmove, 7200000);
if (typeof Object.assign != 'function') {
Object.assign = function (target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
if (typeof "".includes != 'function') {
String.prototype.includes = function (str) {
if(this.indexOf(str)!=-1){
return true;
}else{
return false;
}
}
}
if (typeof [].includes != 'function') {
Array.prototype.includes = function (str) {
if(this.indexOf(str)!=-1){
return true;
}else{
return false;
}
}
}
if (typeof [].fill != 'function') {
Array.prototype.fill = function (str) {
for(var i = 0;i<this.length;i++){
this[i] = str;
}
return this;
}
}
// if (typeof [].entries != 'function') {
// Array.prototype.entries = function (str) {
// for(var i = 0;i<this.length;i++){
// this[i] = str;
// }
// return this;
// }
// }
</script>
<script type="text/javascript" src="/static/lib/crypto1/crypto/crypto.js"></script>
<script type="text/javascript" src="/static/lib/crypto1/hmac/hmac.js"></script>
<script type="text/javascript" src="/static/lib/crypto1/sha1/sha1.js"></script>
<script type="text/javascript" src="/static/lib/base64.js"></script>
<script type="text/javascript" src="/static/variable.js"></script>
<script type="text/javascript" src="/static/lib/sm2.min.js"></script>
<script type="text/javascript" src="/static/lib/es6-promise.auto.min.js"></script>
<script type="text/javascript" src="/js/styles.558ae8.js"></script><script type="text/javascript" src="/js/index.558ae8.js"></script><script type="text/javascript" src="/js/vendor.558ae8.js"></script></body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1">
<title>站点维护中</title>
<style>
body,
html {
width: 100%;
margin: 0;
padding: 0;
}
.site-maintain-container {
max-width: 1200px;
width: 100%;
margin: 0 auto;
text-align: center;
}
.site-maintain-container img {
width: 450px;
height: 341px;
margin-top: 160px;
}
.site-maintain-tip-text {
width: 655px;
text-align: center;
margin: 0 auto;
margin-top: 20px;
font-size: 30px;
font-weight: 500;
color: #666666;
line-height: 42px;
letter-spacing: 1px;
}
@media screen and (max-width: 600px) {
body,
html {
width: 100%;
margin: 0;
padding: 0;
}
.site-maintain-container {
width: 100%;
margin: 0 auto;
text-align: center;
}
.site-maintain-container img {
width: 215px;
height: 171px;
margin-top: 135px;
}
.site-maintain-tip-text {
width: 100%;
text-align: center;
margin: 0 auto;
margin-top: 20px;
font-size: 14px;
font-weight: 500;
color: #999;
line-height: 20px;
letter-spacing: 1px;
word-break: break-all;
}
}
</style>
</head>
<body>
<div class="site-maintain-container">
<img src="https://customproject.oss-cn-shanghai.aliyuncs.com/photo/site_maintenance.png" alt="">
<div class="site-maintain-tip-text">
</div>
</div>
<script>
function getUrlParam(code){
var searchText = window.location.search.split("?")[1].split("&");
var result = "";
for(var i = 0;i<searchText.length;i++){
var arr = searchText[i].split("=");
if(arr[0]==code){
result = arr[1];
break;
}
}
return result;
}
window.onload = function () {
var textDom = document.querySelector(".site-maintain-tip-text");
var text = getUrlParam("text");
textDom.innerHTML = decodeURIComponent(text)||"站点维护中,给您的学习带来不便,敬请谅解";
}
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
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