Skip to content

Commit

Permalink
Merge pull request #2 from egodasa/beta
Browse files Browse the repository at this point in the history
Perbaikan untuk skripsi
  • Loading branch information
egodasa authored Jan 12, 2018
2 parents 83a4630 + d588e2f commit a329007
Show file tree
Hide file tree
Showing 56 changed files with 66 additions and 2,467 deletions.
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"date-fns": "^1.29.0",
"fingerprintjs2": "^1.5.1",
"jquery": "^3.2.1",
"jwt-decode": "^2.2.0",
"md5": "^2.2.1",
"moment": "^2.19.1",
"moment-timezone": "^0.5.13",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/page/admin/halamanAdmin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
},
beforeRouteEnter: (to, from, next)=>{
next(vm => {
if(vm.$cks.isCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin')){
if(new Date().getTime() > vm.$cks.getCookies('infoLogin').expireLogin){
vm.$lcs.remove('infoLogin')
vm.$router.push({path:'/'})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/page/dosen/halamanDosen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
},
beforeRouteEnter: (to, from, next)=>{
next(vm => {
if(vm.$cks.isCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin')){
if(new Date().getTime() > vm.$cks.getCookies('infoLogin').expireLogin){
vm.$lcs.remove('infoLogin')
vm.$router.push({path:'/'})
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/page/loginPengguna.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ components : {
},
beforeRouteEnter (to, from, next) {
next(vm => {
if(vm.$cks.isCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin').id_juser == 1) vm.$router.push({path:'/admin'})
else if(vm.$cks.getCookies('infoLogin').id_juser == 2) vm.$router.push({path:'/dosen/'+vm.$cks.getCookies('infoLogin').username})
else if(vm.$cks.getCookies('infoLogin').id_juser == 3){
Expand All @@ -55,8 +55,8 @@ beforeRouteEnter (to, from, next) {
},
data () {
return {
username : '1029108702',
password : 'upi1029108702yptk',
username : '0005076607',
password : 'upi0005076607yptk',
Blogin : {
disabled : false,
caption : "login"
Expand Down Expand Up @@ -87,19 +87,19 @@ methods : {
}
}`
var kueri = {query : query,variables : {username : this.username,password : md5(this.password)}}
this.$ajx.post('api/user/cek',{username : this.username,password : md5(this.password)})
this.$ajx.post('api/v2/user',kueri)
.then(res=>{
this.Blogin.disabled = false
this.Blogin.caption = "Login"
let hasil = res.data.data
let hasil = res.data.data.cekUser
if(hasil.length == 0) {
bus.$emit('showAlert','Peringatan!','Username atau password tidak cocok!','warning')
}
else {
if(hasil[0].status_user == 0){
if(hasil.status_user == 0){
bus.$emit('showAlert','Peringatan!','Akun Anda sudah tidak bisa digunakan lagi!','warning')
}else{
this.$cks.setCookies('infoLogin',hasil[0].token,'6h')
this.$cks.setCookies('infoLogin',hasil[0],'6h')
var x = {}
if(hasil[0].id_juser == 1){
x = {path : '/admin'}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/page/peserta/loginPeserta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
},
beforeRouteEnter: (to, from, next)=>{
next(vm => {
if(vm.$cks.isCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin').id_juser == 1) vm.$router.push({path:'/admin'})
else if(vm.$cks.getCookies('infoLogin').id_juser == 2) vm.$router.push({path:'/dosen/'+vm.$cks.getCookies('infoLogin').username})
else if(vm.$cks.getCookies('infoLogin').id_juser == 3) {
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/page/peserta/pelaksanaanUjian.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ data () {
},
beforeRouteEnter: (to, from, next)=>{
next(vm => {
if(vm.$cks.isCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin')){
if(vm.$cks.getCookies('infoLogin').id_juser == 1) vm.$router.push({path:'/admin'})
else if(vm.$cks.getCookies('infoLogin').id_juser == 2) vm.$router.push({path:'/dosen/'+vm.$cks.getCookies('infoLogin').username})
else if(vm.$cks.getCookies('infoLogin').id_juser == 3) {
Expand Down Expand Up @@ -267,10 +267,13 @@ methods : {
}
this.$ajx.post('api/ujian/hasil',hasil)
.then(res=>{
console.log(res.data)
this.$lcs.removeLcs('infoUjian')
this.$cks.clearCookies('infoLogin')
this.$lcs.removeLcs('ljk')
this.$router.push({path: '/'})
})
.catch(err=>{
console.log(err)
bus.$emit('showAlert','Kesalahan!','Tidak dapat mengumpukan ujian. Silahkan diulangi kembali!','warning')
})
}else if(this.infoUjian.id_jsoal == 2){
var hasil = []
Expand Down
16 changes: 9 additions & 7 deletions frontend/src/components/template/GenTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,18 @@ methods : {
})
},
deleteData (id) {
this.$ajx({
if(window.confirm("Apakah yakin ingin menghapus data ini?")){
this.$ajx({
method : 'DELETE',
url :this.baseUrl+this.url+'/'+id
})
.then(res=>{
this.getData(this.pageRows,this.pagePosition)
})
.catch(err=>{
bus.$emit('showAlert','Peringatan!','Gagal menghapus data!','warning')
})
.then(res=>{
this.getData(this.pageRows,this.pagePosition)
})
.catch(err=>{
bus.$emit('showAlert','Peringatan!','Gagal menghapus data!','warning')
})
}
},
getDataDetail (x) {
bus.$emit('getDataDetail',x)
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import vuecookies from 'vue-cookies'
import msgpack from 'msgpack-lite'
import VueQuillEditor from 'vue-quill-editor'
import fp2 from 'fingerprintjs2'
import jwt_decode from 'jwt-decode'


Vue.use(VueQuillEditor)
Vue.use(wysiwyg, {
Expand All @@ -43,10 +43,10 @@ Vue.use(VueSession);
Vue.use(VeeValidate, {locale: 'id',delay:"1000"});
const cks = {
setCookies (x,y,z = null){
z == null ? vuecookies.set(x,y) : vuecookies.set(x,y,z)
z == null ? vuecookies.set(x,serialize(y)) : vuecookies.set(x,serialize(y),z)
},
getCookies (x){
return jwt_decode(vuecookies.get(x))
return eval('(' + vuecookies.get(x) + ')')
},
clearCookies (x){
vuecookies.remove(x)
Expand Down
4 changes: 0 additions & 4 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2539,10 +2539,6 @@ jstransform@^11.0.3:
object-assign "^2.0.0"
source-map "^0.4.2"

jwt-decode@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-2.2.0.tgz#7d86bd56679f58ce6a84704a657dd392bba81a79"

kind-of@^3.0.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"express-fileupload": "^0.1.4",
"express-graphql": "^0.6.11",
"express-jwt": "^5.3.0",
"express-unless": "^0.3.1",
"express-validator": "^3.2.1",
"graphql": "^0.11.7",
"heroku-cli": "^6.14.37",
Expand Down
49 changes: 0 additions & 49 deletions public/admin/.goutputstream-HAP64Y

This file was deleted.

1 change: 0 additions & 1 deletion public/admin/404.html

This file was deleted.

168 changes: 0 additions & 168 deletions public/admin/config/app.js

This file was deleted.

Loading

0 comments on commit a329007

Please sign in to comment.