mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: 专业版试用,无需绑定账号
This commit is contained in:
@@ -108,6 +108,23 @@ export class PlusService {
|
||||
return res.accessToken;
|
||||
}
|
||||
|
||||
async getVipTrial() {
|
||||
const plusRequestService = await this.getPlusRequestService();
|
||||
await this.register();
|
||||
const res = await plusRequestService.request({
|
||||
url: '/activation/subject/vip/trialGet',
|
||||
method: 'POST',
|
||||
});
|
||||
if (res.license) {
|
||||
await this.updateLicense(res.license);
|
||||
return {
|
||||
duration: res.duration,
|
||||
};
|
||||
} else {
|
||||
throw new Error('您已经领取过VIP试用了');
|
||||
}
|
||||
}
|
||||
|
||||
async requestWithToken(config: HttpRequestConfig) {
|
||||
const plusRequestService = await this.getPlusRequestService();
|
||||
const token = await this.getAccessToken();
|
||||
|
||||
Reference in New Issue
Block a user