修改接口 默认应用问题
This commit is contained in:
parent
25664afcd6
commit
49b2280732
@ -6,7 +6,7 @@ import { request } from '@/utils/request'
|
||||
export const getSettingApi = () => {
|
||||
return request<settingItem>({
|
||||
method: 'GET',
|
||||
url: '/common/setting',
|
||||
url: '/shop/common/setting',
|
||||
})
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export const uploadApi = (filePath: string): Promise<AnyObject> => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `shop/common/upload?driver=${uploadSetting.mode}`,
|
||||
url: `/shop/common/upload?driver=${uploadSetting.mode}`,
|
||||
filePath,
|
||||
name: 'file',
|
||||
success: (res) => {
|
||||
|
@ -11,7 +11,7 @@ import { request } from '@/utils/request'
|
||||
export const getGoodsListApi = (data?: PageParams & goodsListParams) => {
|
||||
return request<PageResult<goodsListItem>>({
|
||||
method: 'GET',
|
||||
url: 'shop/goods',
|
||||
url: '/shop/goods',
|
||||
data,
|
||||
})
|
||||
}
|
||||
@ -19,7 +19,7 @@ export const getGoodsListApi = (data?: PageParams & goodsListParams) => {
|
||||
export const getGoodsByIdApi = (id: number) => {
|
||||
return request<goodsResult>({
|
||||
method: 'GET',
|
||||
url: 'shop/goods/detail',
|
||||
url: '/shop/goods/detail',
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
@ -29,7 +29,7 @@ export const getGoodsByIdApi = (id: number) => {
|
||||
export const getGoodsServiceApi = (service_ids: string) => {
|
||||
return request<goodsServiceItem[]>({
|
||||
method: 'GET',
|
||||
url: 'shop/goods/service',
|
||||
url: '/shop/goods/service',
|
||||
data: {
|
||||
service_ids,
|
||||
},
|
||||
@ -39,7 +39,7 @@ export const getGoodsServiceApi = (service_ids: string) => {
|
||||
export const getShareInfoApi = (id: number) => {
|
||||
return request<goodsShareResult>({
|
||||
method: 'GET',
|
||||
url: 'shop/goods/share',
|
||||
url: '/shop/goods/share',
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ import { request } from '@/utils/request'
|
||||
export const getBannerApi = (type: number = 1) => {
|
||||
return request<bannerItem[]>({
|
||||
method: 'GET',
|
||||
url: 'shop/advert/banner',
|
||||
url: '/shop/advert/banner',
|
||||
data: {
|
||||
type,
|
||||
},
|
||||
@ -24,7 +24,7 @@ export const getBannerApi = (type: number = 1) => {
|
||||
export const getGoodsListApi = (data?: PageParams) => {
|
||||
return request<PageResult<goodsListItem>>({
|
||||
method: 'GET',
|
||||
url: 'shop/goods',
|
||||
url: '/shop/goods',
|
||||
data,
|
||||
})
|
||||
}
|
||||
@ -37,13 +37,13 @@ export const getGoodsListApi = (data?: PageParams) => {
|
||||
export const getNoticeBartApi = () => {
|
||||
return request<noticeBarItem[]>({
|
||||
method: 'GET',
|
||||
url: 'shop/advert/noticeBar',
|
||||
url: '/shop/advert/noticeBar',
|
||||
})
|
||||
}
|
||||
|
||||
export const getHotRecommendApi = () => {
|
||||
return request<hotRecommendItem[]>({
|
||||
method: 'GET',
|
||||
url: 'shop/advert/hotRecommend',
|
||||
url: '/shop/advert/hotRecommend',
|
||||
})
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ const url = ref('')
|
||||
|
||||
if (isDev) {
|
||||
// dev模式请求域名
|
||||
url.value = 'http://api-test.haibao.shop'
|
||||
url.value = 'https://apis.haibao.shop'
|
||||
} else {
|
||||
// build模式请求域名
|
||||
url.value = 'http://api.haibao.shop'
|
||||
url.value = 'https://api.haibao.shop'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,11 +12,12 @@ const Interceptor = {
|
||||
//拼接请求地址
|
||||
if (!/^https?:\/\//.test(options.url)) {
|
||||
// /api是系统保留的接口,不代理
|
||||
if (options.url.startsWith('/api')) {
|
||||
options.url = apiUrl + options.url
|
||||
} else {
|
||||
options.url = apiUrl + apiName + options.url
|
||||
}
|
||||
// if (options.url.startsWith('/api')) {
|
||||
// options.url = apiUrl + options.url
|
||||
// } else {
|
||||
// options.url = apiUrl + apiName + options.url
|
||||
// }
|
||||
options.url = apiUrl +'/'+ options.url
|
||||
}
|
||||
//请求超时 10s
|
||||
options.timeout = 10000
|
||||
@ -63,7 +64,7 @@ const loginFail = (res: any) => {
|
||||
useMemberStore().clearProfile()
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '登录解锁更多精彩,是否继续?',
|
||||
content: '登录体验保税,是否继续?',
|
||||
confirmText: '去登录',
|
||||
cancelText: '再看看',
|
||||
success: function (res) {
|
||||
|
Loading…
Reference in New Issue
Block a user