Add MIX_API_URL in env to be ref by webpack

This commit is contained in:
Afiq Hamzah
2024-01-02 16:48:37 +08:00
parent b8db5eb860
commit 5bc3403ce2
3 changed files with 25 additions and 20 deletions
+2
View File
@@ -49,3 +49,5 @@ PUSHER_APP_SECRET=421b61fb5a8ecce477a6
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# MIX_API_URL=apiujrah.arrahn
MIX_API_URL=api.arrahn
+5 -3
View File
@@ -126,19 +126,21 @@ Vue.use(require('vue-pusher'), {
}
});
Vue.prototype.$api1 = 'http://api.arrahn/'
Vue.prototype.$api1 = process.env.MIX_API_URL
Vue.prototype.$username = document.querySelector("meta[name='user_name']").getAttribute('content');
Vue.prototype.$userroles = document.querySelector("meta[name='user_roles']").getAttribute('content');
let initial = 'KB2';
let initialhostname = 'http://api.arrahn/';
let initialhostname = process.env.MIX_API_URL;
let initialtahun = new Date().getFullYear();
const store = new Vuex.Store({
state: {
$kodcaw: 'KB2',
$hostname: 'http://api.arrahn/',
$hostname: process.env.MIX_API_URL,
$tahun: new Date().getFullYear()
},
plugins: [createPersistedState()],
+3 -2
View File
@@ -90,7 +90,7 @@
case 'JLI':
case 'ARP':
case '020303':{
this.sethostname('http://api.arrahn')
this.sethostname(process.env.MIX_API_URL);
break;
}
case '010621':
@@ -120,7 +120,8 @@
this.sethostname('http://api2.arrahn')
break;
}
default: this.sethostname('http://api.arrahn')
default: this.sethostname(process.env.MIX_API_URL)
break;
}
}