MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / handleAddCustom

Function handleAddCustom

static/js/email_services.js:534–650  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

532
533// 添加自定义邮箱服务(根据子类型区分)
534async function handleAddCustom(e) {
535 e.preventDefault();
536 const formData = new FormData(e.target);
537 const subType = formData.get('sub_type');
538
539 let serviceType, config;
540 if (subType === 'moemail') {
541 serviceType = 'moe_mail';
542 config = {
543 base_url: formData.get('api_url'),
544 api_key: formData.get('api_key'),
545 default_domain: formData.get('domain')
546 };
547 } else if (subType === 'tempmail_builtin') {
548 serviceType = 'tempmail';
549 config = {
550 base_url: formData.get('tpo_base_url'),
551 timeout: parseInt(formData.get('tpo_timeout'), 10) || 30,
552 max_retries: parseInt(formData.get('tpo_max_retries'), 10) || 3
553 };
554 } else if (subType === 'yyds_mail') {
555 serviceType = 'yyds_mail';
556 config = {
557 base_url: formData.get('yyds_base_url'),
558 api_key: formData.get('yyds_api_key'),
559 default_domain: formData.get('yyds_default_domain'),
560 timeout: parseInt(formData.get('yyds_timeout'), 10) || 30,
561 max_retries: parseInt(formData.get('yyds_max_retries'), 10) || 3
562 };
563 } else if (subType === 'web2') {
564 serviceType = 'web2';
565 config = {
566 base_url: formData.get('web2_base_url') || 'https://web2.temp-mail.org',
567 timeout: parseInt(formData.get('web2_timeout'), 10) || 30,
568 max_retries: parseInt(formData.get('web2_max_retries'), 10) || 3
569 };
570 } else if (subType === 'tempmail') {
571 serviceType = 'temp_mail';
572 config = {
573 base_url: formData.get('tm_base_url'),
574 admin_password: formData.get('tm_admin_password'),
575 domain: formData.get('tm_domain'),
576 enable_prefix: true
577 };
578 } else if (subType === 'duckmail') {
579 serviceType = 'duck_mail';
580 config = {
581 base_url: formData.get('dm_base_url'),
582 api_key: formData.get('dm_api_key'),
583 default_domain: formData.get('dm_domain'),
584 password_length: parseInt(formData.get('dm_password_length'), 10) || 12
585 };
586 } else if (subType === 'luckmail') {
587 serviceType = 'luckmail';
588 config = {
589 base_url: formData.get('lm_base_url'),
590 api_key: formData.get('lm_api_key'),
591 project_code: formData.get('lm_project_code') || 'openai',

Callers

nothing calls this directly

Calls 7

loadCustomServicesFunction · 0.85
successMethod · 0.80
errorMethod · 0.80
loadStatsFunction · 0.70
getMethod · 0.45
filterMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected