Skip to content

Commit

Permalink
update to version 3.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fanjiangwei7 committed Aug 27, 2024
1 parent 70be5a3 commit c472c5a
Show file tree
Hide file tree
Showing 18 changed files with 410 additions and 44 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ yarn mac
yarn win
```

## 软件签名处理说明
对于 mac安装包进行签名处理需要修改配置文件`./_scripts/config.js/`,修改内容如下:
```
const config = {
mac: {
category: 'public.app-category.social', // mac应用分类
identity: 'your-identity', // mac证书标识
}
}
```

对于 windows安装包进行签名处理需要修改配置文件`./_scripts/config.js/`,修改内容如下:
```
const config = {
win: {
publisherName: 'your-company-name', // windows应用发布者名称
certificateFile: 'your-certificate-file-path', // windows证书文件路径(pfx、p12)
certificatePassword: 'your-certificate-password', // windows证书密码
signingHashAlgorithms: 'sha256', // 签名算法(推荐 sha256)
rfc3161TimeStampServer: 'http://timestamp.digicert.com', // 时间戳服务器地址
}
}
```

如果不需要进行签名处理,则需要将上述参数都删除掉。同时针对 mac 安装包,需要修改配置文件`./_scripts/config.js/`,修改内容如下:
```
const config = {
dmg: {
sign: false, // 是否进行签名处理 (mac 不进行签名处理)
}
}
```

### MAC ARM 运行提示
Apple M1 芯片上可能出现安装包无法运行的问题,需要执行如下命令行进行操作:
```
Expand Down
Binary file removed _icons/512x512.png
Binary file not shown.
Binary file added _icons/iconTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions _scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
],
dmg: {
internetEnabled: false,
sign: false,
sign: true,
contents: [
{
path: '/Applications',
Expand Down Expand Up @@ -48,7 +48,8 @@ const config = {
icon: '_icons/icon.icns',
target: ['dmg'],
type: 'distribution',
entitlements: "../entitlements.mac.plist",
identity: 'Beijing MaximTop Technology Co,.Ltd. (963BX74UXU)',
entitlements: "build/../entitlements.mac.plist",
hardenedRuntime: true,
extendInfo: {
"NSMicrophoneUsageDescription": "请允许本程序访问您的麦克风",
Expand All @@ -58,6 +59,11 @@ const config = {
win: {
icon: '_icons/icon.ico',
target: ['nsis'],
publisherName: 'Beijing MaximTop Technology Co,.Ltd.',
certificateFile: 'build/../DevCertDistribution.p12',
certificatePassword: 'st234567.',
signingHashAlgorithms: ['sha256'],
rfc3161TimeStampServer: 'http://timestamp.digicert.com',
},
nsis: {
"oneClick": false,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"author": "Muhammad Ubaid Raza <mubaidr@gmail.com>",
"author": "Beijing MaximTop Technology Co,.Ltd. <eva@bmxlabs.com>",
"bugs": {
"url": "https://github.com/mubaidr/vue-electron-template/issues"
},
Expand Down Expand Up @@ -124,5 +124,5 @@
"all": "node .electron-vue/build.js && electron-builder",
"w": "node .electron-vue/build.js"
},
"version": "3.2.3"
"version": "3.2.4"
}
69 changes: 54 additions & 15 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, Menu, Tray, ipcMain, systemPreferences, shell } from 'electron'
import { app, BrowserWindow, Menu, Tray, ipcMain, systemPreferences, shell, Notification, nativeImage } from 'electron'
import { productName } from '../../package.json'

var os = require("os");
Expand All @@ -16,11 +16,10 @@ process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'

const gotTheLock = app.requestSingleInstanceLock()
const isDev = process.env.NODE_ENV === 'development'
let windows = []
//let mainWindow
let willQuitApp = false;
let tray = null
let isFirstWindow = true
let isMinimized = false;

// only allow single instance of application
/*
Expand Down Expand Up @@ -85,28 +84,59 @@ function createWindow () {
partition: isFirstWindow ? 'persist:userData' : String(+new Date()),
},
show: false,
icon: platform === "linux" ? `${__dirname}/../_icons/icon.png` : ''
icon: platform === "linux" ? `${__dirname}/../_icons/icon.png` : `${__dirname}/../_icons/icon.ico`
})
windows.push(mainWindow)
if (isFirstWindow) {
isFirstWindow = false
}

if (platform != "darwin") {
if (isDev) {
tray = new Tray(`${__dirname}/../../_icons/icon.ico`)
let tray = null;
if (isDev) {
tray = new Tray(`${__dirname}/../../_icons/icon.ico`)
} else {
if (platform === "linux") {
tray = new Tray(`${__dirname}/../_icons/icon.png`)
} else if (platform === "darwin") {
tray = new Tray(`${__dirname}/../_icons/iconTemplate.png`)
} else {
if (platform === "linux") {
tray = new Tray(`${__dirname}/../_icons/icon.png`)
} else {
tray = new Tray(`${__dirname}/../_icons/icon.ico`)
tray = new Tray(`${__dirname}/../_icons/icon.ico`)
}
}
const contextMenu = Menu.buildFromTemplate([
{
label: '蓝莺 IM', type: 'normal',
click: () => {
mainWindow.show()
mainWindow.focus()
}
},
{ type: 'separator' },
{ label: ' 退出 ', type: 'normal',
click: () => {
mainWindow.destroy();
tray.destroy();
mainWindow = null;
tray = null;
}
}
]);
tray.window = mainWindow;
tray.setToolTip('蓝莺 IM');
tray.setContextMenu(contextMenu)
if (platform === "win32") {
tray.on('click', () => {
mainWindow.show()
mainWindow.focus()
})
}
tray.on('double-click', () => {
mainWindow.show()
mainWindow.focus()
})
tray.on('balloon-click', () => {
mainWindow.show()
mainWindow.focus()
});

// eslint-disable-next-line
setMenu()
Expand Down Expand Up @@ -145,15 +175,20 @@ function createWindow () {
mainWindow.focus()
})

mainWindow.on('minimize', () => {
isMinimized = true;
});
mainWindow.on('show', () => {
isMinimized = false;
});

mainWindow.on('close', e => {
/*
if (willQuitApp) {
mainWindow = null
} else {
e.preventDefault();
mainWindow.hide();
}
*/
})
}

Expand All @@ -171,7 +206,11 @@ if (platform != "linux") {
}

app.on('ready', () => {
createWindow()
createWindow();

if (platform === "win32") {
app.setAppUserModelId(productName);
}

//if (isDev) {
installDevTools()
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/im/floo-3.0.0.js

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions src/renderer/ui/chatting/content/group/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ import { numToString, toNumber } from '../../../third/tools';
import { mapGetters } from 'vuex';
import { ipcRenderer } from 'electron';
var os = require("os");
var platform = os.platform();
export default {
name: 'RosterChat',
name: 'GroupChat',
mounted() {
this.requireMessage();
this.scroll();
this.$store.dispatch('forward/actionCancelForward', false);
this.$store.getters.im.on('onGroupMessage', (message) => {
this.reloadMessage(message);
this.sendPCNotice();
});
this.$store.getters.im.on('onGroupMessageContentAppend', (message) => {
Expand All @@ -33,6 +38,7 @@ export default {
if (msg) {
msg.messageContentAppend(message);
this.calculateScroll(message);
this.sendPCNotice();
}
}
});
Expand All @@ -43,6 +49,7 @@ export default {
if (msg) {
msg.messageReplace(message);
this.scroll();
this.sendPCNotice();
}
}
});
Expand Down Expand Up @@ -264,7 +271,11 @@ export default {
}
}
}
}
},
sendPCNotice() {
ipcRenderer.send('unread', { type: 'group' });
},
//methods finish ...
}
};
Expand Down
67 changes: 58 additions & 9 deletions src/renderer/ui/chatting/content/group/inputer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="inputer_frame">
<div class="inputer_frame" ref="groupInputer">
<div class="attach">
<div class="mentionList" v-if="this.filteredMentionRosters.length > 0">
<div :key="roster.user_id" @click="clickMemberListHander(roster.user_id)" class="mentionItem" v-for="roster in this.filteredMentionRosters">
Expand All @@ -24,7 +24,7 @@ import { mapGetters } from 'vuex';
import CryptoJS from 'crypto-js';
export default {
name: 'rosterInputer',
name: 'groupInputer',
data() {
return {
message: '',
Expand All @@ -45,19 +45,19 @@ export default {
}
},
mounted() {
let that = this;
let _this = this;
this.hasBan = false;
this.chechBan(this.getSid);
this.$store.getters.im.on('onGroupBaned', (meta) => {
const { groupId, toUids, content } = meta;
if (that.getSid === groupId) {
if (_this.getSid === groupId) {
if (Array.isArray(toUids) && toUids.length && parseInt(content)) {
toUids.forEach((id) => {
if (id === this.im.userManage.getUid()) {
that.hasBan = true;
that.expired_time = Date.now() + parseInt(content) * 60 * 1000;
that.startBanCheck();
_this.hasBan = true;
_this.expired_time = Date.now() + parseInt(content) * 60 * 1000;
_this.startBanCheck();
}
});
}
Expand All @@ -66,16 +66,60 @@ export default {
this.$store.getters.im.on('onGroupUnbaned', (meta) => {
const { groupId, toUids } = meta;
if (that.getSid === groupId) {
if (_this.getSid === groupId) {
if (Array.isArray(toUids) && toUids.length) {
toUids.forEach((id) => {
if (id === this.im.userManage.getUid()) {
that.stopBanCheck();
_this.stopBanCheck();
}
});
}
}
});
// paste
this.$refs.groupInputer.addEventListener('paste', function (event) {
event.preventDefault();
const clipboardData = event.clipboardData || window.clipboardData;
const items = clipboardData.items;
if (items && items.length) {
for (let i = 0; i < items.length; i++) {
const item = items[i];
if (item.kind === 'file') {
const blob = item.getAsFile();
const file = new File([blob], blob.name, {
type: blob.type
});
_this.fileType = 'file';
if (item.type.indexOf('image') >= 0) {
_this.fileType = 'image';
}
_this.sendFileInBackground(file);
}
}
}
});
// drop
this.$refs.groupInputer.addEventListener('drop', function (event) {
event.preventDefault();
const items = event.dataTransfer.files;
if (items && items.length) {
for (let i = 0; i < items.length; i++) {
const item = items[i];
_this.fileType = 'file';
if (item.type.indexOf('image') >= 0) {
_this.fileType = 'image';
}
_this.sendFileInBackground(item);
}
}
});
// dragover
this.$refs.groupInputer.addEventListener('dragover', function (event) {
event.preventDefault();
});
},
destroyed() {
this.stopBanCheck();
Expand Down Expand Up @@ -243,6 +287,10 @@ export default {
fileChangeHandler(e) {
const file = e.target.files[0];
this.sendFileInBackground(file);
},
sendFileInBackground(file) {
this.im.sysManage
.asyncFileUpload({
file,
Expand Down Expand Up @@ -276,6 +324,7 @@ export default {
this.$refs.fileRef.value = '';
});
},
clickMemberListHander(uid) {
const set = new Set(this.mentionSelectedUids);
set.add(uid);
Expand Down
Loading

0 comments on commit c472c5a

Please sign in to comment.