privacy-statement.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div>
  3. <div>
  4. <p class="agreement-txt">
  5. {{ content }}
  6. </p>
  7. <button
  8. type="button"
  9. class="btn btn-success"
  10. style="width: 100%;"
  11. @click="savePrivacyStatement"
  12. >
  13. 同意(I agree with the privacy policy)
  14. </button>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import Common from '../common/Common.js';
  20. import PrivacyStatementResource from '../api/base/PrivacyStatementResource.js';
  21. import { SqlApi } from 'pc-component-v3';
  22. import { Notify } from 'pc-component-v3';
  23. export default {
  24. data:function(){
  25. return{
  26. content:null,
  27. };
  28. },
  29. mounted: function () {
  30. let _self = this;
  31. _self.readFile();
  32. },
  33. methods:{
  34. readFile:function (){
  35. let fileUrl = 'static/other/prodogTerm1.txt';
  36. let xhr = null,
  37. okStatus = document.location.protocol === 'file' ? 0 : 200;
  38. xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new XMLHttpRequest();
  39. xhr.open('GET', fileUrl, false);
  40. xhr.overrideMimeType('text/html;charset=utf-8');
  41. xhr.send(null);
  42. this.content = xhr.status === okStatus ? xhr.responseText : null;
  43. // SqlApi.execute('20220726_194611', null).then(
  44. // successData => {
  45. // if (successData.errorCode == 0) {
  46. // console.log(successData);
  47. // let fileUrl = Common.getResourceUrl('file', 'com.leanwo.prodog.asset.model.AssetConfig', successData.results.privacyStatement);
  48. // let xhr = null,
  49. // okStatus = document.location.protocol === 'file' ? 0 : 200;
  50. // xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new XMLHttpRequest();
  51. // xhr.open('GET', fileUrl, false);
  52. // xhr.overrideMimeType('text/html;charset=utf-8');
  53. // xhr.send(null);
  54. // this.content = xhr.status === okStatus ? xhr.responseText : null;
  55. // } else {
  56. // Notify.error('查询隐私声明信息', successData.errorMessage, true);
  57. // }
  58. // },
  59. // errorData => {
  60. // Common.processException(errorData);
  61. // },
  62. // );
  63. },
  64. /**
  65. * 保存隐私声明
  66. * @author XiongLiuJie
  67. * @date 2022-07-21
  68. */
  69. savePrivacyStatement: function () {
  70. let _self = this;
  71. let privacyStatementSaveRequest = {
  72. content: _self.content,
  73. };
  74. PrivacyStatementResource.savePrivacyStatement(
  75. privacyStatementSaveRequest,
  76. ).then(
  77. baseObjectResponse => {
  78. if (baseObjectResponse.errorCode === 0) {
  79. console.log(baseObjectResponse);
  80. _self.$emit('finishTask');
  81. }
  82. },
  83. errorData => {
  84. Common.processException(errorData);
  85. },
  86. );
  87. },
  88. },
  89. };
  90. </script>
  91. <style>
  92. .agreement-txt{
  93. height: 650px;
  94. text-align:left;
  95. font-size: x-large;
  96. white-space: break-spaces;
  97. font-family: Avenir, Helvetica, Arial, sans-serif;
  98. }
  99. </style>