rt-sim-training-client/src/views/authorization/index.vue
joylink_cuiweidong 5039c09c16 样式调整
2021-04-21 17:19:25 +08:00

54 lines
1.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="authorization">
<el-input v-model="license" type="textarea" rows="5" placeholder="请输入授权码" style="width: 300px; margin-bottom: 30px;" />
<el-button @click="verifyLicense">授权确认</el-button>
</div>
</template>
<script>
import { postLicenseValidate, postLicenseLocal } from '@/api/pushMessage';
export default {
name: 'Authorization',
data() {
return {
license: ''
};
},
methods: {
async verifyLicense() {
try {
const params = {
secretKey: 'joylink',
license: this.license
};
const res = await postLicenseValidate(params);
if (res.code == 200 && res.data) {
const resLocal = await postLicenseLocal(params);
if (resLocal.code == 200) {
this.$router.push({ path: `/login` });
} else {
this.$messageBox('license无效');
}
} else {
this.$messageBox('license无效');
}
} catch (error) {
console.log(error);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.authorization{
width: 100%;
position: absolute;
top: 30%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
</style>