diff --git a/src/langs/zh_CN.txt b/src/langs/zh_CN.txt index 6925c6e..7814947 100644 --- a/src/langs/zh_CN.txt +++ b/src/langs/zh_CN.txt @@ -186,6 +186,7 @@ Input value is invalid!=输入的内容无效! Protocol is invalid!=协议无效! RPC host cannot be empty!=RPC 主机不能为空! RPC secret is not base64 encoded!=RPC 密钥不是 Base64 编码后的字符串! +URL is not base64 encoded!=指定 URL 不是 Base64 编码后的字符串! Tap to configure and get started with AriaNg.=您还没有进行过设置, 点击这里进行设置. [error] diff --git a/src/scripts/config/defaultLanguage.js b/src/scripts/config/defaultLanguage.js index 88c0ca0..9d9bf7e 100644 --- a/src/scripts/config/defaultLanguage.js +++ b/src/scripts/config/defaultLanguage.js @@ -190,6 +190,7 @@ 'Protocol is invalid!': 'Protocol is invalid!', 'RPC host cannot be empty!': 'RPC host cannot be empty!', 'RPC secret is not base64 encoded!': 'RPC secret is not base64 encoded!', + 'URL is not base64 encoded!': 'URL is not base64 encoded!', 'Tap to configure and get started with AriaNg.': 'Tap to configure and get started with AriaNg.', 'error': { 'unknown': 'Unknown error occurred.', diff --git a/src/scripts/controllers/command.js b/src/scripts/controllers/command.js index 889b886..fcf214c 100644 --- a/src/scripts/controllers/command.js +++ b/src/scripts/controllers/command.js @@ -19,7 +19,15 @@ if (path.indexOf('/new/') === 0) { var base64Url = $routeParams.url; - var url = base64.urldecode(base64Url); + var url = base64Url; + + try { + url = base64.urldecode(base64Url); + } catch (ex) { + ariaNgCommonService.showError('URL is not base64 encoded!'); + return; + } + $rootScope.loadPromise = newUrlDownload(url); ariaNgLogService.info('[CommandController] new download: ' + url); } else if (path.indexOf('/settings/rpc/set/') === 0) {