提交 f9ae78f4 authored 作者: 蔡芬's avatar 蔡芬

1

上级
> 1%
last 2 versions
not dead
# 所有环境默认
# 页面 title 前缀
VUE_APP_TITLE=菜单
# 打包后安装程序名字
VUE_APP_PRODUCTNAME=菜单
# 网络请求公用地址
# 测试
VUE_APP_API=1
VUE_APP_APPID=com.menu.test
# 请求api版本号
VUE_APP_API_VERSION=V1
VUE_APP_IS_WEB=true
IS_WEB=true
\ No newline at end of file
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint",
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"prettier/prettier": "off",
'indent': [2, 2, {
'SwitchCase': 1
}],
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
mocha: true,
},
},
],
};
.DS_Store
node_modules
/tests/e2e/videos/
/tests/e2e/screenshots/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
#Electron-builder output
/dist_electron
\ No newline at end of file
# course_creation
## Project setup
```
yarn install
```
如果出现报错,卡在. electron-chromedriver时,
修改方法:
1. 找到路径:C:\Users\用户名\windows
2. 然后打开路径下面的.yarnrc文件 和 .npmrc文件 ,修改如下:
` registry=https://registry.npm.taobao.org/
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
`
`
npm config set ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/
`
`
npm config set registry=https://registry.npm.taobao.org/
`
3. 然后再去执行,
`yarn add -D electron-chromedriver`
4. 成功之后,重新执行
`vue add electron-builder`
就可以了
### mac打包时报错:electron-v13.6.9-darwin-x64.zip
1. 复制报错链接,下载它,并放到 macOS: ~/Library/Caches/electron/
### 缓存
1. 或者,您可以覆盖本地缓存。
electron-download 会将下载的二进制文件缓存在本地目录中,不会增加网络负担。
您可以使用该缓存文件夹来提供 Electron 的定制版本,或者避免进行网络连接。
`
Linux: $XDG_CACHE_HOME or ~/.cache/electron/
macOS: ~/Library/Caches/electron/
Windows: $LOCALAPPDATA/electron/Cache or ~/AppData/Local/electron/Cache/
`
### [ckeditor5 仓库](http://120.79.101.85:8181/caifen/ck5)
1. 更改src/ckeditor.js,然后在这个仓库内执行命令:yarn build
2. 执行成功后,直接复制build文件夹内容替换 当前项目下 /public/ckeditor的文件夹内容
### Compiles and hot-reloads for development
```
yarn serve
```
```
yarn electron:serve
```
### Compiles and minifies for production
```
yarn build
```
```
yarn electron:build
```
### Run your unit tests
```
yarn test:unit
```
### Run your end-to-end tests
```
yarn test:e2e
```
### Lints and fixes files
```
yarn lint
```
### 修改logo,替换public/logo.png,然后执行
```
yarn electron:generate-icons
# 或者
npm run electron:generate-icons
```
### 打包桌面端配置
1. vue.config.js
2. package.json
`
修改版本号:package.json里=》"version": "1.0.0"
feidao_latest.exe -》 表示当前最新
feidao_v1.0.0.exe =》 表示第几版本
上传到oss: /resources/application/windows/feidao_latest.exe
`
3. 打包window版时,有签名配置的情况下,如果报错:Error: spawn EPERM,
查看是否开启了杀毒软件,关闭杀毒软件,重新打包
4. 打包linux版时,可以在macOS系统上打包
#### package.json
`
"homepage": "https://feidao-tools.oss-cn-shenzhen.aliyuncs.com/resources/application/linux",
"author": "Guangzhou Zaofu Technology Co., Ltd. <service@fei-dao.com> (https://www.fei-dao.com/)",
`
#### vue.config.js
`
"linux": {
"icon": './build/icons',
"category":"Education",
desktop:{
icon: 'feidao'
},
"target": [
"AppImage",
// "flatpak",
"zip",
"deb"
]
}
`
5. 打渠道包
更改./channel/channelMRD.js 里 渠道列表channelAll
然后执行打包命令 `dist:all`
获取渠道:
`
const channelConfig = require('../../channel/channelConfig');
this.$message.info( "安装包来源:"+ this.channelConfig.channel_name );
`
#### Customize configuration
1. See [Configuration Reference](https://cli.vuejs.org/config/).
2. See [vue-cli-plugin-electron-builder](https://nklayman.github.io/vue-cli-plugin-electron-builder/).
3. See [electron-builder](https://www.electron.build/).
4. See [electron-updater文档](https://www.electronjs.org/).
5. See [electron](https://www.electron.build/auto-update.html).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
};
const channel_name = 'oppo';
const channel_type = '3';
exports = module.exports = {
channel_type,
channel_name
};
\ No newline at end of file
const execSync = require('child_process').execSync;
// 渠道包类型
const channelAll = [
{
channel:"360",
channel_type:"1"
},
{
channel:"应用宝",
channel_type:"2"
},
{
channel:"oppo",
channel_type:"3"
},
];
// 打包不同渠道包
for(let i in channelAll) {
let { channel, channel_type } = channelAll[i]
execSync(
`node ./channel/channelProcess.js ${channel} ${channel_type}`
);
execSync('yarn electron:build', {stdio: 'inherit'});
}
const fs = require('fs');
const argv = process.argv;
const channel = argv[2];
const channel_type = argv[3];
const readWriteFile = path => {
fs.readFile(path, function (err, data) {
if (err) {
console.log(`read [${path}] error`);
} else {
const jsonData = JSON.parse(data.toString()); // 读取的package.json内容
const stringData = JSON.stringify(changeData(jsonData)); // 修改后的package.json内容
writeFile(path, stringData); // 写入package.json
}
});
};
const changeData = data => {
data.name = data.name + `-c${channel}`;
data.description = data.description + `-c${channel}`;
data.build.productName = process.env.VUE_APP_PRODUCTNAME + `-c${channel}`;
data.build.directories = {
output: `dist/c${channel}-${channel_type}`
}
return data;
};
const writeFile = (path, data) => {
try {
fs.writeFile(
path,
data,
{
encoding: 'utf8',
},
err => {
if (err) throw err;
console.log(`-- write [${path}] set success`);
}
);
} catch (error) {
console.log(`write [${path}] error: `, error);
}
};
// readWriteFile('./package.json');
// 更改配置文件./channel/channelConfig.js
const configText = `const channel_name = '${channel}';
const channel_type = '${channel_type}';
exports = module.exports = {
channel_type,
channel_name
};`;
writeFile('./channel/channelConfig.js', configText);
{
"pluginsFile": "tests/e2e/plugins/index.js"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论