Explorar o código

fix: 线上环境获取头像使用localhost处理

lanjianrong %!s(int64=4) %!d(string=hai) anos
pai
achega
3395803a57

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

@@ -95,7 +95,9 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
         <Avatar
           size="small"
           className={styles.avatar}
-          src={(isDevMode() && 'http://cld2qa.com') + (currentUser?.avatar ?? consts.DEFAULT_AVATAR)}
+          src={
+            (isDevMode() ? 'http://cld2qa.com' : 'localhost') + (currentUser?.avatar ?? consts.DEFAULT_AVATAR)
+          }
           alt="avatar"
         />
         <span className={`${styles.name} anticon`}>{currentUser.username}</span>

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

@@ -58,7 +58,8 @@ const UesrList: React.FC<UserListProps> = ({ onlineList }) => {
                           className="w-8 h-8 rounded-1/2 block"
                           style={{
                             backgroundImage: `url(${
-                              (isDevMode() && 'http://cld2qa.com') + (item.avatar ?? consts.DEFAULT_AVATAR)
+                              (isDevMode() ? 'http://cld2qa.com' : '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' + '/resource/notice_bell.png'
+  emptyImage: (isDevMode() ? 'http://cld2qa.com' : 'localhost') + '/resource/notice_bell.png'
 }
 
 NoticeIcon.Tab = NoticeList

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

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

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

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

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

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

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

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