0
点赞
收藏
分享

微信扫一扫

基于SpringBoot+Vue的智能楼宇后台管理(个人记录用)

芷兮离离 2022-01-08 阅读 63

一、Day01

1.1 BUG

  • org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input lengt........

    • Settings --> File Encodings --> UTF-8

    • 删除application.yaml文件,重新建一个

  • Springboot框架中Mapper层在进行多参数查询时一定要加@Param注解同时指定名字,否则查询无效

  • Controller层 @RequestParam 指定传入参数的名字

1.2 Vue qs

  • 操作Terminal

    • npm install qs

    • npm run xx

    • const QS = require('qs')   或者 import qs from 'qs’ 导入
      ​
      ​
      validateFields(validateFieldsKey, { force: true }, (err, values) => {
                      if (!err) {
                          console.log('login form', values)
                          const loginParams = { ...values }
                          delete loginParams.username
                          loginParams[!state.loginType ? 'email' : 'username'] = values.username
                          loginParams.password = md5(values.password)
                          const params = QS.stringify(loginParams)
                          Login(params)
                              .then(res => this.loginSuccess(res))
                              .catch(err => this.requestFailed(err))
                              .finally(() => {
                                  state.loginBtn = false
                              })
                      } else {
                          setTimeout(() => {
                              state.loginBtn = false
                          }, 600)
                      }
                  })
              },
  • 增加了一些安全性的查询字符串解析和序列化字符串的库

  • qs.parse()是将URL解析成对象的形式

  • qs.stringify()是将对象 序列化成URL的形式,以&进行拼接

举报

相关推荐

0 条评论