Commit 21a141fa authored by rocosen's avatar rocosen

fix:打包设置

parent cbc06c75
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
<svg width="232" height="232" viewBox="0 0 232 232" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_b)">
<path d="M231.5 1V0.5H231H1H0.5V1V231V231.5H1H231H231.5V231V1ZM40.5 25C40.5 33.0082 34.0082 39.5 26 39.5C17.9918 39.5 11.5 33.0082 11.5 25C11.5 16.9918 17.9918 10.5 26 10.5C34.0082 10.5 40.5 16.9918 40.5 25ZM220.5 25C220.5 33.0082 214.008 39.5 206 39.5C197.992 39.5 191.5 33.0082 191.5 25C191.5 16.9918 197.992 10.5 206 10.5C214.008 10.5 220.5 16.9918 220.5 25ZM40.5 205C40.5 213.008 34.0082 219.5 26 219.5C17.9918 219.5 11.5 213.008 11.5 205C11.5 196.992 17.9918 190.5 26 190.5C34.0082 190.5 40.5 196.992 40.5 205ZM220.5 205C220.5 213.008 214.008 219.5 206 219.5C197.992 219.5 191.5 213.008 191.5 205C191.5 196.992 197.992 190.5 206 190.5C214.008 190.5 220.5 196.992 220.5 205ZM209.5 111C209.5 162.639 167.639 204.5 116 204.5C64.3613 204.5 22.5 162.639 22.5 111C22.5 59.3613 64.3613 17.5 116 17.5C167.639 17.5 209.5 59.3613 209.5 111Z" fill="white" stroke="white"/>
<path d="M63.5 146.5C63.5 149.959 60.8969 152.5 58 152.5C55.1031 152.5 52.5 149.959 52.5 146.5C52.5 143.041 55.1031 140.5 58 140.5C60.8969 140.5 63.5 143.041 63.5 146.5Z" stroke="white" stroke-width="5"/>
<path d="M54.9856 139.466C54.9856 139.466 51.1973 116.315 83.1874 93.1647C115.178 70.014 133.698 69.5931 133.698 69.5931" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M178.902 142.686C177.27 139.853 173.652 138.88 170.819 140.512C167.987 142.144 167.014 145.762 168.646 148.595C170.277 151.427 173.896 152.4 176.728 150.768C179.561 149.137 180.534 145.518 178.902 142.686Z" stroke="white" stroke-width="5"/>
<path d="M169.409 151.555C169.409 151.555 151.24 166.394 115.211 150.232C79.182 134.07 69.5718 118.232 69.5718 118.232" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M109.577 41.9707C107.966 44.8143 108.964 48.4262 111.808 50.038C114.651 51.6498 118.263 50.6512 119.875 47.8075C121.487 44.9639 120.488 41.3521 117.645 39.7403C114.801 38.1285 111.189 39.1271 109.577 41.9707Z" stroke="white" stroke-width="5"/>
<path d="M122.038 45.6467C122.038 45.6467 144.047 53.7668 148.412 93.0129C152.778 132.259 144.012 148.579 144.012 148.579" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M59.6334 105C59.6334 105 50.4373 82.1038 61.3054 73.3616C72.1736 64.6194 96 69.1987 96 69.1987" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M149.532 66.9784C149.532 66.9784 174.391 68.9134 177.477 82.6384C180.564 96.3634 165.799 115.833 165.799 115.833" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M138.248 163.363C138.248 163.363 124.023 183.841 110.618 179.573C97.2129 175.305 87.8662 152.728 87.8662 152.728" stroke="white" stroke-width="5" stroke-linecap="round"/>
<path d="M116 119C120.418 119 124 115.642 124 111.5C124 107.358 120.418 104 116 104C111.582 104 108 107.358 108 111.5C108 115.642 111.582 119 116 119Z" fill="white"/>
</g>
<defs>
<filter id="filter0_b" x="-4" y="-4" width="240" height="240" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feGaussianBlur in="BackgroundImage" stdDeviation="2"/>
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur" result="shape"/>
</filter>
</defs>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="256px" height="256px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>北鲲云标志修改-06</title>
<g id="最新版本" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="北鲲云标志修改-06" fill-rule="nonzero">
<rect id="矩形" fill="#FFFFFF" x="0" y="0" width="256" height="256" rx="49.0591958"></rect>
<path d="M143.375554,114.136619 C143.375554,114.136619 132.066664,106.932197 124.430193,102.125649 C110.107759,93.10662 93.1714274,86.0102105 76.299903,88.8833383 C102.114847,94.0139235 118.889161,114.806295 125.45631,120.9846 L143.375554,114.136619 Z" id="路径" fill="#00CCCC"></path>
<path d="M216.748323,108.27155 C216.359479,103.821442 199.811991,96.3253871 172.355259,100.084216 C134.324121,105.29041 114.730686,125.078267 63.8136787,118.44631 C71.0677748,123.346814 78.6460446,127.749427 86.496266,131.623813 C125.737142,151.195646 162.612548,152.610607 188.168263,140.124383 C213.723978,127.638159 217.288384,114.309438 216.748323,108.27155 Z" id="路径" fill="#0066FF"></path>
<path d="M216.672714,107.882705 C214.512468,123.09084 180.86663,122.172735 146.399899,94.5107801 C122.140332,75.0685625 91.896882,58.6830935 64.0081009,65.0450192 C99.576558,69.9595798 120.854985,92.9770052 141.161301,110.539808 C164.99962,131.15936 189.766845,139.346694 207.113624,127.627357 C210.137969,125.024261 218.098477,116.469685 216.672714,107.882705 Z" id="路径" fill="#00CCCC"></path>
<path d="M40.5910299,106.618961 C32.26328,103.983461 27.7591663,106.618961 18.6537277,105.106789 C32.6953293,113.078098 49.253618,116.718113 63.8136787,118.424708 C68.0369605,118.932366 72.8759124,120.1097 79.3890553,119.710054 C74.9821527,119.2348 70.2836167,116.966541 64.0081009,111.533522 C54.3626007,103.173368 39.7053289,91.1407957 18.0272562,89.2181764 C30.5998903,94.7808109 33.8510611,101.628792 40.5910299,106.618961 Z" id="路径" fill="#0066FF"></path>
<path d="M67.3672841,177.215814 C67.2111136,176.952325 67.0183738,176.712309 66.7948188,176.502932 C66.5929024,176.324406 66.3719465,176.16865 66.1359436,176.038479 C65.8311122,175.859712 65.499091,175.732011 65.1530315,175.660436 C65.6103425,175.510513 66.0176306,175.237743 66.3303658,174.871946 C66.5192125,174.67032 66.6758677,174.440802 66.7948188,174.191469 C66.9369255,173.891048 67.04559,173.575921 67.1188557,173.251762 C67.2016404,172.842986 67.2414613,172.426676 67.2376693,172.00962 C67.244987,171.436041 67.1870074,170.863493 67.0648496,170.303025 C66.9560342,169.815549 66.7040251,169.371712 66.341167,169.02848 C65.9127072,168.643041 65.3917418,168.375116 64.8289946,168.250791 C64.0045703,168.057506 63.1588216,167.97039 62.3123075,167.991562 L48.4327244,167.991562 L48.4327244,184.701067 L60.9189486,184.701067 C61.8103193,184.710477 62.7013946,184.663579 63.5868529,184.560651 C64.2375363,184.490104 64.8785935,184.348854 65.4986709,184.139403 C65.9619833,183.970416 66.3903323,183.7178 66.7624151,183.394118 C67.0874419,183.093431 67.3419473,182.724582 67.5077001,182.313995 C67.6861513,181.894489 67.7990818,181.450053 67.8425383,180.996245 C67.9015663,180.469063 67.9304166,179.938938 67.9289481,179.408464 C67.9352551,178.97455 67.8807185,178.541893 67.7669297,178.123117 C67.67559,177.803917 67.5411354,177.498669 67.3672841,177.215814 L67.3672841,177.215814 Z M64.8073921,173.100544 C64.7754885,173.365071 64.6949238,173.621413 64.569765,173.856631 C64.4578381,174.058364 64.2936785,174.226255 64.0945108,174.342686 C63.8383608,174.496241 63.5566218,174.60235 63.2628159,174.655922 C62.8424623,174.740787 62.4164879,174.794936 61.9882705,174.81794 C61.4914139,174.81794 60.9081473,174.81794 60.1844648,174.81794 L50.7657905,174.81794 L50.7657905,169.935783 L61.5670225,169.935783 C62.1263174,169.930827 62.6854006,169.959683 63.2412135,170.022193 C63.5903103,170.04262 63.9301573,170.142358 64.2349268,170.313826 C64.4581272,170.445008 64.6267844,170.651997 64.710181,170.897093 C64.821252,171.246004 64.8723818,171.611217 64.8613983,171.977216 C64.8643875,172.352374 64.8463572,172.727404 64.8073921,173.100544 Z M50.7657905,176.848572 L60.2276697,176.848572 C61.0161597,176.848572 61.7182397,176.848572 62.3015063,176.848572 C62.797171,176.865055 63.2913565,176.911949 63.7812751,176.988988 C64.1041549,177.046627 64.4194214,177.140844 64.7209822,177.26982 C64.9364095,177.373026 65.1222019,177.529092 65.2610438,177.723472 C65.4003532,177.93442 65.4890679,178.174688 65.5202734,178.425552 C65.5755816,178.761073 65.6008845,179.100855 65.595882,179.440867 C65.6015194,179.877755 65.5762535,180.314494 65.5202734,180.747817 C65.4859981,181.053818 65.3943908,181.350626 65.2502426,181.622716 C65.1302237,181.856035 64.9467659,182.050725 64.7209822,182.18438 C64.415481,182.365424 64.078192,182.486408 63.7272689,182.540821 C63.2432036,182.637101 62.7517141,182.69131 62.2583013,182.70284 C61.685836,182.70284 61.0161597,182.70284 60.1844648,182.70284 L50.7657905,182.70284 L50.7657905,176.848572 Z" id="形状" fill="#4D4D4D"></path>
<polygon id="路径" fill="#4D4D4D" points="90.1902873 167.991562 86.6258808 167.991562 75.9866672 175.206785 73.415974 175.206785 73.415974 167.991562 71.0829079 167.991562 71.0829079 184.733471 73.415974 184.733471 73.415974 177.18341 75.9974685 177.18341 86.9283153 184.711869 86.9715202 184.733471 90.5251255 184.733471 78.3197333 176.200498"></polygon>
<path d="M109.880933,176.362516 C109.880933,177.44264 109.880933,178.285136 109.880933,179.019619 C109.871552,179.638853 109.813769,180.256405 109.708114,180.86663 C109.632096,181.284164 109.470267,181.681381 109.232859,182.033163 C109.01264,182.334317 108.708225,182.563568 108.35796,182.692038 C107.872937,182.875043 107.36321,182.98427 106.845787,183.016075 C106.230117,183.070081 105.463229,183.091684 104.555926,183.091684 L99.7061727,183.091684 C98.7988692,183.091684 98.0211805,183.091684 97.4055103,183.016075 C96.8880875,182.98427 96.3783607,182.875043 95.8933378,182.692038 C95.5430723,182.563568 95.2386577,182.334317 95.018438,182.033163 C94.7866684,181.680651 94.6320688,181.283109 94.5647863,180.86663 C94.4529609,180.257242 94.3951301,179.639175 94.3919666,179.019619 C94.3919666,178.285136 94.3919666,177.421037 94.3919666,176.362516 L94.3919666,167.991562 L92.0264968,167.991562 L92.0264968,176.362516 C92.0264968,177.345428 92.0264968,178.241931 92.0264968,179.030421 C92.0419283,179.756663 92.1250983,180.47988 92.2749251,181.190667 C92.4026137,181.794222 92.6327693,182.371438 92.9554027,182.897262 C93.2959724,183.406957 93.7557052,183.825907 94.2947555,184.117801 C94.9739173,184.465047 95.7025595,184.705499 96.4550019,184.830682 C97.5268387,184.997154 98.6107951,185.073031 99.6953715,185.057508 L104.523522,185.057508 C105.608129,185.07412 106.692177,184.998236 107.763892,184.830682 C108.516459,184.706004 109.245177,184.465527 109.924138,184.117801 C110.460017,183.825553 110.916158,183.406497 111.25269,182.897262 C111.580141,182.373867 111.810647,181.795774 111.933167,181.190667 C112.081835,180.479692 112.164992,179.756583 112.181596,179.030421 C112.181596,178.241931 112.181596,177.345428 112.181596,176.362516 L112.181596,167.991562 L109.84853,167.991562 L109.880933,176.362516 Z" id="路径" fill="#4D4D4D"></path>
<polygon id="路径" fill="#4D4D4D" points="134.086494 182.227585 119.213198 168.034766 119.169993 167.991562 115.367959 167.991562 115.367959 184.733471 117.701025 184.733471 117.701025 170.151808 133.43842 184.701067 133.481625 184.733471 136.41956 184.733471 136.41956 167.991562 134.086494 167.991562"></polygon>
<polygon id="路径" fill="#4D4D4D" points="150.00751 175.995274 142.511455 167.991562 139.389899 167.991562 148.840977 177.788279 148.840977 184.733471 151.174043 184.733471 151.174043 177.788279 160.625121 167.991562 157.492764 167.991562"></polygon>
<path d="M181.028649,176.362516 C181.028649,177.367031 181.028649,178.263533 181.028649,179.019619 C181.019267,179.638853 180.961484,180.256405 180.855829,180.86663 C180.778548,181.282037 180.620769,181.678319 180.391376,182.033163 C180.166895,182.334645 179.858967,182.563713 179.505675,182.692038 C179.020652,182.875043 178.510925,182.98427 177.993502,183.016075 C177.377832,183.070081 176.610945,183.091684 175.703641,183.091684 L170.87549,183.091684 C169.968187,183.091684 169.190498,183.091684 168.574828,183.016075 C168.057581,182.982997 167.54804,182.87381 167.062656,182.692038 C166.71239,182.563568 166.407975,182.334317 166.187756,182.033163 C165.957696,181.679772 165.803241,181.282603 165.734104,180.86663 C165.62283,180.257166 165.565004,179.639147 165.561284,179.019619 C165.561284,178.285136 165.561284,177.388633 165.561284,176.362516 L165.561284,167.991562 L163.239019,167.991562 L163.239019,176.362516 C163.239019,177.367031 163.239019,178.241931 163.239019,179.030421 C163.255623,179.756583 163.33878,180.479692 163.487448,181.190667 C163.615136,181.794222 163.845292,182.371438 164.167925,182.897262 C164.512523,183.407418 164.975849,183.826265 165.518079,184.117801 C166.196077,184.467826 166.925165,184.708425 167.678326,184.830682 C168.750163,184.997154 169.834119,185.073031 170.918695,185.057508 L175.746846,185.057508 C176.831423,185.073031 177.915379,184.997154 178.987216,184.830682 C179.740377,184.708425 180.469464,184.467826 181.147462,184.117801 C181.688588,183.828839 182.148972,183.409296 182.486815,182.897262 C182.814266,182.373867 183.044772,181.795774 183.167293,181.190667 C183.317119,180.47988 183.400289,179.756663 183.415721,179.030421 C183.415721,178.231129 183.415721,177.334627 183.415721,176.362516 L183.415721,167.991562 L181.082655,167.991562 L181.028649,176.362516 Z" id="路径" fill="#4D4D4D"></path>
<polygon id="路径" fill="#4D4D4D" points="205.23421 167.991562 205.23421 182.227585 190.360913 168.034766 190.317708 167.991562 186.515674 167.991562 186.515674 184.733471 188.848741 184.733471 188.848741 170.151808 204.586136 184.701067 204.629341 184.733471 207.556474 184.733471 207.556474 167.991562"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -116,6 +116,7 @@
"electron-debug": "^3.2.0",
"electron-log": "^4.4.8",
"electron-root-path": "^1.1.0",
"electron-traywindow-positioner": "^1.1.1",
"electron-updater": "^5.2.1",
"express": "^4.18.2",
"history": "^5.3.0",
......
......@@ -9,12 +9,13 @@
* `./src/main.js` using webpack. This gives us some performance wins.
*/
import path from 'path';
import { app, BrowserWindow, shell, ipcMain } from 'electron';
import { app, BrowserWindow, shell, ipcMain, Tray, Menu } from 'electron';
import { autoUpdater } from 'electron-updater';
import log from 'electron-log';
import MenuBuilder from './menu';
import { resolveHtmlPath } from './util';
const nativeImage = require('electron').nativeImage;
const positioner = require('electron-traywindow-positioner');
class AppUpdater {
constructor() {
......@@ -23,18 +24,37 @@ class AppUpdater {
autoUpdater.checkForUpdatesAndNotify();
}
}
let tray: Tray | null = null;
let mainWindow: BrowserWindow | null = null;
let win: BrowserWindow | null = null;
let siteWindown: BrowserWindow | null = null;
let homeWindown: BrowserWindow | null = null;
const isDev = process.env.NODE_ENV === 'development';
const alignment = { x: 'left', y: 'up' };
const RESOURCES_PATH = app.isPackaged
? path.join(process.resourcesPath, 'assets')
: path.join(__dirname, '../../assets');
const getAssetPath = (...paths: string[]): string => {
return path.join(RESOURCES_PATH, ...paths);
};
let image = nativeImage.createFromPath(getAssetPath('icon.jpg'));
image = image.resize({
width: 32,
height: 32,
});
Menu.setApplicationMenu(null);
ipcMain.on('createNewWindow-site', (event, arg) => {
if (win) {
win.focus();
if (siteWindown) {
siteWindown.focus();
return;
}
win = new BrowserWindow({
siteWindown = new BrowserWindow({
width: 620,
height: 482,
minWidth: 100,
......@@ -47,24 +67,43 @@ ipcMain.on('createNewWindow-site', (event, arg) => {
contextIsolation: false,
webSecurity: false,
},
// parent: win, //win是主窗口
// parent: siteWindown, //win是主窗口
});
win.loadURL(resolveHtmlPath(`index.html#/site`));
isDev && win.webContents.openDevTools();
win.on('closed', () => {
win = null;
siteWindown.loadURL(resolveHtmlPath(`index.html#/site`));
isDev && siteWindown.webContents.openDevTools();
siteWindown.on('closed', () => {
siteWindown = null;
});
});
ipcMain.on('resize-home', (event) => {
if (mainWindow) {
mainWindow.setContentSize(350, 425);
// mainWindow.setResizable(true);
mainWindow.setMaximizable(false);
// mainWindow.setFrame(false);
// mainWindow.center();
if (!tray) return;
mainWindow?.close();
if (homeWindown) {
homeWindown.focus();
return;
}
homeWindown = new BrowserWindow({
width: 350,
height: 425,
minWidth: 100,
minHeight: 100,
frame: false,
resizable: false,
webPreferences: {
sandbox: false,
nodeIntegration: true,
contextIsolation: false,
webSecurity: false,
},
});
homeWindown.loadURL(resolveHtmlPath(`index.html#/home`));
positioner.position(homeWindown, tray.getBounds(), alignment);
isDev && homeWindown.webContents.openDevTools();
homeWindown.on('closed', () => {
homeWindown = null;
});
});
ipcMain.on('window-close', (event) => {
......@@ -101,23 +140,17 @@ const createWindow = async () => {
await installExtensions();
}
const RESOURCES_PATH = app.isPackaged
? path.join(process.resourcesPath, 'assets')
: path.join(__dirname, '../../assets');
const getAssetPath = (...paths: string[]): string => {
return path.join(RESOURCES_PATH, ...paths);
};
mainWindow = new BrowserWindow({
show: false,
width: 480,
height: 486,
minWidth: 100,
minHeight: 100,
icon: getAssetPath('icon.png'),
icon: getAssetPath('icon.ico'),
frame: true,
resizable: false,
titleBarStyle: 'hidden',
// autoHideMenuBar: true,
webPreferences: {
sandbox: false,
nodeIntegration: true,
......@@ -126,8 +159,14 @@ const createWindow = async () => {
},
});
mainWindow.loadURL(resolveHtmlPath('index.html'));
tray = new Tray(image);
// tray.setTitle('test');
// mainWindow.setMenuBarVisibility(false);
// mainWindow.removeMenu();
// mainWindow.setMenu(null);
mainWindow.loadURL(resolveHtmlPath('index.html'));
// mainWindow.webContents.openDevTools();
mainWindow.on('ready-to-show', () => {
if (!mainWindow) {
throw new Error('"mainWindow" is not defined');
......@@ -136,6 +175,7 @@ const createWindow = async () => {
mainWindow.minimize();
} else {
mainWindow.show();
// mainWindow.webContents.openDevTools();
}
});
......@@ -143,8 +183,8 @@ const createWindow = async () => {
mainWindow = null;
});
const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();
// const menuBuilder = new MenuBuilder(mainWindow);
// menuBuilder.buildMenu();
// Open urls in the user's browser
mainWindow.webContents.setWindowOpenHandler((edata) => {
......@@ -156,16 +196,15 @@ const createWindow = async () => {
// eslint-disable-next-line
new AppUpdater();
// function initLoginWindow(windowObj: any) {
// windowObj.setContentSize(500, 500);
// windowObj.setResizable(false);
// windowObj.setMaximizable(false);
// windowObj.center();
// }
// ipcMain.on('showLoginWindow', (event) => {
// initLoginWindow(mainWindow);
// });
tray.on('click', function () {
if (mainWindow) {
mainWindow.show();
return;
}
if (!homeWindown || !tray) return;
homeWindown.show();
positioner.position(homeWindown, tray.getBounds(), alignment);
});
};
/**
......
......@@ -15,6 +15,7 @@ body {
); */
font-family: sans-serif;
overflow-y: hidden;
-webkit-app-region: drag;
/* display: flex;
justify-content: center;
align-items: center; */
......@@ -32,6 +33,7 @@ button {
transition: all ease-in 0.1s;
cursor: pointer;
opacity: 0.9;
-webkit-app-region: no-drag;
}
button:hover {
......
import { HashRouter as Router, Route, Switch, Routes } from 'react-router-dom';
import { Switch } from 'react-router-dom';
import icon from '../../assets/icon.svg';
import { createBrowserHistory } from 'history';
import './App.css';
import path from 'path';
......
......@@ -249,7 +249,7 @@ export default (props) => {
sx={{
fontSize: '12px',
color: '#565C66',
marginLeft: '4px',
marginLeft: '8px',
}}
>
加载更多…
......
......@@ -22,7 +22,7 @@ const useStyles = makeStyles()((theme) => {
export default (props) => {
const { classes } = useStyles();
const { render, navigate } = public();
const [value, setValue] = useState('two');
const [value, setValue] = useState('one');
const handleChange = (event, newValue) => {
setValue(newValue);
......
......@@ -29,7 +29,7 @@ const useStyles = makeStyles()((theme) => {
flexDirection: 'column',
width: '300px',
margin: '0 auto',
marginTop: '10%',
paddingTop: '10%',
},
root: {
height: '40px',
......
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