leon před 1 rokem
rodič
revize
ba61f6786b

+ 7 - 7
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -109,14 +109,14 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
         var isMulti = false;
         var tempTZ = '';
         if (props.data.fast) {
-            if (props.data.fast.real_start_timezone.gmt) {
+            if (props.data.fast.real_start_timezone && props.data.fast.real_start_timezone.gmt) {
                 tempTZ = props.data.fast.real_start_timezone.gmt
                 if (props.data.fast.real_start_timezone.gmt != currentTZ) {
                     isDiff = true
                 }
             }
 
-            if (props.data.fast.real_end_timezone.gmt) {
+            if (props.data.fast.real_end_timezone && props.data.fast.real_end_timezone.gmt) {
                 if (tempTZ != props.data.fast.real_end_timezone.gmt) {
                     isMulti = true
                 }
@@ -128,7 +128,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
         }
 
         if (props.data.sleep) {
-            if (props.data.sleep.real_start_timezone.gmt) {
+            if (props.data.sleep.real_start_timezone && props.data.sleep.real_start_timezone.gmt) {
                 if (tempTZ == '') {
                     tempTZ = props.data.sleep.real_start_timezone.gmt
                 }
@@ -140,7 +140,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
                 }
             }
 
-            if (props.data.sleep.real_end_timezone.gmt) {
+            if (props.data.sleep.real_end_timezone && props.data.sleep.real_end_timezone.gmt) {
                 if (tempTZ != props.data.sleep.real_end_timezone.gmt) {
                     isMulti = true
                 }
@@ -183,7 +183,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
             if (global.checkAccess) {
                 global.checkAccess((res as any).access, true)
             }
-            
+
             if (global.delFastSleep)
                 global.delFastSleep(props.data)
 
@@ -425,7 +425,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
 
     function recordTime() {
         var timestamp = props.data.first_real_check_time
-        if (props.data.first_timezone.gmt) {
+        if (props.data.first_timezone && props.data.first_timezone.gmt) {
             timestamp = TimeFormatter.transferTimestamp(timestamp, props.data.first_timezone.gmt)
         }
         return TimeFormatter.dateDescription(timestamp, true)
@@ -435,7 +435,7 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number, d
         var timeZoneFormatted = getTimezone()
 
         if (multiTimeZone) {
-            if (props.data.first_timezone.id) {
+            if (props.data.first_timezone && props.data.first_timezone.id) {
                 if (Taro.getSystemInfoSync().platform == 'ios') {
                     if (props.data.first_timezone.id == getTimezoneId()) {
                         return recordTime()

+ 1 - 1
src/features/trackTimeDuration/components/WeekCalendarItem.tsx

@@ -55,7 +55,7 @@ export default function WeekCalendarItem(props: { data: any, isCurrentWeek: bool
                 var real_start = item.real_start_time
                 var real_end = item.real_end_time
 
-                if (item.real_end_timezone.id) {
+                if (item.real_end_timezone && item.real_end_timezone.id) {
 
 
                     // var strEnd = dayjs(real_end).tz(item.real_end_timezone.id).format('YYYY-MM-DDTHH:mm:ss')

+ 1 - 1
src/features/trackTimeDuration/hooks/RingData.tsx

@@ -318,7 +318,7 @@ export const getReal = (data: any, isBigRing: boolean, isRecord: boolean) => {
             realRingBig.durationArc = durationArc(data.sleep.real_start_time, isRecord ? (data.sleep.real_end_time ? data.sleep.real_end_time : new Date().getTime()) : new Date().getTime())
         }
         else {
-            if (data.fast.real_end_timezone.gmt && data.status == 'COMPLETED') {
+            if (data.fast.real_end_timezone && data.fast.real_end_timezone.gmt && data.status == 'COMPLETED') {
                 var timestamp = TimeFormatter.transferTimestamp(data.fast.real_start_time, data.fast.real_end_timezone.gmt)
 
                 realRingBig.startArc = startArc(timestamp)

+ 1 - 0
src/services/http/request.ts

@@ -90,6 +90,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
         header['X-Timestamp'] = new Date().getTime()
         if (token.length > 0) {
             header['Authorization'] = `Bearer ${token}`;
+            // header['Authorization'] = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhY2NvdW50Iiwic3ViIjoiMjZkOGE1YTg0MDMyYmExN2Q4NDk3MTlkNTljNGY1NzgiLCJpc3MiOiJmYXN0Iiwibmlja25hbWUiOiJCSyIsInR5cCI6IkJlYXJlciIsInNlc3Npb25fc3RhdGUiOiI1ZDU2NTkzYmNjNWFmNzM0OWNlZTMwZjlkNGYzMWIyMCIsImV4cCI6MTc0ODE3MDg5NSwiaWF0IjoxNzE2NjM0ODk1fQ.uaRm2vSNCX8fkFS63Oe-WNWIDHG_cRM-nQ5EGyUMaBg';
         }