|
@@ -2,7 +2,7 @@
|
|
|
<view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
<cus-header :title='title' bgColor="transparent" :backUrl="backUrl"></cus-header>
|
|
|
<div class="box">
|
|
|
- <div class="title adfac">角色形象</div>
|
|
|
+ <div class="title adfac">角色形象<span>*</span></div>
|
|
|
<div class="upload">
|
|
|
<div class="sc">
|
|
|
<u-upload width="188rpx" height="188rpx"
|
|
@@ -186,6 +186,7 @@
|
|
|
this.voiceText = e.value[0].name;
|
|
|
},
|
|
|
comfirmSure(){
|
|
|
+ if(this.fileList.length===0) return this.$showToast('请上传角色头像')
|
|
|
if(!this.agentDto.agentName) return this.$showToast('请输入角色昵称')
|
|
|
if(this.agentDto.voiceText==='请选择音色') return this.$showToast('请选择音色')
|
|
|
|
|
@@ -201,6 +202,7 @@
|
|
|
dto.chatHistoryConf = 1;
|
|
|
dto.langCode = 'zh';
|
|
|
dto.language = '中文';
|
|
|
+ if(this.fileList.length) dto.avatar = this.fileList[0].url;
|
|
|
this.$api.post(this.agentId?`/agent/update/${this.agentId}`:'/agent',dto).then(res=>{
|
|
|
if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
this.$showToast(this.agentId?'编辑成功':'创建成功');
|
|
@@ -213,6 +215,7 @@
|
|
|
this.$api.get(`/agent/${this.agentId}`).then(res=>{
|
|
|
if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
this.agentDto = {...this.agentDto,...res.data.data};
|
|
|
+ if(this.agentDto.avatar) this.fileList.push({url:this.agentDto.avatar});
|
|
|
if(this.agentDto.systemPrompt) this.showta = true;
|
|
|
this.getModelVoiceList();
|
|
|
})
|