提交 023ee1b6 authored 作者: JaxBBLL's avatar JaxBBLL

fix: init 2

上级 7409b5f4
......@@ -21,7 +21,7 @@ export default {
plus.screen.lockOrientation("landscape-primary"); //锁定横屏
// #endif
// this.init();
this.init();
// #ifdef APP-PLUS
plus.android.requestPermissions(
......@@ -61,7 +61,7 @@ export default {
if (now_user.user) {
this.$store.commit("SET_USER", now_user);
}
this.init();
// this.init();
},
onLoad: function (query) {
console.log("即将开始初始化app");
......
<template>
<!-- 首页 -->
<view class="container">
<view class="flex">
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=23"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">23</button>
</navigator>
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=16"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">16</button>
</navigator>
</view>
<!-- 第一个模块 -->
<view class="header">
<view class="title">杭州内网监管在线-运维在线</view>
......
......@@ -8,14 +8,35 @@
</view>
<view class="form_wrap">
<view class="input_wrap">
<uni-easyinput class="log-input" clearSize="0" v-model="person.account" prefixIcon="person"
placeholder="用户名"></uni-easyinput>
<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>
<uni-easyinput
class="log-input"
clearSize="0"
v-model="person.account"
prefixIcon="person"
placeholder="用户名"
></uni-easyinput>
<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 class="login_btn" @click="login">
<view class="login_btn_text"> 登录 </view>
......@@ -26,19 +47,17 @@
</template>
<script>
import userApi from "@/api/user.js"
import SqlliteDbUtil from '@/utils/sqllitedb'
import table from '@/api/sqllite/table.js'
import {
getUserList,
} from "@/utils/systemCofig";
import {
import userApi from "@/api/user.js";
import SqlliteDbUtil from "@/utils/sqllitedb";
import table from "@/api/sqllite/table.js";
import { getUserList } from "@/utils/systemCofig";
import {
LOG_TYPE_ENUM,
getLogContent,
addLog,
readLogData,
} from "@/utils/IoReadingAndWriting.js";
export default {
} from "@/utils/IoReadingAndWriting.js";
export default {
components: {},
data() {
return {
......@@ -61,9 +80,7 @@
created() {},
onShow() {},
async mounted() {
},
async mounted() {},
// 定义返回退出
onBackPress(options) {
this.backButtonPress++;
......@@ -79,7 +96,7 @@
} else {
plus.nativeUI.toast("再划一次退出应用");
}
setTimeout(function() {
setTimeout(function () {
this.backButtonPress = 0;
}, 1000);
return true;
......@@ -95,12 +112,18 @@
if (res.data) {
this.personList = res.data;
this.$store.commit("SET_USER", this.personList);
uni.setStorageSync("now_user", this.personList);
uni.setStorageSync(
"last_time",
this.personList.LastSynchronizationTime || ""
);
uni.navigateTo({
url: "/pages/home/home",
});
}else{
} else {
uni.showToast({
title: '账号密码错误,请重新输入',
title: "账号密码错误,请重新输入",
icon: "none",
duration: 2000,
});
......@@ -108,11 +131,11 @@
});
},
},
};
};
</script>
<style scoped lang="less">
.content {
.content {
width: 100vw;
height: 100vh;
// background-color: red;
......@@ -141,7 +164,8 @@
}
}
.login_wrap {}
.login_wrap {
}
.log-input {
width: 350px;
......@@ -200,5 +224,5 @@
color: #fff;
}
}
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论