王震
2023-12-19 2fa578a18ed9055f8cb9863a8a0f02977cfa8350
src/page/login/index.vue
@@ -74,35 +74,35 @@
  created() {
    this.getSysTitle()
  },
  mounted() {
    const _that = this
    $.ajax({
      type: 'get',
      url: 'http://127.0.0.1:15211/LocalUnique',
      /* headers: {
                'Content-Type': 'text/xml;charset=utf-8'
              }, */
      // data: requireData,
      success: function(response) {
        const resultData = JSON.parse(
          response
            .replace(/\r/g, '')
            .replace(/\n/g, '')
            .replace(/\s*/g, '')
        )
        const username = resultData[0].ID
        const password = resultData[0].Unique
        _that.$store
          .dispatch('LoginByMSL', { username: username, password: password })
          .then(() => {
            _that.$router.push({ path: _that.tagWel.value })
          })
      },
      error: function(XMLHttpRequest, textStatus, errorThrown) {
        console.error('访问马上聊出错')
      }
    })
  },
  // mounted() {
  //   const _that = this
  //   $.ajax({
  //     type: 'get',
  //     url: 'http://127.0.0.1:15211/LocalUnique',
  //     /* headers: {
  //               'Content-Type': 'text/xml;charset=utf-8'
  //             }, */
  //     // data: requireData,
  //     success: function(response) {
  //       const resultData = JSON.parse(
  //         response
  //           .replace(/\r/g, '')
  //           .replace(/\n/g, '')
  //           .replace(/\s*/g, '')
  //       )
  //       const username = resultData[0].ID
  //       const password = resultData[0].Unique
  //       _that.$store
  //         .dispatch('LoginByMSL', { username: username, password: password })
  //         .then(() => {
  //           _that.$router.push({ path: _that.tagWel.value })
  //         })
  //     },
  //     error: function(XMLHttpRequest, textStatus, errorThrown) {
  //       console.error('访问马上聊出错')
  //     }
  //   })
  // },
  computed: {
    ...mapGetters(['website', 'tagWel'])
  },