diff --git a/auth-code/api/api.js b/auth-code/api/api.js new file mode 100644 index 0000000..5c774de --- /dev/null +++ b/auth-code/api/api.js @@ -0,0 +1,22 @@ +const URL = ""; + +export async function callApi(fn_url, params, headers) { + try { + console.log("API CALL") + var url = URL + fn_url + var resp = await axios.post(url, params, headers) + if (resp != 'OK') { + return { + status: 'ERR', + message: resp.message + } + } else { + + } + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} \ No newline at end of file diff --git a/auth-code/components/authentication.vue b/auth-code/components/authentication.vue new file mode 100644 index 0000000..d83bbb2 --- /dev/null +++ b/auth-code/components/authentication.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/auth-code/components/dekstop.vue b/auth-code/components/dekstop.vue new file mode 100644 index 0000000..50b8ae1 --- /dev/null +++ b/auth-code/components/dekstop.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/auth-code/components/mobile.vue b/auth-code/components/mobile.vue new file mode 100644 index 0000000..ea08341 --- /dev/null +++ b/auth-code/components/mobile.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/auth-code/images/bg-left.jpg b/auth-code/images/bg-left.jpg new file mode 100644 index 0000000..ca025a5 Binary files /dev/null and b/auth-code/images/bg-left.jpg differ diff --git a/auth-code/index.html b/auth-code/index.html new file mode 100644 index 0000000..edb5ee6 --- /dev/null +++ b/auth-code/index.html @@ -0,0 +1,118 @@ + + + + + + Authentication + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/auth-code/language.js b/auth-code/language.js new file mode 100644 index 0000000..971e48a --- /dev/null +++ b/auth-code/language.js @@ -0,0 +1,14 @@ +var CustomMessages = { + en: { + message: { + authtext: 'Enter the authentication code', + msgInfo: 'Contact Administrator to get the authentication code', + }, + }, + id: { + message: { + authtext: 'Masukan kode autentifikasi', + msgInfo: "Hubungi Administrator untuk mendapatkan kode autentifikasi", + }, + }, +}; \ No newline at end of file diff --git a/auth-code/modules/auth.js b/auth-code/modules/auth.js new file mode 100644 index 0000000..2ef0500 --- /dev/null +++ b/auth-code/modules/auth.js @@ -0,0 +1,55 @@ +import * as api from "../api/api.js" + +const Store = { + state() { + return { + alert: { + show: false, + type: 'info', + message: window.i18n.global.t('message.msgInfo') + }, + authcode: "", + loading: false, + } + }, + mutations: { + setAuthcode(state, data) { + state.authcode = data + }, + setAlert(state, data) { + state.alert = data + }, + setLoading(state, data) { + state.loading = data + } + }, + actions: { + async submit({state, commit}) { + commit('setLoading', true) + try { + let fn = "linking" + let params = { + AuthCodeCode: state.authcode + } + let headers = {} + + let resp = await api.callApi(fn, params, headers) + if (resp.data.status != 'OK') { + commit('setLoading', false); + } else { + commit('setLoading', false); + + localStorage.setItem("token", resp.data.token) + localStorage.setItem("user", JSON.stringify(resp.data.data)) + + window.location.replace("") + } + } catch (error) { + console.log(error); + commit('setLoading', false); + } + } + } +} + +export default Store \ No newline at end of file diff --git a/loginv3/components/dekstop.vue b/loginv3/components/dekstop.vue index 21cb6da..2c74cb7 100644 --- a/loginv3/components/dekstop.vue +++ b/loginv3/components/dekstop.vue @@ -10,23 +10,22 @@ style="background-repeat: repeat-y" class="bg-white" src="./images/bg-left.jpg" - cover > -
- -
- +
+
+ +

@@ -55,19 +54,6 @@ :placeholder="$t('message.placeholderEmail')" variant="outlined" > - + + + SIGN IN WITH GOOGLE +

@@ -135,6 +131,9 @@ export default { set(val) { this.$store.commit("login/setPassword", val); }, + loginGoogle() { + this.$store.dispatch("login/loginGoogle") + } }, }, methods: { diff --git a/loginv3/components/mobile.vue b/loginv3/components/mobile.vue index 682e9fd..ef75877 100644 --- a/loginv3/components/mobile.vue +++ b/loginv3/components/mobile.vue @@ -1,86 +1,95 @@ diff --git a/loginv3/images/google_logo.png b/loginv3/images/google_logo.png new file mode 100644 index 0000000..e7d106c Binary files /dev/null and b/loginv3/images/google_logo.png differ diff --git a/loginv3/images/logo_google.svg b/loginv3/images/logo_google.svg new file mode 100644 index 0000000..c0669b3 --- /dev/null +++ b/loginv3/images/logo_google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/loginv3/index.html b/loginv3/index.html index 5b0569e..696a72d 100644 --- a/loginv3/index.html +++ b/loginv3/index.html @@ -3,7 +3,7 @@ - BISKEU + Login diff --git a/loginv3/modules/login.js b/loginv3/modules/login.js index 6fb3a3b..b5b32ef 100644 --- a/loginv3/modules/login.js +++ b/loginv3/modules/login.js @@ -1,7 +1,7 @@ // const URL = "/westone-api/v1/system/auth"; - -const URL = "https://devcpone.aplikasi.web.id/westone-api/v1/system/auth/"; +// const URL = "https://devcpone.aplikasi.web.id/westone-api/v1/system/auth"; +const apiURL = "http://localhost:8080/api/v1/auth"; const store = { namespaced: true, @@ -63,12 +63,12 @@ const store = { message: window.i18n.global.t('message.msgInfo') } let params = { - username: state.email, + email: state.email, password: state.password }; - console.log(params); + try { - const response = await axios.post(URL + '/login', params); + const response = await axios.post(apiURL + '/login', params); console.log(response.data) if (response.data.status != 'OK') { commit('setLoading', false); @@ -81,13 +81,19 @@ const store = { } else { commit('setLoading', false); commit('setData', response.data.data); - localStorage.setItem("token", response.data.data.token) - localStorage.setItem('user', JSON.stringify(response.data.data.user)) + localStorage.setItem("token", response.data.token) + localStorage.setItem('user', JSON.stringify(response.data.data)) //console.log(localStorage.getItem("token")) // if (data.user.is_courier === 'Y' && window.innerWidth < 600) // window.location = "/one-ui/test/vuex/one-courier-mobile/"; // else // window.location = "/" + response.data.data.user.M_UserGroupDashboard; + + if (response.data.type === 'westone') { + + } else { + window.location.href = "/auth-code"; + } } commit('setAlert', alert) @@ -97,6 +103,9 @@ const store = { } }, + async loginGoogle() { + window.location.href = apiURL + "/google/login" + }, async loginState({ state, commit }) { commit('setLoading', true); const params = { @@ -105,7 +114,7 @@ const store = { }; try { - const response = await axios.post(URL + '/login', params); + const response = await axios.post(apiURL + '/login', params); if (response.status != 'OK') { commit('setLoading', false); @@ -121,7 +130,7 @@ const store = { }, async LoginParam({ commit }, params) { try { - const response = await axios.post(URL + '/login', params); + const response = await axios.post(apiURL + '/login', params); commit('setData', response.data); } catch (error) { commit('setError', error); diff --git a/registration/components/datatable_patient.vue b/registration/components/datatable_patient.vue index 3c7b999..595ebf3 100644 --- a/registration/components/datatable_patient.vue +++ b/registration/components/datatable_patient.vue @@ -1,6 +1,6 @@ @@ -92,7 +87,8 @@ const items = [ { prependAvatar: "https://cdn.vuetifyjs.com/images/lists/3.jpg", title: "LAA0000082", - subtitle: `Fatiha Rizku Nur Imansari — Giwangan Tegal Turi UH.7 144 Sawunggaling, Wonokromo, Surabaya`, + name: "Fatiha Rizku Nur Imansari", + subtitle: `Giwangan Tegal Turi UH.7 144 Sawunggaling, Wonokromo, Surabaya`, dob: "19-01-2001", hp: "087731221123", }, @@ -100,7 +96,8 @@ const items = [ { prependAvatar: "https://cdn.vuetifyjs.com/images/lists/2.jpg", title: "LAA0007904", - subtitle: `Stephan Wilson Mandala Putra Aditama — Taman Pondok Jati BI/5 Sawunggaling, Wonokromo, Surabaya`, + name: "Stephan Wilson Mandala Putra Aditama", + subtitle: `Taman Pondok Jati BI/5 Sawunggaling, Wonokromo, Surabaya`, dob: "07-07-2002", hp: "081234222126", }, @@ -108,8 +105,8 @@ const items = [ { prependAvatar: "https://cdn.vuetifyjs.com/images/lists/1.jpg", title: "LAA0000035", - subtitle: - 'Ujang Taufik S.Sastramidjaja — JL. Winata NO.14 Sawunggaling, Wonokromo, Surabaya?', + name: "Ujang Taufik S.Sastramidjaja", + subtitle: 'JL. Winata NO.14 Sawunggaling, Wonokromo, Surabaya', dob: "14-09-1988", hp: "085111222129", selected: false, @@ -118,8 +115,8 @@ const items = [ { prependAvatar: "https://cdn.vuetifyjs.com/images/lists/4.jpg", title: "LAA0000072", - subtitle: - 'Santi Yuliana — Darmo Permai TIM 2/41 Sawunggaling, Wonokromo, Surabaya', + name: "Santi Yuliana", + subtitle: 'Darmo Permai TIM 2/41 Sawunggaling, Wonokromo, Surabaya', dob: "11-10-2004", hp: "0852343421900", selected: true, @@ -128,8 +125,8 @@ const items = [ { prependAvatar: "https://cdn.vuetifyjs.com/images/lists/5.jpg", title: "LAA0010689", - subtitle: - 'Cindy Tiara Hadianti — Gunung Sari Indah OO-9 Sawunggaling, Wonokromo, Surabaya', + name: "Cindy Tiara Hadianti", + subtitle: 'Gunung Sari Indah OO-9 Sawunggaling, Wonokromo, Surabaya', dob: "17-01-2001", hp: "087734211126", selected: false, @@ -137,157 +134,157 @@ const items = [ ]; diff --git a/registration/components/detail_order.vue b/registration/components/detail_order.vue new file mode 100644 index 0000000..7eee7c0 --- /dev/null +++ b/registration/components/detail_order.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/registration/components/form_patient.vue b/registration/components/form_patient.vue index b354be0..a941b19 100644 --- a/registration/components/form_patient.vue +++ b/registration/components/form_patient.vue @@ -1,23 +1,15 @@