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