Houjie
2025-04-18 ae3855638dba0c927236c1a1b1a85d5b048c40e2
pages/login/login.vue
@@ -15,12 +15,14 @@
                  <view class="title"><text class="cuIcon-lock margin-right-xs"></text>密码:</view>
                  <input class="uni-input" placeholder="请输入密码" :password="!showPassword" v-model="password" />
                  <view class="action text-lg">
                      <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" @click="changePassword"></text>
                       <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']"
                          @click="changePassword"></text>
                  </view>
               </view>
               <view class="padding text-center margin-top">
                  <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                     @tap="onLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                    <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading"
                       :class="[shape=='round'?'round':'']" @tap="onLogin"><text
                          space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                  </button>
                  <!-- <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                     @tap="loginWay=3-loginWay">短信登录
@@ -36,15 +38,17 @@
                      <view class="title"><text class="cuIcon-lock margin-right-xs"></text>验证码:</view>
                      <input class="uni-input" placeholder="请输入验证码" v-model="smsCode"/>
                      <view class="action">
                         <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend"> {{ getSendBtnText }}</button>
                       <button class="cu-btn line-blue sm" :disabled="!isSendSMSEnable" @click="onSMSSend">
                          {{ getSendBtnText }}</button>
                      </view>
                   </view>
                   <view class="padding text-center margin-top">
                      <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                         @tap="onSMSLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                    <button class="cu-btn bg-blue lg margin-right shadow" :loading="loading"
                       :class="[shape=='round'?'round':'']" @tap="onSMSLogin"><text
                          space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
                      </button>
                      <button class="cu-btn line-blue lg margin-left shadow" :loading="loading" :class="[shape=='round'?'round':'']"
                         @tap="loginWay=1">账户登录
                    <button class="cu-btn line-blue lg margin-left shadow" :loading="loading"
                       :class="[shape=='round'?'round':'']" @tap="loginWay=1">账户登录
                      </button>
                   </view>
                </block>
@@ -69,8 +73,14 @@
</template>
<script>
   import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
   import { mapActions } from "vuex"
     import {
        ACCESS_TOKEN,
        USER_NAME,
        USER_INFO
     } from "@/common/util/constants"
     import {
        mapActions
     } from "vuex"
    import configService from '@/common/service/config.service.js';
   
    export default {
@@ -94,12 +104,14 @@
            thirdLoginState:false,
            bindingPhoneModal:false,
            thirdUserUuid:'',
              id: '',
            url: {
               bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
            }
            };
        },
      onLoad:function(){
        onLoad: function(options) {
           this.id = options.id;
         // #ifdef APP-PLUS
         var that=this
         plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
@@ -149,7 +161,22 @@
                   // #endif
                   // #ifndef APP-PLUS
                    this.$tip.success('登录成功!')
                    this.$Router.replaceAll({name:'index'})
                    this.$Router.replaceAll({
                       name: 'index'
                    })
                    // if (this.id) {
                    //    uni.navigateTo({
                    //       url: `/pages/device/deviceWebDeils/deviceWebDeils?equipmentId=${this.id}`
                    //    });
                    // } else {
                    //    this.$tip.success('登录成功!')
                    //    this.$Router.replaceAll({
                    //       name: 'index'
                    //    })
                    // }
                   // #endif
                  }else{
                       this.$tip.alert(res.data.message);
@@ -165,10 +192,16 @@
         saveClientId(){
            var info = plus.push.getClientInfo();
            var cid = info.clientid;
            this.$http.get("/sys/user/saveClientId",{params:{clientId:cid}}).then(res=>{
              this.$http.get("/sys/user/saveClientId", {
                 params: {
                    clientId: cid
                 }
              }).then(res => {
               console.log("res::saveClientId>",res)
               this.$tip.success('登录成功!')
               this.$Router.replaceAll({name:'index'})
                 this.$Router.replaceAll({
                    name: 'index'
                 })
            })
         },
         changePassword() {
@@ -228,7 +261,9 @@
              console.log("res====》",res)
              if(res.data.success){
               this.$tip.success('登录成功!')
               this.$Router.replaceAll({name:'index'})
                    this.$Router.replaceAll({
                       name: 'index'
                    })
              }else{
               this.$tip.error(res.data.message);
              }
@@ -239,7 +274,9 @@
         },
         loginSuccess() {
           // 登陆成功,重定向到主页
           this.$Router.replace({name:'index'})
              this.$Router.replace({
                 name: 'index'
              })
         },
         requestFailed(err) {
           this.$message.warning("登录失败")
@@ -275,7 +312,8 @@
       text-align: center;
    }
    .input-placeholder, .zai-input {
     .input-placeholder,
     .zai-input {
        color: #94afce;
    }
@@ -302,5 +340,4 @@
    .zai-btn.button-hover {
        transform: translate(1upx, 1upx);
    }
</style>