yc-ui2 0.1.5-beta1 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44269,12 +44269,22 @@ function findServiceFeeAi() {
44269
44269
  findDataByProblem({
44270
44270
  problem: msg.replace(/\n/g, ""),
44271
44271
  aiServiceId: 1
44272
- }).then(res => {
44273
- if (res && res.data && res.data.answer && res.data.based) {
44274
- this.add(res.data.answer || "您好", 'admin', null, res.data.based);
44275
- } else {
44276
- this.add("您好", 'admin', null, "");
44277
- }
44272
+ }).then(({
44273
+ data
44274
+ }) => {
44275
+ this.add((() => {
44276
+ if (data) {
44277
+ return data.length > 1 ? data.reduce((prev, curr) => [...prev, curr.problem], []) : data[0].answer || "您好";
44278
+ } else {
44279
+ return "您好";
44280
+ }
44281
+ })(), 'admin', null, (() => {
44282
+ if (data && data.length == 1) {
44283
+ return data[0].based;
44284
+ } else {
44285
+ return "";
44286
+ }
44287
+ })());
44278
44288
  });
44279
44289
  },
44280
44290
  add(msg, id = "personal", fun, based = "") {