目录调整
This commit is contained in:
1 parent
c985c08405
commit
f7e899b4a1
19 files changed
+50
-81
No files matched your search
+2
-3
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import isDevEnv from "./sheep/utils/isDevEnv"
|
||||
import { getAppInfo } from "@@/utils/getAppInfo"
|
||||
import getLaunchParam from "@/sheep/utils/getLaunchParam"
|
||||
import { isDevEnv, getLaunchParam } from "@/sheep/utils/app"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
|
||||
// import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"
|
||||
// onLaunch(() => {})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from "vue"
|
||||
import { ref, reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { isEmpty } from "radash"
|
||||
|
||||
import { hooks, router, constant } from "@@/index"
|
||||
import { hooks, router } from "@@/index"
|
||||
import { faceApi } from "@@/api"
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
@@ -57,10 +57,10 @@ import { reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { isEmpty } from "radash"
|
||||
import { filePath } from "@@/utils/file"
|
||||
import { getAppInfo } from "@@/utils/getAppInfo"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
import { hooks, router, constant } from "@@/index"
|
||||
import { userApi } from "@@/api"
|
||||
import isDevEnv from "@/sheep/utils/isDevEnv"
|
||||
import { isDevEnv } from "@/sheep/utils/app"
|
||||
// import dd from "gdt-jsapi"
|
||||
|
||||
const state = reactive<{
|
||||
|
||||
@@ -8,7 +8,7 @@ import { orderApi } from "@@/api"
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
|
||||
import getLaunchParam from "@/sheep/utils/getLaunchParam"
|
||||
import { getLaunchParam } from "@/sheep/utils/app"
|
||||
|
||||
const data = {
|
||||
tabs: [
|
||||
|
||||
@@ -23,7 +23,7 @@ onLoad(() => {
|
||||
app._initTabbar()
|
||||
})
|
||||
onShow(() => {
|
||||
// pageRef.value && pageRef.value.reload(false)
|
||||
pageRef.value && pageRef.value.reload(false)
|
||||
})
|
||||
|
||||
const toDetail = async (v: any) => {
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<view class="flex-1 flex-col m-l-20rpx">
|
||||
<view class="sub-text-34">
|
||||
<text class="mr-2">{{ v.name }}</text>
|
||||
<!-- <tm-tag v-if="v.supType == '10' && Number(v.mchCount) > 0" size="xs" skin="thin">共{{ v.mchCount }}家</tm-tag> -->
|
||||
</view>
|
||||
<view class="m-t-10rpx">
|
||||
<view class="flex justify-between items-center">
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue"
|
||||
import { userApi } from "@/sheep/api"
|
||||
import getLaunchParam from "@/sheep/utils/getLaunchParam"
|
||||
import { getLaunchParam } from "@/sheep/utils/app"
|
||||
|
||||
const userRole = ref("user")
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
|
||||
import { hooks } from "@@/index"
|
||||
import { foodApi } from "@@/api"
|
||||
|
||||
const data = {}
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
status: 1,
|
||||
},
|
||||
})
|
||||
|
||||
onLoad(() => {})
|
||||
onShow(() => {})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<crud-layout title="订单详情" bg="/static/page/blue-bg.png"> </crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -85,5 +85,3 @@ const doTab = (e: any) => {
|
||||
</z-paging>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
File renamed without changes.
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
logo: "/static/constant/logo.png"
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
export { default as imgConstant } from "./img-constant";
|
||||
export { default as serviceEnum } from "./service-enum"
|
||||
|
||||
export { default as serviceEnum } from "./service-enum";
|
||||
|
||||
export { default as storageConstant } from "./storage-constant";
|
||||
export { default as storageConstant } from "./storage-constant"
|
||||
@@ -1,6 +1,6 @@
|
||||
import storageConstant from "../constant/storage-constant"
|
||||
import { jump } from "../router/index"
|
||||
import isDevEnv from "../utils/isDevEnv"
|
||||
import { isDevEnv } from "../utils/app"
|
||||
|
||||
export const useToken = () => {
|
||||
const tokenKey = storageConstant.TOKEN
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// app运行环境
|
||||
// export default () => import.meta.env.VITE_DEV_ENV === "dev"
|
||||
export const isDevEnv = (): boolean => process.env.NODE_ENV === "development"
|
||||
|
||||
// 获取启动参数
|
||||
export const getLaunchParam = (): "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null => {
|
||||
return new URL(window.location.href).searchParams.get("launchParam") as "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null
|
||||
}
|
||||
|
||||
// 检测app信息判断运行环境
|
||||
export const getAppInfo = async (): Promise<string> => {
|
||||
try {
|
||||
const res = await (window as any).CP2.getAppInfo()
|
||||
// 浙政钉环境
|
||||
if (res.code === 0) {
|
||||
console.log("环境:zzd")
|
||||
return "zzd"
|
||||
} else {
|
||||
// 诗画环境
|
||||
console.log("环境:sh")
|
||||
return "sh"
|
||||
}
|
||||
} catch (error) {
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import isDevEnv from "./isDevEnv"
|
||||
import { isDevEnv } from "./app"
|
||||
|
||||
export const filePath = (path?: string) => {
|
||||
const imageBaseUrl = isDevEnv() ? import.meta.env.VITE_IMAGE_DEV_PATH : import.meta.env.VITE_APP_PROD_IMAGE
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// 检测app信息判断运行环境
|
||||
export const getAppInfo = async (): Promise<string> => {
|
||||
try {
|
||||
const res = await (window as any).CP2.getAppInfo()
|
||||
// 浙政钉环境
|
||||
if (res.code === 0) {
|
||||
console.log("环境:zzd")
|
||||
return "zzd"
|
||||
} else {
|
||||
// 诗画环境
|
||||
console.log("环境:sh")
|
||||
return "sh"
|
||||
}
|
||||
} catch (error) {
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// 获取启动参数
|
||||
const getLaunchParam = (): "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null => {
|
||||
return new URL(window.location.href).searchParams.get("launchParam") as "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null
|
||||
}
|
||||
|
||||
export default getLaunchParam
|
||||
@@ -1,2 +0,0 @@
|
||||
// export default () => import.meta.env.VITE_DEV_ENV === "dev"
|
||||
export default () => process.env.NODE_ENV === "development"
|
||||
+11
-11
@@ -2,8 +2,8 @@ import Request from "luch-request"
|
||||
import { router, constant } from "@@/index"
|
||||
import { userApi } from "../api"
|
||||
import { isEmpty } from "radash"
|
||||
import isDevEnv from "./isDevEnv"
|
||||
import { getAppInfo } from "@@/utils/getAppInfo"
|
||||
import { isDevEnv } from "./app"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
import showVerifyDeviceImpModel from "../components/verifyDeviceImpModel/verifyDeviceImpModel"
|
||||
|
||||
const TOKEN_KEY = constant.storageConstant.TOKEN
|
||||
@@ -78,15 +78,15 @@ async function handleShLogin(): Promise<boolean> {
|
||||
try {
|
||||
uni.showLoading({ title: "登录中...", mask: true })
|
||||
|
||||
const userInfo = await (window as any).CP2.getUserInfo()
|
||||
if (userInfo.code == 0 || !userInfo.data.accountId || !userInfo.data.sessionId) {
|
||||
uni.showToast({ title: "获取诗画用户信息失败", icon: "none" })
|
||||
return false
|
||||
}
|
||||
// const userInfo = await (window as any).CP2.getUserInfo()
|
||||
// if (userInfo.code == 0 || !userInfo.data.accountId || !userInfo.data.sessionId) {
|
||||
// uni.showToast({ title: "获取诗画用户信息失败", icon: "none" })
|
||||
// return false
|
||||
// }
|
||||
|
||||
const { accountId, sessionId } = userInfo.data
|
||||
const response = await userApi.authsh({ accountId, sessionId })
|
||||
// const response = await userApi.authsh({ accountId: "67e790d6a95d5a7b507e53dd", sessionId: "68215b03a95d5a4899d20cb4" }) // 测试
|
||||
// const { accountId, sessionId } = userInfo.data
|
||||
// const response = await userApi.authsh({ accountId, sessionId })
|
||||
const response = await userApi.authsh({ accountId: "67e790d6a95d5a7b507e53dd", sessionId: "68215b03a95d5a4899d20cb4" }) // 测试
|
||||
|
||||
if (response.code == 0) {
|
||||
uni.setStorageSync(TOKEN_KEY, { accessToken: response.data.accessToken })
|
||||
@@ -274,7 +274,7 @@ http.interceptors.response.use(
|
||||
uni.removeStorageSync(TOKEN_KEY)
|
||||
uni.removeStorageSync(USER_INFO_KEY)
|
||||
uni.showToast({ title: "登录已过期,请重新登录", icon: "none" })
|
||||
router.jump("/pages/test/login")
|
||||
router.jump("/pages/user/login")
|
||||
} else {
|
||||
try {
|
||||
const newTokenStorage = await refreshToken()
|
||||
|
||||
Reference in new issue
Block a user