Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-mobile-react-cloud
This commit is contained in:
commit
ded0ed5093
17 files changed
+138
-131
No files matched your search
@@ -22,8 +22,8 @@ VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
# ******************** start 开发环境 start ********************
|
||||
# VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api
|
||||
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api
|
||||
VITE_APP_DEV_SERVICE = http://192.168.101.24:7001/app-api # 邓本地
|
||||
# VITE_APP_DEV_SERVICE = http://localhost:9999
|
||||
# VITE_APP_DEV_SERVICE = http://192.168.101.24:48080/app-api
|
||||
VITE_APP_DEV_SERVICE = http://localhost:9999
|
||||
# ******************** end 开发环境 end ********************
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -239,7 +239,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/humanFace",
|
||||
"root": "pages/human-face",
|
||||
"pages": [
|
||||
{
|
||||
"path": "list",
|
||||
@@ -293,4 +293,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,6 @@ const getDetail = async () => {
|
||||
const { data } = await applyApi.foreignDetail(_pa)
|
||||
if (!isEmpty(data)) {
|
||||
state.detail = data
|
||||
|
||||
const startTime = hooks.useTime(data.applyStartTime, "{y}-{m}-{d}")
|
||||
const endTime = hooks.useTime(data.applyEndTime, "{y}-{m}-{d}")
|
||||
applyForm.displayTimeRangeStr = startTime + "~" + endTime
|
||||
@@ -66,11 +65,12 @@ const doSubmit = async () => {
|
||||
const { isPass } = applyFormRef.value.validate()
|
||||
if (!isPass) return
|
||||
const range = applyForm.displayTimeRange
|
||||
console.log(range);
|
||||
try {
|
||||
uni.showLoading({ title: '申请中...', mask: false });
|
||||
const _pa = {
|
||||
applyStartTime: dayjs(range[0]).valueOf(),
|
||||
applyEndTime: dayjs(range[1]).valueOf(),
|
||||
applyStartTime: hooks.useTime(range[0], "{y}-{m}-{d}"),
|
||||
applyEndTime: hooks.useTime(range[1], "{y}-{m}-{d}"),
|
||||
count: applyForm.count,
|
||||
remark: applyForm.remark,
|
||||
}
|
||||
|
||||
@@ -6,16 +6,17 @@ import { isEmpty } from 'radash'
|
||||
import { hooks, router } from "@@/index"
|
||||
import { applyApi } from "@@/api"
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
id: null,
|
||||
pagesize: 99,
|
||||
pagesize: 15,
|
||||
},
|
||||
})
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.foreignItems, null, 'data')
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.codeList, null, 'data.records')
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
}
|
||||
@@ -46,12 +47,12 @@ onShow(() => {
|
||||
v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)">
|
||||
<view class="flex-row items-center">
|
||||
<view class="flex-row items-center">
|
||||
<tm-tag v-if="v.status == 1" size="m" color="info">未使用</tm-tag>
|
||||
<tm-tag v-if="v.status == 2" size="m" color="success">已使用</tm-tag>
|
||||
<tm-tag v-if="v.status == 0" size="m" color="info">未使用</tm-tag>
|
||||
<tm-tag v-if="v.status == 1" size="m" color="success">已使用</tm-tag>
|
||||
</view>
|
||||
<view class="flex-row items-center sub-text-28">
|
||||
<text class="m-l-30rpx">{{ v.userNameStr }}</text>
|
||||
<text class="m-l-30rpx">{{ v.userMobile }}</text>
|
||||
<text class="m-l-30rpx">{{ v.username }}</text>
|
||||
<text class="m-l-10rpx second-text-26">{{ v.userMobile }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
|
||||
|
||||
@@ -17,12 +17,12 @@ const data = {
|
||||
}
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
status: data.tabs[0].id,
|
||||
processStatus: data.tabs[0].id,
|
||||
},
|
||||
})
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.foreignList, null, 'data.list')
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.foreignList, null, 'data.records')
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ onShow(() => {
|
||||
|
||||
const doTab = (e: any) => {
|
||||
const target = data.tabs[e];
|
||||
state.pa.status = target.id
|
||||
state.pa.processStatus = target.id
|
||||
pageRef.value.reload(true)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ const doApply = async () => {
|
||||
}
|
||||
|
||||
const doCard = (v: any) => {
|
||||
if (v.status == 2) {
|
||||
if (v.processStatus == 2) {
|
||||
router.jump("/pages/apply/foreign-items", { id: v.id })
|
||||
} else {
|
||||
router.jump("/pages/apply/foreign-apply", { type: 'view', id: v.id })
|
||||
@@ -76,9 +76,9 @@ const doCard = (v: any) => {
|
||||
<view class="flex-row items-center">
|
||||
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
|
||||
<view class="flex-row-center m-l-20rpx">
|
||||
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
|
||||
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
|
||||
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 1" size="xs" color="info">待审核</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 2" size="xs" color="success">已通过</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 3" size="xs" color="error">已拒绝</tm-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -97,7 +97,7 @@ const doCard = (v: any) => {
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="v.status != 1">
|
||||
<view v-if="v.processStatus != 1">
|
||||
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
|
||||
<view class="flex items-center justify-between second-text-26">
|
||||
<view class="flex items-center">
|
||||
@@ -111,7 +111,7 @@ const doCard = (v: any) => {
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center justify-end m-t-25rpx">
|
||||
<text v-if="v.status == 2" class="botder_btn">使用</text>
|
||||
<text v-if="v.processStatus == 2" class="botder_btn">使用</text>
|
||||
<text v-else class="botder_btn">查看</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -14,7 +14,7 @@ const state = reactive<any>({
|
||||
})
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.strideItems, null, 'data')
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.codeList, null, 'data')
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ const data = {
|
||||
}
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
status: data.tabs[0].id,
|
||||
processStatus: data.tabs[0].id,
|
||||
},
|
||||
})
|
||||
|
||||
const pageRef = ref<any>(null)
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.strideList, null, 'data.list')
|
||||
const pageHook = hooks.usePage(pageRef, applyApi.strideList, null, 'data.records')
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ onShow(() => {
|
||||
|
||||
const doTab = (e: any) => {
|
||||
const target = data.tabs[e];
|
||||
state.pa.status = target.id
|
||||
state.pa.processStatus = target.id
|
||||
pageRef.value.reload(true)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ const doApply = async () => {
|
||||
}
|
||||
|
||||
const doCard = (v: any) => {
|
||||
if (v.status == 2) {
|
||||
if (v.processStatus == 2) {
|
||||
router.jump("/pages/apply/stride-items", { id: v.id })
|
||||
} else {
|
||||
router.jump("/pages/apply/stride-apply", { type: 'view', id: v.id })
|
||||
@@ -76,9 +76,9 @@ const doCard = (v: any) => {
|
||||
<view class="flex-row items-center">
|
||||
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
|
||||
<view class="flex-row-center m-l-20rpx">
|
||||
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
|
||||
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
|
||||
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 1" size="xs" color="info">待审核</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 2" size="xs" color="success">已通过</tm-tag>
|
||||
<tm-tag v-if="v.processStatus == 3" size="xs" color="error">已拒绝</tm-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -89,7 +89,7 @@ const doCard = (v: any) => {
|
||||
<text class="m-l-10rpx">{{ v.count }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="v.status != 1">
|
||||
<view v-if="v.processStatus != 1">
|
||||
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
|
||||
<view class="flex items-center justify-between second-text-26">
|
||||
<view class="flex items-center">
|
||||
@@ -103,7 +103,7 @@ const doCard = (v: any) => {
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex items-center justify-end m-t-25rpx">
|
||||
<text v-if="v.status == 2" class="botder_btn">使用</text>
|
||||
<text v-if="v.processStatus == 2" class="botder_btn">使用</text>
|
||||
<text v-else class="botder_btn">查看</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -3,14 +3,16 @@ import { ref, reactive, nextTick } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { isEmpty } from "radash";
|
||||
|
||||
import { hooks, router } from "@@/index";
|
||||
import { hooks, router, constant } from "@@/index";
|
||||
import { faceApi } from "@@/api";
|
||||
const uploadPhotoBaseUrl = import.meta.env.VITE_APP_DEV_SERVICE;
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
const state = reactive<any>({
|
||||
detailType: "add",
|
||||
detailId: null,
|
||||
detail: null,
|
||||
header: {}
|
||||
});
|
||||
const applyForm = reactive<any>({
|
||||
faceImg: [],
|
||||
@@ -23,26 +25,28 @@ onLoad(async (options: any) => {
|
||||
const { type, id } = options;
|
||||
if (!isEmpty(type)) state.detailType = type;
|
||||
if (!isEmpty(id)) state.detailId = id;
|
||||
state.header = hooks.useDefaultHeader()
|
||||
if (type === "edit") {
|
||||
applyForm.faceImg = [];
|
||||
uploadFileUrl.value = "";
|
||||
await getDetail();
|
||||
}
|
||||
});
|
||||
onShow(() => {});
|
||||
onShow(() => { });
|
||||
|
||||
const getDetail = async () => {
|
||||
if (isEmpty(state.detailId)) return;
|
||||
const { data } = await faceApi.get({ id: state.detailId });
|
||||
if (!isEmpty(data)) {
|
||||
applyForm.faceImg = [data.faceImg];
|
||||
uploadFileUrl.value = data.faceImg;
|
||||
const img = filePath(data.faceImg)
|
||||
applyForm.faceImg = [img]
|
||||
uploadFileUrl.value = img
|
||||
}
|
||||
};
|
||||
|
||||
const beforeComplete = (uploadFile: any) => {
|
||||
if (JSON.parse(uploadFile.data).code == 0) {
|
||||
uploadFileUrl.value = JSON.parse(uploadFile.data).data;
|
||||
uploadFileUrl.value = JSON.parse(uploadFile.data).data.url;
|
||||
return true;
|
||||
} else {
|
||||
uploadFileUrl.value = "";
|
||||
@@ -55,7 +59,6 @@ const doSubmit = async () => {
|
||||
applyFormRef.value.submit();
|
||||
const { isPass } = applyFormRef.value.validate();
|
||||
if (!isPass || !uploadFileUrl.value) return;
|
||||
|
||||
try {
|
||||
uni.showLoading({ title: "提交中...", mask: false });
|
||||
const { data, code }: any =
|
||||
@@ -80,21 +83,14 @@ const doSubmit = async () => {
|
||||
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
|
||||
<tm-form-item name="faceImg" label="人脸图片" :required="false" :showBottom="false">
|
||||
<view class="h-10rpx" />
|
||||
<tm-upload-photo
|
||||
:rangUrl="applyForm.faceImg[0]"
|
||||
:beforeComplete="beforeComplete"
|
||||
v-model="applyForm.faceImg"
|
||||
:maxCount="1"
|
||||
:url="uploadPhotoBaseUrl + '/infra/file/upload'"
|
||||
/>
|
||||
<tm-upload-photo :header="state.header" :rangUrl="applyForm.faceImg[0]" :beforeComplete="beforeComplete"
|
||||
v-model="applyForm.faceImg" :maxCount="1" :url="'/api/admin/sys-file/upload'" />
|
||||
</tm-form-item>
|
||||
</tm-form>
|
||||
</view>
|
||||
<view
|
||||
v-if="state.detailType != 'view'"
|
||||
<view v-if="state.detailType != 'view'"
|
||||
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
|
||||
@tap="doSubmit"
|
||||
>
|
||||
@tap="doSubmit">
|
||||
{{ state.detailId ? "修改" : "提交" }}
|
||||
</view>
|
||||
</crud-layout>
|
||||
@@ -1,39 +1,3 @@
|
||||
<template>
|
||||
<crud-layout title="人脸管理" bg="/static/page/blue-bg.png">
|
||||
<z-paging
|
||||
ref="pageRef"
|
||||
height="100%"
|
||||
:fixed="false"
|
||||
v-model="pageHook.list"
|
||||
:default-page-size="10"
|
||||
safe-area-inset-bottom
|
||||
:loading-more-enabled="true"
|
||||
:show-scrollbar="false"
|
||||
@query="query"
|
||||
:auto-clean-list-when-reload="false"
|
||||
:auto-scroll-to-top-when-reload="false"
|
||||
@scroll="pageHook.scroll"
|
||||
>
|
||||
<view class="h-20rpx" />
|
||||
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="v.id">
|
||||
<view class="flex items-center justify-between second-text-26">
|
||||
<image class="w-100rpx h-100rpx rounded-50rpx" :src="v.faceImg" />
|
||||
<text class="font-600">{{ v.username }}</text>
|
||||
<text class="botder_btn" @click="doEdit(v.id)">修改</text>
|
||||
<tm-modal title="确定删除吗?" height="auto" @confirm="doDel(v.id)">
|
||||
<template v-slot:trigger><text class="botder_btn">删除</text></template>
|
||||
</tm-modal>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template #bottom>
|
||||
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!" @tap="doAdd">添加</view>
|
||||
<view class="h-30rpx" />
|
||||
</template>
|
||||
</z-paging>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
@@ -41,6 +5,8 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { hooks, router } from "@@/index";
|
||||
import { faceApi } from "@@/api";
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
const state = reactive<any>({
|
||||
pa: {
|
||||
pagesize: 10,
|
||||
@@ -48,12 +14,12 @@ const state = reactive<any>({
|
||||
});
|
||||
|
||||
const pageRef = ref<any>(null);
|
||||
const pageHook = hooks.usePage(pageRef, faceApi.page, null, "data.list");
|
||||
const pageHook = hooks.usePage(pageRef, faceApi.page, null, "data.records");
|
||||
const query = (page: number, pagesize: number) => {
|
||||
pageHook.startPage(page, pagesize, false, state.pa);
|
||||
};
|
||||
|
||||
onLoad(() => {});
|
||||
onLoad(() => { });
|
||||
onShow(() => {
|
||||
if (pageRef.value) {
|
||||
pageRef.value.reload(false);
|
||||
@@ -61,11 +27,11 @@ onShow(() => {
|
||||
});
|
||||
|
||||
const doAdd = () => {
|
||||
router.jump("/pages/humanFace/apply");
|
||||
router.jump("/pages/human-face/apply");
|
||||
};
|
||||
|
||||
const doEdit = (id: string) => {
|
||||
router.jump("/pages/humanFace/apply", { type: "edit", id });
|
||||
router.jump("/pages/human-face/apply", { type: "edit", id });
|
||||
};
|
||||
|
||||
const doDel = (id: string) => {
|
||||
@@ -80,3 +46,34 @@ const doDel = (id: string) => {
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<crud-layout title="人脸管理" bg="/static/page/blue-bg.png">
|
||||
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
|
||||
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
|
||||
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
|
||||
<view class="h-20rpx" />
|
||||
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="v.id">
|
||||
<view class="flex items-center justify-between second-text-26">
|
||||
<div class="flex items-center">
|
||||
<image mode="aspectFill" class="w-100rpx h-100rpx rounded-50rpx" :src="filePath(v.faceImg)" />
|
||||
<view class="w-30rpx" />
|
||||
<text class="font-600">{{ v.username }}</text>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<text class="botder_btn" @click="doEdit(v.id)">修改</text>
|
||||
<view class="w-30rpx" />
|
||||
<tm-modal title="确定删除吗?" height="auto" @confirm="doDel(v.id)">
|
||||
<template v-slot:trigger><text class="botder_btn">删除</text></template>
|
||||
</tm-modal>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
<template #bottom>
|
||||
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
|
||||
@tap="doAdd">添加</view>
|
||||
<view class="h-30rpx" />
|
||||
</template>
|
||||
</z-paging>
|
||||
</crud-layout>
|
||||
</template>
|
||||
+7
-10
@@ -10,10 +10,9 @@ const data = {
|
||||
serviceList: [
|
||||
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
|
||||
{ text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
|
||||
// { text: '车牌管理', icon: '/static/icon/service_2.png', router: '/pages/user/diff-price' },
|
||||
{ text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
|
||||
{ text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" },
|
||||
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/humanFace/list" },
|
||||
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" },
|
||||
{ text: "测试登录", icon: "/static/icon/login.png", router: "/pages/test/login" },
|
||||
],
|
||||
};
|
||||
@@ -116,7 +115,8 @@ const doLogout = async () => {
|
||||
<template>
|
||||
<crud-layout title="我的" bg="/static/page/blue-bg.png">
|
||||
<view class="flex-row items-center">
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-if="state.userInfo.avatar" :src="state.userInfo.avatar" mode="aspectFill" />
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-if="state.userInfo.avatar" :src="state.userInfo.avatar"
|
||||
mode="aspectFill" />
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png" mode="aspectFill" />
|
||||
<view class="m-l-30rpx" v-if="state.userInfo.id">
|
||||
<view class="flex-row items-center">
|
||||
@@ -132,12 +132,8 @@ const doLogout = async () => {
|
||||
</view>
|
||||
|
||||
<view class="m-t-40rpx rounded-20rpx shadow-main p-30rpx p-b-40rpx bg-white!">
|
||||
<view
|
||||
class="service_item flex-row items-center justify-between"
|
||||
v-for="(v, i) in data.serviceList"
|
||||
:key="i"
|
||||
@tap="router.jump(v.router)"
|
||||
>
|
||||
<view class="service_item flex-row items-center justify-between" v-for="(v, i) in data.serviceList" :key="i"
|
||||
@tap="router.jump(v.router)">
|
||||
<view class="flex-row-center">
|
||||
<image class="w-40rpx h-40rpx" :src="v.icon" mode="aspectFill" />
|
||||
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
|
||||
@@ -147,7 +143,8 @@ const doLogout = async () => {
|
||||
</view>
|
||||
|
||||
<view class="flex-col-center m-t-40rpx m-x-30rpx">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff" @tap="doLogout">
|
||||
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
|
||||
@tap="doLogout">
|
||||
退出登录
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -32,6 +32,7 @@ const doSubmit = async () => {
|
||||
if (!isPass) return;
|
||||
const tokenKey = constant.storageConstant.TOKEN;
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
uni.removeStorageSync(tokenKey)
|
||||
uni.showLoading({ title: "登录中...", mask: true });
|
||||
const res = await userApi.login({
|
||||
...applyForm,
|
||||
|
||||
+8
-17
@@ -3,7 +3,7 @@ import request from "@/sheep/utils/request";
|
||||
export default {
|
||||
foreignList: (params: any) =>
|
||||
request({
|
||||
url: "pay/foreign-ticket/get-all",
|
||||
url: "wallet/wallet-foreign/app/page-join",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -12,16 +12,16 @@ export default {
|
||||
}),
|
||||
foreignDetail: (params: any) =>
|
||||
request({
|
||||
url: "pay/foreign-ticket/get-detail",
|
||||
url: "wallet/wallet-foreign/app/detail",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
foreignItems: (params: any) =>
|
||||
codeList: (params: any) =>
|
||||
request({
|
||||
url: "pay/foreign-ticket/get-items",
|
||||
url: "wallet/wallet-code-use/app/code-list",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
}),
|
||||
foreignApply: (data: any) =>
|
||||
request({
|
||||
url: "pay/foreign-ticket/apply",
|
||||
url: "wallet/wallet-foreign/app/apply",
|
||||
method: "POST",
|
||||
data,
|
||||
custom: {
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
}),
|
||||
strideList: (params: any) =>
|
||||
request({
|
||||
url: "pay/stride-dept/get-all",
|
||||
url: "wallet/wallet-stride/app/page-join",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -48,16 +48,7 @@ export default {
|
||||
}),
|
||||
strideDetail: (params: any) =>
|
||||
request({
|
||||
url: "pay/stride-dept/get-detail",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
strideItems: (params: any) =>
|
||||
request({
|
||||
url: "pay/stride-dept/get-items",
|
||||
url: "wallet/wallet-stride/app/detail",
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -66,7 +57,7 @@ export default {
|
||||
}),
|
||||
strideApply: (data: any) =>
|
||||
request({
|
||||
url: "pay/stride-dept/apply",
|
||||
url: "wallet/wallet-stride/app/apply",
|
||||
method: "POST",
|
||||
data,
|
||||
custom: {
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from "@/sheep/utils/request";
|
||||
export default {
|
||||
page: (params: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-page-join`,
|
||||
url: `/admin/user-face/app/page-join`,
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
}),
|
||||
del: (params: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-delete`,
|
||||
url: `/admin/user-face/app`,
|
||||
method: "DELETE",
|
||||
params,
|
||||
custom: {
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
}),
|
||||
create: (data: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-create`,
|
||||
url: `/admin/user-face/app`,
|
||||
method: "POST",
|
||||
data,
|
||||
custom: {
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
}),
|
||||
get: (params: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-get`,
|
||||
url: `/admin/user-face/app/detail`,
|
||||
method: "GET",
|
||||
params,
|
||||
custom: {
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
}),
|
||||
put: (data: any) =>
|
||||
request({
|
||||
url: `/sys/user/face-update`,
|
||||
url: `/admin/user-face/app`,
|
||||
method: "PUT",
|
||||
data,
|
||||
custom: {
|
||||
|
||||
@@ -9,3 +9,5 @@ export * from "./use-page";
|
||||
export * from "./use-phone";
|
||||
|
||||
export * from "./use-unit";
|
||||
|
||||
export * from "./use-token";
|
||||
@@ -1,6 +1,11 @@
|
||||
import { filePath } from "../utils/file";
|
||||
|
||||
export const usePreviewImage = (str: string | undefined) => {
|
||||
console.log(str, "str");
|
||||
|
||||
if (str == undefined) return;
|
||||
let urlList = str.split(",");
|
||||
let urlList = str.split(",").map((v) => filePath(v));
|
||||
console.log(urlList);
|
||||
uni.previewImage({
|
||||
urls: urlList,
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import storageConstant from "../constant/storage-constant";
|
||||
|
||||
export const useToken = () => {
|
||||
const tokenKey = storageConstant.TOKEN;
|
||||
const tokenStorage = uni.getStorageSync(tokenKey);
|
||||
if (!tokenStorage.access_token) return "";
|
||||
return `Bearer ${tokenStorage.access_token}`;
|
||||
};
|
||||
|
||||
export const useDefaultHeader = () => {
|
||||
const token = useToken();
|
||||
return {
|
||||
"TENANT-ID": "1",
|
||||
"CLIENT-TOC": "Y",
|
||||
Authorization: token,
|
||||
};
|
||||
};
|
||||
@@ -154,15 +154,15 @@ http.interceptors.response.use(
|
||||
return Promise.resolve(response.data);
|
||||
},
|
||||
(error) => {
|
||||
let errorMessage = "";
|
||||
console.log(error);
|
||||
|
||||
let errorMessage = error.data.msg;
|
||||
if (error !== undefined) {
|
||||
if (errorMessage) {
|
||||
uni.showToast({
|
||||
title: errorMessage || "",
|
||||
icon: "none",
|
||||
mask: true,
|
||||
});
|
||||
}
|
||||
uni.showToast({
|
||||
title: errorMessage || "",
|
||||
icon: "none",
|
||||
mask: true,
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user