fix skit2
This commit is contained in:
@@ -74,88 +74,11 @@ class LoginController extends Controller
|
||||
else{
|
||||
return redirect('login')->with('error', 'Oppes! You have entered invalid credentials');
|
||||
}
|
||||
// if($auth_user['roles'] == 'teller'){
|
||||
// if($auth_user['role_harian'] == 'teller'){
|
||||
// $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
// // return view('homepage.'.$auth_user['role_harian'].'.home',compact('cawangan_info','api_url'));
|
||||
// return redirect()->route('home');
|
||||
// }elseif($auth_user['role_harian'] == 'penilai'){
|
||||
// $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
// $gadaian_semasa = Http::get(config('api.url') . '/api/gadaiansemasa/'. $auth_user['cawangan'])->json();
|
||||
// $gadaian_belumserah = Http::get(config('api.url') . '/api/gadaiansemasa/belum_serah/'. $auth_user['cawangan'])->json();
|
||||
// // return view('homepage.'.$auth_user['role_harian'].'.home',compact('cawangan_info','gadaian_semasa','gadaian_belumserah','api_url'));
|
||||
// return redirect()->route('home');
|
||||
// }else{
|
||||
// return view('not_assign');
|
||||
// }
|
||||
// }
|
||||
// elseif($auth_user['roles'] == 'pc' || $auth_user['roles'] == 'ppc'){
|
||||
// $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
// // return view('homepage.khazanah.home',compact('cawangan_info','api_url'));
|
||||
// return redirect()->route('home');
|
||||
// }
|
||||
// else{
|
||||
// $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
// // return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info','api_url'));
|
||||
// return redirect()->route('home');
|
||||
// }
|
||||
}
|
||||
|
||||
return redirect('login')->with('error', 'Oppes! You have entered invalid credentials');
|
||||
}
|
||||
|
||||
public function loginDashboard(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => 'required|string|email',
|
||||
'password' => 'required|string',
|
||||
]);
|
||||
|
||||
$credentials = $request->only('email', 'password');
|
||||
|
||||
if (Auth::guard('dashboard')->attempt($credentials,true)) {
|
||||
$auth_user = Auth::guard('dashboard')->user();
|
||||
|
||||
$user_login['nama'] = $auth_user['name'];
|
||||
$user_login['email'] = $auth_user['email'];
|
||||
$user_login['password'] = $auth_user['password'];
|
||||
$user_login['icno'] = $auth_user['no_kp'];
|
||||
$user_login['apitoken'] = $auth_user['remember_token'];
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'user' => $user_login
|
||||
]);
|
||||
} else {
|
||||
//if authentication is unsuccessfull, notice how I return json parameters
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid Email or Password',
|
||||
], 401);
|
||||
}
|
||||
}
|
||||
|
||||
public function logoutDashboard(Request $res)
|
||||
{
|
||||
$login_detail = Dashboard::where([['no_kp','=',$res->nokp],['remember_token','=',$res->header('Authorization')]])->first();
|
||||
// dd($login_detail);
|
||||
if ($login_detail) {
|
||||
// dd($login_detail);
|
||||
$logout_user = Dashboard::where([['no_kp','=',$res->nokp],['remember_token','=',$res->header('Authorization')]])->update(array(
|
||||
'remember_token' => null
|
||||
));
|
||||
// dd($logout_user);
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Logout successfully'
|
||||
]);
|
||||
}else {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Unable to Logout'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function logout(){
|
||||
Auth::logout();
|
||||
Session::flush();
|
||||
|
||||
Generated
+55
@@ -20,6 +20,9 @@
|
||||
"vue-property-decorator": "^9.1.2",
|
||||
"vue-pusher": "^1.1.0",
|
||||
"vue-router": "^3.5.3",
|
||||
"vue-spinner": "^1.0.4",
|
||||
"vue-swal2-loading-overlay": "^1.0.3",
|
||||
"vue-sweetalert2": "^5.0.2",
|
||||
"vue-toastification": "^1.7.14",
|
||||
"vuejs-datetimepicker": "^1.1.13",
|
||||
"vuelidate": "^0.7.7",
|
||||
@@ -9327,6 +9330,14 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sweetalert2": {
|
||||
"version": "11.3.3",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.3.3.tgz",
|
||||
"integrity": "sha512-10Keqbmjng/+XpkpSOQ6dttpztl7XNohjnpC6bX6XFgm0WpRXM81YE0wmonGYOP6uyzd76vpfnZS04PdVvO31Q==",
|
||||
"funding": {
|
||||
"url": "https://sweetalert2.github.io/#donations"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "2.2.19",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.2.19.tgz",
|
||||
@@ -9835,6 +9846,11 @@
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz",
|
||||
"integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg=="
|
||||
},
|
||||
"node_modules/vue-spinner": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/vue-spinner/-/vue-spinner-1.0.4.tgz",
|
||||
"integrity": "sha512-GNG2F+8BLX201JT/jUX+84Gsi3ZteVQwt9K7mues3ts9FcQ95dGn7uu6a5ndSxdYYUEzfh1KngZiOE0u+l4itA=="
|
||||
},
|
||||
"node_modules/vue-style-loader": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
|
||||
@@ -9845,6 +9861,22 @@
|
||||
"loader-utils": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-swal2-loading-overlay": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-swal2-loading-overlay/-/vue-swal2-loading-overlay-1.0.3.tgz",
|
||||
"integrity": "sha512-5gX2jLLKkZYzcbT6hRxmKRfGycIrZ+r8MTaV/uqZP5hhSKMGVLvUgiBbsXiSs2qZr3/XizE0xTQuFkCm33QJzA=="
|
||||
},
|
||||
"node_modules/vue-sweetalert2": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-sweetalert2/-/vue-sweetalert2-5.0.2.tgz",
|
||||
"integrity": "sha512-28pcpmvaFxwoXIUkOWwhZhmsV749jXxha8JicwPoSKyFKR5FhIaZU6UHO5WlUCLIVUI6sAWY6WngK2x/iXYwZg==",
|
||||
"dependencies": {
|
||||
"sweetalert2": "11.x"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-template-compiler": {
|
||||
"version": "2.6.14",
|
||||
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz",
|
||||
@@ -17599,6 +17631,11 @@
|
||||
"stable": "^0.1.8"
|
||||
}
|
||||
},
|
||||
"sweetalert2": {
|
||||
"version": "11.3.3",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.3.3.tgz",
|
||||
"integrity": "sha512-10Keqbmjng/+XpkpSOQ6dttpztl7XNohjnpC6bX6XFgm0WpRXM81YE0wmonGYOP6uyzd76vpfnZS04PdVvO31Q=="
|
||||
},
|
||||
"tailwindcss": {
|
||||
"version": "2.2.19",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.2.19.tgz",
|
||||
@@ -17983,6 +18020,11 @@
|
||||
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz",
|
||||
"integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg=="
|
||||
},
|
||||
"vue-spinner": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/vue-spinner/-/vue-spinner-1.0.4.tgz",
|
||||
"integrity": "sha512-GNG2F+8BLX201JT/jUX+84Gsi3ZteVQwt9K7mues3ts9FcQ95dGn7uu6a5ndSxdYYUEzfh1KngZiOE0u+l4itA=="
|
||||
},
|
||||
"vue-style-loader": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz",
|
||||
@@ -17993,6 +18035,19 @@
|
||||
"loader-utils": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"vue-swal2-loading-overlay": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-swal2-loading-overlay/-/vue-swal2-loading-overlay-1.0.3.tgz",
|
||||
"integrity": "sha512-5gX2jLLKkZYzcbT6hRxmKRfGycIrZ+r8MTaV/uqZP5hhSKMGVLvUgiBbsXiSs2qZr3/XizE0xTQuFkCm33QJzA=="
|
||||
},
|
||||
"vue-sweetalert2": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vue-sweetalert2/-/vue-sweetalert2-5.0.2.tgz",
|
||||
"integrity": "sha512-28pcpmvaFxwoXIUkOWwhZhmsV749jXxha8JicwPoSKyFKR5FhIaZU6UHO5WlUCLIVUI6sAWY6WngK2x/iXYwZg==",
|
||||
"requires": {
|
||||
"sweetalert2": "11.x"
|
||||
}
|
||||
},
|
||||
"vue-template-compiler": {
|
||||
"version": "2.6.14",
|
||||
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz",
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
"vue-property-decorator": "^9.1.2",
|
||||
"vue-pusher": "^1.1.0",
|
||||
"vue-router": "^3.5.3",
|
||||
"vue-spinner": "^1.0.4",
|
||||
"vue-swal2-loading-overlay": "^1.0.3",
|
||||
"vue-sweetalert2": "^5.0.2",
|
||||
"vue-toastification": "^1.7.14",
|
||||
"vuejs-datetimepicker": "^1.1.13",
|
||||
"vuelidate": "^0.7.7",
|
||||
|
||||
Vendored
+531
-61
File diff suppressed because one or more lines are too long
@@ -40,10 +40,32 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formansuran").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formansuran").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -42,10 +42,32 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formgadaian").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formgadaian").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -41,10 +41,30 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false
|
||||
|
||||
});
|
||||
|
||||
document.getElementById("formimbangduga").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false
|
||||
|
||||
});
|
||||
|
||||
document.getElementById("formimbangduga").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -44,10 +44,31 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
|
||||
});
|
||||
document.getElementById("formlejeram").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
|
||||
});
|
||||
|
||||
document.getElementById("formlejeram").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -74,10 +74,29 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
document.getElementById("formpendser").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
|
||||
});
|
||||
document.getElementById("formpendser").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -42,10 +42,32 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formpenebusan").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formpenebusan").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -41,10 +41,32 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formtuntutbaki").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formtuntutbaki").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
@@ -45,10 +45,32 @@ export default {
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formupah").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formupah").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
|
||||
Vendored
+8
-1
@@ -20,6 +20,11 @@ import Vuelidate from 'vuelidate'
|
||||
import datetime from 'vuejs-datetimepicker';
|
||||
import VueContentPlaceholders from 'vue-content-placeholders'
|
||||
|
||||
import VueSweetalert2 from 'vue-sweetalert2';
|
||||
import 'sweetalert2/dist/sweetalert2.min.css';
|
||||
|
||||
Vue.use(VueSweetalert2);
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
window.Vue = require('vue').default;
|
||||
@@ -52,6 +57,8 @@ Vue.use(Toast, options)
|
||||
Vue.use(datetime)
|
||||
Vue.use(VueContentPlaceholders)
|
||||
|
||||
|
||||
|
||||
Alpine.start()
|
||||
|
||||
Vue.use(require('vue-pusher'), {
|
||||
@@ -107,7 +114,6 @@ Vue.component('pemb-chart', require('./components/Chart/PembiayaanChart.vue').de
|
||||
Vue.component('peny-chart', require('./components/Chart/PenyelesaianChart.vue').default)
|
||||
Vue.component('keun-chart', require('./components/Chart/KeuntunganChart.vue').default)
|
||||
|
||||
|
||||
Vue.component('sidebar', require('./components/Sidebar.vue').default)
|
||||
Vue.component('breadcrumb', require('./components/Breadcrumb.vue').default)
|
||||
Vue.component('dashboard', require('./pages/dashboard.vue').default)
|
||||
@@ -135,6 +141,7 @@ Vue.component('clock-component', require('./components/util/Clock.vue').default)
|
||||
|
||||
Vue.component('logout-component', require('./Logout.vue').default)
|
||||
|
||||
Vue.component('pulse-loader', require('vue-spinner/src/PulseLoader.vue'));
|
||||
|
||||
Vue.component('apexchart', VueApexCharts)
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
props: {
|
||||
status: String,
|
||||
roles: String,
|
||||
route:String
|
||||
route:String,
|
||||
akaun:String
|
||||
},
|
||||
data: function(){
|
||||
return{
|
||||
@@ -36,7 +37,6 @@
|
||||
this.caw = this.$kodcaw
|
||||
|
||||
this.axios.get('/api/check/cawangan').then(response => {
|
||||
console.log(response.data)
|
||||
this.cawangan = response.data;
|
||||
});
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
this.setkodcaw(this.caw)
|
||||
this.$forceUpdate();
|
||||
|
||||
location.reload();
|
||||
if(this.akaun =='no')
|
||||
location.reload();
|
||||
|
||||
},
|
||||
namacawangan: function(cawangannama){
|
||||
|
||||
@@ -95,6 +95,8 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div id="app" @guest style="background: url(/img/background.jpg) no-repeat center center fixed;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
@@ -124,7 +126,7 @@
|
||||
|
||||
@auth
|
||||
<clock-component></clock-component>
|
||||
<cawangan-component status={{ Auth::user()->cawangan }} roles={{ Auth::user()->roles }} route={{ (Route::is('home') || Route::is('akaun.home')) ? 'ada' : 'tiada' }}></cawangan-component>
|
||||
<cawangan-component status={{ Auth::user()->cawangan }} roles={{ Auth::user()->roles }} route={{ (Route::is('home') || Route::is('akaun.home')) ? 'ada' : 'tiada' }} akaun={{ (Route::is('akaun.home') ? 'yes' : 'no')}}></cawangan-component>
|
||||
@endauth
|
||||
|
||||
<div class="flex items-center">
|
||||
|
||||
Reference in New Issue
Block a user