exam.js 964 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import request from '@/utils/request'
  2. export function getExamList(data = {}) {
  3. return request({
  4. 'url': '/app/shiti/list',
  5. headers: {
  6. isToken: true
  7. },
  8. method: 'post',
  9. data,
  10. timeout: 20000
  11. })
  12. }
  13. export function getExamAnswerList(data = {}) {
  14. return request({
  15. 'url': '/app/shiti/answer/list',
  16. headers: {
  17. isToken: true
  18. },
  19. method: 'post',
  20. data,
  21. timeout: 20000
  22. })
  23. }
  24. function initScript() {
  25. // 动态加载第三方JS文件
  26. const script = document.createElement('script');
  27. script.src = 'https://cdn.example.com/third-party-library.js';
  28. script.onload = () => {
  29. // JS文件加载完成后的回调
  30. console.log('Third-party library loaded.');
  31. // 你可以在这里调用第三方库的方法
  32. };
  33. script.onerror = () => {
  34. // 处理加载错误
  35. console.error('Failed to load third-party library.');
  36. };
  37. document.head.appendChild(script); // 或者使用 document.body.appendChild(script);
  38. }