ai-error-assistant-pro 0.0.13 → 0.0.15

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.
@@ -8,7 +8,10 @@
8
8
  <div class="robot-image-div"></div>
9
9
  <!-- <img alt="" src="../static/robot.png" style="width: 48px; height: 48px">-->
10
10
  </div>
11
- <div v-else class="robot user">user</div>
11
+ <div v-if ="list.type === 'user' && avatarUrl" class="robot">
12
+ <img :src="avatarUrl" alt="" style="width: 48px; height: 48px; border-radius: 50%;">
13
+ </div>
14
+ <div v-if ="list.type === 'user' && avatarUrl===''" class="robot user">user</div>
12
15
  <div :class="{'user-info': list.type === 'user'}" class="robot-message">
13
16
  <div v-html="list.message"></div>
14
17
  <div v-if="list.type === 'robot' && list.links.length > 0 && showFile" class="link">
@@ -117,6 +120,10 @@ export default {
117
120
  type: Boolean,
118
121
  default: false,
119
122
  },
123
+ avatarUrl: {
124
+ type: String,
125
+ default: '',
126
+ },
120
127
  },
121
128
  data() {
122
129
  return {
@@ -426,6 +433,23 @@ export default {
426
433
  line-height: 24px;
427
434
  }
428
435
 
436
+ :deep {
437
+ .robot-message {
438
+ p {
439
+ margin: 0;
440
+ span {
441
+ color: #fff !important;
442
+ }
443
+ }
444
+ pre {
445
+ code {
446
+ white-space: pre-wrap;
447
+ }
448
+ white-space: pre-wrap;
449
+ }
450
+ }
451
+ }
452
+
429
453
  .user-info {
430
454
  width: auto;
431
455
  border-radius: 12px;
@@ -20,6 +20,7 @@
20
20
  :xtId="xtId"
21
21
  :show-more-q-a="showMoreQA"
22
22
  :show-file="showFile"
23
+ :avatarUrl="avatarUrl"
23
24
  :key-word="aiMessageKeyWord"
24
25
  :analy-exercise="analyExercise"
25
26
  @on-reanser="reanserMethod"
@@ -48,6 +49,7 @@ import Chat from './chat.vue';
48
49
  import Cookies from "js-cookie";
49
50
  import { getUserInfo } from '../utils/config';
50
51
  import {checkCourseIdIsExist, queryCallWord} from '../api/index';
52
+ import cache from "../plugins/cache";
51
53
  export default {
52
54
  name: 'AiErrorAssistant',
53
55
  components: {
@@ -92,18 +94,21 @@ export default {
92
94
  message:'',
93
95
  showMoreQA: false,
94
96
  showFile: false,
97
+ avatarUrl: '',
95
98
  }
96
99
  },
97
- async mounted() {
100
+ mounted() {
98
101
  if (!Cookies.get("token")) {
99
102
  return this.$message.warning('未获取到登录信息,请重新登录');
100
103
  }
101
- getUserInfo(Cookies.get("token"), this.businessSource);
102
- const wordRes = await queryCallWord(this.resId);
103
- if (!wordRes) return;
104
- const { showMoreQA, isShowFile } = wordRes;
105
- this.showMoreQA = showMoreQA;
106
- this.showFile = !!isShowFile;
104
+ getUserInfo(Cookies.get("token"), this.businessSource, async () => {
105
+ const wordRes = await queryCallWord(this.resId);
106
+ if (!wordRes) return;
107
+ const { showMoreQA, isShowFile } = wordRes;
108
+ this.showMoreQA = showMoreQA;
109
+ this.showFile = !!isShowFile;
110
+ this.avatarUrl = cache.session.getJSON('USER_AVATAR_URL');
111
+ });
107
112
  },
108
113
  methods: {
109
114
  closeMessage() {
@@ -86,7 +86,14 @@ export const cacheMessageList = [
86
86
  // });
87
87
  // cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
88
88
  // }
89
- export const getUserInfo = async (token, businessSource) => {
90
- await ssoAuth(token, businessSource);
89
+ export const getUserInfo = async (token, businessSource, fn) => {
90
+ await ssoAuth(token, businessSource).then(async (ssoRes) => {
91
+ if (ssoRes?.avatarUrl){
92
+ cache.session.setJSON('USER_AVATAR_URL', ssoRes.avatarUrl);
93
+ }else{
94
+ cache.session.setJSON('USER_AVATAR_URL', '');
95
+ }
96
+ });
91
97
  cache.session.setJSON('SRKJ_TOKEN_CACHE', token);
98
+ if (fn) fn();
92
99
  }
@@ -6546,7 +6546,7 @@ if (typeof window !== 'undefined') {
6546
6546
  // Indicate to webpack that this file can be concatenated
6547
6547
  /* harmony default export */ var setPublicPath = (null);
6548
6548
 
6549
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=2440bc18&scoped=true
6549
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=039c1a7e&scoped=true
6550
6550
  var render = function render() {
6551
6551
  var _vm = this,
6552
6552
  _c = _vm._self._c;
@@ -6576,6 +6576,7 @@ var render = function render() {
6576
6576
  "xtId": _vm.xtId,
6577
6577
  "show-more-q-a": _vm.showMoreQA,
6578
6578
  "show-file": _vm.showFile,
6579
+ "avatarUrl": _vm.avatarUrl,
6579
6580
  "key-word": _vm.aiMessageKeyWord,
6580
6581
  "analy-exercise": _vm.analyExercise
6581
6582
  },
@@ -6645,10 +6646,10 @@ var staticRenderFns = [function () {
6645
6646
  }, [_vm._v("智能解析")])]);
6646
6647
  }];
6647
6648
 
6648
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=2440bc18&scoped=true
6649
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=039c1a7e&scoped=true
6649
6650
 
6650
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=template&id=3433f3ca&scoped=true
6651
- var chatvue_type_template_id_3433f3ca_scoped_true_render = function render() {
6651
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=template&id=25a39a99&scoped=true
6652
+ var chatvue_type_template_id_25a39a99_scoped_true_render = function render() {
6652
6653
  var _vm = this,
6653
6654
  _c = _vm._self._c;
6654
6655
  return _c('div', {
@@ -6672,9 +6673,21 @@ var chatvue_type_template_id_3433f3ca_scoped_true_render = function render() {
6672
6673
  staticClass: "robot"
6673
6674
  }, [_c('div', {
6674
6675
  staticClass: "robot-image-div"
6675
- })]) : _c('div', {
6676
+ })]) : _vm._e(), list.type === 'user' && _vm.avatarUrl ? _c('div', {
6677
+ staticClass: "robot"
6678
+ }, [_c('img', {
6679
+ staticStyle: {
6680
+ "width": "48px",
6681
+ "height": "48px",
6682
+ "border-radius": "50%"
6683
+ },
6684
+ attrs: {
6685
+ "src": _vm.avatarUrl,
6686
+ "alt": ""
6687
+ }
6688
+ })]) : _vm._e(), list.type === 'user' && _vm.avatarUrl === '' ? _c('div', {
6676
6689
  staticClass: "robot user"
6677
- }, [_vm._v("user")]), _c('div', {
6690
+ }, [_vm._v("user")]) : _vm._e(), _c('div', {
6678
6691
  staticClass: "robot-message",
6679
6692
  class: {
6680
6693
  'user-info': list.type === 'user'
@@ -6756,7 +6769,7 @@ var chatvue_type_template_id_3433f3ca_scoped_true_render = function render() {
6756
6769
  }) : _vm._e()], 1)]);
6757
6770
  })], 2);
6758
6771
  };
6759
- var chatvue_type_template_id_3433f3ca_scoped_true_staticRenderFns = [];
6772
+ var chatvue_type_template_id_25a39a99_scoped_true_staticRenderFns = [];
6760
6773
 
6761
6774
  ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/bind.js
6762
6775
 
@@ -11077,9 +11090,16 @@ const cacheMessageList = [{
11077
11090
  // });
11078
11091
  // cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
11079
11092
  // }
11080
- const getUserInfo = async (token, businessSource) => {
11081
- await ssoAuth(token, businessSource);
11093
+ const getUserInfo = async (token, businessSource, fn) => {
11094
+ await ssoAuth(token, businessSource).then(async ssoRes => {
11095
+ if (ssoRes !== null && ssoRes !== void 0 && ssoRes.avatarUrl) {
11096
+ cache.session.setJSON('USER_AVATAR_URL', ssoRes.avatarUrl);
11097
+ } else {
11098
+ cache.session.setJSON('USER_AVATAR_URL', '');
11099
+ }
11100
+ });
11082
11101
  cache.session.setJSON('SRKJ_TOKEN_CACHE', token);
11102
+ if (fn) fn();
11083
11103
  };
11084
11104
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat-tools.vue?vue&type=template&id=a40a67cc&scoped=true
11085
11105
  var chat_toolsvue_type_template_id_a40a67cc_scoped_true_render = function render() {
@@ -14310,6 +14330,10 @@ const signal = controller.signal;
14310
14330
  showFile: {
14311
14331
  type: Boolean,
14312
14332
  default: false
14333
+ },
14334
+ avatarUrl: {
14335
+ type: String,
14336
+ default: ''
14313
14337
  }
14314
14338
  },
14315
14339
  data() {
@@ -14559,10 +14583,10 @@ const signal = controller.signal;
14559
14583
  });
14560
14584
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=script&lang=js
14561
14585
  /* harmony default export */ var src_chatvue_type_script_lang_js = (chatvue_type_script_lang_js);
14562
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=style&index=0&id=3433f3ca&prod&lang=scss&scoped=true
14586
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/chat.vue?vue&type=style&index=0&id=25a39a99&prod&lang=scss&scoped=true
14563
14587
  // extracted by mini-css-extract-plugin
14564
14588
 
14565
- ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=3433f3ca&prod&lang=scss&scoped=true
14589
+ ;// CONCATENATED MODULE: ./components/demo/src/chat.vue?vue&type=style&index=0&id=25a39a99&prod&lang=scss&scoped=true
14566
14590
 
14567
14591
  ;// CONCATENATED MODULE: ./components/demo/src/chat.vue
14568
14592
 
@@ -14575,11 +14599,11 @@ const signal = controller.signal;
14575
14599
 
14576
14600
  var chat_component = normalizeComponent(
14577
14601
  src_chatvue_type_script_lang_js,
14578
- chatvue_type_template_id_3433f3ca_scoped_true_render,
14579
- chatvue_type_template_id_3433f3ca_scoped_true_staticRenderFns,
14602
+ chatvue_type_template_id_25a39a99_scoped_true_render,
14603
+ chatvue_type_template_id_25a39a99_scoped_true_staticRenderFns,
14580
14604
  false,
14581
14605
  null,
14582
- "3433f3ca",
14606
+ "25a39a99",
14583
14607
  null
14584
14608
 
14585
14609
  )
@@ -14726,6 +14750,7 @@ var api = init(defaultConverter, { path: '/' });
14726
14750
 
14727
14751
 
14728
14752
 
14753
+
14729
14754
  /* harmony default export */ var mainvue_type_script_lang_js = ({
14730
14755
  name: 'AiErrorAssistant',
14731
14756
  components: {
@@ -14771,22 +14796,25 @@ var api = init(defaultConverter, { path: '/' });
14771
14796
  courseFlag: false,
14772
14797
  message: '',
14773
14798
  showMoreQA: false,
14774
- showFile: false
14799
+ showFile: false,
14800
+ avatarUrl: ''
14775
14801
  };
14776
14802
  },
14777
- async mounted() {
14803
+ mounted() {
14778
14804
  if (!api.get("token")) {
14779
14805
  return this.$message.warning('未获取到登录信息,请重新登录');
14780
14806
  }
14781
- getUserInfo(api.get("token"), this.businessSource);
14782
- const wordRes = await queryCallWord(this.resId);
14783
- if (!wordRes) return;
14784
- const {
14785
- showMoreQA,
14786
- isShowFile
14787
- } = wordRes;
14788
- this.showMoreQA = showMoreQA;
14789
- this.showFile = !!isShowFile;
14807
+ getUserInfo(api.get("token"), this.businessSource, async () => {
14808
+ const wordRes = await queryCallWord(this.resId);
14809
+ if (!wordRes) return;
14810
+ const {
14811
+ showMoreQA,
14812
+ isShowFile
14813
+ } = wordRes;
14814
+ this.showMoreQA = showMoreQA;
14815
+ this.showFile = !!isShowFile;
14816
+ this.avatarUrl = cache.session.getJSON('USER_AVATAR_URL');
14817
+ });
14790
14818
  },
14791
14819
  methods: {
14792
14820
  closeMessage() {
@@ -14839,10 +14867,10 @@ var api = init(defaultConverter, { path: '/' });
14839
14867
  });
14840
14868
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
14841
14869
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
14842
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=2440bc18&prod&lang=scss&scoped=true
14870
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=039c1a7e&prod&lang=scss&scoped=true
14843
14871
  // extracted by mini-css-extract-plugin
14844
14872
 
14845
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=2440bc18&prod&lang=scss&scoped=true
14873
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=039c1a7e&prod&lang=scss&scoped=true
14846
14874
 
14847
14875
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
14848
14876
 
@@ -14859,7 +14887,7 @@ var main_component = normalizeComponent(
14859
14887
  staticRenderFns,
14860
14888
  false,
14861
14889
  null,
14862
- "2440bc18",
14890
+ "039c1a7e",
14863
14891
  null
14864
14892
 
14865
14893
  )