File tree Expand file tree Collapse file tree
frontend/src/views/setting/backup-account/operate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ func loadRefreshTokenByCode(backup *model.BackupAccount) (string, error) {
535535 if err := json .Unmarshal ([]byte (backup .Vars ), & varMap ); err != nil {
536536 return "" , fmt .Errorf ("unmarshal backup vars failed, err: %v" , err )
537537 }
538- if _ , ok := varMap ["refresh_token" ]; ok {
538+ if token , ok := varMap ["refresh_token" ]; ok && len ( token .( string )) != 0 {
539539 return "" , nil
540540 }
541541 refreshToken := ""
Original file line number Diff line number Diff line change 347347 >
348348 <el-input v-model.trim =" dialogData.rowData!.varsJson['redirect_uri']" />
349349 </el-form-item >
350- <el-form-item :label =" $t('setting.code')" prop =" varsJson.code" :rules = " rules.driveCode " >
350+ <el-form-item :label =" $t('setting.code')" prop =" varsJson.code" >
351351 <div class =" !w-full" >
352352 <el-input
353353 style =" width : calc (100% - 80px )"
@@ -430,19 +430,6 @@ const regionInput = ref();
430430
431431const domainProto = ref (' http' );
432432const emit = defineEmits ([' search' ]);
433- const rules = reactive ({
434- driveCode: [{ validator: checkDriveCode , required: true , trigger: ' blur' }],
435- });
436- function checkDriveCode(rule : any , value : any , callback : any ) {
437- if (! value ) {
438- return callback (new Error (i18n .global .t (' setting.codeWarning' )));
439- }
440- const reg = / ^ [A-Za-z0-9 /_. -] + $ / ;
441- if (! reg .test (value )) {
442- return callback (new Error (i18n .global .t (' setting.codeWarning' )));
443- }
444- callback ();
445- }
446433
447434interface DialogProps {
448435 title: string ;
@@ -726,6 +713,11 @@ const onCheck = async (formEl: FormInstance | undefined) => {
726713 dialogData .value .rowData ! .varsJson [' endpoint' ] = itemEndpoint ;
727714 }
728715 }
716+ if (isOneDrive ()) {
717+ dialogData .value .rowData ! .varsJson [' code' ] = decodeURIComponent (
718+ dialogData .value .rowData ! .varsJson [' code' ] || ' ' ,
719+ );
720+ }
729721 if (isALIYUNYUN ()) {
730722 dialogData .value .rowData ! .varsJson [' token' ] = undefined ;
731723 }
You can’t perform that action at this time.
0 commit comments