MCPcopy Create free account
hub / github.com/su-kaka/gcli2api / clearEnvCredentials

Function clearEnvCredentials

front/common.js:2674–2698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2672}
2673
2674async function clearEnvCredentials() {
2675 if (!confirm('确定要清除所有从环境变量导入的凭证文件吗?\n这将删除所有文件名以 "env-" 开头的认证文件。')) {
2676 return;
2677 }
2678
2679 try {
2680 showStatus('正在清除环境变量凭证文件...', 'info');
2681
2682 const response = await fetch('./auth/env-creds', {
2683 method: 'DELETE',
2684 headers: getAuthHeaders()
2685 });
2686
2687 const data = await response.json();
2688
2689 if (response.ok) {
2690 showStatus(`✅ 成功删除 ${data.deleted_count} 个环境变量凭证文件`, 'success');
2691 setTimeout(() => checkEnvCredsStatus(), 1000);
2692 } else {
2693 showStatus(`清除失败: ${data.detail || data.error || '未知错误'}`, 'error');
2694 }
2695 } catch (error) {
2696 showStatus(`网络错误: ${error.message}`, 'error');
2697 }
2698}
2699
2700// =====================================================================
2701// 配置管理

Callers

nothing calls this directly

Calls 3

showStatusFunction · 0.85
getAuthHeadersFunction · 0.85
checkEnvCredsStatusFunction · 0.85

Tested by

no test coverage detected