u
This commit is contained in:
1 parent
26721a142e
commit
840d33ef3b
32 files changed
+2068
-590
No files matched your search
@@ -3,10 +3,17 @@ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { loadTianDiTu } from '@/utils/tdl-loader'
|
||||
import { useUserStore } from './store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
// const userStore = useUserStore()
|
||||
|
||||
onLaunch(() => {
|
||||
userStore.requireLogin()
|
||||
// userStore.requireLogin()
|
||||
})
|
||||
|
||||
onLoad(async (options) => {
|
||||
// options 会包含 orgid 和 bid
|
||||
const { orgid, bid } = options
|
||||
|
||||
console.log(options)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"vueVersion": "3",
|
||||
"h5": {
|
||||
"router": {
|
||||
"base": "/g3cdjtd-app/"
|
||||
"base": "/g3ocr-app/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<!-- <script setup lang="ts">
|
||||
import type { UploadFile, UploadFileItem } from 'sard-uniapp'
|
||||
import { dialog, isImageUrl, isVideoUrl, toast } from 'sard-uniapp'
|
||||
import { aliyunpluploadApi, delSubRecordApi, loaddataAttachApi } from '@/request/api'
|
||||
@@ -159,4 +159,17 @@ function onRemove(index: number, item: UploadFileItem) {
|
||||
.file {
|
||||
padding: 36rpx;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class=""></view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
@@ -56,36 +56,11 @@ async function onSubmit() {
|
||||
icon: 'success',
|
||||
})
|
||||
|
||||
uni.switchTab({
|
||||
uni.navigateTo({
|
||||
// url: '/pages-sub/upload/index',
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
}
|
||||
|
||||
// if (!res?.data) {
|
||||
// toast.fail('登录失败,请检查账号密码')
|
||||
// return
|
||||
// }
|
||||
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// orgid: formModel.orgid,
|
||||
// userid: formModel.userid,
|
||||
// token: res.data,
|
||||
// }
|
||||
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// username,
|
||||
// }
|
||||
|
||||
// uni.showToast({
|
||||
// title: '登录成功',
|
||||
// icon: 'success',
|
||||
// })
|
||||
|
||||
// uni.switchTab({
|
||||
// url: '/pages/home/index',
|
||||
// })
|
||||
}
|
||||
catch (err: any) {
|
||||
// 表单验证错误
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import type { FieldValidateError, FormExpose, FormRules } from 'sard-uniapp'
|
||||
import { getWindowInfo, toast } from 'sard-uniapp'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { loaddataApi, saveobjtApi } from '@/request/api'
|
||||
import { loadDataApi, updatePasswordApi } from '@/request/api'
|
||||
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -33,46 +34,12 @@ async function onSubmit() {
|
||||
|
||||
submitLoading.value = true
|
||||
|
||||
const searchcondition = `b_id = '${userStore.userInfo.userid}' AND ISNULL(b_password, '') = ISNULL('${formModel.oldPassword}', '')`
|
||||
|
||||
const searchRes = await loaddataApi({
|
||||
viewname: 'v_mini_loginid',
|
||||
searchcondition: `${searchcondition}`,
|
||||
orderfield: 'b_id',
|
||||
soption: '',
|
||||
const saveobjtRes = await updatePasswordApi({
|
||||
oldPassword: formModel.oldPassword,
|
||||
newPassword: formModel.newPassword,
|
||||
})
|
||||
|
||||
if (!searchRes.data || searchRes.data.length === 0) {
|
||||
toast.fail('旧密码错误,请重新输入')
|
||||
return
|
||||
}
|
||||
|
||||
const updateObj = {
|
||||
b_id: userStore.userInfo.userid,
|
||||
b_password: formModel.newPassword,
|
||||
}
|
||||
|
||||
const tables = []
|
||||
const insertValues = []
|
||||
const updateValues = []
|
||||
const delValues = []
|
||||
const keys = []
|
||||
|
||||
tables.push('b_truck')
|
||||
insertValues.push('[]')
|
||||
updateValues.push(JSON.stringify([updateObj]))
|
||||
delValues.push('[]')
|
||||
keys.push('b_id')
|
||||
|
||||
const saveobjtRes = await saveobjtApi({
|
||||
tables,
|
||||
insertValues,
|
||||
delValues,
|
||||
updateValues,
|
||||
keys,
|
||||
})
|
||||
|
||||
if (saveobjtRes.data === 'OK') {
|
||||
if (saveobjtRes.success) {
|
||||
toast.success('密码修改成功,请重新登录')
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -210,7 +210,7 @@ async function handleConfirm() {
|
||||
b_container_no: form.value.containerNo,
|
||||
b_container_img: form.value.containerImageUrl,
|
||||
b_ocr_no: form.value.ocrNo,
|
||||
b_ocr_score: form.value.ocrScore,
|
||||
b_ocr_score: form.value.ocrScore || 0.00,
|
||||
}
|
||||
|
||||
const fileInserts = []
|
||||
|
||||
@@ -76,7 +76,7 @@ function deleteAliyunFiles() {
|
||||
/>
|
||||
</view>
|
||||
<view v-if="userStore.isLogined" class="grid-container">
|
||||
<sar-grid :columns="2" gap="24rpx">
|
||||
<sar-grid :columns="1" gap="24rpx">
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/upload/index')"
|
||||
>
|
||||
@@ -86,10 +86,6 @@ function deleteAliyunFiles() {
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
</sar-grid>
|
||||
|
||||
<sar-button @click="deleteAliyunFiles">
|
||||
删除附件
|
||||
</sar-button>
|
||||
</view>
|
||||
<sar-result v-else status="warning" title="尚未登陆" style="margin-top: 32rpx;">
|
||||
<sar-button
|
||||
|
||||
@@ -72,3 +72,23 @@ export function saveObjectApi(params: SaveObjectParams[]) {
|
||||
export function getUniqueIdApi() {
|
||||
return httpPost<number>('/data/getUniqueId')
|
||||
}
|
||||
|
||||
interface LoadDataParams {
|
||||
viewName: string
|
||||
searchCondition: string
|
||||
orderField: string
|
||||
searchColumns: string[]
|
||||
}
|
||||
|
||||
export function loadDataApi(params: LoadDataParams) {
|
||||
return httpPost<any[]>('/data/loadData', params)
|
||||
}
|
||||
|
||||
interface UpdatePasswordParams {
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
export function updatePasswordApi(params: UpdatePasswordParams) {
|
||||
return httpPost(`/auth/updatePassword`, params)
|
||||
}
|
||||
@@ -18,7 +18,7 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
// H5:用 request 请求,带时间戳保证最新
|
||||
const timestamp = Date.now()
|
||||
uni.request({
|
||||
url: `/g3cdjtd-app/static/db.json?t=${timestamp}`,
|
||||
url: `/g3ocr-app/static/db.json?t=${timestamp}`,
|
||||
method: 'GET',
|
||||
success: r => res(r.data as Record<string, string>),
|
||||
fail: err => rej(err),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"g3hd": "http://127.0.0.1:8085/api"
|
||||
// "g3hd": "http://ser369.g3soft.cn:80/api",
|
||||
"g3hd": "http://192.168.1.137:80/api"
|
||||
}
|
||||
Reference in new issue
Block a user