updated
This commit is contained in:
parent
2fc2a3faf0
commit
79453457d1
1 changed files with 20 additions and 17 deletions
|
|
@ -18,8 +18,8 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
/** ยิง API เพื่อดึงรายการข้อมูลเครื่องอ่านบัตร
|
||||
* @param {any} q ค่า this ของ quasar
|
||||
*/
|
||||
function fetchDeviceLists(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/device`, {
|
||||
async function fetchDeviceLists(q: any) {
|
||||
await fetch(`${apiURL.value}/smart-card/device`, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
@ -41,10 +41,13 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
/** connect device ที่เลือก
|
||||
* @param {any} q ค่า this ของ quasar
|
||||
*/
|
||||
function readDevice(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/connect/?deviceName=${devices.value}`, {
|
||||
method: "GET",
|
||||
})
|
||||
async function readDevice(q: any) {
|
||||
await fetch(
|
||||
`${apiURL.value}/smart-card/connect/?deviceName=${devices.value}`,
|
||||
{
|
||||
method: "GET",
|
||||
}
|
||||
)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
|
|
@ -63,7 +66,7 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
* @param {any} q ค่า this ของ quasar
|
||||
*/
|
||||
async function getInfo(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/info`, {
|
||||
await fetch(`${apiURL.value}/smart-card/info`, {
|
||||
method: "GET",
|
||||
})
|
||||
.then(function (response) {
|
||||
|
|
@ -86,7 +89,7 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
* @param {any} q ค่า this ของ quasar
|
||||
*/
|
||||
async function postReadIdCard(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/read/`, {
|
||||
await fetch(`${apiURL.value}/smart-card/read/`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
fields: [
|
||||
|
|
@ -122,8 +125,8 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
/** setting ami environment
|
||||
* @param {any} q ค่า this ของ quasar
|
||||
*/
|
||||
function amiEnvironment(q: any) {
|
||||
fetch(`${apiURL.value}/ami/environment`, {
|
||||
async function amiEnvironment(q: any) {
|
||||
await fetch(`${apiURL.value}/ami/environment`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
host: "lkbmabk.bma.go.th",
|
||||
|
|
@ -152,8 +155,8 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
* connect ami
|
||||
* @param q ค่า this ของ quasar
|
||||
*/
|
||||
function amiConnect(q: any) {
|
||||
fetch(`${apiURL.value}/ami/connect`, {
|
||||
async function amiConnect(q: any) {
|
||||
await fetch(`${apiURL.value}/ami/connect`, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
@ -175,8 +178,8 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
* card authentication
|
||||
* @param q ค่า this ของ quasar
|
||||
*/
|
||||
function authentication(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/authentication`, {
|
||||
async function authentication(q: any) {
|
||||
await fetch(`${apiURL.value}/smart-card/authentication`, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
@ -211,7 +214,7 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
fetch(`${apiURL.value}/smart-card/verify`, requestOptions)
|
||||
await fetch(`${apiURL.value}/smart-card/verify`, requestOptions)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
|
|
@ -290,8 +293,8 @@ export const useLinkageStore = defineStore("linkageData", () => {
|
|||
});
|
||||
}
|
||||
|
||||
function disconnect(q: any) {
|
||||
fetch(`${apiURL.value}/smart-card/disconnect`, {
|
||||
async function disconnect(q: any) {
|
||||
await fetch(`${apiURL.value}/smart-card/disconnect`, {
|
||||
method: "GET",
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue