业务交流通
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

app.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // app.js
  2. App({
  3. onLaunch() {
  4. // 展示本地存储能力
  5. const logs = wx.getStorageSync('logs') || []
  6. logs.unshift(Date.now())
  7. wx.setStorageSync('logs', logs)
  8. // 登录
  9. wx.login({
  10. success: (res) => {
  11. if (res.code) {
  12. //获取openid
  13. wx.request({
  14. url: this.mangerUrl + '/service/weixin/getWxOpenId',
  15. data: {
  16. appNum: 11,
  17. js_code: res.code
  18. },
  19. success: (result) => {
  20. if (!!result.data && result.data.openid) {
  21. // this.globalData.openid = result.data.openid;
  22. this.globalData.appid = result.data.appid;
  23. this.globalData.sessionKey = result.data.sessionKey;
  24. }
  25. }
  26. })
  27. } else {
  28. wx.showToast({
  29. title: '获取登录信息失败',
  30. icon: 'none',
  31. duration: 2000
  32. })
  33. }
  34. }
  35. })
  36. },
  37. globalData: {
  38. userInfo: null,
  39. openid: "oBkT7vu1Q8l-xsbux_i1FNmRWuJ4",
  40. appid: "",
  41. sessionKey: "",
  42. suiteCode: "",
  43. customerId: "",
  44. },
  45. // mangerUrl: 'http://test2.hhrchina.com',
  46. mangerUrl: "http://192.168.18.156",
  47. // mangerUrl: "https://www.hhrchina.com",
  48. // mangerUrlPath: "https://www.hhrchina.com",
  49. })