From 8c270bb7eba9769d94b281578c31890825e52553 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:50:41 +0800 Subject: [PATCH] add setup=auth --- platform/TencentSCF_env.php | 81 ++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/platform/TencentSCF_env.php b/platform/TencentSCF_env.php index c8084ae..eae113d 100644 --- a/platform/TencentSCF_env.php +++ b/platform/TencentSCF_env.php @@ -1,4 +1,7 @@ - ', 'Program updating', 201); + ', 'Program updating', 201, 1); } - return output('Jump + return message(getconstStr('Success') . ' - ', 302); + var i = 0; + var uploadList = setInterval(function(){ + if (document.getElementById("dis").style.display=="none") { + console.log(i++); + } else { + clearInterval(uploadList); + location.href = "' . path_format($_SERVER['base_path'] . '/') . '"; + } + }, 1000); + ', 201, 1); } if ($_GET['install1']) { $tmp['timezone'] = $_COOKIE['timezone']; @@ -199,7 +210,7 @@ function install() if ($tmp['ONEMANAGER_CONFIG_SAVE'] == 'file') { $html = getconstStr('ONEMANAGER_CONFIG_SAVE_FILE') . '
' . getconstStr('Home') . ''; $title = 'Reinstall'; - return message($html, $title, 201); + return message($html, $title, 201, 1); } $html .= '
@@ -217,7 +228,7 @@ function install() } '; $title = getconstStr('SetAdminPassword'); - return message($html, $title, 201); + return message($html, $title, 201, 1); } } if ($_GET['install0']) { @@ -228,10 +239,11 @@ language:
'; $html .= '
'; } - if (getConfig('SecretId')==''||getConfig('SecretKey')=='') $html .= ' + //if (getConfig('SecretId')==''||getConfig('SecretKey')=='') + $html .= ' ' . getconstStr('Create') . ' SecretId & SecretKey

-
'; +
'; $html .= '

'; @@ -255,7 +267,8 @@ language:
'; } function notnull(t) {'; - if (getConfig('SecretId')==''||getConfig('SecretKey')=='') $html .= ' + //if (getConfig('SecretId')==''||getConfig('SecretKey')=='') + $html .= ' if (t.SecretId.value==\'\') { alert(\'input SecretId\'); return false; @@ -603,3 +616,53 @@ function addFileToZip($zip, $rootpath, $path = '') } @closedir($path); } + +function changeAuthKey() { + if ($_POST['SecretId']!=''&&$_POST['SecretId']!='') { + $tmp['SecretId'] = $_POST['SecretId']; + $tmp['SecretKey'] = $_POST['SecretKey']; + $response = setConfigResponse( SetbaseConfig($tmp, $_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $tmp['SecretId'], $tmp['SecretKey']) ); + if (api_error($response)) { + $html = api_error_msg($response); + $title = 'Error'; + return message($html, $title, 400); + } else { + $html = getconstStr('Success') . ' + '; + return message($html, $title, 201, 1); + } + } + $html = ' + + ' . getconstStr('Create') . ' SecretId & SecretKey
+
+
+ +
+ '; + return message($html, 'Change platform Auth token or key', 200); +}