zhouwx
2026-01-21 f11670c36ece6beff61013ec98ff798a3fe0d6ba
pages/index/index.vue
@@ -7,7 +7,7 @@
      <view>   
         <u-form :model="form" ref="uForm" class="form" >
            <u-form-item style="width: 75%;"><u-input color="#fff" v-model="form.name" placeholder="请输入用户名"  /></u-form-item>
            <u-form-item style="margin-top: 10px;width: 75%;" ><u-input color="#fff" v-model="form.pwd" type="password" placeholder="请输入密码"  /></u-form-item>
            <u-form-item style="margin-top: 10px;width: 75%;" ><u-input color="#fff" v-model="form.pwd"    placeholder="请输入密码"  /></u-form-item>
            <!-- <view class="loginPsw">
                   <u-checkbox-group >
                     <u-checkbox disabled="true"></u-checkbox><text style="color: #fff;">自动登录</text>
@@ -41,9 +41,11 @@
            connectStatus: '未连接',
            registrationID: '未获得',
            isLogining: false,
            psw: true
         }
      },
      onShow() {
         console.log(this.$u.config.v)
         console.log("数据",uni.getStorageSync('name'))
         if(uni.getStorageSync('name') && uni.getStorageSync('pwd')){
            // this.form.name = uni.getStorageSync('name');
@@ -71,7 +73,7 @@
         }
      },
      onLoad() {
         this.connect()
         // this.connect()
      },
      methods: {
         Login(){
@@ -79,12 +81,12 @@
            login(this.form).then(res => {
               if (res.code === 100) {
                  this.isLogining = false;
                   //登录成功后
                   //设置别名
                  jpushModule.setAlias({
                     'alias': this.phone,
                     'sequence': 1
                  })
                  //  //登录成功后
                  //  //设置别名
                  // jpushModule.setAlias({
                  //    'alias': this.phone,
                  //    'sequence': 1
                  // })
                  uni.setStorageSync("name", this.form.name);
                  uni.setStorageSync("pwd", this.form.pwd);
                  uni.setStorageSync("tk", res.data.tk);