使用用户generate使用次数每个只有两次

This commit is contained in:
X1627315083
2024-01-30 13:33:08 +08:00
parent f51465f7a9
commit 958e4958de
18 changed files with 153 additions and 86 deletions

View File

@@ -511,12 +511,12 @@ export default defineComponent({
getgenerate(){
clearInterval(this.remGenerateTime)
this.remGenerate = false
if(this.isTest){//试用用户禁止使用
message.info(
this.t('isTest.available')
);
return
}
// if(this.isTest){//试用用户禁止使用
// message.info(
// this.t('isTest.available')
// );
// return
// }
if(this.loadingShow){
return
}
@@ -550,20 +550,26 @@ export default defineComponent({
userId:this?.userInfo?.userId,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
version:1,//为1就是Print
isTestUser:this.driver__.driver?false:this.isTest,
gender:'',
}
this.loadingShow = true
Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
(rv) => {
if(rv){
this.generateId = rv
this.setGenerate()
this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true
},10000)
}else{
// this.loadingShow = false
if(data.isTestUser){
if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:this.t('collectionModal.Moodboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Moodboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate()
this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true
},10000)
}
).catch(res=>{
this.loadingShow = false