使用用户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

View File

@@ -584,12 +584,12 @@ export default defineComponent({
getgenerate(){
clearInterval(this.remGenerateTime)
this.remGenerate = false
if(this.isTest){//试用用户禁止使用
message.warning(
this.t('isTest.available')
);
return
}
// if(this.isTest){//试用用户禁止使用
// message.warning(
// this.t('isTest.available')
// );
// return
// }
if(this.loadingShow){
return
}
@@ -611,6 +611,7 @@ export default defineComponent({
text:`${generage.printModel.value},${this.captionGeneration}`,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
userId:this?.userInfo?.userId,
isTestUser:this.driver__.driver?false:this.isTest,
version:1,//为1就是Print
gender:'',
}
@@ -671,15 +672,20 @@ export default defineComponent({
// Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data,{cancelToken: this.source?.token}).then(
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.Printboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Printboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate()
this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true
},10000)
}
).catch(res=>{
this.loadingShow = false

View File

@@ -293,20 +293,20 @@ export default defineComponent({
// }
},
}
if(this.isTest){//试用用户禁止使用
// message.warning(
// this.t('isTest.available')
// );
this.record.push({
state:1,
str:this.t('isTest.src'),
src:'https://code-create.com.hk/aida/'
})
this.createTimer()
this.textScroll()
this.chatCentent = ""
return
}
// if(this.isTest){//试用用户禁止使用
// // message.warning(
// // this.t('isTest.available')
// // );
// this.record.push({
// state:1,
// str:this.t('isTest.src'),
// src:'https://code-create.com.hk/aida/'
// })
// this.createTimer()
// this.textScroll()
// this.chatCentent = ""
// return
// }
Https.axiosPost(Https.httpUrls.chatStreamTest, data).then(
// Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then(
(rv) => {

View File

@@ -697,12 +697,12 @@ export default defineComponent({
this.remGenerate = false
// this.sketchCatecoryList = this.store.state.Workspace.workspacePosition
let sketchCatecoryList = this.sketchCatecoryList
if(this.isTest){//试用用户禁止使用
message.warning(
this.t('isTest.available')
);
return
}
// if(this.isTest){//试用用户禁止使用
// message.warning(
// this.t('isTest.available')
// );
// return
// }
if(this.loadingShow){
return
}
@@ -717,6 +717,7 @@ export default defineComponent({
text:this.captionGeneration,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
userId:this?.userInfo?.userId,
isTestUser:this.driver__.driver?false:this.isTest,
version:1,//为1就是Print
gender:this.workspace.sex,
}
@@ -775,13 +776,20 @@ export default defineComponent({
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)
if(data.isTestUser){
if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:this.t('collectionModal.Sketchboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Sketchboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate()
this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true
},10000)
}
).catch(res=>{
this.loadingShow = false