获得徽章 7
使用nodejs启动window的powershell,并在上面添加自定义文字,需要关闭powershell后关闭electron服务,哪个大佬会啊,我已经改了快两天了
11
juejin.cn大佬们,帮孩子看看这个问题怎么解决吧[流泪]
2
function startPowerShell() {
const command = [
"chcp 65001 | Out-Null",
"$OutputEncoding = [System.Text.Encoding]::UTF8",
"[Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
"[Console]::InputEncoding = [System.Text.Encoding]::UTF8",

'[Console]::WriteLine("本地服务器已启动:http://localhost:3000")',
'[Console]::WriteLine("按任意键关闭应用...")',
'$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null',
"exit",
].join("; ");

powershellProcess = spawn(
"powershell.exe",
["-NoProfile", "-Command", command],
{
stdio: "inherit",
detached: false,
windowsHide: false,
}
);



powershellProcess.on("exit", (code) => {
if (!isExiting) {

app.quit();
}
});


powershellProcess.on("error", (err) => {
dialog.showErrorBox(
"启动失败",

);
cleanupResources();
app.quit();
});
}为什么打开window的powershell无法显示任何文字,这是在electron的主进程启动的
展开
评论
各位大佬,使用"electron": "^37.3.1",打包html,我想打包后启动生成一个本地链接打开默认浏览器,但是这样会请求跨域,该怎么解决,我不使用electron提供的窗口。
4
万能的掘友们,我想nodejs使用rsa加密账号密码
公私钥:
const nodeRsa = require("node-rsa");
const key = new nodeRsa({ b: 512 });
const publicKey = key.exportKey("pkcs8-public");
const privateKey = key.exportKey("pkcs8-private");

前端使用公钥加密:
export function getJsencrypt(key:string,data:string) {
const jsencrypt = new JSEncrypt()
jsencrypt.setPublicKey(key)
const rsaPassword = jsencrypt.encrypt(data)
return rsaPassword
}
const data = {
username: e.target[0].value,
password: e.target[1].value,
};
const password = getJsencrypt(publicKey, JSON.stringify(data));
const res = await axios.post("login", { password: password });

后端密钥解密该怎么解啊?
展开
4
<Image style={StyleSheet.imageFullStyle} source={props.url} />
<FadeView style={imageStyle.$mask}>
<Icon style={{position: 'absolute',top: 6,right: 6}} icon='checked' size={22} />
</FadeView>
这个FadeView是一个动画的Animted.view,他加了position:absolate。问题:当icon在fadeView下面时会被image遮挡,zindex没用。当icon在fadeView里面就可以显示在image上层
展开
评论
下一页
个人成就
文章被点赞 1,718
文章被阅读 66,017
掘力值 4,773
收藏集
2
关注标签
3
加入于