Merge pull request #68 from locolocoer/main

bugfix: httpstohttp path error in windows
This commit is contained in:
刘嘉伟 2025-02-13 14:33:43 +08:00 committed by GitHub
commit 08c2a2cb5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 2 deletions

28
.github/workflows/webpack.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: NodeJS with Webpack
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.8.0]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
npx run release

View File

@ -565,14 +565,19 @@ const handleRandomProxyName = () => {
`df_${editForm.value.type}_${result}`.toLocaleLowerCase();
};
import path from "path";
function normalizePath(filePath: string) {
return path.normalize(filePath).replace(/\\/g, "/");
}
const handleSelectFile = (type: number, ext: string[]) => {
ipcRenderer.invoke("file.selectFile", ext).then(r => {
switch (type) {
case 1:
editForm.value.https2httpCaFile = r[0];
editForm.value.https2httpCaFile = normalizePath(r[0]);
break;
case 2:
editForm.value.https2httpKeyFile = r[0];
editForm.value.https2httpKeyFile = normalizePath(r[0]);
break;
}
console.log(r);