Commit d9043206 authored by wty's avatar wty

新增背景生成 dev

parent 554f1579
const env = 'prod' const env = 'dev'
const getConfig = ()=>{ const getConfig = ()=>{
switch (env){ switch (env){
......
{ {
"files": { "files": {
"main.css": "/static/css/main.ca93c6f5.chunk.css", "main.css": "/static/css/main.ca93c6f5.chunk.css",
"main.js": "/static/js/main.6e8d308a.chunk.js", "main.js": "/static/js/main.f2c08f80.chunk.js",
"main.js.map": "/static/js/main.6e8d308a.chunk.js.map", "main.js.map": "/static/js/main.f2c08f80.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.6f469cb7.js", "runtime-main.js": "/static/js/runtime-main.6f469cb7.js",
"runtime-main.js.map": "/static/js/runtime-main.6f469cb7.js.map", "runtime-main.js.map": "/static/js/runtime-main.6f469cb7.js.map",
"static/css/2.1f1ea42e.chunk.css": "/static/css/2.1f1ea42e.chunk.css", "static/css/2.1f1ea42e.chunk.css": "/static/css/2.1f1ea42e.chunk.css",
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
"static/css/2.1f1ea42e.chunk.css", "static/css/2.1f1ea42e.chunk.css",
"static/js/2.a11bd04d.chunk.js", "static/js/2.a11bd04d.chunk.js",
"static/css/main.ca93c6f5.chunk.css", "static/css/main.ca93c6f5.chunk.css",
"static/js/main.6e8d308a.chunk.js" "static/js/main.f2c08f80.chunk.js"
] ]
} }
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="//yun.duiba.com.cn/polaris/dui512-512.da584fffa7f8fd717dd77acc6efdfc360ffe7da6.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>兑123百宝箱·软件下载|新人导航|文档规范|在线工具</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.ca93c6f5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4a2ff99b"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.a11bd04d.chunk.js"></script><script src="/static/js/main.6e8d308a.chunk.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="//yun.duiba.com.cn/polaris/dui512-512.da584fffa7f8fd717dd77acc6efdfc360ffe7da6.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>兑123百宝箱·软件下载|新人导航|文档规范|在线工具</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.ca93c6f5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4a2ff99b"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.a11bd04d.chunk.js"></script><script src="/static/js/main.f2c08f80.chunk.js"></script></body></html>
\ No newline at end of file \ 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.
import logo from "../../static/logo.png"; import logo from "../../static/logo.png";
import './index.scss' import './index.scss'
import {Root} from "../../dataCenter/Root"; import {Root} from "../../dataCenter/Root";
import {useContext, useEffect, useState} from "react"; import React,{useContext, useEffect, useState} from "react";
import {NEED_UPDATE_INDEX} from "../../dataCenter/action"; import {NEED_UPDATE_INDEX} from "../../dataCenter/action";
import {useHistory} from "react-router-dom"; import {useHistory} from "react-router-dom";
import gotoLogin from "../../utils/gotoLogin"; import gotoLogin from "../../utils/gotoLogin";
...@@ -13,6 +13,7 @@ function Index() { ...@@ -13,6 +13,7 @@ function Index() {
const history = useHistory() const history = useHistory()
const [mdLock, setMdLock] = useState(false) const [mdLock, setMdLock] = useState(false)
const {fetchData, dataCenter, dispatch} = useContext(Root) const {fetchData, dataCenter, dispatch} = useContext(Root)
const [backgroundData, setBackgroundData] = useState(null)
const getUser = async () => { const getUser = async () => {
await fetchData('/users/getUser', {}, 'userInfo') await fetchData('/users/getUser', {}, 'userInfo')
...@@ -25,7 +26,24 @@ function Index() { ...@@ -25,7 +26,24 @@ function Index() {
} }
const createImg = ()=>{
const user = dataCenter?.userInfo
const canvas = document.createElement('canvas')
const context = canvas.getContext('2d')
// context.fillStyle = "cornflowerblue"; //画布填充色
// context.fillRect(0, 0, 200, 200); //清空画布
canvas.height = 200
canvas.width = 200
context.globalAlpha = 0.1
context.fillStyle = "black"; //设置字体颜色
context.font = "18px Arial"; //设置字体
context.textAlign = "center";
context.translate(100, 100)
context.rotate((Math.PI / 180) * -25)
context.fillText(user?.name + ' ' + user?.id,0,0)
context.translate(-100, -100)
return canvas.toDataURL('image/png')
}
useEffect(() => { useEffect(() => {
if (dataCenter.needUpdateIndex) { if (dataCenter.needUpdateIndex) {
...@@ -40,6 +58,7 @@ function Index() { ...@@ -40,6 +58,7 @@ function Index() {
if (!!dataCenter?.userInfo) { if (!!dataCenter?.userInfo) {
await sendMd(dataCenter?.userInfo, Exposure, 'page_index') await sendMd(dataCenter?.userInfo, Exposure, 'page_index')
setMdLock(true) setMdLock(true)
setBackgroundData(createImg())
} }
}, [dataCenter?.userInfo]) }, [dataCenter?.userInfo])
...@@ -50,8 +69,7 @@ function Index() { ...@@ -50,8 +69,7 @@ function Index() {
}, []) }, [])
return ( return (
<div className="index" style={{backgroundImage: `url(${backgroundData})`}}>
<div className="index">
<TypeNavBar/> <TypeNavBar/>
<div className="welcome-top"> <div className="welcome-top">
<span>欢迎您! <span>欢迎您!
......
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