Browse Source

fix: revmove en & prefix host

hi-cactus! 3 years ago
parent
commit
4502b04328

+ 1 - 1
app/components/ColorPicker/index.tsx

@@ -38,7 +38,7 @@ const ColorPicker: RefForwardingComponent<
   const colorChange = useCallback(
     (e: ColorResult) => {
       const { r, g, b, a } = e.rgb
-      onChange(rawValue ? [r, g, b, a] : `rgba(${r}, ${g}, ${b}, ${a})`)
+      onChange?.(rawValue ? [r, g, b, a] : `rgba(${r}, ${g}, ${b}, ${a})`)
     },
     [onChange, rawValue]
   )

+ 9 - 7
app/containers/Display/components/Setting/Form/Item.tsx

@@ -30,6 +30,7 @@ import {
   Icon,
   Col
 } from 'antd'
+
 const RadioGroup = Radio.Group
 const CheckboxGroup = Checkbox.Group
 const { Option } = Select
@@ -45,6 +46,7 @@ import { SlideSettingContext } from './util'
 import api from 'utils/api'
 
 import utilStyles from 'assets/less/util.less'
+import { ASSETS_HOST } from 'app/globalConstants'
 
 interface IItemProps {
   item: SettingItem
@@ -122,9 +124,9 @@ const Item: React.FC<IItemProps> = (props) => {
       control = (
         <ColorPicker rawValue size={size}>
           <IconFont
-            type="icon-palette"
-            className="display-setting-form-palette"
-            style={{ color }}
+            type='icon-palette'
+            className='display-setting-form-palette'
+            // style={{ color }}
           />
         </ColorPicker>
       )
@@ -137,10 +139,10 @@ const Item: React.FC<IItemProps> = (props) => {
       control = (
         <Upload name={item.name} action={action}>
           {img ? (
-            <div className="display-setting-form-img">
-              <img src={img} alt={item.title} />
+            <div className='display-setting-form-img'>
+              <img src={ASSETS_HOST + img} alt={item.title} />
               <Icon
-                type="delete"
+                type='delete'
                 onClick={(e) => {
                   e.stopPropagation()
                   form.setFieldsValue({ [item.name]: null })
@@ -148,7 +150,7 @@ const Item: React.FC<IItemProps> = (props) => {
               />
             </div>
           ) : (
-            <Icon type="plus" />
+            <Icon type='plus' />
           )}
         </Upload>
       )

+ 1 - 0
app/globalConstants.ts

@@ -22,6 +22,7 @@ export const CLIENT_VERSION = '0.3-rc'
 const isProd = process.env.NODE_ENV === 'production'
 export const HOST1 = isProd ? 'http://thgateway.xt.wenhq.top:8083/' : '/'
 export const API_HOST = isProd ? `${HOST1}taihu-analysis/api/v3` : '/api/v3'
+export const ASSETS_HOST = `${HOST1}taihu-analysis`
 export const SHARE_HOST = `${location.origin}/share.html`
 export const EXTERNAL_LOG_OUT_URL = '/login/oauth2/logout'
 

+ 1 - 0
app/utils/util.ts

@@ -106,6 +106,7 @@ export function errorHandler(error) {
         break
     }
   } else if (error.message) {
+    console.log(error.message, '====')
     message.error(error.message, 3)
   } else {
     throw error

+ 5 - 5
share/components/Background/index.tsx

@@ -26,11 +26,11 @@ import styles from './index.less'
 export function Background(props) {
   return (
     <div className={`${styles.container} ${styles.share}`}>
-      <Helmet title="Login" />
-      <img
-        className={styles.logo}
-        src={require('assets/images/logo_light.svg')}
-      />
+      <Helmet title="登录" />
+      {/* <img */}
+      {/*  className={styles.logo} */}
+      {/*  src={require('assets/images/logo_light.svg')} */}
+      {/* /> */}
       <div className={`${styles.window} ${styles.wrapper}`}>
         {props.children}
       </div>

+ 3 - 3
share/containers/App/index.tsx

@@ -83,12 +83,12 @@ export const App: React.FC = () => {
   return (
     <div>
       <Helmet
-        titleTemplate="%s - Davinci"
-        defaultTitle="Davinci Web Application"
+        titleTemplate="%s - 聚合平台"
+        defaultTitle="聚合平台-数据分享"
         meta={[
           {
             name: 'description',
-            content: 'Davinci web application built for data visualization'
+            content: '聚合平台-数据分享'
           }
         ]}
       />