Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
748424ad
提交
748424ad
authored
4月 07, 2025
作者:
JaxBBLL
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://git.yfzx.zjtys.com.cn/privateNetwork/inspection-pad-web
into dev
上级
2741c629
e0ecdcbc
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
435 行增加
和
392 行删除
+435
-392
init.js
api/sqllite/init.js
+154
-159
table.js
api/sqllite/table.js
+220
-201
user.js
api/user.js
+2
-2
user.json
baseData/user.json
+43
-30
login.vue
pages/login/login.vue
+6
-0
sqllitedb.js
utils/sqllitedb.js
+10
-0
没有找到文件。
api/sqllite/init.js
浏览文件 @
748424ad
import
table
from
"../sqllite/table"
;
import
_Path
from
"@/constant/ioPath"
;
import
ioUtil
from
"@/utils/ioUtil"
;
import
SqlliteDbUtil
from
"@/utils/sqllitedb"
;
import
userApi
from
"@/api/user"
;
import
hoistwayApi
from
"@/api/hoistway"
;
import
assRoomApi
from
"@/api/assRoom.js"
;
import
hoistwayjson
from
"../../baseData/hoistway.json"
;
import
userjson
from
"../../baseData/user.json"
;
import
assroomjson
from
"../../baseData/assroom.json"
;
import
fileImport
from
"@/utils/fileImport.js"
;
import
table
from
'../sqllite/table'
import
_Path
from
'@/constant/ioPath'
import
ioUtil
from
'@/utils/ioUtil'
import
SqlliteDbUtil
from
'@/utils/sqllitedb'
import
userApi
from
'@/api/user'
import
hoistwayApi
from
'@/api/hoistway'
import
assRoomApi
from
'@/api/assRoom.js'
import
hoistwayjson
from
'../../baseData/hoistway.json'
import
userjson
from
'../../baseData/user.json'
import
assroomjson
from
'../../baseData/assroom.json'
import
fileImport
from
'@/utils/fileImport.js'
export
default
{
// app初始化
async
init
()
{
uni
.
showLoading
({
title
:
"正在初始化..."
,
});
// 初始化目录
await
this
.
initDir
();
// 初始化数据库
// cookie.set('initDB', true)
await
this
.
initSqlLite
();
// 导入用戶文件文件
// await this.importFileData();
await
userApi
.
saveBatch
(
userjson
);
await
hoistwayApi
.
saveBatch
(
hoistwayjson
);
await
assRoomApi
.
saveBatch
(
assroomjson
);
// 初始化完成通知首页
uni
.
$emit
(
"initDone"
,
"ok"
);
uni
.
hideLoading
();
},
// app初始化
async
init
()
{
// 检查文件导入
async
importFileData
()
{
// 解压缩需要导入的zip,导入后删除
try
{
console
.
log
(
"解压导入开始...."
);
console
.
log
(
"导入基础数据开始"
);
await
fileImport
.
importBaseFile
();
console
.
log
(
"导入基础数据结束!"
);
console
.
log
(
"解压导入完成...."
);
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
uni
.
showToast
({
icon
:
"none"
,
title
:
e
.
message
,
});
uni
.
hideLoading
();
}
},
uni
.
showLoading
({
title
:
'正在初始化...'
,
})
// 初始化目录
await
this
.
initDir
()
// 初始化数据库
await
this
.
initSqlLite
()
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
()
let
isInit
=
await
SqlliteDbUtil
.
checkIfDataImported
(
sqllitedb
)
if
(
!
isInit
)
{
await
userApi
.
saveBatch
(
userjson
)
await
hoistwayApi
.
saveBatch
(
hoistwayjson
)
await
assRoomApi
.
saveBatch
(
assroomjson
)
await
SqlliteDbUtil
.
markDataAsImported
(
sqllitedb
)
}
// 初始化完成通知首页
uni
.
hideLoading
()
},
////////// 初始化数据库////////////
async
initSqlLite
()
{
console
.
log
(
"初始化数据库开始..."
);
let
sqllitedb
=
null
;
try
{
// 创建打开数据库,已经存在表则跳过
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
();
console
.
log
(
sqllitedb
,
"是否存在"
);
// console.log('创建用户表...')
await
sqllitedb
.
createTable
(
table
.
userName
,
table
.
user
);
await
sqllitedb
.
createTable
(
table
.
inspectionRecordName
,
table
.
inspectionRecord
);
// 巡检记录表
await
sqllitedb
.
createTable
(
table
.
assRoomName
,
table
.
assRoom
);
// 机房、井道信息表
await
sqllitedb
.
createTable
(
table
.
assBuildingName
,
table
.
assBuilding
);
// 楼宇信息
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
finally
{
return
;
// 关闭数据库
if
(
sqllitedb
)
{
await
sqllitedb
.
closeDB
();
}
// 初始化完成后重启APP/退出APP
uni
.
showToast
({
icon
:
"none"
,
title
:
"初始化完毕即将重新加载..."
,
duration
:
3000
,
});
let
that
=
this
;
setTimeout
(
function
()
{
that
.
restartApp
();
},
3000
);
}
},
// 检查文件导入
async
importFileData
()
{
// 解压缩需要导入的zip,导入后删除
try
{
console
.
log
(
'解压导入开始....'
)
console
.
log
(
'导入基础数据开始'
)
await
fileImport
.
importBaseFile
()
console
.
log
(
'导入基础数据结束!'
)
console
.
log
(
'解压导入完成....'
)
}
catch
(
e
)
{
console
.
log
(
e
.
message
)
uni
.
showToast
({
icon
:
'none'
,
title
:
e
.
message
})
uni
.
hideLoading
()
}
},
// 初始化目录
async
initDir
()
{
try
{
const
_www
=
_Path
.
getPrivateWWW
();
const
_doc
=
_Path
.
getPrivateDOC
();
const
_download
=
_Path
.
getDownloads
();
const
_temp
=
_Path
.
getTempPath
();
const
wwwEntry
=
await
ioUtil
.
getFileEntry
(
_www
);
const
docEntry
=
await
ioUtil
.
getFileEntry
(
_doc
);
const
downloadEntry
=
await
ioUtil
.
getFileEntry
(
_download
);
////////// 初始化数据库////////////
async
initSqlLite
()
{
console
.
log
(
'初始化数据库开始...'
)
let
sqllitedb
=
null
try
{
// 创建打开数据库,已经存在表则跳过
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
()
console
.
log
(
sqllitedb
,
'是否存在'
)
// console.log('创建用户表...')
await
sqllitedb
.
createTable
(
table
.
metadataName
,
table
.
metadata
)
await
sqllitedb
.
createTable
(
table
.
userName
,
table
.
user
)
await
sqllitedb
.
createTable
(
table
.
inspectionRecordName
,
table
.
inspectionRecord
)
// 巡检记录表
await
sqllitedb
.
createTable
(
table
.
assRoomName
,
table
.
assRoom
)
// 机房、井道信息表
await
sqllitedb
.
createTable
(
table
.
assBuildingName
,
table
.
assBuilding
)
// 楼宇信息
}
catch
(
e
)
{
console
.
log
(
e
.
message
)
}
finally
{
return
// 关闭数据库
if
(
sqllitedb
)
{
await
sqllitedb
.
closeDB
()
}
// 初始化完成后重启APP/退出APP
uni
.
showToast
({
icon
:
'none'
,
title
:
'初始化完毕即将重新加载...'
,
duration
:
3000
})
let
that
=
this
setTimeout
(
function
()
{
that
.
restartApp
()
},
3000
)
}
},
if
(
downloadEntry
)
{
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
"base"
);
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
"export"
);
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
"import"
);
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
"doc"
);
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
"error"
);
}
// 初始化目录
async
initDir
()
{
try
{
const
_www
=
_Path
.
getPrivateWWW
()
const
_doc
=
_Path
.
getPrivateDOC
()
const
_download
=
_Path
.
getDownloads
()
const
_temp
=
_Path
.
getTempPath
()
const
wwwEntry
=
await
ioUtil
.
getFileEntry
(
_www
)
const
docEntry
=
await
ioUtil
.
getFileEntry
(
_doc
)
const
downloadEntry
=
await
ioUtil
.
getFileEntry
(
_download
)
// 获取设备名称
uni
.
getSystemInfo
({
success
:
async
function
(
e
)
{
const
deviceData
=
{
deviceId
:
e
.
deviceId
,
brand
:
e
.
deviceBrand
,
deviceModel
:
e
.
deviceModel
,
};
const
deviceFilePath
=
downloadEntry
.
fullPath
+
"name.txt"
;
await
ioUtil
.
removeExistFile
(
deviceFilePath
);
await
ioUtil
.
writeFile
(
"name.txt"
,
downloadEntry
,
JSON
.
stringify
(
deviceData
)
);
},
});
if
(
downloadEntry
)
{
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
'base'
)
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
'export'
)
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
'import'
)
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
'doc'
)
await
ioUtil
.
createDir
(
downloadEntry
.
fullPath
,
'error'
)
}
// 文件目录
if
(
docEntry
)
{
await
ioUtil
.
createDir
(
docEntry
.
fullPath
,
"file"
);
}
// 获取设备名称
uni
.
getSystemInfo
({
success
:
async
function
(
e
)
{
const
deviceData
=
{
deviceId
:
e
.
deviceId
,
brand
:
e
.
deviceBrand
,
deviceModel
:
e
.
deviceModel
,
}
const
deviceFilePath
=
downloadEntry
.
fullPath
+
'name.txt'
await
ioUtil
.
removeExistFile
(
deviceFilePath
)
await
ioUtil
.
writeFile
(
'name.txt'
,
downloadEntry
,
JSON
.
stringify
(
deviceData
))
},
});
// 临时目录
let
tempEntry
=
await
ioUtil
.
getFileEntry
(
_temp
);
if
(
!
tempEntry
)
{
await
ioUtil
.
createDir
(
_temp
);
tempEntry
=
await
ioUtil
.
createDir
(
_Path
.
getTempParent
(),
"inspectTemp"
);
}
await
ioUtil
.
createDir
(
tempEntry
.
fullPath
,
"db"
);
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
},
// 重启app
restartApp
()
{
// #ifdef APP-PLUS
if
(
plus
.
os
.
name
.
toLowerCase
()
===
"android"
)
{
plus
.
runtime
.
restart
();
}
// #endif
},
// 文件目录
if
(
docEntry
)
{
await
ioUtil
.
createDir
(
docEntry
.
fullPath
,
'file'
)
}
// 退出app
exitApp
()
{
// #ifdef APP-PLUS
if
(
plus
.
os
.
name
.
toLowerCase
()
===
"android"
)
{
plus
.
runtime
.
quit
();
}
else
{
const
threadClass
=
plus
.
ios
.
importClass
(
"NSThread"
);
const
mainThread
=
plus
.
ios
.
invoke
(
threadClass
,
"mainThread"
);
plus
.
ios
.
invoke
(
mainThread
,
"exit"
);
// 或者如下
// plus.ios.import('UIApplication').sharedApplication().performSelector('exit');
}
// #endif
},
};
// 临时目录
let
tempEntry
=
await
ioUtil
.
getFileEntry
(
_temp
)
if
(
!
tempEntry
)
{
await
ioUtil
.
createDir
(
_temp
)
tempEntry
=
await
ioUtil
.
createDir
(
_Path
.
getTempParent
(),
'inspectTemp'
)
}
await
ioUtil
.
createDir
(
tempEntry
.
fullPath
,
'db'
)
}
catch
(
e
)
{
console
.
log
(
e
.
message
)
}
},
// 重启app
restartApp
()
{
// #ifdef APP-PLUS
if
(
plus
.
os
.
name
.
toLowerCase
()
===
'android'
)
{
plus
.
runtime
.
restart
();
}
// #endif
},
// 退出app
exitApp
()
{
// #ifdef APP-PLUS
if
(
plus
.
os
.
name
.
toLowerCase
()
===
'android'
)
{
plus
.
runtime
.
quit
();
}
else
{
const
threadClass
=
plus
.
ios
.
importClass
(
"NSThread"
);
const
mainThread
=
plus
.
ios
.
invoke
(
threadClass
,
"mainThread"
);
plus
.
ios
.
invoke
(
mainThread
,
"exit"
);
// 或者如下
// plus.ios.import('UIApplication').sharedApplication().performSelector('exit');
}
// #endif
}
}
\ No newline at end of file
api/sqllite/table.js
浏览文件 @
748424ad
module
.
exports
=
{
// 数据库设置
metadataName
:
'SYS_CONFIG'
,
metadata
:
[{
field
:
"key"
,
format
:
"TEXT PRIMARY KEY"
,
},
{
field
:
"value"
,
format
:
"TEXT"
,
}],
// 用户表
userName
:
"SYS_USER"
,
user
:
[{
field
:
"userId"
,
format
:
"TEXT"
,
format
:
"TEXT
PRIMARY KEY
"
,
},
{
field
:
"user
Name
"
,
field
:
"user"
,
format
:
"TEXT"
,
},
{
...
...
@@ -18,210 +27,219 @@ module.exports = {
format
:
"TEXT"
,
},
{
field
:
"password"
,
field
:
"passWord"
,
format
:
"TEXT"
,
},
{
field
:
"roleName"
,
format
:
"TEXT"
,
},
{
field
:
"unitName"
,
format
:
"TEXT"
,
},
{
field
:
"isAdmin"
,
format
:
"TEXT"
,
},
{
field
:
"
rememberPwd
"
,
field
:
"
LastSynchronizationTime
"
,
format
:
"TEXT"
,
},
],
// 巡检记录表
inspectionRecordName
:
"INSPECTION_RECORD"
,
inspectionRecord
:
[
{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"inspectionType"
,
format
:
"TEXT"
,
},
{
field
:
"recordName"
,
format
:
"TEXT"
,
},
{
field
:
"userId"
,
format
:
"TEXT"
,
},
{
field
:
"userName"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionTime"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionCode"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"isException"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionData"
,
format
:
"TEXT"
,
}
],
// 机房、井道信息表
assRoomName
:
"ASS_ROOM"
,
assRoom
:
[
{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"roomName"
,
format
:
"TEXT"
,
},
{
field
:
"buildingId"
,
format
:
"TEXT"
,
},
{
field
:
"buildingName"
,
format
:
"TEXT"
,
},
{
field
:
"roomType"
,
format
:
"TEXT"
,
},
{
field
:
"roomFile"
,
format
:
"TEXT"
,
},
{
field
:
"roomAddress"
,
format
:
"TEXT"
,
},
{
field
:
"keynoteFlag"
,
format
:
"TEXT"
,
},
{
field
:
"sort"
,
format
:
"TEXT"
,
},
{
field
:
"roomDesc"
,
format
:
"TEXT"
,
},
{
field
:
"remark"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
},
{
field
:
"SHOW"
,
format
:
"TEXT"
,
},
{
field
:
"roomFeature"
,
format
:
"TEXT"
,
},
{
field
:
"dictValue"
,
format
:
"TEXT"
,
}
],
// 楼宇信息
assBuildingName
:
"ASS_BUILDING"
,
assBuilding
:
[
{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"buildingName"
,
format
:
"TEXT"
,
},
{
field
:
"sort"
,
format
:
"TEXT"
,
},
{
field
:
"remark"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
}
]
inspectionRecordName
:
"INSPECTION_RECORD"
,
inspectionRecord
:
[{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"inspectionType"
,
format
:
"TEXT"
,
},
{
field
:
"recordName"
,
format
:
"TEXT"
,
},
{
field
:
"userId"
,
format
:
"TEXT"
,
},
{
field
:
"userName"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionTime"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionCode"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"isException"
,
format
:
"TEXT"
,
},
{
field
:
"inspectionData"
,
format
:
"TEXT"
,
}
],
// 机房、井道信息表
assRoomName
:
"ASS_ROOM"
,
assRoom
:
[{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"roomName"
,
format
:
"TEXT"
,
},
{
field
:
"buildingId"
,
format
:
"TEXT"
,
},
{
field
:
"buildingName"
,
format
:
"TEXT"
,
},
{
field
:
"roomType"
,
format
:
"TEXT"
,
},
{
field
:
"roomFile"
,
format
:
"TEXT"
,
},
{
field
:
"roomAddress"
,
format
:
"TEXT"
,
},
{
field
:
"keynoteFlag"
,
format
:
"TEXT"
,
},
{
field
:
"sort"
,
format
:
"TEXT"
,
},
{
field
:
"roomDesc"
,
format
:
"TEXT"
,
},
{
field
:
"remark"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
},
{
field
:
"SHOW"
,
format
:
"TEXT"
,
},
{
field
:
"roomFeature"
,
format
:
"TEXT"
,
},
{
field
:
"dictValue"
,
format
:
"TEXT"
,
}
],
// 楼宇信息
assBuildingName
:
"ASS_BUILDING"
,
assBuilding
:
[{
field
:
"id"
,
format
:
"TEXT NOT NULL"
,
},
{
field
:
"buildingName"
,
format
:
"TEXT"
,
},
{
field
:
"sort"
,
format
:
"TEXT"
,
},
{
field
:
"remark"
,
format
:
"TEXT"
,
},
{
field
:
"createTime"
,
format
:
"TEXT"
,
},
{
field
:
"createBy"
,
format
:
"TEXT"
,
},
{
field
:
"updateTime"
,
format
:
"TEXT"
,
},
{
field
:
"updateBy"
,
format
:
"TEXT"
,
},
{
field
:
"delFlag"
,
format
:
"TEXT"
,
},
{
field
:
"synFlag"
,
format
:
"TEXT"
,
}
]
};
\ No newline at end of file
api/user.js
浏览文件 @
748424ad
...
...
@@ -19,7 +19,7 @@ export default {
account
,
pwd
}
=
data
const
sql
=
`select * from
${
table
.
userName
}
where user
Name
= '
${
account
}
'`
const
sql
=
`select * from
${
table
.
userName
}
where user = '
${
account
}
'`
let
res
=
await
sqllitedb
.
selectSQL
(
sql
);
const
user
=
res
[
0
]
...
...
@@ -54,7 +54,7 @@ export default {
}
=
data
let
sqllitedb
=
await
SqlliteDbUtil
.
initSqlliteDB
()
const
[
current
]
=
await
sqllitedb
.
selectSQL
(
`select * from
${
table
.
userName
}
where userId = '
${
userId
}
' and user
Name
= '
${
userName
}
'`
,
[
userId
,
`select * from
${
table
.
userName
}
where userId = '
${
userId
}
' and user = '
${
userName
}
'`
,
[
userId
,
userName
]
);
...
...
baseData/user.json
浏览文件 @
748424ad
[
{
"userId"
:
1
,
"userName"
:
"姜安平"
,
"userType"
:
"normal"
,
"avatar"
:
""
,
"password"
:
"Jap@123"
,
"rememberPwd"
:
"0"
},
{
"userId"
:
2
,
"userName"
:
"段树梁"
,
"userType"
:
"sys_user"
,
"avatar"
:
""
,
"password"
:
"Dsl@123"
,
"rememberPwd"
:
"0"
},
{
"userId"
:
3
,
"userName"
:
"孔佳真"
,
"userType"
:
"sys_user"
,
"avatar"
:
""
,
"password"
:
"Kjz@123"
,
"rememberPwd"
:
"0"
},
{
"userId"
:
4
,
"userName"
:
"钟校明"
,
"userType"
:
"sys_user"
,
"avatar"
:
""
,
"password"
:
"Zxm@123"
,
"rememberPwd"
:
"0"
}]
\ No newline at end of file
[
{
"userId"
:
1
,
"user"
:
"姜安平"
,
"avatar"
:
""
,
"passWord"
:
"Jap@123"
,
"roleName"
:
"运维"
,
"unitName"
:
"运维"
,
"isAdmin"
:
false
,
"LastSynchronizationTime"
:
""
},
{
"userId"
:
2
,
"user"
:
"段树梁"
,
"avatar"
:
""
,
"passWord"
:
"Dsl@123"
,
"roleName"
:
"运维"
,
"unitName"
:
"运维"
,
"isAdmin"
:
false
,
"LastSynchronizationTime"
:
""
},
{
"userId"
:
3
,
"user"
:
"孔佳真"
,
"avatar"
:
""
,
"passWord"
:
"Kjz@123"
,
"roleName"
:
"运维"
,
"unitName"
:
"运维"
,
"isAdmin"
:
false
,
"LastSynchronizationTime"
:
""
},
{
"userId"
:
1
,
"user"
:
"钟校明"
,
"avatar"
:
""
,
"passWord"
:
"Zxm@123"
,
"roleName"
:
"运维"
,
"unitName"
:
"运维"
,
"isAdmin"
:
false
,
"LastSynchronizationTime"
:
""
}
]
\ No newline at end of file
pages/login/login.vue
浏览文件 @
748424ad
...
...
@@ -98,6 +98,12 @@
uni
.
navigateTo
({
url
:
"/pages/home/home"
,
});
}
else
{
uni
.
showToast
({
title
:
'账号密码错误,请重新输入'
,
icon
:
"none"
,
duration
:
2000
,
});
}
});
},
...
...
utils/sqllitedb.js
浏览文件 @
748424ad
...
...
@@ -172,4 +172,14 @@ export default class SqlliteDB {
async
commitTransaction
()
{
this
.
openTransaction
(
"commit"
);
}
static
async
checkIfDataImported
(
sqllitedb
)
{
// 假设有一个表或字段来记录数据导入状态
let
result
=
await
sqllitedb
.
selectSQL
(
'SELECT value FROM SYS_CONFIG WHERE key = "data_imported"'
);
return
result
&&
result
.
length
>
0
&&
result
[
0
].
value
===
'true'
;
}
static
async
markDataAsImported
(
sqllitedb
)
{
await
sqllitedb
.
executeSQL
(
'INSERT OR REPLACE INTO SYS_CONFIG (key, value) VALUES ("data_imported", "true")'
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论