index.js 668 B

123456789101112131415161718192021222324252627
  1. import {
  2. hexMD5
  3. } from "../../utils/md5";
  4. const _Http = getApp().globalData.http;
  5. Page({
  6. data: {
  7. username: "000101",
  8. password: "123456789",
  9. },
  10. onLoad(options) {
  11. },
  12. login() {
  13. _Http.login({
  14. "accountno": this.data.username,
  15. "password": hexMD5(this.data.password),
  16. "systemclient": "wechatsaletool"
  17. }).then(res => {
  18. console.log("登录", res)
  19. wx.showToast({
  20. title: res.msg == '成功' ? '登录成功' : res.msg,
  21. icon: "none"
  22. });
  23. wx.setStorageSync('userMsg', res.account_list[0])
  24. })
  25. },
  26. })