@focus-teach/ui 1.2.1 → 1.2.3

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.
package/api/index.js CHANGED
@@ -7,7 +7,7 @@ import { Message } from 'element-ui';
7
7
  const VUE_APP_SSO_LOGIN_URL = 'http://ssoedu.focusteach.com/sso/authentication/require?client_id=focusteachsmartclass&equipmentType=epxIumhmRz0'
8
8
  let timer = null
9
9
  let token = "";
10
- axios.defaults.timeout = 30000;
10
+ axios.defaults.timeout = 60000;
11
11
  //axios请求时,如果不显示的设置Content-Type,那么默认是text/plain,这时服务器就不知道怎么解析数据
12
12
  axios.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8";
13
13
  // axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; //默认异步请求
@@ -475,6 +475,37 @@ export function getQuestionApi(options) {
475
475
  );
476
476
  });
477
477
  }
478
+ //神笔数据有问题,后端不愿意处理,前端特殊过滤
479
+ export function getCompositionApi(options) {
480
+ const apiAxios = axios.create({
481
+ baseURL: axios.defaults.baseURL,
482
+ timeout: 30000,
483
+ crossDomain: true,
484
+ withCredentials: true
485
+ });
486
+ return new Promise((resolve) => {
487
+ apiAxios.get(`/files/${options.itemId}?type=2`, {
488
+ header: {
489
+ "Content-Type": "text/html;charset=UTF-8"
490
+ }
491
+ }).then(
492
+ (res) => {
493
+ res = res.data || res
494
+ let data = res?.data || res
495
+ let result = {
496
+ ...res,
497
+ ...data
498
+ }
499
+ delete result?.data
500
+ resolve([null, result]);
501
+ },
502
+ (err) => {
503
+ resolve([err, null]);
504
+ }
505
+ );
506
+ });
507
+ }
508
+
478
509
  export function getTitleHtml(options, params) {
479
510
  return new Promise((resolve) => {
480
511
  axios.get(`/files/${options.itemId}?type=2`, params, {