8282 </th >
8383 <th style =" text-align : center " >序号</th >
8484 <th style =" text-align : center " >挂载路径</th >
85- <th style =" width : 100 px ; text-align : center " >协议类型</th >
85+ <th style =" width : 140 px ; text-align : center " >协议类型</th >
8686 <th style =" width : 260px ; text-align : center " >任务状态</th >
8787 <th style =" text-align : center " >令牌绑定</th >
8888 <th style =" text-align : center " >创建时间</th >
219219 <input v-model =" newStorage.shareAccessCode" type =" text" class =" form-input" placeholder =" 请输入访问码(可选)" />
220220 </div >
221221 </div >
222+ <div v-if =" newStorage.protocol === 'subscribe_share'" >
223+ <div class =" form-group" >
224+ <label class =" form-label" >订阅用户ID</label >
225+ <input v-model =" newStorage.subscribeUser" type =" text" class =" form-input" placeholder =" 请输入订阅用户ID" />
226+ </div >
227+ <div class =" form-group" >
228+ <label class =" form-label" >分享码</label >
229+ <input v-model =" newStorage.shareCode" type =" text" class =" form-input" placeholder =" 请输入分享码" />
230+ </div >
231+ </div >
222232 <div v-if =" newStorage.protocol === 'person'" >
223233 <div class =" form-group" >
224234 <label class =" form-label" >选择文件夹</label >
429439 </td >
430440 <td >
431441 <span class =" result-type" :class =" `type-${result.type}`" >
432- {{ result.type === 'subscribe' ? '订阅' : '分享' }}
442+ {{ result.type === 'subscribe' ? '订阅' : result.type === 'subscribe_share' ? '订阅分享' : '分享' }}
433443 </span >
434444 </td >
435445 <td >
456466 </td >
457467 <td >
458468 <input
459- v-if =" result.type === 'subscribe'"
469+ v-if =" result.type === 'subscribe' || result.type === 'subscribe_share' "
460470 v-model =" result.subscribeUser"
461471 type =" text"
462472 class =" table-input"
466476 </td >
467477 <td >
468478 <input
469- v-if =" result.type === 'share'"
479+ v-if =" result.type === 'share' || result.type === 'subscribe_share' "
470480 v-model =" result.shareCode"
471481 type =" text"
472482 class =" table-input"
@@ -601,6 +611,7 @@ const newStorage = reactive({
601611const protocolOptions = [
602612 { label: ' 订阅类型' , value: ' subscribe' },
603613 { label: ' 分享类型' , value: ' share' },
614+ { label: ' 订阅分享类型' , value: ' subscribe_share' },
604615 { label: ' 个人类型' , value: ' person' },
605616 { label: ' 家庭类型' , value: ' family' }
606617]
@@ -752,6 +763,15 @@ const confirmAddStorage = async () => {
752763 toast .warning (' 请输入分享码' )
753764 return
754765 }
766+ } else if (newStorage .protocol === ' subscribe_share' ) {
767+ if (! newStorage .subscribeUser .trim ()) {
768+ toast .warning (' 请输入订阅用户ID' )
769+ return
770+ }
771+ if (! newStorage .shareCode .trim ()) {
772+ toast .warning (' 请输入分享码' )
773+ return
774+ }
755775 } else if (newStorage .protocol === ' person' ) {
756776 if (! newStorage .cloudToken ) {
757777 toast .warning (' 个人类型需要选择云盘令牌' )
@@ -794,7 +814,10 @@ const confirmAddStorage = async () => {
794814 if (newStorage .shareAccessCode .trim ()) {
795815 requestData .shareAccessCode = newStorage .shareAccessCode .trim ()
796816 }
797- } else if (newStorage .protocol === ' person' ) {
817+ } else if (newStorage .protocol === ' subscribe_share' ) {
818+ requestData .subscribeUser = newStorage .subscribeUser .trim ()
819+ requestData .shareCode = newStorage .shareCode .trim ()
820+ } else if (newStorage .protocol === ' person' ) {
798821 requestData .fileId = newStorage .fileId .trim ()
799822 } else if (newStorage .protocol === ' family' ) {
800823 requestData .familyId = newStorage .familyId .trim ()
@@ -1122,7 +1145,7 @@ const parseLinks = async () => {
11221145 for (const result of results ) {
11231146 try {
11241147 const preAddData: any = {
1125- protocol: result .type === ' subscribe' ? ' subscribe' : ' share'
1148+ protocol: result .type === ' subscribe' ? ' subscribe' : result . type === ' subscribe_share ' ? ' subscribe_share ' : ' share'
11261149 }
11271150
11281151 if (result .type === ' subscribe' ) {
@@ -1132,6 +1155,9 @@ const parseLinks = async () => {
11321155 if (result .accessCode ) {
11331156 preAddData .shareAccessCode = result .accessCode
11341157 }
1158+ } else if (result .type === ' subscribe_share' ) {
1159+ preAddData .subscribeUser = result .shareId
1160+ preAddData .shareCode = result .accessCode
11351161 }
11361162
11371163 if (defaultCloudToken .value ) {
@@ -1147,8 +1173,8 @@ const parseLinks = async () => {
11471173 suggestedName ,
11481174 localPath: defaultPathPrefix .value ? ` ${defaultPathPrefix .value }/${suggestedName } ` : ` /${suggestedName } ` ,
11491175 cloudToken: defaultCloudToken .value ,
1150- subscribeUser: result .type === ' subscribe' ? result .shareId : ' ' ,
1151- shareCode: result .type === ' share' ? result .shareId : ' '
1176+ subscribeUser: result .type === ' subscribe' || result . type === ' subscribe_share ' ? result .shareId : ' ' ,
1177+ shareCode: result .type === ' share' ? result .shareId : result . type === ' subscribe_share ' ? result . accessCode : ' '
11521178 })
11531179 } catch (error ) {
11541180 console .warn (` 链接验证失败 (${result .originalUrl }): ` , error )
@@ -1193,6 +1219,7 @@ const batchImportStorages = async () => {
11931219 if (! result .localPath .trim ()) return true
11941220 if (result .type === ' subscribe' && ! result .subscribeUser ?.trim ()) return true
11951221 if (result .type === ' share' && ! result .shareCode ?.trim ()) return true
1222+ if (result .type === ' subscribe_share' && (! result .subscribeUser ?.trim () || ! result .shareCode ?.trim ())) return true
11961223 return false
11971224 })
11981225
@@ -1211,7 +1238,7 @@ const batchImportStorages = async () => {
12111238 try {
12121239 const requestData: AddStorageRequest = {
12131240 localPath: result .localPath .trim (),
1214- protocol: result .type === ' subscribe' ? ' subscribe' : ' share'
1241+ protocol: result .type === ' subscribe' ? ' subscribe' : result . type === ' subscribe_share ' ? ' subscribe_share ' : ' share'
12151242 }
12161243
12171244 if (result .cloudToken ) {
@@ -1225,6 +1252,9 @@ const batchImportStorages = async () => {
12251252 if (result .accessCode ?.trim ()) {
12261253 requestData .shareAccessCode = result .accessCode .trim ()
12271254 }
1255+ } else if (result .type === ' subscribe_share' ) {
1256+ requestData .subscribeUser = result .subscribeUser ! .trim ()
1257+ requestData .shareCode = result .shareCode ! .trim ()
12281258 }
12291259
12301260 await storageApi .add (requestData )
@@ -1309,6 +1339,8 @@ const getProtocolLabel = (protocol: string): string => {
13091339 return ' 订阅'
13101340 case ' share' :
13111341 return ' 分享'
1342+ case ' subscribe_share' :
1343+ return ' 订阅分享'
13121344 case ' cloud_folder' :
13131345 return ' 个人'
13141346 case ' cloud_family_folder' :
@@ -1627,6 +1659,11 @@ onUnmounted(() => {
16271659 color : #d97706 ;
16281660}
16291661
1662+ .protocol-subscribe_share {
1663+ background : #f0fdf4 ;
1664+ color : #15803d ;
1665+ }
1666+
16301667.protocol-cloud_folder {
16311668 background : #f0f9ff ;
16321669 color : #0369a1 ;
0 commit comments