1、修改本地开发ip
This commit is contained in:
parent
e895946567
commit
f36d4a8599
@ -20,7 +20,7 @@ const isWhiteList = (path: string) => {
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start();
|
||||
// 仅仅限本地无token调试时候,不做token校验
|
||||
/* next();
|
||||
/* next();
|
||||
return;*/
|
||||
if (getToken()) {
|
||||
to.meta.title && useSettingsStore().setTitle(to.meta.title as string);
|
||||
|
@ -1,47 +1,39 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { reactive } from 'vue';
|
||||
import { listPmsProductCategory } from '@/api/pms/productCategory';
|
||||
import { allBrand } from '@/api/pms/brand';
|
||||
import { areaSelect } from '@/api/system/common.js';
|
||||
|
||||
export const useMallStore = defineStore('mall', () => {
|
||||
const state = reactive({
|
||||
const state = ref({
|
||||
productCategories: [],
|
||||
brandList: [],
|
||||
areaSelect: [],
|
||||
aaaaaaa: 'store开发测试'
|
||||
areaSelect: []
|
||||
});
|
||||
const aaaaaaa = ref('store开发测试');
|
||||
const changeAAA = (info: any) => {
|
||||
aaaaaaa.value = info;
|
||||
};
|
||||
const loadProductCategories = async (force: any = false) => {
|
||||
if (!force && state.productCategories.length > 0) {
|
||||
if (!force && state.value.productCategories.length > 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return listPmsProductCategory({}).then((res: any) => {
|
||||
state.productCategories = res;
|
||||
state.value.productCategories = res;
|
||||
});
|
||||
};
|
||||
const loadAreaSelect = async (force: any = false) => {
|
||||
if (!force && state.areaSelect.length > 0) {
|
||||
if (!force && state.value.areaSelect.length > 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return areaSelect({}).then((res) => {
|
||||
state.areaSelect = res.data;
|
||||
state.value.areaSelect = res.data;
|
||||
});
|
||||
};
|
||||
const loadBrandList = async (force: any = false) => {
|
||||
if (!force && state.brandList.length > 0) {
|
||||
if (!force && state.value.brandList.length > 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return allBrand({}).then((res: any) => {
|
||||
state.brandList = res;
|
||||
state.value.brandList = res;
|
||||
});
|
||||
};
|
||||
return {
|
||||
changeAAA,
|
||||
aaaaaaa,
|
||||
state,
|
||||
loadProductCategories,
|
||||
loadAreaSelect,
|
||||
|
@ -124,7 +124,6 @@ service.interceptors.response.use(
|
||||
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.resolve(res.data);
|
||||
if (code === 401) {
|
||||
// prettier-ignore
|
||||
if (!isRelogin.show) {
|
||||
@ -148,7 +147,7 @@ service.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
|
||||
} else if (code === HttpStatus.SERVER_ERROR) {
|
||||
} else if (code === HttpStatus.SERVER_ERROR || code === HttpStatus.NOT_FOUND) {
|
||||
ElMessage({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg));
|
||||
} else if (code === HttpStatus.WARN) {
|
||||
|
@ -24,7 +24,8 @@ export default defineConfig(({ mode, command }) => {
|
||||
open: true,
|
||||
proxy: {
|
||||
[env.VITE_APP_BASE_API]: {
|
||||
target: 'http://192.168.1.250:8080',
|
||||
// target: 'http://192.168.1.250:8080',
|
||||
target: 'http://192.168.1.13:8080',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user