yc-ui2 0.1.5-beta1 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -44259,12 +44259,22 @@ function findServiceFeeAi() {
44259
44259
  findDataByProblem({
44260
44260
  problem: msg.replace(/\n/g, ""),
44261
44261
  aiServiceId: 1
44262
- }).then(res => {
44263
- if (res && res.data && res.data.answer && res.data.based) {
44264
- this.add(res.data.answer || "您好", 'admin', null, res.data.based);
44265
- } else {
44266
- this.add("您好", 'admin', null, "");
44267
- }
44262
+ }).then(({
44263
+ data
44264
+ }) => {
44265
+ this.add((() => {
44266
+ if (data) {
44267
+ return data.length > 1 ? data.reduce((prev, curr) => [...prev, curr.problem], []) : data[0].answer || "您好";
44268
+ } else {
44269
+ return "您好";
44270
+ }
44271
+ })(), 'admin', null, (() => {
44272
+ if (data && data.length == 1) {
44273
+ return data[0].based;
44274
+ } else {
44275
+ return "";
44276
+ }
44277
+ })());
44268
44278
  });
44269
44279
  },
44270
44280
  add(msg, id = "personal", fun, based = "") {