帖子
帖子
用户
博客
课程
显示全部楼层
23
帖子
0
勋章
890
Y币

[云开发] 安卓手机正常,苹果手机账号录入不了但是密码可以正常...

[复制链接]
发表于 2022-8-10 11:23:52
本帖最后由 app定制 于 2022-8-10 11:36 编辑
  1. <!DOCTYPE html>
  2. <html>

  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6.     <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7.     <title>登录</title>
  8.     <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  9.     <link rel="stylesheet" type="text/css" href="../../css/style.css" />
  10.     <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  11.     <link rel="stylesheet" type="text/css" href="../../css/index.css" />
  12.     <style>
  13.         html,
  14.         body {
  15.             background-color: #fff;
  16.         }

  17.         .l_title {
  18.             display: block;
  19.             /*height:6rem;*/
  20.             padding: 3.5rem;
  21.             font-size: 1.5rem;
  22.             text-align: center;
  23.             color: #fff;
  24.             background-image: url(../../image/icon/dbg.png);
  25.             background-position: center;
  26.             background-size: 100% 100%;
  27.             background-repeat: no-repeat;
  28.         }

  29.         .l_list {
  30.             display: block;
  31.             padding: 3rem 2rem;
  32.         }

  33.         .l_img {
  34.             display: block;
  35.             width: 1rem;
  36.             height: 1.2rem;
  37.         }

  38.         .li_b {
  39.             border-bottom: 1px solid #ccc !important;
  40.         }

  41.         .aui-btn-block {
  42.             margin: auto;
  43.             margin-top: 3rem;
  44.             margin-bottom: 1rem;
  45.             width: 80%;
  46.             border-radius: 1rem;
  47.             text-align: center;
  48.         }

  49.         .aui-list .aui-list-item-label,
  50.         .aui-list .aui-list-item-label-icon {
  51.             width: 10% !important;
  52.         }
  53.         .aui-list-item{
  54.           display: flex;
  55.         }
  56.     </style>
  57. </head>

  58. <body>
  59.     <div class="aui-content" id="vue">
  60.         <div class="l_title">登录</div>
  61.         <div class="l_list">
  62.             <div class="aui-content aui-margin-b-15">
  63.                 <ul class="aui-list aui-form-list" style="background-size:100% 0px;">
  64.                     <div class="ms-login">
  65.                         <li class="aui-list-item">
  66.                             <div class="aui-list-item-label">
  67.                                 <img class="l_img" src="../../image/icon/yonghu.png" alt="">
  68.                             </div>
  69.                             <div prop="username" style="line-height: 2.5rem;width:90%;">
  70.                                 <input v-model="ruleForm.username" placeholder="账号"></input>
  71.                             </div>
  72.                         </li>
  73.                         <li class="aui-list-item">
  74.                             <div class="aui-list-item-label">
  75.                                 <img class="l_img" src="../../image/icon/mi.png" alt="">
  76.                             </div>
  77.                             <div prop="password" style="line-height: 2.5rem;width:90%;">
  78.                                 <input type="password" placeholder="密码" v-model="ruleForm.password" @keyup.enter.native="submitForm('ruleForm')"></input>
  79.                             </div>
  80.                         </li>
  81.                         <!-- `checked` 为 true 或 false -->
  82.                         <li class="" style="padding-top:1rem;display:flex;justify-content: flex-end;">
  83.                             <input type="checkbox" v-model="checked" style="width:1rem;height:1rem;margin:0.1rem .5rem;background-color:#fff;">
  84.                             <span>记住密码</span>
  85.                         </li>
  86.                         <div class="login-btn">
  87.                             <button type="primary" class="aui-btn aui-btn-info aui-btn-block aui-btn-sm" @click="submitForm('ruleForm')">登录</button>
  88.                         </div>
  89.                     </div>
  90.                 </ul>
  91.             </div>
  92.         </div>
  93.     </div>
  94. </body>

  95. </html>
  96. <script type="text/javascript" src="../../script/api.js"></script>
  97. <script type="text/javascript" src="../../script/jquery-2.1.1.min.js"></script>
  98. <script type="text/javascript" src="../../script/common.js"></script>
  99. <script type="text/javascript" src="../../script/vue.js"></script>
  100. <script type="text/javascript" src="../../script/vant.min.js"></script>
  101. <script type="text/javascript">
  102.     var vm = new Vue({
  103.         el: "#vue",
  104.         data: {
  105.             ruleForm: {
  106.                 username: '',
  107.                 password: ''
  108.             },
  109.             checked: true,
  110.         },
  111.         mounted() { //在mounted里面获取cookie
  112.             this.getCookie();
  113.         },
  114.         methods: {
  115.             submitForm(formName) {
  116.                 //判断复选框是否被勾选 勾选则调用配置cookie方法
  117.                 if (vm.checked == true) {
  118.                     // console.log("checked == true");
  119.                     //传入账号名,密码,和保存天数3个参数
  120.                     vm.setCookie(vm.ruleForm.username, vm.ruleForm.password, 30);
  121.                 } else {
  122.                     // console.log("清空Cookie");
  123.                     //清空Cookie
  124.                     vm.clearCookie();
  125.                 }

  126.                 //与后端请求代码,本功能不需要与后台交互所以省略
  127.                 if (vm.ruleForm.username != '' && vm.ruleForm.password != '') {
  128.                     api.showProgress({
  129.                         style: 'default',
  130.                         animationType: 'fade',
  131.                         title: '',
  132.                         text: '',
  133.                         modal: false
  134.                     });
  135.                     api.ajax({
  136.                         url: '' + csAppip + 'appUser/login.do',
  137.                         method: 'post',
  138.                         timeout: 30,
  139.                         cache: true,
  140.                         dataType: 'json',
  141.                         returnAll: false,
  142.                         data: {
  143.                             values: {
  144.                                 USERNAME: vm.ruleForm.username,
  145.                                 PASSWORD: vm.ruleForm.password
  146.                             }
  147.                         }
  148.                     }, function(ret, err) {
  149.                         if (ret) {
  150.                             if ("200" == ret.code) {
  151.                                 console.log(JSON.stringify(ret.data));
  152.                                 // open_toast('登录成功!');
  153.                                 $api.setStorage('USERNAME', ret.data.USERNAME);
  154.                                 $api.setStorage("msLogin", 'OK');
  155.                                 if ("" == ret.data.LAST_LOGIN) { //初次登录强制修改密码
  156.                                     $api.setStorage("msFirst", 'YES');
  157.                                     all_win_vue('修改密码', 'personal/xiugaimima', '初次登录,强制修改初始密码', '1')
  158.                                 } else {
  159.                                     var calling = api.require('tencentTrtcCalling');
  160.                                     calling.init({}, function(ret, err) {
  161.                                         if (ret) {
  162.                                             // alert(JSON.stringify(ret));
  163.                                             console.log(JSON.stringify(ret));
  164.                                         } else {
  165.                                             console.log(JSON.stringify(err));
  166.                                         }
  167.                                     });
  168.                                     var sdkAppId = 1400673358;
  169.                                     var userId = ret.data.USER_ID;
  170.                                     var userSig = ret.data.USERSIG;
  171.                                     calling.login({
  172.                                         sdkAppId: sdkAppId,
  173.                                         userId: userId,
  174.                                         userSig: userSig
  175.                                     }, function(ret, err) {
  176.                                         if (ret) {
  177.                                             // alert(JSON.stringify(ret));
  178.                                             console.log(JSON.stringify(ret));
  179.                                         } else {
  180.                                             console.log(JSON.stringify(err));
  181.                                         }
  182.                                     });


  183.                                     $api.setStorage("USERSIG", ret.data.USERSIG);
  184.                                     $api.setStorage("USER_ID", ret.data.USER_ID);
  185.                                     $api.setStorage("ROLE_NAME", ret.data.ROLE_NAME);
  186.                                     $api.setStorage("ROLE_ID", ret.data.ROLE_ID);
  187.                                     $api.setStorage("BUMEN_ID", ret.data.BUMEN_ID);
  188.                                     $api.setStorage("BUMEN_NAME", ret.data.BUMEN_NAME);
  189.                                     $api.setStorage('NAME', ret.data.NAME);
  190.                                     $api.setStorage('USERPHOTO', ret.data.USERPHOTO);
  191.                                     $api.setStorage('PHONE', ret.data.PHONE);
  192.                                     $api.setStorage('EMAIL', ret.data.EMAIL);
  193.                                     $api.setStorage('COUNTY', ret.data.COUNTY);
  194.                                     $api.setStorage('COUNTYNAME', ret.data.COUNTYNAME);
  195.                                     $api.setStorage('TOWN', ret.data.TOWN);
  196.                                     $api.setStorage('TOWNNAME', ret.data.TOWNNAME);
  197.                                     $api.setStorage('VILLAGE', ret.data.VILLAGE);
  198.                                     $api.setStorage('VILLAGENAME', ret.data.VILLAGENAME);
  199.                                     $api.setStorage('QUYU', ret.data.QUYU);
  200.                                     $api.setStorage('LONGITUDE', ret.data.LONGITUDE);
  201.                                     $api.setStorage('LATITUDE', ret.data.LATITUDE);
  202.                                     $api.setStorage('RADIUS', ret.data.RADIUS);
  203.                                     $api.setStorage('msToken', ret.data.TOKEN);
  204.                                     //新增宣传部
  205.                                     $api.setStorage('msUNIT1', ret.data.UNIT1);
  206.                                     $api.setStorage('msUNIT2', ret.data.UNIT2);
  207.                                     $api.setStorage('msUNIT3', ret.data.UNIT3);
  208.                                     $api.setStorage('msUNIT1NAME', ret.data.UNIT1NAME);
  209.                                     $api.setStorage('msUNIT2NAME', ret.data.UNIT2NAME);
  210.                                     $api.setStorage('msUNIT3NAME', ret.data.UNIT3NAME);
  211.                                     $api.setStorage('msTYPE', ret.data.TYPE);
  212.                                     api.sendEvent({
  213.                                         name: 'denglu',
  214.                                     });
  215.                                     setTimeout(function() {
  216.                                         api.closeWin();
  217.                                     }, 200);
  218.                                     jpush = api.require('ajpush');
  219.                                     if (api.systemType != 'ios') {
  220.                                         initJPush();
  221.                                     }
  222.                                     var param = {
  223.                                         alias: ret.data.USER_ID,
  224.                                         tags: [ret.data.BUMEN_ID, ret.data.PHONE]
  225.                                     };
  226.                                     jpush.getRegistrationId(function(res) {
  227.                                         console.log('getRegistrationId=====' + JSON.stringify(res))
  228.                                         pst(res.id);
  229.                                     });
  230.                                     jpush.bindAliasAndTags(param, function(ret, err) {
  231.                                         if (ret) {
  232.                                             if (ret.statusCode == 0) {
  233.                                                 console.log('成功!别名')
  234.                                             } else {
  235.                                                 console.log('绑定别名失败!')
  236.                                             }
  237.                                         } else {
  238.                                             console.log(JSON.stringify(err))
  239.                                         }
  240.                                     });

  241.                                 }
  242.                             } else {
  243.                                 open_toast(ret.msg);
  244.                             }
  245.                         } else {
  246.                             open_toast('请检查您的网络denglu');
  247.                         };
  248.                         api.hideProgress();
  249.                         return
  250.                     });
  251.                 } else {
  252.                     open_toast('请将信息填写完整!');
  253.                 }
  254.                 // console.log("登陆成功");

  255.             },
  256.             //设置cookie
  257.             setCookie(c_name, c_pwd, exdays) {
  258.                 var exdate = new Date(); //获取时间
  259.                 exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //保存的天数
  260.                 //字符串拼接cookie
  261.                 window.document.cookie = "userName" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
  262.                 window.document.cookie = "userPwd" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
  263.             },
  264.             //读取cookie
  265.             getCookie: function() {
  266.                 if (document.cookie.length > 0) {
  267.                     var arr = document.cookie.split('; '); //这里显示的格式需要切割一下自己可输出看下
  268.                     for (var i = 0; i < arr.length; i++) {
  269.                         var arr2 = arr[i].split('='); //再次切割
  270.                         //判断查找相对应的值
  271.                         if (arr2[0] == 'userName') {
  272.                             this.ruleForm.username = arr2[1]; //保存到保存数据的地方
  273.                         } else if (arr2[0] == 'userPwd') {
  274.                             this.ruleForm.password = arr2[1];
  275.                         }
  276.                     }
  277.                 }
  278.             },
  279.             //清除cookie
  280.             clearCookie: function() {
  281.                 this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
  282.             },


  283.             all_win_vue(msName, msUrl, msLink, msValue, msValue1, msValue2, msValue3, msValue4, msValue5) {
  284.                 all_win_vue(msName, msUrl, msLink, msValue, msValue1, msValue2, msValue3, msValue4, msValue5);
  285.             },
  286.         }
  287.     });

  288.     apiready = function() {
  289.         var timer = 0
  290.         api.addEventListener({
  291.             name: 'keyback'
  292.         }, function(ret, err) {
  293.             var currentTime = new Date().getTime()
  294.             api.historyBack(function(ret, err) {
  295.                 if (!ret.status) {
  296.                     if ((currentTime - timer) > 2000) {
  297.                         timer = currentTime;
  298.                         open_toast('再按一次返回键退出app')
  299.                     } else {
  300.                         api.closeWidget({
  301.                             id: 'A6021379356643', //这里改成自己的应用ID
  302.                             retData: {
  303.                                 name: 'closeWidget'
  304.                             },
  305.                             silent: true
  306.                         })
  307.                     }
  308.                 }
  309.             })
  310.         })
  311.     }
  312. </script>


复制代码
安卓手机正常,苹果手机账号录入不了但是密码可以正常录入
可以描述的具体点,录入不了是什么
23
帖子
0
勋章
890
Y币
找到问题了,加了一个type='text'就好了
技术咨询-特特 · 2022-8-10 11:33可以描述的具体点,录入不了是什么
您需要登录后才可以回帖 登录

本版积分规则