feat:订单接口替换

This commit is contained in:
dzc committed 2025-01-07 16:08:39 +08:00
1 parent bfbb15502e
commit 2af8d5fd0b
9 files changed
+315 -206

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ export default {
}),
getShopCar: (params: any) =>
request({
url: `/hardware/car/get`,
url: `/hard/hard-car/app/mch-detail`,
method: "GET",
params,
custom: {
@@ -39,7 +39,7 @@ export default {
}),
updateShopCar: (data: any) =>
request({
url: `/hardware/car/save-or-upload`,
url: `/hard/car/save-or-upload`,
method: "POST",
data,
custom: {
+1 -1
View File
@@ -7,7 +7,7 @@ const basicAuth =
export default {
userInfo: () =>
request({
url: "/sys/user/get",
url: "/admin/user/info",
method: "GET",
custom: {
showLoading: false,
+32
View File
@@ -1,4 +1,5 @@
import storageConstant from "../constant/storage-constant";
import { jump } from "../router/index";
export const useToken = () => {
const tokenKey = storageConstant.TOKEN;
@@ -15,3 +16,34 @@ export const useDefaultHeader = () => {
Authorization: token,
};
};
export const useStaticCheckLogin = () => {
const tokenKey = storageConstant.TOKEN;
const tokenStorage = uni.getStorageSync(tokenKey);
if (tokenStorage) return true;
return false;
};
export const useCheckLogin = async (): Promise<boolean> => {
const tokenKey = storageConstant.TOKEN;
const tokenStorage = uni.getStorageSync(tokenKey);
if (tokenStorage) return true;
uni.showModal({
title: "提示",
content: "您还未登录,请先登录",
confirmColor: "#0094ff",
cancelText: "取消",
confirmText: "去登录",
success: async (res) => {
if (res.confirm) {
jump("/pages/test/login", {}, 3);
return;
}
if (!res.confirm) {
return;
}
return;
},
});
return false;
};