Leon 2 роки тому
батько
коміт
6d8eee2f44

BIN
ios/assets/src/assets/images/avatar_empty.png


BIN
ios/assets/src/assets/images/camera.png


+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -550,7 +550,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -583,7 +583,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
ios/main.jsbundle


+ 17 - 8
src/components/input/Inputs.tsx

@@ -9,10 +9,12 @@ interface CustomInputProps {
     value: string;
     onChange: (value: string) => void;
     onConfirm: Function,
-    openType?:string;
+    openType?: string;
     disabled?: boolean;
     isSecure?: boolean;
-    autoFocus?:boolean;
+    autoFocus?: boolean;
+    onBlur?: Function;
+    onFocus?: Function;
 }
 
 export default function Component({
@@ -23,7 +25,9 @@ export default function Component({
     openType,
     disabled,
     isSecure,
-    autoFocus
+    autoFocus,
+    onBlur,
+    onFocus
 }: CustomInputProps) {
     const [inputValue, setInputValue] = useState(value ? value : '');
     const [isFocus, setIsFocus] = useState(false)
@@ -33,11 +37,11 @@ export default function Component({
         onChange(newValue);
     };
 
-    useEffect(()=>{
-        setInputValue(value?value:'')
-    },[value])
+    useEffect(() => {
+        setInputValue(value ? value : '')
+    }, [value])
 
-    function clear(){
+    function clear() {
         setInputValue('')
         onChange('')
     }
@@ -48,9 +52,10 @@ export default function Component({
                 placeholder={placeholder ? placeholder : ''}
                 value={inputValue}
                 password={isSecure ? true : false}
-                type={isSecure ?'safe-password':'text'}
+                type={isSecure ? 'safe-password' : 'text'}
                 // type={openType?openType:'text'}
                 onInput={handleInputChange}
+
                 // onConfirm={() => onConfirm()}
                 focus={autoFocus}
                 confirmType="done"
@@ -58,9 +63,13 @@ export default function Component({
                 disabled={disabled ? disabled : false}
                 onFocus={() => {
                     setIsFocus(true)
+                    if (onFocus)
+                        onFocus()
                 }}
                 onBlur={() => {
                     setIsFocus(false)
+                    if (onBlur)
+                        onBlur()
                 }}
             />
             {

+ 0 - 2
src/components/input/LimitPickers.tsx

@@ -168,8 +168,6 @@ const Component = forwardRef((props: {
         const month = date.getMonth() + 1;
         const day = date.getDate();
         const time = `${year}-${expandZero(month)}-${expandZero(day)}T${expandZero(hours[values[1]])}:${expandZero(minutes[values[2]])}:${expandZero((new Date(global.set_time)).getSeconds())}`;
-        console.log(global.set_time)
-        debugger
         if (getTimestamp(time) > global.set_time) {
             Taro.showToast({
                 icon: 'none',

+ 0 - 1
src/components/input/PickerViews.tsx

@@ -41,7 +41,6 @@ const Component = forwardRef((props: {
         if (process.env.TARO_ENV == 'weapp') {
             e.stopPropagation()
         }
-        debugger
         props.onChange(v)
     }
 

+ 2 - 0
src/components/input/Slider.tsx

@@ -10,6 +10,8 @@ import { jumpPage } from '@/features/trackTimeDuration/hooks/Common';
 
 var currentValue = 0;
 var lastValue = 0;
+
+
 export default function (props: { onChanged?: Function, value?: number, edit?: boolean, isPreMeal?: boolean, isPostMeal?: boolean, id?: string }) {
     const sliderWidth = 578;
     const [brightness, setBrightness] = useState(props.value ? props.value * 10 : 0);

+ 60 - 19
src/components/input/SlidngScale.tsx

@@ -5,9 +5,15 @@ import { useEffect, useRef, useState } from "react";
 import Taro from "@tarojs/taro";
 import { rpxToPx } from "@/utils/tools";
 import { throttle } from 'lodash';
+// import { SvgXml } from "react-native-svg";
 
 var timerA = null
 var lastValue = 0
+
+let SvgXml;
+if (process.env.TARO_ENV == 'rn') {
+    SvgXml = require("react-native-svg").SvgXml
+}
 export default function Component(props: {
     step: number, min: number,
     max: number, default_value: number,
@@ -91,18 +97,27 @@ export default function Component(props: {
     }, [])
 
     useEffect(() => {
-        if (isEnd && !isDraging) {
-            props.updateStatus(true)
-            setEnableText(true)
-        }
-        else {
-            props.updateStatus(false)
-            setEnableText(false)
+        if (process.env.TARO_ENV == 'weapp') {
+            if (isEnd && !isDraging) {
+                props.updateStatus(true)
+                setEnableText(true)
+                console.log('true')
+            }
+            else {
+                props.updateStatus(false)
+                setEnableText(false)
+                console.log('false')
+            }
         }
-
     }, [isEnd, isDraging])
 
     function scrollContent(e) {
+        if (process.env.TARO_ENV == 'rn') {
+            update(e)
+            setIsDraging(false)
+            setIsEnd(true)
+            return
+        }
         lastValue = e.detail.scrollLeft;
         if (timerA)
             clearTimeout(timerA);
@@ -135,8 +150,11 @@ export default function Component(props: {
     }
 
     function touchStart() {
-        props.updateStatus(false)
-        setEnableText(false)
+        if (process.env.TARO_ENV=='weapp'){
+            props.updateStatus(false)
+            setEnableText(false)
+        }
+        
     }
 
     function dragStart(e) {
@@ -215,17 +233,17 @@ export default function Component(props: {
     // debugger
 
     var svgLine = `<svg xmlns="http://www.w3.org/2000/svg" width="100" height="${rpxToPx(28)}">`;
-    var svgNumber = `<svg xmlns="http://www.w3.org/2000/svg" width="${list.length * 10 - 8+60}" height="${rpxToPx(38)}">`;
+    var svgNumber = `<svg xmlns="http://www.w3.org/2000/svg" width="${list.length * 10 - 8 + 60}" height="${rpxToPx(38)}">`;
     for (var i = 0; i < 10; i++) {
         var obj = list[i];
         svgLine += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
-        
+
     }
     for (var i = 0; i < list.length; i++) {
         var obj = list[i];
         if (obj.showBig) {
             //字体设置参考 https://segmentfault.com/a/1190000006110417
-            svgNumber += `<text x="${i * 10+1+30}" y="${rpxToPx(2 + 36)}" text-anchor="middle" fill="white" font-family="PingFang SC,Helvetica Neue,Helvetica,Arial,Hiragino Sans GB,Heiti SC,Microsoft YaHei" font-size="${rpxToPx(36)}">${obj.value}</text>`
+            svgNumber += `<text x="${i * 10 + 1 + 30}" y="${rpxToPx(2 + 36)}" text-anchor="middle" fill="white" font-family="PingFang SC,Helvetica Neue,Helvetica,Arial,Hiragino Sans GB,Heiti SC,Microsoft YaHei" font-size="${rpxToPx(36)}">${obj.value}</text>`
         }
     }
     svgLine += `</svg>`
@@ -236,6 +254,16 @@ export default function Component(props: {
     var basestr2 = encodeURIComponent(svgNumber)
     var imgNum = `url("data:image/svg+xml,${basestr2}");`
 
+    var svgLine2 = `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">`
+    svgLine2 += `<pattern id="pattern" width="100" height="${rpxToPx(28)}" patternUnits="userSpaceOnUse">`
+    for (var i = 0; i < 10; i++) {
+        var obj = list[i];
+        svgLine2 += `<line x1="${i * 10 + 1}" y1="0" x2="${i * 10 + 1}" y2="${obj.showBig ? rpxToPx(28) : obj.showMiddle ? rpxToPx(24) : rpxToPx(16)}" stroke="${props.themeColor}"  stroke-width="2"/>`
+    }
+    svgLine2 += `</pattern>
+    <rect width="100%" height="100%" fill="url(#pattern)" />
+  </svg>`
+
 
 
     const isLeonTest = true
@@ -243,10 +271,10 @@ export default function Component(props: {
     return <View className="slidng">
         <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
             {
-                process.env.TARO_ENV == 'weapp'?<Text className="number" style={{fontFamily:"PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;"}}>{current}</Text>:
-                <Text className="number">{current}</Text>
+                process.env.TARO_ENV == 'weapp' ? <Text className="number" style={{ fontFamily: "PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;" }}>{current}</Text> :
+                    <Text className="number">{current}</Text>
             }
-            
+
             <Text className="unit">{props.unit}</Text>
         </View>
 
@@ -257,6 +285,7 @@ export default function Component(props: {
             <View className="top_line" style={{ backgroundColor: props.themeColor }} />
             <ScrollView
                 style={{ zIndex: 0, position: 'relative' }} ref={scrollViewRef}
+                showsHorizontalScrollIndicator={false}
                 scrollX scrollLeft={left} className="scroll"
                 enablePassive={true}
                 fastDeceleration={true}
@@ -284,9 +313,21 @@ export default function Component(props: {
                         {
                             isLeonTest && <View>
                                 <View style={{ width: list.length * 10 - 8, height: 100 }}>
-                                    {/* <mysvg src={svg2} /> */}
-                                    <View style={{ width: list.length * 10 - 8, height: rpxToPx(28), backgroundImage: imgLines }} />
-                                    <View style={{ width: list.length * 10 - 8+60,marginLeft:-30, height: rpxToPx(38), backgroundImage: imgNum }} />
+                                    {
+                                        process.env.TARO_ENV == 'weapp' && <View style={{ width: list.length * 10 - 8, height: rpxToPx(28), backgroundImage: imgLines }} />
+                                    }
+                                    {
+                                        process.env.TARO_ENV == 'rn' && <SvgXml xml={svgLine2} width={list.length * 10 - 8} height={rpxToPx(28)} />
+                                    }
+
+                                    {process.env.TARO_ENV == 'weapp' &&
+                                        <View style={{ width: list.length * 10 - 8 + 60, marginLeft: -30, height: rpxToPx(38), backgroundImage: imgNum }} />}
+                                    {
+                                        process.env.TARO_ENV == 'rn' &&
+                                        <View style={{ flexDirection: 'row', marginLeft: -30 }}>
+                                            <SvgXml xml={svgNumber} width={list.length * 10 - 8 + 60} height={rpxToPx(38)} />
+                                        </View>
+                                    }
                                 </View>
                             </View>
                         }

+ 97 - 11
src/features/auth/components/CreateAccount.tsx

@@ -11,6 +11,7 @@ import check from '@/assets/svg/check.svg'
 import './Auth.scss'
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { ColorType } from "@/context/themes/color";
+import { checkUnique } from "@/services/user";
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
   useNavigation = require("@react-navigation/native").useNavigation
@@ -20,7 +21,11 @@ export default function Component(props: { login: () => void }) {
   const { t } = useTranslation()
   const [name, setName] = useState('');
   const [email, setEmail] = useState('');
-  const [disableBtn,setDistableBtn] = useState(false)
+  const [nameInputing, setNameInputing] = useState(false);
+  const [emailInputing, setEmailInputing] = useState(false);
+  const [aviableName, setAvialbleName] = useState(-1)
+  const [aviableEmail, setAvialbleEmail] = useState(-1)
+  const [disableBtn, setDistableBtn] = useState(false)
   const handleNameChange = (value: string) => {
     setName(value);
   };
@@ -36,9 +41,31 @@ export default function Component(props: { login: () => void }) {
 
   function signupComponent() {
     return <View>
-      <Inputs autoFocus={true} value={name} onChange={handleNameChange} onConfirm={(e) => { }} placeholder={t('feature.auth.create_account.input_username_placeholder')}></Inputs>
+      <Inputs autoFocus={true}
+        value={name}
+        onChange={handleNameChange}
+        onConfirm={(e) => { }}
+        onFocus={() => {
+          setNameInputing(true)
+        }}
+        onBlur={() => {
+          setNameInputing(false)
+          checkData(true)
+        }}
+        placeholder={t('feature.auth.create_account.input_username_placeholder')}></Inputs>
       <View style={{ height: 20 }} />
-      <Inputs value={email} onChange={handleEmailChange} onConfirm={(e) => { }} placeholder={t('feature.auth.create_account.input_email_placeholder')}></Inputs>
+      <Inputs value={email}
+        onChange={handleEmailChange}
+        onConfirm={(e) => {
+          setEmailInputing(true)
+        }}
+        onFocus={() => {
+          setEmailInputing(false)
+        }}
+        onBlur={() => {
+          checkData(false)
+        }}
+        placeholder={t('feature.auth.create_account.input_email_placeholder')}></Inputs>
     </View>
   }
 
@@ -47,26 +74,85 @@ export default function Component(props: { login: () => void }) {
       return;
     }
 
-    if  (disableBtn){
+    if (disableBtn) {
       return;
     }
 
+    if (aviableName == 0 || aviableEmail == 0) {
+      Taro.showToast({
+        icon: 'none',
+        title: '请检查输入内容'
+      })
+      return;
+    }
+
+    if (nameInputing || emailInputing) {
+      checkUnique({
+        param: nameInputing ? 'username' : 'email',
+        value: nameInputing ? name : email
+      }).then(res => {
+        if (!(res as any).result) {
+          Taro.showToast({
+            icon: 'none',
+            title: (res as any).error
+          })
+        }
+        else {
+          goNextPage()
+        }
+      })
+      return
+    }
+    goNextPage()
+
+  }
+
+  function goNextPage() {
     setDistableBtn(true)
-    setTimeout(()=>{
+    setTimeout(() => {
       setDistableBtn(false)
-    },500)
-    
+    }, 500)
+
+
     global.username = name
     global.email = email
     setTimeout(() => {
-      jumpPage(`/pages/Auth?type=createPassword&name=${name}&email=${email}`, 'Auth', navigation,{
-        type:'createPassword',
-        name:name,
-        email:email
+      jumpPage(`/pages/Auth?type=createPassword&name=${name}&email=${email}`, 'Auth', navigation, {
+        type: 'createPassword',
+        name: name,
+        email: email
       })
     }, 100)
   }
 
+  function checkData(isUsername: boolean) {
+    checkUnique({
+      param: isUsername ? 'username' : 'email',
+      value: isUsername ? name : email
+    }).then(res => {
+      if (!(res as any).result) {
+        Taro.showToast({
+          icon: 'none',
+          title: (res as any).error
+        })
+        if (isUsername) {
+          setAvialbleName(0)
+        }
+        else {
+          setAvialbleEmail(0)
+        }
+      }
+      else {
+        if (isUsername) {
+          setAvialbleName(1)
+        }
+        else {
+          setAvialbleEmail(1)
+        }
+      }
+    })
+  }
+
   return <View style={{ width: '100%', height: '100%' }}>
     <Texts text={t('feature.auth.create_account.title')} type={TextType.primary}></Texts>
     <Texts text={t('feature.auth.create_account.sub_title')} type={TextType.secondary}></Texts>

+ 8 - 0
src/features/auth/components/CreatePassword.tsx

@@ -68,6 +68,14 @@ export default function Component(prop: { name?: string, email?: string }) {
       return;
     }
 
+    if (password!=repeat){
+      Taro.showToast({
+        title:'两次密码输入不一致',
+        icon:'none'
+      })
+      return
+    }
+
     register(
       global.username,
       global.email,

+ 8 - 4
src/features/trackSomething/components/Metric.tsx

@@ -144,7 +144,14 @@ export default function Component(props: any) {
             if (!item.latest_record) {
                 return
             }
-            jumpPage('/pages/common/RecordsHistory?type=metric&refreshList=getCards&code=' + item.code + `&title=${item.name}` + '&themeColor=' + item.theme_color)
+            jumpPage('/pages/common/RecordsHistory?type=metric&refreshList=getCards&code='
+                + item.code + `&title=${item.name}` + '&themeColor=' + item.theme_color, 'RecordsHistory', navigation, {
+                type: 'metric',
+                refreshList: 'getCards',
+                code: item.code,
+                title: item.name,
+                themeColor: item.theme_color
+            })
         }
         else {
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
@@ -258,7 +265,6 @@ export default function Component(props: any) {
     }
 
     function metricModalContent() {
-        debugger
         switch (modalType) {
             case MetricModalType.choose:
                 return <MetricModalChoose
@@ -401,7 +407,6 @@ export default function Component(props: any) {
 
     function onPageContainerCancel() {
         if (modalType == MetricModalType.choose || modalType == MetricModalType.order) {
-            debugger
             var array: any = [];
             list.map(item => {
                 array.push({
@@ -410,7 +415,6 @@ export default function Component(props: any) {
                     is_following: true
                 })
             })
-            // debugger
             setOrders(array)
             setNewOrders([])
             setGroups(JSON.parse(JSON.stringify(orignalGroups)))

+ 0 - 1
src/features/trackTimeDuration/components/Console.tsx

@@ -199,7 +199,6 @@ export default function Component(props: { isNextStep?: boolean }) {
             global.limit = limit
             //当set_time秒数<=latest_record_time秒数时,最小限制时间戳需+1分钟
             if (new Date(global.set_time).getSeconds() <= new Date(time.last_real_check_time).getSeconds() && global.set_time - time.last_real_check_time > 60000) {
-                debugger
                 limit = limit + 60 * 1000
             }
         }

+ 0 - 1
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -48,7 +48,6 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
     }
 
     function schedules() {
-        debugger
         return <View style={{ display: 'flex', flexDirection: 'column' }}>
 {/* 
             <Text className="modalTitle1" style={{

+ 0 - 6
src/features/trackTimeDuration/components/SetSchedule.weapp.tsx

@@ -208,9 +208,6 @@ export default function Component() {
     setHours(durationTime(e, endTime)[0])
     setMinutes(durationTime(e, endTime)[1])
     saveTempCache(e, endTime);
-    debugger
-    console.log(e)
-
     global.updateDial(e, endTime)
   }
 
@@ -222,7 +219,6 @@ export default function Component() {
     setHours(durationTime(startTime, e)[0])
     setMinutes(durationTime(startTime, e)[1])
     saveTempCache(startTime, e);
-    debugger
     console.log(e)
     global.updateDial(startTime, e)
   }
@@ -244,7 +240,6 @@ export default function Component() {
     setIsOpen(false)
     if (beginChange) {
       var strEnd = TimeFormatter.calculateTimeByTimeRange(count, startTime, true)
-      debugger
 
       setEndTime(strEnd);
       saveTempCache(startTime, strEnd)
@@ -252,7 +247,6 @@ export default function Component() {
     }
     else {
       var strStart = TimeFormatter.calculateTimeByTimeRange(count, endTime, false)
-      debugger
       setStartTime(strStart);
       saveTempCache(strStart, endTime)
       global.updateDial(strStart, endTime)

+ 3 - 0
src/features/trackTimeDuration/components/TimelineStage.rn.tsx

@@ -15,6 +15,7 @@ import { useFocusEffect } from '@react-navigation/native';
 import React from 'react';
 import JPush from 'jpush-react-native';
 import { Linking } from 'react-native';
+import { uploadPushPerm } from '@/services/user';
 
 
 export default function Component(props: { data: any, title?: string, subTitle?: string, isSchedule?: boolean,first_real_check_time?:number }) {
@@ -54,6 +55,8 @@ export default function Component(props: { data: any, title?: string, subTitle?:
 
         JPush.isNotificationEnabled(obj => {
             setPushEnable(obj)
+
+            uploadPushPerm(obj)
         })
     }
 

+ 0 - 1
src/features/workout/Result.tsx

@@ -88,7 +88,6 @@ export default function Component() {
         if ((record as any).items[0].format == 'TIME_SECONDS') {
             var time = Math.floor((item.end.timestamp - item.start.timestamp) / 1000);
             time = time < 1 ? 1 : time
-            debugger
             var obj = TimeFormatter.workoutTimeAndUnitList(time)
             return <MultiText values={obj.values}
                 units={obj.units}

+ 0 - 1
src/features/workout/WorkoutStopWatch.tsx

@@ -474,7 +474,6 @@ export default function Component(props: { targetCount: any, end: Function }) {
 
                     postData()
                 } else if (res.cancel) {
-                    debugger
                     resume()
                     console.log('用户点击取消')
                 }

+ 1 - 2
src/pages/clock/Clock.rn.tsx

@@ -172,9 +172,8 @@ export default function IndexPage() {
 
 
     useReady(async () => {
-        debugger
+
         const userData = await getStorage('userData');
-        debugger
         if (userData) {
             dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
             setTimeout(() => {

+ 0 - 2
src/pages/common/RecordsHistory.tsx

@@ -135,8 +135,6 @@ export default function Page() {
     }
 
     function getHistory(page = pageIndex) {
-        console.log('current type',router.params.type)
-        debugger
         if (page == 1)
             setTriggered(true)
         

+ 1 - 0
src/services/http/api.js

@@ -23,6 +23,7 @@ export const API_CLEAR_MIX = `${baseUrl}/api/clear-data/FAST_SLEEP`
 export const API_CHECK_UNIQUE = `${baseUrl}/api/user/check-unique`
 export const API_UPLOAD_SESSION = `${baseUrl}/api/thirdparty/wx/session`
 export const API_DEL_SESSION = `${baseUrl}/api/thirdparty/wx/session`
+export const API_USER_PERMS =  `${baseUrl}/api/user/perms`
 
 //track time duration
 export const API_FAST_PLANS = `${baseUrl}/api/fast/plans`

+ 16 - 3
src/services/user.tsx

@@ -1,13 +1,13 @@
 import Taro from '@tarojs/taro'
-import { API_OAUTH_LOGIN, API_REGISTER, API_LOGIN, API_LOGOUT, API_CLEAR_USER, API_USER_INFO, API_CHECK_UNIQUE, API_CLIENT_ID } from './http/api'
+import { API_OAUTH_LOGIN, API_REGISTER, API_LOGIN, API_LOGOUT, API_CLEAR_USER, API_USER_INFO, API_CHECK_UNIQUE, API_CLIENT_ID, API_USER_PERMS } from './http/api'
 import { request } from './http/request'
 import { clearSuccess, getInfoSuccess, loginSuccess, logoutSuccess, registerSuccess, updateSuccess } from '@/store/user'
 
 
-export const checkUnique = (username?: string, email?: string) => {
+export const checkUnique = (params: any) => {
     return new Promise((resolve, reject) => {
         request({
-            url: API_CHECK_UNIQUE, method: 'GET', data: { username: username, email: email }
+            url: API_CHECK_UNIQUE, method: 'GET', data: params
         }).then(res => {
             resolve(res);
             console.log(res);
@@ -30,6 +30,19 @@ export const login = (username: string, password: string) => {
     })
 }
 
+export const uploadPushPerm = (push_enable: boolean) => {
+    return new Promise((resolve, reject) => {
+        request({
+            url: API_USER_PERMS, method: 'POST', data: { push_enabled: push_enable }
+        }).then(res => {
+            resolve(res)
+            // dispatch(loginSuccess(res));
+        }).catch(e => {
+            reject(e)
+        })
+    })
+}
+
 export const wxLogin = (code: string/*, encryptedData: string, iv: string*/) => {
     return new Promise((resolve, reject) => {
         request({

Деякі файли не було показано, через те що забагато файлів було змінено