2023-04-14 16:50:13 +00:00
|
|
|
import axios from 'axios'
|
2023-04-14 16:39:52 +00:00
|
|
|
|
|
|
|
const CHECK_IN_ID = 'qmXXCxw9WEWN3X/YrkMWuQ=='
|
|
|
|
const CHECK_OUT_ID = 'j8ekmJaw6W3M4w3i6hlSIQ=='
|
|
|
|
|
2023-04-26 15:30:46 +00:00
|
|
|
async function kingoftime(
|
|
|
|
operationId: string,
|
|
|
|
token: string,
|
|
|
|
userToken: string,
|
|
|
|
) {
|
2023-04-14 16:39:52 +00:00
|
|
|
const response = await axios({
|
|
|
|
method: 'post',
|
2023-04-14 16:50:13 +00:00
|
|
|
// url: 'https://s2.kingtime.jp/gateway/bprgateway',
|
2023-04-14 16:39:52 +00:00
|
|
|
url: 'https://httpbin.org/anything',
|
|
|
|
headers: {
|
2023-04-14 16:50:13 +00:00
|
|
|
Accept: 'application/json, text/javascript, */*; q=0.01',
|
2023-04-14 16:39:52 +00:00
|
|
|
},
|
|
|
|
data: new URLSearchParams({
|
2023-04-14 16:50:13 +00:00
|
|
|
id: operationId,
|
|
|
|
highAccuracyFlg: 'false',
|
|
|
|
credential_code: '40', // eslint-disable-line camelcase
|
|
|
|
user_token: userToken, // eslint-disable-line camelcase
|
|
|
|
version: '1.4.2',
|
|
|
|
token: token,
|
|
|
|
}),
|
2023-04-14 16:39:52 +00:00
|
|
|
})
|
|
|
|
console.log(response.data)
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function checkin(token: string, userToken: string): Promise<void> {
|
|
|
|
await kingoftime(CHECK_IN_ID, token, userToken)
|
|
|
|
}
|
|
|
|
|
2023-04-26 15:30:46 +00:00
|
|
|
export async function checkout(
|
|
|
|
token: string,
|
|
|
|
userToken: string,
|
|
|
|
): Promise<void> {
|
2023-04-14 16:39:52 +00:00
|
|
|
await kingoftime(CHECK_OUT_ID, token, userToken)
|
|
|
|
}
|