mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 02:49:01 +08:00
fix: 修复 password 为数字时的 bug
This commit is contained in:
parent
de2813b035
commit
cc556b641d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.382",
|
||||
"version": "2.14.383",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
isNotBlank,
|
||||
ipAddress,
|
||||
getRandomPort,
|
||||
numberToString,
|
||||
} from '@/utils';
|
||||
import PROXY_PROCESSORS, { ApplyProcessor } from './processors';
|
||||
import PROXY_PREPROCESSORS from './preprocessors';
|
||||
@ -327,6 +328,9 @@ function formatTransportPath(path) {
|
||||
}
|
||||
|
||||
function lastParse(proxy) {
|
||||
if (typeof proxy.password === 'number') {
|
||||
proxy.password = numberToString(proxy.password);
|
||||
}
|
||||
if (proxy.interface) {
|
||||
proxy['interface-name'] = proxy.interface;
|
||||
delete proxy.interface;
|
||||
|
@ -111,6 +111,12 @@ function getRandomPort(portString) {
|
||||
}
|
||||
}
|
||||
|
||||
function numberToString(value) {
|
||||
return Number.isSafeInteger(value)
|
||||
? String(value)
|
||||
: BigInt(value).toString();
|
||||
}
|
||||
|
||||
export {
|
||||
ipAddress,
|
||||
isIPv4,
|
||||
@ -123,4 +129,5 @@ export {
|
||||
// utf8ArrayToStr,
|
||||
getPolicyDescriptor,
|
||||
getRandomPort,
|
||||
numberToString,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user