Commit 62db9c41 authored by kaitly205422@163.com's avatar kaitly205422@163.com

添加记住密码功能

parent ce972888
var server = require('pushstate-server'); var server = require('pushstate-server');
server.start({ server.start({
port: 5000, port: 5001,
directory: './dist' directory: './dist'
}); });
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <meta
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT" />
<meta http-equiv="expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>融通危险源辨识系统</title> <title>融通危险源辨识系统</title>
<link rel="stylesheet" href="//at.alicdn.com/t/font_1623819_3g3arzgtlmk.css"> <link
rel="stylesheet"
href="//at.alicdn.com/t/font_1623819_3g3arzgtlmk.css"
/>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but vue-newbee-shop doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong
>We're sorry but vue-newbee-shop doesn't work properly without
JavaScript enabled. Please enable it to continue.</strong
>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
...@@ -130,7 +130,6 @@ export default { ...@@ -130,7 +130,6 @@ export default {
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
console.log(this.cachePage);
// 列表操作去除缓存,刷新列表页 // 列表操作去除缓存,刷新列表页
if (from.name == "confirme-danger" || to.name == "confirme-danger") { if (from.name == "confirme-danger" || to.name == "confirme-danger") {
// 隐患整改页面缓存处理 // 隐患整改页面缓存处理
...@@ -151,6 +150,8 @@ export default { ...@@ -151,6 +150,8 @@ export default {
this.handleCache("riskTaskList", to.name, "taskLedger"); this.handleCache("riskTaskList", to.name, "taskLedger");
} else if ((from.name == 'riskInherent' && to.name === 'addInherent') || (to.name == 'riskInherent' && from.name == 'addInherent')) { } else if ((from.name == 'riskInherent' && to.name === 'addInherent') || (to.name == 'riskInherent' && from.name == 'addInherent')) {
this.handleCache('addInherent', to.name, 'riskInherent') this.handleCache('addInherent', to.name, 'riskInherent')
} else if ((from.name == 'riskInherent' && to.name === 'addCurrent') || (to.name == 'riskInherent' && from.name == 'addCurrent')) {
this.handleCache('addCurrent', to.name, 'riskInherent')
} }
// else if (to.name == 'riskView' || from.name == 'riskInherent') { // else if (to.name == 'riskView' || from.name == 'riskInherent') {
// this.handleCache("addInherent", to.name, "riskInherent"); // this.handleCache("addInherent", to.name, "riskInherent");
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<div class="login" :style="{ backgroundImage: `url(${bg})` }"> <div class="login" :style="{ backgroundImage: `url(${bg})` }">
<div class="title"> <div class="title">
<div class="login-logo"> <div class="login-logo">
<van-image <van-image width="48" height="48" :src="require('@/assets/imgs/logo.png')" />
width="48"
height="48"
:src="require('@/assets/imgs/logo.png')"
/>
<span style="margin-left: 6px">融通危险源辨识系统</span> <span style="margin-left: 6px">融通危险源辨识系统</span>
</div> </div>
<!-- <div class="login-name">Enterprise Business Data Monitoring</div> --> <!-- <div class="login-name">Enterprise Business Data Monitoring</div> -->
...@@ -16,44 +12,26 @@ ...@@ -16,44 +12,26 @@
<div class="hello">Hello!</div> <div class="hello">Hello!</div>
<div class="welcome">欢迎登录<span></span>!</div> <div class="welcome">欢迎登录<span></span>!</div>
<div class="login-form"> <div class="login-form">
<van-form <van-form @submit="onSubmit" :show-error-message="false" validate-trigger="onSubmit">
@submit="onSubmit"
:show-error-message="false"
validate-trigger="onSubmit"
>
<div class="username-wrap"> <div class="username-wrap">
<div class="username-icon"> <div class="username-icon">
<van-image :src="require('@/assets/login/login-username.png')" /> <van-image :src="require('@/assets/login/login-username.png')" />
</div> </div>
<van-field <van-field v-model="username" name="username" label="" placeholder="账号"
v-model="username" :rules="[{ required: true, message: '请填写账号' }]" />
name="username"
label=""
placeholder="账号"
:rules="[{ required: true, message: '请填写账号' }]"
/>
</div> </div>
<div class="passworld-wrap"> <div class="passworld-wrap">
<div class="passworld-icon"> <div class="passworld-icon">
<van-image :src="require('@/assets/login/login-passworld.png')" /> <van-image :src="require('@/assets/login/login-passworld.png')" />
</div> </div>
<van-field <van-field v-model="password" type="password" name="password" placeholder="密码"
v-model="password" :rules="[{ required: true, message: '请填写密码' }]" />
type="password"
name="password"
placeholder="密码"
:rules="[{ required: true, message: '请填写密码' }]"
/>
</div> </div>
<div style="margin: 16px 0"> <div style="margin: 16px 0">
<van-checkbox v-model="remember" shape="square" <van-checkbox v-model="remember" shape="square">记住密码</van-checkbox>
>记住密码</van-checkbox
>
</div> </div>
<div style="margin: 16px"> <div style="margin: 16px">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit">登录</van-button>
>登录</van-button
>
</div> </div>
</van-form> </van-form>
</div> </div>
...@@ -81,7 +59,7 @@ export default { ...@@ -81,7 +59,7 @@ export default {
password: "", password: "",
remember: remember:
localStorage.getItem("isRemember") && localStorage.getItem("isRemember") &&
localStorage.getItem("isRemember") !== "false" localStorage.getItem("isRemember") !== "false"
? true ? true
: false, : false,
}; };
...@@ -126,10 +104,11 @@ export default { ...@@ -126,10 +104,11 @@ export default {
postFun("/login", values).then((Response) => { postFun("/login", values).then((Response) => {
if (Response.code == 200) { if (Response.code == 200) {
this.$toast.clear(); this.$toast.clear();
setLocalUserInfo({ const localUserInfo = {
loginName: values.username, loginName: values.username,
loginPassword: Base64.encode(values.password), loginPassword: Base64.encode(values.password),
}); }
// setLocalUserInfo(localUserInfo);
setToken(Response.token); setToken(Response.token);
getFun("/getInfo").then((Response2) => { getFun("/getInfo").then((Response2) => {
console.log( console.log(
...@@ -139,6 +118,7 @@ export default { ...@@ -139,6 +118,7 @@ export default {
); );
var userInfo = { var userInfo = {
...Response2.user, ...Response2.user,
...localUserInfo
}; };
/* 存储用户信息 */ /* 存储用户信息 */
setUserInfo(userInfo); setUserInfo(userInfo);
......
This diff is collapsed.
...@@ -8,32 +8,12 @@ ...@@ -8,32 +8,12 @@
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated> <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab :title="buildingName"> <van-tab :title="buildingName">
<van-dropdown-menu z-index="1000"> <van-dropdown-menu z-index="1000">
<van-dropdown-item <van-dropdown-item v-model="value0" @change="changeBuild" :options="option0" get-container="body" />
v-model="value0" <van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body" />
@change="changeBuild" <van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body" />
:options="option0"
get-container="body"
/>
<van-dropdown-item
v-model="value1"
@change="changeFloor"
:options="option1"
get-container="body"
/>
<van-dropdown-item
v-model="value2"
@change="changeRoom"
:options="option2"
get-container="body"
/>
</van-dropdown-menu> </van-dropdown-menu>
<div class="con-list"> <div class="con-list">
<van-cell-group <van-cell-group inset v-for="(item, index) in messageList" :key="index" @click="touchstart(index, item)">
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div style="font-size: 0.45rem; padding: 5px 0"> <div style="font-size: 0.45rem; padding: 5px 0">
{{ item.name }} {{ item.name }}
</div> </div>
...@@ -42,8 +22,8 @@ ...@@ -42,8 +22,8 @@
<van-row gutter=""> <van-row gutter="">
<van-col span="9">发起时间:</van-col> <van-col span="9">发起时间:</van-col>
<van-col span="15">{{ <van-col span="15">{{
timestampToTimes(item.createTime) timestampToTimes(item.createTime)
}}</van-col> }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="9">楼层:</van-col> <van-col span="9">楼层:</van-col>
...@@ -60,37 +40,25 @@ ...@@ -60,37 +40,25 @@
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)" <van-button round type="primary" @click="goDetail(item)">编辑</van-button>
>编辑</van-button <van-button round type="danger" @click="delInherent(item)" v-show="active == 0">删除</van-button>
>
<van-button
round
type="danger"
@click="delInherent(item)"
v-show="active == 0"
>删除</van-button
>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
<div <div style="
style="
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 0.48rem; font-size: 0.48rem;
position: fixed; position: fixed;
top: 30%; top: 30%;
" " v-if="messageList['length'] == 0">
v-if="messageList['length'] == 0"
>
暂无数据 暂无数据
</div> </div>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
<div <div style="
style="
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
background-color: #fff; background-color: #fff;
...@@ -100,26 +68,16 @@ ...@@ -100,26 +68,16 @@
text-align: center; text-align: center;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
" ">
> <div @click="copyFloor" style="color: #4bced0; font-size: 14px; font-weight: 600">
<div
@click="copyFloor"
style="color: #4bced0; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="coupon-o" /></div> <div style="font-size: 22px"><van-icon name="coupon-o" /></div>
<div>复制楼层</div> <div>复制楼层</div>
</div> </div>
<div <div @click="performTasks" style="color: #4bced0; font-size: 14px; font-weight: 600">
@click="performTasks"
style="color: #4bced0; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="plus" /></div> <div style="font-size: 22px"><van-icon name="plus" /></div>
<div>新增固有风险</div> <div>新增固有风险</div>
</div> </div>
<div <div @click="endTasks" style="color: #d9001b; font-size: 14px; font-weight: 600">
@click="endTasks"
style="color: #d9001b; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="cross" /></div> <div style="font-size: 22px"><van-icon name="cross" /></div>
<div>任务执行结束</div> <div>任务执行结束</div>
</div> </div>
...@@ -354,7 +312,6 @@ export default { ...@@ -354,7 +312,6 @@ export default {
let arr = this.floorListData.filter( let arr = this.floorListData.filter(
(item) => item.name == this.value0 (item) => item.name == this.value0
)[0].children; )[0].children;
console.log(arr);
if (!arr) arr = []; if (!arr) arr = [];
arr = [{ id: "-1", name: "全部" }, ...arr]; arr = [{ id: "-1", name: "全部" }, ...arr];
this.option1 = this.changeData(arr); this.option1 = this.changeData(arr);
......
const Timestamp = new Date().getTime();
module.exports = { module.exports = {
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment