From 4769d17281a1472a4fc9eb0550f6b5dbdb923f6f Mon Sep 17 00:00:00 2001 From: tickstep Date: Mon, 1 Apr 2024 22:46:24 +0800 Subject: [PATCH] set webapi optional --- internal/config/pan_config.go | 3 +++ internal/config/pan_user.go | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/config/pan_config.go b/internal/config/pan_config.go index cc144cd..58dac5f 100644 --- a/internal/config/pan_config.go +++ b/internal/config/pan_config.go @@ -411,6 +411,9 @@ func (c *PanConfig) ActiveUser() *PanUser { u.panClient = user.panClient u.Nickname = user.Nickname + if u.ActiveDriveId == "" { + u.ActiveDriveId = user.DriveList.GetFileDriveId() + } u.DriveList = user.DriveList // check workdir valid or not if user.IsFileDriveActive() { diff --git a/internal/config/pan_user.go b/internal/config/pan_user.go index e718fff..02e3d97 100644 --- a/internal/config/pan_user.go +++ b/internal/config/pan_user.go @@ -119,9 +119,9 @@ func SetupUserByCookie(openapiToken, webapiToken *PanClientToken, ticketId, user if openapiToken == nil { return nil, apierror.NewFailedApiError("openapi token is empty") } - if webapiToken == nil { - return nil, apierror.NewFailedApiError("webapi token is empty") - } + //if webapiToken == nil { + // return nil, apierror.NewFailedApiError("webapi token is empty") + //} doOpenLoginAct: // setup openapi client