yc-ui2 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 = "") {