App-Android(使用App+htnl5框架,解决消息推送兼容SignalR问题)
loulijun2021
2022-10-21 0ab4bf8f3982bdee9962076f29c5664185328517
pages/login/index.html
@@ -19,12 +19,8 @@
      <script type="text/javascript" src="../../js/http.js"></script>
      <!-- 导入自定义js文件 -->
      <!-- <script type="module" src="../../js/global.js"></script> -->
      <!-- <link rel="stylesheet" href="../css/global.css" type="text/css" charset="utf-8" /> -->
      <!-- 导入自定义全局js文件 -->
      <script type="text/javascript" src="../../js/global.js"></script>
   </head>
   <body>
@@ -50,7 +46,8 @@
                  </van-field>
               </div>
               <div style="margin-top:30px;">
                  <van-button type="info" style="border-radius: 10px;" @click='loginClick' size="large">立即登录
                  <van-button type="info" style="border-radius: 10px;" :disabled="username===''||password===''"
                     @click='loginClick' :loading='submitIsDisabled' loading-text="正在登录,请稍等..." size="large">立即登录
                  </van-button>
               </div>
            </div>
@@ -64,6 +61,7 @@
         el: '#app',
         data: function() {
            return {
               submitIsDisabled: false,
               username: '999',
               password: '123',
               isOpenEye: false,
@@ -82,7 +80,7 @@
                  password: this.password,
                  usertype: 'APP'
               }
               this.submitIsDisabled = true
               get('Login/LoginSave', data).then(res => {
                  if (res.code === '200') {
                     // window.location.reload()   //页面重新
@@ -96,6 +94,8 @@
                        localStorage.setItem('usertype', res.data.usertype)
                     }
                     window.location.href = '../xtsy/index.html'
                  } else {
                     this.submitIsDisabled = false
                  }
                  if (res.code === '302') {
@@ -105,18 +105,12 @@
                        username: res.data.username,
                        usertype: res.data.usertype
                     }
                     post('Login/ForcedOffline?userid=' + res.data.userid + '&usercode=' + res.data
                        .usercode + '&username=' + res.data.username + '&usertype=' + res.data
                        .usertype).then(res2 => {
                     post('Login/ForcedOffline' + formatParams(data2)).then(res2 => {
                        if (res2.code === '200') {
                           this.loginClick()
                        }
                     })
                  }
               }).catch(err => {
                  console.log(err);
               });