init项目

This commit is contained in:
2024-08-07 21:48:24 +08:00
parent 54cf1247fa
commit 2c3a02d33b
10 changed files with 126 additions and 0 deletions

BIN
build/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
build/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

BIN
build/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
build/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
build/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
build/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
build/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

108
electron/config/bin.js Normal file
View File

@@ -0,0 +1,108 @@
/**
* ee-bin 配置
* 仅适用于开发环境
*/
module.exports = {
/**
* development serve ("frontend" "electron" )
* ee-bin dev
*/
dev: {
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'dev'],
protocol: 'http://',
hostname: 'localhost',
port: 18091,
indexPath: 'index.html'
},
electron: {
directory: './',
cmd: 'electron',
args: ['.', '--env=local', '--color=always'], // --env: local|prod; '--color=always' 控制台颜色
}
},
/**
* 构建
* ee-bin build
*/
build: {
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'build'],
}
},
/**
* 移动资源
* ee-bin move
*/
move: {
frontend_dist: {
dist: './frontend/dist',
target: './public/dist'
}
},
/**
* 预发布模式prod
* ee-bin start
*/
start: {
directory: './',
cmd: 'electron',
args: ['.', '--env=prod']
},
/**
* 加密
*/
encrypt: {
// confusion - 压缩混淆加密
// bytecode - 字节码加密
// strict - 先混淆加密,然后字节码加密
type: 'confusion',
// 文件匹配
// ! 符号开头的意思是过滤
files: [
'electron/**/*.(js|json)',
'!electron/config/encrypt.js',
'!electron/config/nodemon.json',
'!electron/config/builder.json',
'!electron/config/bin.json',
],
// 需要加密的文件后缀暂时只支持js
fileExt: ['.js'],
// 混淆加密配置
confusionOptions: {
// 压缩成一行
compact: true,
// 删除字符串文字并将其放置在一个特殊数组中
stringArray: true,
// 对stringArray的所有字符串文字进行编码'none' | 'base64' | 'rc4'
stringArrayEncoding: ['none'],
// 注入死代码,注:影响性能
deadCodeInjection: false,
}
},
/**
* 执行自定义命令
* ee-bin exec
*/
exec: {
node_v: {
directory: './',
cmd: 'node',
args: ['-v'],
},
npm_v: {
directory: './',
cmd: 'npm',
args: ['-v'],
},
},
};

18
frontend/src/App.vue Normal file
View File

@@ -0,0 +1,18 @@
<template>
<!--element-plus语言国际化全局修改为中文-->
<el-config-provider :locale="zhCn">
<router-view/>
</el-config-provider>
</template>
<script lang="ts" setup>
defineOptions({
name: "App"
})
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
document.getElementById('loadingPage').remove()
</script>
<style scoped></style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 KiB