Kaynağa Gözat

fix: 线上环境访问头像使用localhost

lanjianrong 4 yıl önce
ebeveyn
işleme
dabc0ca5e8

+ 2 - 1
src/components/RightContent/AvatarDropdown.tsx

@@ -96,7 +96,8 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
           size="small"
           className={styles.avatar}
           src={
-            (isDevMode() ? 'http://cld2qa.com' : 'localhost') + (currentUser?.avatar ?? consts.DEFAULT_AVATAR)
+            (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') +
+            (currentUser?.avatar ?? consts.DEFAULT_AVATAR)
           }
           alt="avatar"
         />

+ 1 - 1
src/components/RightContent/Book/components/UserList/index.tsx

@@ -58,7 +58,7 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
                           className="w-8 h-8 rounded-1/2 block"
                           style={{
                             backgroundImage: `url(${
-                              (isDevMode() ? 'http://cld2qa.com' : 'localhost') +
+                              (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') +
                               (item.avatar ?? consts.DEFAULT_AVATAR)
                             })`,
                             backgroundSize: 'cover'

+ 1 - 1
src/components/RightContent/NoticeIcon/NoticeIcon.tsx

@@ -110,7 +110,7 @@ const NoticeIcon: React.FC<NoticeIconProps> & {
 }
 
 NoticeIcon.defaultProps = {
-  emptyImage: (isDevMode() ? 'http://cld2qa.com' : 'localhost') + '/resource/notice_bell.png'
+  emptyImage: (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') + '/resource/notice_bell.png'
 }
 
 NoticeIcon.Tab = NoticeList

+ 2 - 1
src/pages/Customer/Client/components/ClientDetail/LowerList.tsx

@@ -118,7 +118,8 @@ export const ServiceLogItem: React.FC<ServiceLogItemProps> = ({ item, logType, u
               className="rounded-1/2 w-8 h-8"
               style={{
                 backgroundImage: `url(${
-                  (isDevMode() ? 'http://cld2qa.com' : 'localhost') + (item.avatar ?? consts.DEFAULT_AVATAR)
+                  (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') +
+                  (item.avatar ?? consts.DEFAULT_AVATAR)
                 })`,
                 backgroundSize: 'cover'
               }}

+ 2 - 2
src/pages/Hr/Notification/components/AddMessage.jsx

@@ -23,11 +23,11 @@ const AddMessage = props => {
         switch (values.media) {
           case mediaType.VersionUpdate:
             newValues.avatar =
-              (isDevMode() ? 'http://cld2qa.com' : 'localhost') + '/resource/notice_email.png'
+              (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') + '/resource/notice_email.png'
             break
           case mediaType.HolidayNotice:
             newValues.avatar =
-              (isDevMode() ? 'http://cld2qa.com' : 'localhost') + '/resource/notice_airplane.png'
+              (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') + '/resource/notice_airplane.png'
             break
           default:
             break

+ 2 - 1
src/pages/Product/Lock/LockStore/components/LockDetail/TabList.tsx

@@ -148,7 +148,8 @@ const LockTabList: React.FC<LockTabListProps> = ({
                 className="rounded-1/2 w-8 h-8"
                 style={{
                   backgroundImage: `url(${
-                    (isDevMode() ? 'http://cld2qa.com' : 'localhost') + (item.avatar ?? consts.DEFAULT_AVATAR)
+                    (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') +
+                    (item.avatar ?? consts.DEFAULT_AVATAR)
                   })`,
                   backgroundSize: 'cover'
                 }}

+ 2 - 1
src/pages/User/Account/Settings/components/BaseView.jsx

@@ -51,7 +51,8 @@ const BaseView = () => {
     initData()
   }, [])
   const avatar =
-    (isDevMode() ? 'http://cld2qa.com' : 'localhost') + (staff?.avatar ?? '/resource/avatar/avtra_2.jpg')
+    (isDevMode() ? 'http://cld2qa.com' : 'http://localhost') +
+    (staff?.avatar ?? '/resource/avatar/avtra_2.jpg')
   return (
     <Tabs defaultActiveKey="1">
       <TabPane tab="基本信息" key="1">