import http from '@/utils/http' // const appId = uni.getAccountInfoSync().miniProgram.appId export function loginByCode(data) { return new Promise((resolve, reject) => { uni.login({ provider: 'weixin', success: function(res) { http.post('wxMini/login', { code: res.code, }, { isAuth: false, showLoading: false }).then(res => { resolve(res) }).catch(err => { reject(err) }) } }) }) } export function login(data) { return http.post('user/login', data) } export function wxLogin(data) { return new Promise((resolve, reject) => { uni.login({ provider: 'weixin', success: function(res) { http.post('wxMini/authLogin', { encryptedData: data.encryptedData, ivStr: data.iv, userInfo: JSON.stringify(data.userInfo), code: res.code, }, { isAuth: false, loadingTitle: '登录中...' }).then(res => { resolve(res) }).catch(err => { reject(err) }) } }) }) } export function logout(data) { return http.post('user/logout', data) } // 意见反馈 export function addAdvice(data) { return http.post('user/advice', data) } export function getAdviceList() { return http.get('user/advice/list') } // 版本信息 export function getVersionList(data) { return http.get('user/version', data) } // 通讯录 export function getAddrbookList() { return http.get('user/advice/list') } // 协议、隐私 export function getPolicy() { return http.get('user/privacyPolicy') } export function getAgreement() { return http.get('user/userServiceAgreement') }