邀请登记判断见面会是否开始

main
king 1 year ago
parent 14cbc8584f
commit 87a1c4e833
  1. 5
      src/api/login.ts
  2. 2
      src/api/request.ts
  3. 15
      src/pages/meeting/meeting.tsx
  4. 7
      types/user.d.ts

@ -14,6 +14,9 @@ export const loginApi = {
return request<LoginParams>("/api/v1/auth/login/meeting", "GET");
},
testLogin() {
return request('/token/18708100736', "GET")
return request('/token/15882685759', "GET")
},
meetingInfo(id: string) {
return request(`/api/v1/meetings/meeting/${id}/info`, "GET")
}
}

@ -81,7 +81,7 @@ export function request<T = unknown>(
try {
const data = res?.data as any
if (data?.code === 0 && res?.statusCode === 200) {
resolve(data?.data || [])
resolve(data?.data)
} else if (res.statusCode === 401) {
Taro.showModal({
title: "登录过期,需重新登陆",

@ -7,7 +7,7 @@ import {getCurrentInstance} from "@tarojs/runtime";
import {regexTel} from "@/utils/regu";
const Meeting: FC = () => {
const {depid, start_time, end_time} = getCurrentInstance()?.router?.params as unknown as Offline
const {meeting_id} = getCurrentInstance()?.router?.params as unknown as { meeting_id: string }
const {setUser, setToken, setCompany} = Profile.useContainer()
const [h5params, setH5Params] = useState<LoginParams | null>(null)
const router = useRouter()
@ -18,23 +18,18 @@ const Meeting: FC = () => {
})
}, [])
Taro.useLoad(() => {
const time = Date.now()
if (!depid
|| !start_time
|| !end_time
|| time > new Date(end_time).getTime()
|| time < new Date(start_time).getTime()) {
loginApi.meetingInfo(meeting_id).then(res => {
if (res !== 1) {
Taro.showModal({
title: '二维码已过期',
success() {
Taro.reLaunch({url: '/pages/login/login'})
}
})
return
}
})
})
function submit(e) {
const value = e.detail.value
@ -82,7 +77,7 @@ const Meeting: FC = () => {
}
return (
<View className='h-10 bg-white p-2'>
<View className='h-10 bg-white px-2'>
<Form className='form' onSubmit={submit}>
<View className='item'>

7
types/user.d.ts vendored

@ -95,9 +95,4 @@ interface HourHistory extends Curriculum {
}
interface Offline {
depid: number
start_time: number
end_time: number
path: string
}

Loading…
Cancel
Save