opt: 授权码
This commit is contained in:
Binary file not shown.
@@ -15,12 +15,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
name: 'LicenseTip',
|
||||
data() {
|
||||
return {
|
||||
activationCode: '',
|
||||
tip: ''
|
||||
tip: '',
|
||||
redirect: '/dashboard'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -38,8 +41,25 @@ export default {
|
||||
}
|
||||
// 暂时不对接API,这里模拟激活成功
|
||||
console.log('授权码:', this.activationCode)
|
||||
localStorage.setItem('cdk', this.activationCode.trim())
|
||||
this.$router.push({ path: '/' })
|
||||
request({
|
||||
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