page.js 707 B

123456789101112131415161718192021222324252627282930
  1. import request from '@/utils/request'
  2. // api地址
  3. const apiUrl = {
  4. detail: 'page/detail'
  5. }
  6. // 页面数据
  7. export function detail(pageId) {
  8. return request.get(apiUrl.detail, {
  9. pageId
  10. })
  11. }
  12. export const wxLogin = async () => {
  13. return new Promise((resolve, reject) => {
  14. wx.login({
  15. success: async (res) => {
  16. console.log('code',res.code)
  17. // let rs = await getOpenId(res.code)
  18. // let openId = rs.data.openid
  19. // let sessionKey = rs.data.sessionKey
  20. // uni.setStorageSync('openId', openId)
  21. // uni.setStorageSync('sessionKey', sessionKey)
  22. // resolve(openId)
  23. }
  24. })
  25. })
  26. }