first commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import post, {get} from "@/api/request";
|
||||
|
||||
export const areaListReq = data => post('/area/list-by-level', data)
|
||||
|
||||
export const areaInfoReq = data => post('/area/info', data)
|
||||
|
||||
export const areaInfoByNameReq = data => post('/area/info-by-name', data)
|
||||
|
||||
export const indexListReq = data => post('/com/publish-list/list', data)
|
||||
|
||||
export const swiperListReq = () => get('/sys/sys-swiper')
|
||||
|
||||
export const communityListReq = data => post('/community/list', data)
|
||||
|
||||
export const dictListReq = data => post('/system/dict/info', data)
|
||||
|
||||
export const addViewNumReq = data => post('/shop/user-browse/add', data)
|
||||
|
||||
export const sysSettingInfoReq = data => post('/sys', data)
|
||||
|
||||
export const dictDataReq = data => post('/system/dict-data/list-by-dict', data)
|
||||
|
||||
export const listArticleReq = params => get('/cms/article', {params})
|
||||
|
||||
export const articleInfoReq = data => post('/cms/article/info', data)
|
||||
|
||||
export const articleCateReq = params => get('/cms/article-category', {params})
|
||||
|
||||
export const feedbackReq = data => post('/law/law-feedback', data)
|
||||
|
||||
export const listFeedbackReq = () => get('/law/law-feedback')
|
||||
|
||||
export const listLegalCalTypeReq = () => get('/law/law-legal-cal-type')
|
||||
|
||||
export const listLawLegalCalConfig = params => get(`/law/law-legal-cal-config`, {params})
|
||||
@@ -0,0 +1,11 @@
|
||||
import post, {get} from "@/api/request";
|
||||
|
||||
export const listLawOrgReq = params => get('/law/law-org', {params})
|
||||
|
||||
export const listLawOrgPeopleReq = params => get('/law/law-org-people', {params})
|
||||
export const lawOrgCheckActionReq = data => post('/law/law-org-check-log', data)
|
||||
export const lawLegalAidReq = data => post('/law/law-legal-aid', data)
|
||||
export const sendChatReq = data => post('/chat/message', data)
|
||||
export const stopChatReq = data => post('/chat/messageStop', data)
|
||||
export const lawLegalArbitrateReq = data => post('/law/law-legal-arbitrate', data)
|
||||
export const lawLegalAppraisalReq = data => post('/law/law-legal-appraisal', data)
|
||||
@@ -0,0 +1,7 @@
|
||||
import post, {get} from "@/api/request";
|
||||
|
||||
export const listLegalDocTypeReq = () => get('/law/law-legal-doc-type')
|
||||
export const legalDocTypeInfoReq = (id) => get(`/law/law-legal-doc-type/${id}`)
|
||||
export const legalDocConfigReq = params => get('/law/law-legal-doc-config', {params})
|
||||
export const legalDocMakeReq = data => post('/law/law-legal-doc-config/make', data)
|
||||
export const legalDocSendEmailReq = data => post('/law/law-legal-doc-config/send-email', data)
|
||||
@@ -0,0 +1,8 @@
|
||||
import post, {get, put} from "@/api/request";
|
||||
|
||||
export const listLegalOrgCheckTypeReq = () => get('/law/law-legal-org-check-type')
|
||||
export const listLegalOrgCheckTypeInfoReq = (id) => get(`/law/law-legal-org-check-type/${id}`)
|
||||
export const listLegalOrgCheckConfigReq = params => get('/law/law-legal-org-check-config', {params})
|
||||
export const addLegalOrgCheckContentReq = data => post('/law/law-legal-org-check-content', data)
|
||||
export const updateLegalOrgCheckContentReq = data => post('/law/law-legal-org-check-content/update', data)
|
||||
export const listLegalOrgCheckContentReq = () => get('/law/law-legal-org-check-content')
|
||||
@@ -0,0 +1,7 @@
|
||||
import post, {get, put} from "@/api/request";
|
||||
|
||||
export const listLegalOrgCheckTypeSuggestReq = () => get('/law/law-legal-org-check-type-suggest')
|
||||
export const listLegalOrgCheckTypeSuggestInfoReq = (id) => get(`/law/law-legal-org-check-type-suggest/${id}`)
|
||||
export const listLegalOrgCheckSuggestConfigReq = params => get('/law/law-legal-org-check-config-suggest', {params})
|
||||
export const addLegalOrgCheckContentSuggestReq = data => post('/law/law-legal-org-check-content-suggest', data)
|
||||
export const updateLegalOrgCheckContentSuggestReq = data => put('/law/law-legal-org-check-content-suggest', data)
|
||||
@@ -0,0 +1,4 @@
|
||||
import post, {get} from "@/api/request";
|
||||
|
||||
export const listNotaryConfigReq = () => get('/law/law-notary-config')
|
||||
export const notaryActionReq = data => post('/law/law-notary-list', data)
|
||||
@@ -0,0 +1,96 @@
|
||||
import Request from '@/js_sdk/luch-request/luch-request/index.js'
|
||||
import {API} from '@/config'
|
||||
import {getUserInfo, clearUserInfo} from "@/util/user";
|
||||
|
||||
const http = new Request();
|
||||
http.config.baseURL = API
|
||||
|
||||
http.interceptors.request.use((config) => {
|
||||
// uni.showLoading({title: '加载中'})
|
||||
const token = getUserInfo().token
|
||||
if (token && token !== 'undefined') {
|
||||
config.header.Authorization = token
|
||||
}
|
||||
config.header.tenantId = 10049
|
||||
return config
|
||||
}, config => {
|
||||
return Promise.reject(config)
|
||||
})
|
||||
|
||||
http.interceptors.response.use((response) => {
|
||||
const url = response.config.url
|
||||
// uni.hideLoading()
|
||||
switch (parseInt(response.data.code)) {
|
||||
case 401: {
|
||||
if (['user-cart-num', 'new-order', 'user-cart-add', 'user-info'].indexOf(url) === -1) {
|
||||
uni.showToast({
|
||||
title: '请登录',
|
||||
icon: 'error',
|
||||
duration: 2000,
|
||||
})
|
||||
setTimeout(() => {
|
||||
clearUserInfo()
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 500: {
|
||||
if (['/user/change-pay-password', 'new-order-from-goods-list'].indexOf(url) === -1) {
|
||||
console.log(response.data)
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: response.data.content.msg,
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 502: {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '系统维护中',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
}
|
||||
return response
|
||||
}, (error) => {
|
||||
if (error.code === 502) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '系统维护中',
|
||||
duration: 2000,
|
||||
})
|
||||
}
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
const post = (url, formData, options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(url, formData, options).then(res => {
|
||||
if (res.data.code === 0) resolve(res.data)
|
||||
else if (res.data.code === 401) reject(res.data)
|
||||
else reject(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const get = (url, options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(url, options).then(res => {
|
||||
resolve(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const put = (url, formData, options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.put(url, formData, options).then(res => {
|
||||
if (res.data.code === 0) resolve(res.data)
|
||||
else if (res.data.code === 401) reject(res.data)
|
||||
else reject(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export default post
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import post from "@/api/request";
|
||||
|
||||
export const loginReq = data => post('/shop/wx-login/getOpenId', data)
|
||||
|
||||
export const loginByPhoneReq = data => post('/login-by-phone', data)
|
||||
|
||||
export const userInfoReq = data => post('/system/user/info', data)
|
||||
|
||||
export const userInfoUpdateReq = data => post('/system/user/update', data)
|
||||
|
||||
export const userInfoUpdateDataReq = data => post('/system/user/update-data', data)
|
||||
|
||||
export const userSearchReq = data => post('/user/search', data)
|
||||
|
||||
export const userSetCardReq = data => post('/user/set-card', data)
|
||||
|
||||
export const userCardChargeReq = data => post('/user/card-charge', data)
|
||||
|
||||
export const userCardReduceReq = data => post('/user/card-reduce', data)
|
||||
|
||||
export const userCardUseReq = data => post('/user/card-use', data)
|
||||
Reference in New Issue
Block a user