tanghaolin
2022-10-08 37b626a2e9073132a504e595b0416c7e704a8cd8
修改报错提示和登陆后保存密码和账号的功能
已修改4个文件
32 ■■■■ 文件已修改
login/login/index.js 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
reportForm/index/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test/reportTable/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/api.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
login/login/index.js
@@ -22,7 +22,16 @@
    isShowPwd:false,//是否显示密码
  },
  //获取缓存中的用户信息
  getStorageUserInfo(){
    if(!wx.getStorageSync('AccountInfo'))return
    let userInfo =  JSON.parse(wx.getStorageSync('AccountInfo')) || {}
    if(!userInfo)return
      this.setData({
        phone:userInfo.access_info.account,
        password:userInfo.access_info.password
      })
  },
  // 打电话
  call: function () {
    wx.makePhoneCall({
@@ -171,15 +180,22 @@
        if(Token){
          isNeedToken = true
        }
        let ExpreTime = new Date().getTime() //获取当前时间戳
        let access_info = {
          account:that.data.phone,
          password:that.data.password
        }
        // 账户信息
        let userAccountInfo = {
          access_info:access_info
        }
        wx.setStorageSync('AccessToken', {
          Token:Token,
          ExpreTime:ExpreTime,
          isNeedToken:isNeedToken
        })
        wx.setStorageSync( "AccountInfo",JSON.stringify(userAccountInfo))
        var return_user = return_data.User;
        //console.log(return_user);
@@ -198,7 +214,6 @@
  //登录成功
  loginSuccessCb: function (userInfo) {
    var that = this;
    console.log(userInfo,184)
    that.setData({
      userInfo: userInfo
    });
@@ -356,7 +371,7 @@
      inputWidth: screenWidth,
      inputHeight: screenHightScale * 177
    });
    this.getStorageUserInfo()
  },
  onShareAppMessage: function () {
reportForm/index/index.js
@@ -90,7 +90,7 @@
        var result = res.data.Data
        if (res.data.Code != 0) {
          wx.showToast({
            title: '数据加载失败',
            title: '当前月份暂无报表数据',
            icon: 'none',
            duration: 2000
          })
@@ -159,7 +159,7 @@
            icon: 'none',
            duration: 2000
          })
        // console.log(err)
         console.log(err)
      }
    })
  },
test/reportTable/index.js
@@ -172,7 +172,7 @@
        //return
        if (res.data.Code != 0) {
          wx.showToast({
            title: '数据加载失败',
            title: '当前月份暂无报表数据',
            icon: 'none',
            duration: 2000
          })
utils/api.js
@@ -1,4 +1,5 @@
const Request = function(params){
    console.log(params,2)
    let tokenInfo = wx.getStorageSync('AccessToken')
    // console.log(tokenInfo,3)
    let currentDateTime = new Date().getTime()