2121 </div >
2222 <div v-else >
2323 <div v-if =" usecveRecordStore.isIdOrRecordFound" >
24- <div v-if =" websiteEnv !== 'prd' " class =" notification is-warning is-light" role =" alert" >
24+ <div v-if =" !genericGlobalsStore.isProductionWebsite " class =" notification is-warning is-light" role =" alert" >
2525 <div class =" is-flex" style =" justify-content : center ;" >
2626 <p id =" alertIconCveRecordsRequestErrored" class =" is-hidden" >alert</p >
2727 <font-awesome-icon style =" flex : 0 0 40px ;" size =" 1x" icon =" triangle-exclamation" role =" img"
@@ -103,7 +103,9 @@ export default {
103103 : this .GenericGlobalsStore .cveServiceTestBaseUrl ,
104104 usecveRecordStore: usecveRecordStore (),
105105 cveId: usecveRecordStore ().cveId ,
106+ cveServicesUrl: undefined ,
106107 errorMessageStore: useErrorMessageStore (),
108+ genericGlobalsStore: useGenericGlobalsStore (),
107109 showHelpText: false ,
108110 disabled: true ,
109111 getIdStatusCode: undefined ,
@@ -122,12 +124,15 @@ export default {
122124 }
123125 },
124126 created () {
125- const fullPathArr = this .$route .fullPath .split (' id=' );
126- if (fullPathArr .length === 2 ) {
127- const cveId = fullPathArr[1 ];
127+ const cveId = this .$route .query ? .id ;
128+ if (cveId) {
128129 this .cveId = this .cveIdToUpperCase (cveId);
129130 this .validateCveId ();
130131 if (! this .disabled ) {
132+ if (this .$route .query ? .prod ?? ' false' === ' true' )
133+ this .currentServicesUrl = this .genericGlobalsStore .cveServicesBaseUrl ;
134+ else
135+ this .currentServicesUrl = this .genericGlobalsStore .currentServicesUrl ;
131136 this .startLookup ();
132137 } else {
133138 usecveRecordStore ().showHelpText = true ;
@@ -138,10 +143,15 @@ export default {
138143 },
139144 watch: {
140145 $route (to) {
141- if (Object .prototype .hasOwnProperty .call (to .query , ' id' )) {
142- this .cveId = this .cveIdToUpperCase (to .query .id );
146+ const cveId = to .query ? .id ;
147+ if (cveId) {
148+ this .cveId = this .cveIdToUpperCase (cveId);
143149 this .validateCveId ();
144150 if (! this .disabled ) {
151+ if (this .$route .query ? .prod ?? ' false' === ' true' )
152+ this .currentServicesUrl = this .genericGlobalsStore .cveServicesBaseUrl ;
153+ else
154+ this .currentServicesUrl = this .genericGlobalsStore .currentServicesUrl ;
145155 this .startLookup ();
146156 } else {
147157 this .resetStates ();
@@ -203,7 +213,7 @@ export default {
203213
204214 const getIdUrl = ` /api/cve-id/${ usecveRecordStore ().cveId } ` ;
205215 try {
206- axios .defaults .baseURL = this .GenericGlobalsStore . currentServicesUrl ;
216+ axios .defaults .baseURL = this .currentServicesUrl ;
207217 const idData = await axios .get (getIdUrl);
208218 this .getIdStatusCode = 200 ;
209219 if (idData .status === 200 && idData? .data ? .error === undefined ) {
@@ -239,7 +249,7 @@ export default {
239249 }
240250 },
241251 async getRecordData () {
242- const getRecordUrl = ` ${ useGenericGlobalsStore () .currentServicesUrl } /api/cve/${ usecveRecordStore ().cveId } ` ;
252+ const getRecordUrl = ` ${ this .currentServicesUrl } /api/cve/${ usecveRecordStore ().cveId } ` ;
243253 if (this .GenericGlobalsStore .useSearch ) {
244254 this .isResultFromProd = true ;
245255 } else {
0 commit comments