sonar qube; getCookie refactored
This commit is contained in:
@@ -1,18 +1,17 @@
|
|||||||
export function getCookie(name) {
|
export function getCookie(name) {
|
||||||
const nameEqual = name + "=";
|
const nameEqual = name + "=";
|
||||||
const cookieArr = document.cookie.split(';');
|
const cookieArr = document.cookie.split(';');
|
||||||
for (let i = 0; i < cookieArr.length; i++) {
|
|
||||||
let c = cookieArr[i];
|
for (const cookie of cookieArr) {
|
||||||
while (c.charAt(0) === ' ') {
|
let c = cookie.trim();
|
||||||
c = c.substring(1, c.length);
|
if (c.indexOf(nameEqual) === 0) {
|
||||||
|
return c.substring(nameEqual.length, c.length);
|
||||||
}
|
}
|
||||||
if (c.indexOf(nameEqual) === 0) {
|
|
||||||
return c.substring(nameEqual.length, c.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
export function setCookie(name, value, days=1) {
|
export function setCookie(name, value, days=1) {
|
||||||
let expires = "";
|
let expires = "";
|
||||||
if (days) {
|
if (days) {
|
||||||
|
|||||||
@@ -426,7 +426,6 @@ export default {
|
|||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.infiniteFinish = false;
|
this.infiniteFinish = false;
|
||||||
this.infiniteStart += ONCE_RENDER_NUM_OF_DATA;
|
this.infiniteStart += ONCE_RENDER_NUM_OF_DATA;
|
||||||
// await this.acctMgmtStore.getAccountDetail();
|
|
||||||
this.infiniteAcctDataVue2 = await [...this.infiniteAcctDataVue2, ...this.allUserAccoutList.slice(
|
this.infiniteAcctDataVue2 = await [...this.infiniteAcctDataVue2, ...this.allUserAccoutList.slice(
|
||||||
this.infiniteStart, this.infiniteStart + ONCE_RENDER_NUM_OF_DATA)];
|
this.infiniteStart, this.infiniteStart + ONCE_RENDER_NUM_OF_DATA)];
|
||||||
this.isInfiniteFinish = true;
|
this.isInfiniteFinish = true;
|
||||||
@@ -452,9 +451,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.isLoading = false; //TODO:
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ export default {
|
|||||||
name,
|
name,
|
||||||
is_admin,
|
is_admin,
|
||||||
is_active,
|
is_active,
|
||||||
is_sso,
|
|
||||||
has_data,
|
|
||||||
} = currentViewingUser.value;
|
} = currentViewingUser.value;
|
||||||
|
|
||||||
onBeforeMount(async() => {
|
onBeforeMount(async() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user