提交 e3089cd4 authored 作者: zs's avatar zs

日志新增登录/修改密码

上级 0b1cf98e
...@@ -131,8 +131,18 @@ ...@@ -131,8 +131,18 @@
if(res.data){ if(res.data){
uni.showToast({ uni.showToast({
title: "恭喜您,密码更新成功!", title: "恭喜您,密码更新成功!",
icon:"none",
duration: 3000, duration: 3000,
}); });
const logContent = getLogContent(
LOG_TYPE_ENUM.updatePassword,
"",
"其他"
);
const log_list = this.$store.state.log_list;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {});
this.logOut(); this.logOut();
}else{ }else{
uni.showToast({ uni.showToast({
......
...@@ -8,35 +8,14 @@ ...@@ -8,35 +8,14 @@
</view> </view>
<view class="form_wrap"> <view class="form_wrap">
<view class="input_wrap"> <view class="input_wrap">
<uni-easyinput <uni-easyinput class="log-input" clearSize="0" v-model="person.account" prefixIcon="person"
class="log-input" placeholder="用户名"></uni-easyinput>
clearSize="0" <uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0"
v-model="person.account" v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder"
prefixIcon="person" :passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
placeholder="用户名" <uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pd"
></uni-easyinput> @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false"
<uni-easyinput :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
v-if="passwordVisible"
class="log-input"
prefixIcon="locked"
clearSize="0"
v-model="person.pwd"
@iconClick="togglePasswordVisible"
:placeholder="passwordPlaceholder"
:passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"
></uni-easyinput>
<uni-easyinput
v-else
class="log-input"
prefixIcon="locked-filled"
clearSize="0"
v-model="person.pd"
@iconClick="togglePasswordVisible"
:placeholder="passwordPlaceholder"
:passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"
></uni-easyinput>
</view> </view>
<view class="login_btn" @click="login"> <view class="login_btn" @click="login">
<view class="login_btn_text"> 登录 </view> <view class="login_btn_text"> 登录 </view>
...@@ -47,23 +26,25 @@ ...@@ -47,23 +26,25 @@
</template> </template>
<script> <script>
import userApi from "@/api/user.js"; import userApi from "@/api/user.js";
import SqlliteDbUtil from "@/utils/sqllitedb"; import SqlliteDbUtil from "@/utils/sqllitedb";
import table from "@/api/sqllite/table.js"; import table from "@/api/sqllite/table.js";
import { getUserList } from "@/utils/systemCofig"; import {
import { getUserList
} from "@/utils/systemCofig";
import {
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
getLogContent, getLogContent,
addLog, addLog,
readLogData, readLogData,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
person: { person: {
account: "姜安平", account: "管理员",
pwd: "Jap@123", pwd: "Gly@124",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
...@@ -96,7 +77,7 @@ export default { ...@@ -96,7 +77,7 @@ export default {
} else { } else {
plus.nativeUI.toast("再划一次退出应用"); plus.nativeUI.toast("再划一次退出应用");
} }
setTimeout(function () { setTimeout(function() {
this.backButtonPress = 0; this.backButtonPress = 0;
}, 1000); }, 1000);
return true; return true;
...@@ -117,7 +98,15 @@ export default { ...@@ -117,7 +98,15 @@ export default {
"last_time", "last_time",
this.personList.LastSynchronizationTime || "" this.personList.LastSynchronizationTime || ""
); );
const logContent = getLogContent(
LOG_TYPE_ENUM.login,
"",
"其他"
);
const log_list = this.$store.state.log_list;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {});
uni.navigateTo({ uni.navigateTo({
url: "/pages/home/home", url: "/pages/home/home",
}); });
...@@ -131,11 +120,11 @@ export default { ...@@ -131,11 +120,11 @@ export default {
}); });
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.content { .content {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
// background-color: red; // background-color: red;
...@@ -164,8 +153,7 @@ export default { ...@@ -164,8 +153,7 @@ export default {
} }
} }
.login_wrap { .login_wrap {}
}
.log-input { .log-input {
width: 350px; width: 350px;
...@@ -224,5 +212,5 @@ export default { ...@@ -224,5 +212,5 @@ export default {
color: #fff; color: #fff;
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论