Base Login
This commit is contained in:
47
components/AccessExtend.vue
Normal file
47
components/AccessExtend.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="py-5 has-background-danger has-text-white mt-3 px-4" style="border-radius: 10px">
|
||||
<!-- <p class="fsb-20">
|
||||
Gói dịch vụ của quý khách đã hết hạn sử dụng. Để tiếp tục truy cập findata.vn với một số tính năng bị khóa vui
|
||||
lòng click:
|
||||
</p>
|
||||
<p>
|
||||
<button class="button is-medium is-primary px-2 mt-4" @click="redirect()">
|
||||
<span class="icon-text fsb-20">
|
||||
<span class="material-symbols-outlined">highlight_mouse_cursor</span>
|
||||
<span class="ml-2">Findata.vn</span>
|
||||
</span>
|
||||
</button>
|
||||
</p> -->
|
||||
<p>Nội dung đang được cập nhật</p>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Bowser from 'bowser';
|
||||
export default {
|
||||
methods: {
|
||||
async createToken() {
|
||||
let data = this.$copy(this.$store.state.login);
|
||||
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||
let obj = {
|
||||
browser: browser.getBrowserName(),
|
||||
browser_version: browser.getBrowserVersion(),
|
||||
platform: browser.getPlatform().type,
|
||||
os: browser.getOSName(),
|
||||
user: data.id,
|
||||
token: this.$id(),
|
||||
};
|
||||
let ele = this.$copy(data);
|
||||
ele.token = obj.token;
|
||||
await this.$insertapi('authtoken', obj);
|
||||
this.$redirectWeb(ele);
|
||||
},
|
||||
async redirect() {
|
||||
let f = { user: this.$store.state.login.id };
|
||||
let row = await this.$getdata('accessextend', f, undefined, true);
|
||||
if (row) return await this.createToken();
|
||||
await this.$insertapi('accessextend', f);
|
||||
await this.createToken();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user