inux ubuntu
parent
4dc04fb092
commit
f5a4af9a87
|
@ -8,9 +8,9 @@ const executor = {
|
|||
return true
|
||||
},
|
||||
async linux (exec, { certPath }) {
|
||||
const cmds = ['open "' + certPath + '"']
|
||||
const cmds = [`sudo cp ${certPath} /usr/local/share/ca-certificates`, 'sudo update-ca-certificates ']
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const ret = await exec(cmds, { type: 'cmd' })
|
||||
const ret = await exec(cmds)
|
||||
return true
|
||||
},
|
||||
async mac (exec, { certPath }) {
|
||||
|
|
|
@ -138,6 +138,7 @@ function getSystemPlatform () {
|
|||
case 'linux':
|
||||
return 'linux'
|
||||
case 'win32':
|
||||
return 'windows'
|
||||
case 'win64':
|
||||
return 'windows'
|
||||
case 'unknown os':
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
|
@ -75,6 +75,21 @@ function setTray (app) {
|
|||
return appTray
|
||||
}
|
||||
|
||||
function isLinux () {
|
||||
const platform = DevSidecar.api.shell.getSystemPlatform()
|
||||
return platform === 'linux'
|
||||
}
|
||||
|
||||
function hideWin () {
|
||||
if (win) {
|
||||
if (isLinux()) {
|
||||
win.minimize()
|
||||
} else {
|
||||
win.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
|
||||
|
@ -113,7 +128,7 @@ function createWindow () {
|
|||
}
|
||||
|
||||
if (startHideWindow) {
|
||||
win.hide()
|
||||
hideWin()
|
||||
}
|
||||
|
||||
win.on('closed', async (e) => {
|
||||
|
@ -124,7 +139,7 @@ function createWindow () {
|
|||
win.on('close', (e) => {
|
||||
if (!forceClose) {
|
||||
e.preventDefault()
|
||||
win.hide()
|
||||
hideWin()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -21,13 +21,16 @@
|
|||
2、然后按如下图步骤将随机生成的根证书设置为始终信任<br/>
|
||||
3、可能需要重新启动应用和浏览器才能生效<br/>
|
||||
</template>
|
||||
<template v-else-if="this.systemPlatform === 'linux'">
|
||||
1、点击右上角“点此去安装按钮”,将自动安装到系统证书库中<br/>
|
||||
2、火狐、chrome等浏览器不走系统证书,需要手动安装(下图以chrome为例安装根证书)<br/>
|
||||
</template>
|
||||
<template v-else>
|
||||
1、点击右上角“点此去安装按钮”,打开证书<br/>
|
||||
2、然后按如下图步骤将根证书添加到<b>信任的根证书颁发机构</b><br/>
|
||||
</template>
|
||||
</div>
|
||||
<img width="100%" :src="setupImage" />
|
||||
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
|
@ -59,6 +62,8 @@ export default {
|
|||
setupImage () {
|
||||
if (this.systemPlatform === 'mac') {
|
||||
return '/setup-mac.png'
|
||||
} else if (this.systemPlatform === 'linux') {
|
||||
return '/setup-linux.png'
|
||||
} else {
|
||||
return '/setup.png'
|
||||
}
|
||||
|
@ -75,6 +80,9 @@ export default {
|
|||
},
|
||||
async doSetup () {
|
||||
this.$emit('setup')
|
||||
if (this.systemPlatform === 'linux') {
|
||||
this.$message.success('根证书已成功安装到系统证书库(注意:浏览器仍然需要手动安装)')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue