JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_继续开发语音按钮
This commit is contained in:
@@ -47,8 +47,8 @@ export enum ControlCode {
|
||||
AI_ANSWER_OVER = 0b0100, // 本轮AI回答的文本内容已经全部返回
|
||||
AI_CLUE = 0b0101, // 需要AI提示命令(发后端)
|
||||
AI_CLUE_OVER = 0b0110, // AI提示命令已经全部返回
|
||||
FRNOT_TO_SERVER_OVER = 0b0111, // 语音按钮已经抬起
|
||||
SERVER_TO_FRNOT_OVER = 0b1000, // 后端已经返回本次全部内容
|
||||
FRONT_TO_SERVER_OVER = 0b0111, // 语音按钮已经抬起
|
||||
SERVER_TO_FRONT_OVER = 0b1000, // 后端已经返回本次全部内容
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,11 @@ export enum ControlCommand {
|
||||
FINISH_PLAY = 0b0010, // 一句话播放结束
|
||||
}
|
||||
|
||||
export interface ControlBody {
|
||||
type: ControlCode; // type 是必选属性,关联你的 ControlCode 枚举
|
||||
[key: string]: any; // 索引签名:兼容后端返回的任意动态属性(txt/ossKey 等)
|
||||
}
|
||||
|
||||
/**
|
||||
* 解包返回结果接口
|
||||
*/
|
||||
@@ -108,7 +113,7 @@ export interface UnpackedResult {
|
||||
compression : CompressionType;
|
||||
compressionName : keyof typeof CompressionType;
|
||||
sequence : number; // 消息顺序号(0~65535,默认0)
|
||||
body : Uint8Array | string | object | unknown[] | null; // PING 消息可能返回 null
|
||||
body : Uint8Array | string | object | unknown[] | null | ControlBody; // PING 消息可能返回 null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,12 +83,10 @@ const hideLoading = () => uni.hideLoading()
|
||||
|
||||
// 根据姓名的长度生成对应的带星号格式
|
||||
export const formatName = (name) => {
|
||||
|
||||
// 处理空值或非字符串情况
|
||||
if (!name || typeof name !== 'string') {
|
||||
return '';
|
||||
}
|
||||
|
||||
const familyName = name.charAt(0); // 取姓氏(第一个字符)
|
||||
const givenNameLength = name.length - 1; // 名字部分的长度
|
||||
|
||||
|
||||
Reference in New Issue
Block a user