@@ -88,9 +88,7 @@ export const UserMenu: React.FC = () => {
8888
8989 // 豆瓣图片代理选项
9090 const doubanImageProxyTypeOptions = [
91- { value : 'direct' , label : '直连(浏览器直接请求豆瓣)' } ,
9291 { value : 'server' , label : '服务器代理(由服务器代理请求豆瓣)' } ,
93- { value : 'img3' , label : '豆瓣官方精品 CDN(阿里云)' } ,
9492 {
9593 value : 'cmliussss-cdn-tencent' ,
9694 label : '豆瓣 CDN By CMLiussss(腾讯云)' ,
@@ -159,10 +157,13 @@ export const UserMenu: React.FC = () => {
159157 ) ;
160158 const defaultDoubanImageProxyType =
161159 ( window as any ) . RUNTIME_CONFIG ?. DOUBAN_IMAGE_PROXY_TYPE || 'cmliussss-cdn-tencent' ;
160+ // 兼容历史数据:直连和豆瓣官方精品 CDN 统一使用服务器代理
161+ const normalizeImageProxyType = ( type : string ) =>
162+ type === 'direct' || type === 'img3' ? 'server' : type ;
162163 if ( savedDoubanImageProxyType !== null ) {
163- setDoubanImageProxyType ( savedDoubanImageProxyType ) ;
164+ setDoubanImageProxyType ( normalizeImageProxyType ( savedDoubanImageProxyType ) ) ;
164165 } else if ( defaultDoubanImageProxyType ) {
165- setDoubanImageProxyType ( defaultDoubanImageProxyType ) ;
166+ setDoubanImageProxyType ( normalizeImageProxyType ( defaultDoubanImageProxyType ) ) ;
166167 }
167168
168169 const savedDoubanImageProxyUrl = localStorage . getItem (
@@ -422,8 +423,11 @@ export const UserMenu: React.FC = () => {
422423 ( window as any ) . RUNTIME_CONFIG ?. DOUBAN_PROXY_TYPE || 'cmliussss-cdn-tencent' ;
423424 const defaultDoubanProxy =
424425 ( window as any ) . RUNTIME_CONFIG ?. DOUBAN_PROXY || '' ;
425- const defaultDoubanImageProxyType =
426+ let defaultDoubanImageProxyType =
426427 ( window as any ) . RUNTIME_CONFIG ?. DOUBAN_IMAGE_PROXY_TYPE || 'cmliussss-cdn-tencent' ;
428+ if ( defaultDoubanImageProxyType === 'direct' || defaultDoubanImageProxyType === 'img3' ) {
429+ defaultDoubanImageProxyType = 'server' ;
430+ }
427431 const defaultDoubanImageProxyUrl =
428432 ( window as any ) . RUNTIME_CONFIG ?. DOUBAN_IMAGE_PROXY || '' ;
429433 const defaultFluidSearch =
0 commit comments