提交 2e3909f4 authored 作者: 邓文彬's avatar 邓文彬

fix(密码修改):修改密码替换方式

上级 bba56721
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
.then((res) => { .then((res) => {
// 获取文件数据 // 获取文件数据
let userData = Base64.decode(res); let userData = Base64.decode(res);
console.log("---读取文件数据", userData); // console.log("---读取文件数据", userData);
uni.setStorage({ uni.setStorage({
key: "user_data", key: "user_data",
......
...@@ -57,15 +57,7 @@ import { Base64 } from "js-base64"; ...@@ -57,15 +57,7 @@ import { Base64 } from "js-base64";
import { import {
SYNCHRONIZE_DATA_PAD, SYNCHRONIZE_DATA_PAD,
checkAndCreateDirectory,
SYNCHRONIZE_DATA_PATH,
readFilesInDirectory,
USER_LiST,
BASE_PATH,
checkFileExists,
createFileWithPlusIO, createFileWithPlusIO,
readFileContent,
TEST,
USER_FILE_NAME, USER_FILE_NAME,
} from "@/utils/systemCofig"; } from "@/utils/systemCofig";
export default { export default {
...@@ -142,15 +134,26 @@ export default { ...@@ -142,15 +134,26 @@ export default {
// console.log(this.formData.oldPd,this.user.pd) // console.log(this.formData.oldPd,this.user.pd)
// 输入密码与该账号密码一致 // 输入密码与该账号密码一致
if (this.formData.oldPd == this.user.passWord) { if (this.formData.oldPd == this.user.passWord) {
this.user.passWord = this.formData.newPd; // this.user.passWord = this.formData.newPd;
let key = null; // let key = null;
this.personList.some((item, index) => { // this.personList.some((item, index) => {
if (item.id == this.user.id) { // if (item.id == this.user.id) {
key = index; // key = index;
} // }
}); // });
// console.log("---- this.user", this.user)
// 将数组中与当前登录账号ID相同项替换 // 将数组中与当前登录账号ID相同项替换
this.personList.splice(key, 1, this.user); // this.personList.splice(key, 1, this.user);
const id = this.user.id;
const tempPersonList = this.personList.map(item => {
if(item.id ==id ){
item.passWord = this.formData.newPd
}
return item
})
let timeStr = getDateTime.dateTimeStr("y-m-d h:i"); let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
let operData = { let operData = {
name: this.$store.state.now_user.name, name: this.$store.state.now_user.name,
...@@ -162,8 +165,9 @@ export default { ...@@ -162,8 +165,9 @@ export default {
time: timeStr, time: timeStr,
}; };
this.$store.state.oper_record.unshift(operData); this.$store.state.oper_record.unshift(operData);
// 重新存储本地用户信息 // 重新存储本地用户信息
let _this = this; // let _this = this;
// plus.io.resolveLocalFileSystemURL( // plus.io.resolveLocalFileSystemURL(
// "/storage/emulated/0/Android/data/asmzx/pd/", //指定的目录 // "/storage/emulated/0/Android/data/asmzx/pd/", //指定的目录
// function(entry) { // function(entry) {
...@@ -210,9 +214,10 @@ export default { ...@@ -210,9 +214,10 @@ export default {
// }) // })
// this.logOut() // this.logOut()
const temp = JSON.stringify(tempPersonList)
const fileContent = JSON.stringify( const fileContent = JSON.stringify(
Base64.encode(JSON.stringify(this.personList)) Base64.encode(temp)
); );
createFileWithPlusIO( createFileWithPlusIO(
SYNCHRONIZE_DATA_PAD, SYNCHRONIZE_DATA_PAD,
...@@ -220,7 +225,7 @@ export default { ...@@ -220,7 +225,7 @@ export default {
fileContent fileContent
).then((res) => { ).then((res) => {
console.log("---写入成功", res); console.log("---写入成功", res);
uni.setStorageSync("user_data", this.personList); uni.setStorageSync("user_data", temp);
uni.showToast({ uni.showToast({
title: "恭喜您,密码更新成功!", title: "恭喜您,密码更新成功!",
icon: "none", icon: "none",
......
...@@ -38,7 +38,6 @@ import { ...@@ -38,7 +38,6 @@ import {
readFileContent, readFileContent,
TEST TEST
} from "@/utils/systemCofig"; } from "@/utils/systemCofig";
import { Base64 } from "js-base64";
export default { export default {
components: { components: {
...@@ -47,7 +46,7 @@ export default { ...@@ -47,7 +46,7 @@ export default {
data() { data() {
return { return {
person: { person: {
user: "", user: "test",
pd: "", pd: "",
}, },
backButtonPress: 0, backButtonPress: 0,
......
差异被折叠。
差异被折叠。
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<script>
var __UniViewStartTime__ = Date.now();
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>View</title>
<link rel="stylesheet" href="view.css" />
</head>
<body>
<div id="app"></div>
<script src="__uniappes6.js"></script>
<script src="view.umd.min.js"></script>
<script src="app-view.js"></script>
</body>
</html>
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/index/index","pages/index/operLog","pages/synchronization/synchronization","pages/inspection/inspection","pages/inspection/inspFirst","pages/inspection/inspDetail","pages/inspection/sampleTable","pages/inspection/lookInsp","pages/inspection/inspProcess","pages/repair/repair","pages/repair/repairDetail","pages/repair/showRapair","pages/report/report","pages/report/lookReport","pages/report/reportInfo","pages/report/sampleTable","pages/repair/sampleTable","pages/login/login","pages/report/report-detail/deatil_first","pages/index/editPd"],"window":{"pageOrientation":"landscape","navigationStyle":"custom","rpxCalcMaxDeviceWidth":2000,"rpxCalcIncludeWidth":750},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"巡检管理","compilerVersion":"4.24","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{}},{"path":"/pages/index/operLog","meta":{},"window":{}},{"path":"/pages/synchronization/synchronization","meta":{},"window":{}},{"path":"/pages/inspection/inspection","meta":{},"window":{}},{"path":"/pages/inspection/inspFirst","meta":{},"window":{}},{"path":"/pages/inspection/inspDetail","meta":{},"window":{}},{"path":"/pages/inspection/sampleTable","meta":{},"window":{}},{"path":"/pages/inspection/lookInsp","meta":{},"window":{}},{"path":"/pages/inspection/inspProcess","meta":{},"window":{}},{"path":"/pages/repair/repair","meta":{},"window":{}},{"path":"/pages/repair/repairDetail","meta":{},"window":{}},{"path":"/pages/repair/showRapair","meta":{},"window":{}},{"path":"/pages/report/report","meta":{},"window":{}},{"path":"/pages/report/lookReport","meta":{},"window":{}},{"path":"/pages/report/reportInfo","meta":{},"window":{}},{"path":"/pages/report/sampleTable","meta":{},"window":{}},{"path":"/pages/repair/sampleTable","meta":{},"window":{}},{"path":"/pages/login/login","meta":{},"window":{}},{"path":"/pages/report/report-detail/deatil_first","meta":{},"window":{}},{"path":"/pages/index/editPd","meta":{},"window":{}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "app-config": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ var jsonpArray = this["webpackJsonp"] = this["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ([]);
\ No newline at end of file
No preview for this file type
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论