修改token
parent
b83976b5d1
commit
6e741f941b
|
|
@ -1,4 +1,5 @@
|
|||
<script>
|
||||
// import { useUserStoreWithOut } from "@/store/modules/user";
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "业绩数据"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "upload/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传数据"
|
||||
|
|
@ -127,6 +128,12 @@
|
|||
"navigationBarTitleText": "清洁任务提交"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "task_ledgers_submit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "数据上报"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
|
|
@ -134,7 +141,8 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},{
|
||||
},
|
||||
{
|
||||
"root": "pages/expense-account",
|
||||
"pages": [
|
||||
{
|
||||
|
|
@ -142,14 +150,16 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "报销管理"
|
||||
}
|
||||
},{
|
||||
},
|
||||
{
|
||||
"path": "submit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "报销提交"
|
||||
}
|
||||
}
|
||||
]
|
||||
},{
|
||||
},
|
||||
{
|
||||
"root": "pages/work",
|
||||
"pages": [
|
||||
{
|
||||
|
|
@ -167,7 +177,7 @@
|
|||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColorTop":"#FFFFFF",
|
||||
"backgroundColorTop": "#FFFFFF",
|
||||
"app-plus": {
|
||||
"bounce": "none",
|
||||
"scrollIndicator": "none"
|
||||
|
|
|
|||
|
|
@ -44,17 +44,17 @@ import { useUserStore } from '@/store/modules/user'
|
|||
const userStore = useUserStore()
|
||||
|
||||
const form = ref({
|
||||
username: 'admin',
|
||||
password: 'admin',
|
||||
username: '',
|
||||
password: '',
|
||||
})
|
||||
|
||||
const handleClick = async () => {
|
||||
try {
|
||||
const { username, password } = form.value
|
||||
await userStore.login({
|
||||
username,
|
||||
password,
|
||||
})
|
||||
// const { username, password } = form.value
|
||||
// await userStore.login({
|
||||
// username,
|
||||
// password,
|
||||
// })
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
<template>
|
||||
<view>
|
||||
<CuNavbar title="上报"></CuNavbar>
|
||||
<CuNavbar :isBack="isBack" title="上报"></CuNavbar>
|
||||
<uv-sticky>
|
||||
<view class="bg-white h-80rpx flex items-center px-base">
|
||||
<view>2024-03-21</view>
|
||||
<uv-icon class="ml-10rpx" size="20rpx" name="arrow-down-fill"></uv-icon>
|
||||
</view>
|
||||
</uv-sticky>
|
||||
{{ store.is_lottery_store }}
|
||||
<uv-form
|
||||
class="mt-30rpx"
|
||||
labelPosition="left"
|
||||
|
|
@ -14,6 +15,22 @@
|
|||
labelWidth="130rpx"
|
||||
>
|
||||
<view class="px-base space-y-20rpx">
|
||||
<view class="card">
|
||||
<view class="pl-20rpx">
|
||||
<uv-form-item label="日期" prop="userInfo.sex">
|
||||
<uv-input
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择日期"
|
||||
:border="`none`"
|
||||
>
|
||||
</uv-input>
|
||||
<template v-slot:right>
|
||||
<uv-icon name="arrow-right"></uv-icon>
|
||||
</template>
|
||||
</uv-form-item>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<TitleComp title="电彩"></TitleComp>
|
||||
<view class="pl-20rpx">
|
||||
|
|
@ -101,13 +118,55 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { http } from '@/utils/request'
|
||||
import CuNavbar from '@/components/cu-navbar/index'
|
||||
import TitleComp from '@/components/title-comp/index'
|
||||
import { addUnit, sys } from '@climblee/uv-ui/libs/function/index'
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref, onBeforeMount, reactive } from 'vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const userInfo = computed(() => userStore.userInfo || {})
|
||||
const store = computed(() => userInfo.value.store)
|
||||
|
||||
const form = reactive({
|
||||
dateTime: Number(new Date()),
|
||||
items: [],
|
||||
new_customers: '',
|
||||
sales: '',
|
||||
expenditure: '',
|
||||
handover_amount: '',
|
||||
photos: [],
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
isBack: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
const style = computed(() => {
|
||||
const style = {}
|
||||
style.bottom = addUnit(sys().windowBottom, 'px')
|
||||
return style
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
if (!store.value.is_lottery_store) {
|
||||
getTypeList()
|
||||
}
|
||||
})
|
||||
|
||||
const getTypeList = () => {
|
||||
http
|
||||
.get('/keywords', {
|
||||
params: {
|
||||
parent_key: 'lottery_type',
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ const tabList = ref([
|
|||
{
|
||||
name: '任务审核',
|
||||
apiUrl: '/workflow',
|
||||
params: {},
|
||||
params: {
|
||||
// aaa:111
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
|
|
|
|||
|
|
@ -87,19 +87,28 @@ const onSubmit = async () => {
|
|||
if (loading.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const resData = await http.post(`/tasks/${id.value}/submit`, {
|
||||
id: id.value,
|
||||
description: form.description,
|
||||
photos: form.photos.map((item) => item.url),
|
||||
await http.request({
|
||||
url: `/tasks/${id.value}/submit`,
|
||||
method: 'POST',
|
||||
header: {
|
||||
Accept: 'application/json',
|
||||
},
|
||||
data: {
|
||||
task_hygiene: {
|
||||
description: form.description,
|
||||
photos: form.photos.map((item) => item.url),
|
||||
},
|
||||
},
|
||||
})
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'none',
|
||||
})
|
||||
formRef.value.resetFields()
|
||||
uni.$emit('ex:submit', resData)
|
||||
uni.$emit('task:submit', resData)
|
||||
uni.navigateBack()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<template>
|
||||
<view>
|
||||
<RevertPage :isBack="true"></RevertPage>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import RevertPage from "@/pages/revert/index";
|
||||
</script>
|
||||
|
|
@ -6,7 +6,8 @@ export const useUserStore = defineStore({
|
|||
id: 'app-user',
|
||||
state: () => ({
|
||||
userInfo: null,
|
||||
token: null,
|
||||
token: '22|ua3STGluZFzDeV1nOs4I3S9s2UCDtQp9AtVLT2jN0535e0a5',
|
||||
roles: []
|
||||
}),
|
||||
getters: {
|
||||
getUserInfo(state) {
|
||||
|
|
@ -35,6 +36,7 @@ export const useUserStore = defineStore({
|
|||
return new Promise((resolve, reject) => {
|
||||
http.get('/auth/profile').then(async (res) => {
|
||||
this.userInfo = res
|
||||
this.roles = res.role
|
||||
resolve(res);
|
||||
}).catch(err => {
|
||||
reject(err);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ http.interceptors.response.use(async (response) => {
|
|||
|
||||
// 处理响应结果
|
||||
const { statusCode, data } = response
|
||||
if (statusCode !== 200 && statusCode !== 201) {
|
||||
if (statusCode >= 400) {
|
||||
uni.showToast({
|
||||
title: data.message || '服务器错误',
|
||||
icon: 'none'
|
||||
|
|
|
|||
Loading…
Reference in New Issue