无token不发起请求

main
king 1 year ago
parent 0983880725
commit 0d05ea82ac
  1. 1
      .env
  2. 2
      src/api/request.ts
  3. 8
      src/pages/business/videoInfo/components/course.tsx
  4. 3
      src/pages/business/videoInfo/videoInfo.tsx
  5. 4
      src/pages/manage/depAdmin/depAdmin.tsx

@ -1,3 +1,2 @@
#TARO_APP_API=http://192.168.1.19:9898
TARO_APP_API=https://yjx.dev.yaojiankang.top TARO_APP_API=https://yjx.dev.yaojiankang.top
#TARO_APP_API=https://playedu.yaojiankang.top #TARO_APP_API=https://playedu.yaojiankang.top

@ -74,6 +74,8 @@ export function request<T = unknown>(
if (!whitelist.includes(url)) { if (!whitelist.includes(url)) {
return new Promise((_, reject) => reject()) return new Promise((_, reject) => reject())
} }
} else {
return new Promise((_, reject) => reject())
} }
} }
if (method === 'GET' && data) { if (method === 'GET' && data) {

@ -196,7 +196,9 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => {
style={{height: "70vh"}} style={{height: "70vh"}}
snapToEdge snapToEdge
current={index} current={index}
onChange={(e) => setIndex((e.target as any).value)}> onChange={(e) => {
setIndex((e.target as any).current)
}}>
{examAll?.[time]?.map((d, index) => {examAll?.[time]?.map((d, index) =>
<SwiperItem> <SwiperItem>
<ScrollView style='height:70vh' scrollY> <ScrollView style='height:70vh' scrollY>
@ -218,7 +220,7 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => {
data={d as ShareSubject} data={d as ShareSubject}
validate={validate} validate={validate}
onAnswer={onAnswer} onAnswer={onAnswer}
end={index === examAll?.[time].length} end={index === examAll?.[time].length - 1}
/>} />}
{d.question_type === 3 && {d.question_type === 3 &&
<ShortAnswer <ShortAnswer
@ -228,7 +230,7 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => {
onUpAndDown={(index) => setIndex(index)} onUpAndDown={(index) => setIndex(index)}
index={index} index={index}
validate={validate} validate={validate}
end={index === examAll?.[time].length} end={index === examAll?.[time].length - 1}
/>} />}
</ScrollView> </ScrollView>
</SwiperItem> </SwiperItem>

@ -88,7 +88,6 @@ const VideoInfo: FC = () => {
}) })
return ( return (
<Profile.Provider> <Profile.Provider>
<View className='content'> <View className='content'>
@ -105,7 +104,7 @@ const VideoInfo: FC = () => {
</View> </View>
<View className='font-weight font-40 my-4'>{data?.course.title}</View> <View className='font-weight font-40 my-4'>{data?.course.title}</View>
<View className='text-muted font-26'> <View className='text-muted font-26'>
<Text>{data?.learn_record?.finished_count || 0}/{data?.course.class_hour}</Text> <Text>{data?.learn_hour_records.length || 0}/{data?.course.class_hour}</Text>
</View> </View>
</View> </View>

@ -56,7 +56,7 @@ const ChangeData: FC<ChangeDataProps> = ({putCompany, getDeps, parent_id}: Chang
return ( return (
<View className='depForm'> <View className='depForm'>
<View className='mt-2 text-center font-weight font-34'></View> <View className='mt-2 text-center font-weight font-34'>{putCompany ? '修改' + putCompany.name : '添加部门'}</View>
<Form className='form mt-3'> <Form className='form mt-3'>
<View className='item'> <View className='item'>
<View></View> <View></View>
@ -119,7 +119,7 @@ const DepAdmin: FC = () => {
Taro.showActionSheet({ Taro.showActionSheet({
itemList: [ itemList: [
'查看部门课程', '查看部门课程',
'查看子部门', '查看子部门和学员',
'修改', '修改',
'删除' '删除'
], ],

Loading…
Cancel
Save