12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- 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')
- }
|