mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 08:52:43 +08:00
Merge pull request #906 from cmliu/beta2.0
fix: 优化CF_JSON配置逻辑,确保正确处理UsageAPI字段
This commit is contained in:
@@ -127,15 +127,11 @@ export default {
|
||||
if (newConfig.Email && newConfig.GlobalAPIKey) {
|
||||
CF_JSON.Email = newConfig.Email;
|
||||
CF_JSON.GlobalAPIKey = newConfig.GlobalAPIKey;
|
||||
CF_JSON.AccountID = null;
|
||||
CF_JSON.APIToken = null;
|
||||
CF_JSON.UsageAPI = null;
|
||||
} else if (newConfig.AccountID && newConfig.APIToken) {
|
||||
CF_JSON.Email = null;
|
||||
CF_JSON.GlobalAPIKey = null;
|
||||
CF_JSON.AccountID = newConfig.AccountID;
|
||||
CF_JSON.APIToken = newConfig.APIToken;
|
||||
CF_JSON.UsageAPI = null;
|
||||
} else if (newConfig.UsageAPI){
|
||||
CF_JSON.UsageAPI = newConfig.UsageAPI;
|
||||
} else {
|
||||
return new Response(JSON.stringify({ error: '配置不完整' }), { status: 400, headers: { 'Content-Type': 'application/json;charset=utf-8' } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user