Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
This commit is contained in:
@@ -210,13 +210,13 @@ export class ChatAIService {
|
||||
let userData = {
|
||||
isAi: false,
|
||||
msg: message,
|
||||
msgId: new Date().getTime(),
|
||||
msgId: new Date().getTime().toString(),
|
||||
};
|
||||
msgList.push(userData);
|
||||
let aiData = {
|
||||
isAi: true,
|
||||
msg: response.text,
|
||||
msgId: new Date().getTime() + 1,
|
||||
msgId: (new Date().getTime() + 1).toString(),
|
||||
};
|
||||
msgList.push(aiData);
|
||||
this.reqChatMsg(roleId, msgList);
|
||||
|
||||
@@ -525,10 +525,9 @@ export class ChatModel {
|
||||
//return false;
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
const roleData = this.rolesData.get(this.currentGirlId);
|
||||
const leftTime = girlData.getChatRemainCount(
|
||||
return girlData.isCanChat(
|
||||
roleData.categoryId,
|
||||
roleData.girlId
|
||||
);
|
||||
return leftTime === 0 ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { InnerMsgCode } from "../../Main/Config/InnerMsgCode";
|
||||
export class WalletData extends BaseData {
|
||||
// 余额
|
||||
private _balance: number = 0;
|
||||
// vip失效时间戳
|
||||
// vip失效时间戳,秒
|
||||
private _vipExpire: number = 0;
|
||||
|
||||
public reset(): void {
|
||||
|
||||
@@ -242,7 +242,7 @@ export class ChatHistoryManager {
|
||||
const message: ChatMessage = {
|
||||
role: serverMsg.isAi ? "model" : "user",
|
||||
parts: [{ text: serverMsg.msg }],
|
||||
timestamp: serverMsg.msgId || Date.now(),
|
||||
timestamp: Number(serverMsg.msgId) || Date.now(),
|
||||
};
|
||||
messages.push(message);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ export class ChatHistoryManager {
|
||||
const msg = girlData.getChatRecordMsg(category.toString(), roleId, id);
|
||||
if (msg) {
|
||||
serverMessages.push({
|
||||
msgId: id,
|
||||
msgId: id.toString(),
|
||||
msg: msg,
|
||||
isAi: isAi,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user