opt: 授权码
This commit is contained in:
Binary file not shown.
@@ -15,12 +15,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LicenseTip',
|
name: 'LicenseTip',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activationCode: '',
|
activationCode: '',
|
||||||
tip: ''
|
tip: '',
|
||||||
|
redirect: '/dashboard'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -38,8 +41,25 @@ export default {
|
|||||||
}
|
}
|
||||||
// 暂时不对接API,这里模拟激活成功
|
// 暂时不对接API,这里模拟激活成功
|
||||||
console.log('授权码:', this.activationCode)
|
console.log('授权码:', this.activationCode)
|
||||||
localStorage.setItem('cdk', this.activationCode.trim())
|
request({
|
||||||
this.$router.push({ path: '/' })
|
url: 'api/verify/activity',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
code: this.activationCode.trim()
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
console.log('激活成功:', res)
|
||||||
|
if (res.result) {
|
||||||
|
localStorage.setItem('cdk', this.activationCode.trim())
|
||||||
|
window.location.href = this.redirect
|
||||||
|
this.$message(res.message || '激活成功')
|
||||||
|
// this.$router.push({ path: '/' })
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message || '激活失败,请检查授权码')
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('API错误:', error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user