view.js 479 B

12345678910111213141516171819202122
  1. // 查看消息需要用到的JS
  2. app = new Vue({
  3. el: '#app',
  4. data: {
  5. status: -1,
  6. text: null,
  7. },
  8. mounted: function() {
  9. // 从URL获取GUID,然后透过POST获取消息
  10. var guid = reg_guid.exec(window.location.href)[0];
  11. axios.post('/api/get-msg', {
  12. guid: guid
  13. }).then(function (response) {
  14. var data = response.data;
  15. app.status = data.status;
  16. app.text = data.text;
  17. }).catch(function (error) {
  18. throw error;
  19. alert('发生错误!')
  20. });
  21. }
  22. });