liangbowen před 11 měsíci
rodič
revize
4f9637759e

+ 13 - 10
components/ay-login/login-password.vue

@@ -6,7 +6,7 @@
 					autocomplete="off" />
 			</view>
 			<view class="input-wrap" style="margin-top: 50rpx;">
-				<input class="uni-input" placeholder="请输入密码" v-model="password"/>
+				<input class="uni-input" placeholder="请输入密码" password type="text" v-model="password" />
 			</view>
 			<view style="text-align: center;margin-top: 100rpx;" @tap="loginFun">
 				<view class="login" style="background-color: #49A992">登录</view>
@@ -16,7 +16,8 @@
 </template>
 
 <script>
-	import md5 from "md5";
+	import md5 from "md5";
+	import sha1 from "js-sha1";
 	export default {
 		components: {},
 		props: {
@@ -67,10 +68,12 @@
 					});
 					return;
 				}
-				let pad = md5(that.password).substr(8, 16).toUpperCase();
+				let pad = md5(
+					sha1(that.password).toUpperCase()
+				).toUpperCase();
 				let data = {
-					userid: that.username,
-					password: pad,
+					loginId: that.username,
+					pwd: pad,
 				};
 				this.$emit('loginFun', data);
 			},
@@ -80,19 +83,19 @@
 
 <style lang="scss">
 	.context {
+		position: relative;
 		width: 100%;
 		height: 100%;
-		padding: 300rpx 50rpx 0rpx 50rpx;
-		background: url('../../static/loginback.png');
-		background-size: 100% 100%;
+		padding: 190rpx 50rpx 0rpx 50rpx;
+		z-index: 100;
 	}
 
 	.input-wrap {
 		height: 100rpx;
 		text-align: center;
-		padding: 35rpx;
+		padding: 30rpx;
 		border: 2rpx solid #d5d4d4;
-		border-radius: 100rpx;
+		border-radius: 100rpx;
 		background-color: #fff;
 	}
 

+ 12 - 4
env.js

@@ -1,4 +1,12 @@
-// 接口跟域名
-export const BASE_URL = 'http://192.168.0.163:9993';
-// 接口路径
-export const API_URL = '/SPDapi';
+// uEnvDev
+let baseurl = null;
+if (process.env.NODE_ENV === 'development') {
+	// TODO
+	baseurl = '/dev-api';
+}
+// uEnvProd
+if (process.env.NODE_ENV === 'production') {
+	// TODO
+	baseurl = '/api/admin';
+}
+module.exports = baseurl;

+ 76 - 0
node_modules/js-sha1/CHANGELOG.md

@@ -0,0 +1,76 @@
+# Change Log
+
+## v0.7.0 / 2024-01-24
+### Added
+- TypeScript interfaces. #6, #9
+- HMAC feature.
+- support for web worker. #14
+
+### Fixed
+- deprecated `new Buffer`, replace with `Buffer.from`. #10
+- dependencies and security issues.
+- refactor: simplify formatMessage internal logic.
+- Generates incorrect hash in some cases.
+
+### Changed
+- remove `eval` and use `require` directly. #8
+- throw error by Error oject.
+- throw error if update after finalize
+- use unsigned right shift.
+
+## v0.6.0 / 2017-12-21
+### Fixed
+- incorrect result when first bit is 1 of bytes.
+
+### Changed
+- prevent webpack to require dependencies.
+
+## v0.5.0 / 2017-10-31
+### Fixed
+- incorrect result when file size >= 512M.
+
+## v0.4.1 / 2016-12-30
+### Fixed
+- ArrayBuffer dosen't work in Webpack.
+
+## v0.4.0 / 2016-12-05
+### Added
+- update method.
+- support Array output.
+- support ArrayBuffer output.
+- support AMD.
+
+## v0.3.0 / 2015-03-04
+### Added
+- support ArrayBuffer input.
+### Changed
+- improve performance.
+
+## v0.2.0 / 2015-02-16
+### Added
+- support byte array input.
+- test cases.
+### Removed
+- ascii parameter.
+### Changed
+- improve performance.
+
+## v0.1.3 / 2015-01-07
+### Added
+- bower package.
+- travis.
+- coveralls.
+### Fixed
+- JSHint warnings.
+
+## v0.1.2 / 2014-07-27
+### Fixed
+- accents bug.
+
+## v0.1.1 / 2014-01-05
+### Changed
+- update license.
+
+## v0.1.0 / 2014-01-04
+### Added
+- initial release.

+ 20 - 0
node_modules/js-sha1/LICENSE.txt

@@ -0,0 +1,20 @@
+Copyright 2014-2024 Chen, Yi-Cyuan
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 94 - 0
node_modules/js-sha1/README.md

@@ -0,0 +1,94 @@
+# js-sha1
+[![Build Status](https://travis-ci.org/emn178/js-sha1.svg?branch=master)](https://travis-ci.org/emn178/js-sha1)
+[![Coverage Status](https://coveralls.io/repos/emn178/js-sha1/badge.svg?branch=master)](https://coveralls.io/r/emn178/js-sha1?branch=master)  
+[![NPM](https://nodei.co/npm/js-sha1.png?stars&downloads)](https://nodei.co/npm/js-sha1/)  
+A simple SHA1 hash function for JavaScript supports UTF-8 encoding.
+
+## Demo
+[SHA1 Online](http://emn178.github.io/online-tools/sha1.html)
+[SHA1 File Checksum Online](https://emn178.github.io/online-tools/sha1_checksum.html)
+
+## Download
+[Compress](https://raw.github.com/emn178/js-sha1/master/build/sha1.min.js)  
+[Uncompress](https://raw.github.com/emn178/js-sha1/master/src/sha1.js)
+
+## Installation
+You can also install js-sha1 by using Bower.
+
+    bower install js-sha1
+
+For node.js, you can use this command to install:
+
+    npm install js-sha1
+
+## Notice
+NIST formally deprecated use of SHA-1 in 2011 and disallowed its use for digital signatures in 2013, and declared that it should be phased out by 2030. However, SHA-1 is still secure for HMAC. [wiki](https://en.wikipedia.org/wiki/SHA-1)
+
+## Usage
+You could use like this:
+```JavaScript
+sha1('Message to hash');
+var hash = sha1.create();
+hash.update('Message to hash');
+hash.hex();
+
+// HMAC
+sha1.hmac('key', 'Message to hash');
+
+var hash = sha1.hmac.create('key');
+hash.update('Message to hash');
+hash.hex();
+```
+
+### Node.js
+If you use node.js, you should require the module first:
+```JavaScript
+var sha1 = require('js-sha1');
+```
+
+### TypeScript
+If you use TypeScript, you can import like this:
+```TypeScript
+import { sha1 } from 'js-sha1';
+```
+
+## RequireJS
+It supports AMD:
+```JavaScript
+require(['your/path/sha1.js'], function(sha1) {
+// ...
+});
+```
+
+## Example
+```JavaScript
+sha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709
+sha1('The quick brown fox jumps over the lazy dog'); // 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
+sha1('The quick brown fox jumps over the lazy dog.'); // 408d94384216f890ff7a0c3528e8bed1e0b01621
+
+// It also supports UTF-8 encoding
+sha1('中文'); // 7be2d2d20c106eee0836c9bc2b939890a78e8fb3
+
+// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
+sha1([]); // da39a3ee5e6b4b0d3255bfef95601890afd80709
+sha1(new Uint8Array([])); // da39a3ee5e6b4b0d3255bfef95601890afd80709
+
+// Different output
+sha1(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709
+sha1.hex(''); // da39a3ee5e6b4b0d3255bfef95601890afd80709
+sha1.array(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]
+sha1.digest(''); // [218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9]
+sha1.arrayBuffer(''); // ArrayBuffer
+
+// HMAC
+sha1.hmac.hex('key', 'Message to hash');
+sha1.hmac.array('key', 'Message to hash');
+// ...
+```
+
+## License
+The project is released under the [MIT license](http://www.opensource.org/licenses/MIT).
+
+## Contact
+The project's website is located at https://github.com/emn178/js-sha1  
+Author: Chen, Yi-Cyuan (emn178@gmail.com)

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 9 - 0
node_modules/js-sha1/build/sha1.min.js


+ 148 - 0
node_modules/js-sha1/index.d.ts

@@ -0,0 +1,148 @@
+type Message = string | number[] | ArrayBuffer | Uint8Array;
+
+interface Hasher {
+  /**
+   * Update hash
+   *
+   * @param message The message you want to hash.
+   */
+  update(message: Message): Hasher;
+
+  /**
+   * Return hash in hex string.
+   */
+  hex(): string;
+
+  /**
+   * Return hash in hex string.
+   */
+  toString(): string;
+
+  /**
+   * Return hash in ArrayBuffer.
+   */
+  arrayBuffer(): ArrayBuffer;
+
+  /**
+   * Return hash in integer array.
+   */
+  digest(): number[];
+
+  /**
+   * Return hash in integer array.
+   */
+  array(): number[];
+}
+
+interface Hmac {
+  /**
+   * Computes a Hash-based message authentication code (HMAC) using a secret key
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  (secretKey: Message, message: Message): string;
+
+  /**
+   * Create a hash object using a secret key.
+   *
+   * @param secretKey The Secret Key
+   */
+  create(secretKey: Message): Hasher;
+
+  /**
+   * Create a hash object and hash message using a secret key
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  update(secretKey: Message, message: Message): Hasher;
+
+  /**
+   * Return hash in hex string.
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  hex(secretKey: Message, message: Message): string;
+
+  /**
+   * Return hash in ArrayBuffer.
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  arrayBuffer(secretKey: Message, message: Message): ArrayBuffer;
+
+  /**
+   * Return hash in integer array.
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  digest(secretKey: Message, message: Message): number[];
+
+  /**
+   * Return hash in integer array.
+   *
+   * @param secretKey The Secret Key
+   * @param message The message you want to hash.
+   */
+  array(secretKey: Message, message: Message): number[];
+}
+
+interface Hash {
+  /**
+   * Hash and return hex string.
+   *
+   * @param message The message you want to hash.
+   */
+  (message: Message): string;
+
+  /**
+   * Create a hash object.
+   */
+  create(): Hasher;
+
+  /**
+   * Create a hash object and hash message.
+   *
+   * @param message The message you want to hash.
+   */
+  update(message: Message): Hasher;
+
+  /**
+   * Return hash in hex string.
+   *
+   * @param message The message you want to hash.
+   */
+  hex(message: Message): string;
+
+  /**
+   * Return hash in ArrayBuffer.
+   *
+   * @param message The message you want to hash.
+   */
+  arrayBuffer(message: Message): ArrayBuffer;
+
+  /**
+   * Return hash in integer array.
+   *
+   * @param message The message you want to hash.
+   */
+  digest(message: Message): number[];
+
+  /**
+   * Return hash in integer array.
+   *
+   * @param message The message you want to hash.
+   */
+  array(message: Message): number[];
+
+  /**
+   * HMAC interface
+   */
+  hmac: Hmac;
+}
+
+export var sha1: Hash;

+ 75 - 0
node_modules/js-sha1/package.json

@@ -0,0 +1,75 @@
+{
+  "_from": "js-sha1",
+  "_id": "js-sha1@0.7.0",
+  "_inBundle": false,
+  "_integrity": "sha512-oQZ1Mo7440BfLSv9TX87VNEyU52pXPVG19F9PL3gTgNt0tVxlZ8F4O6yze3CLuLx28TxotxvlyepCNaaV0ZjMw==",
+  "_location": "/js-sha1",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "tag",
+    "registry": true,
+    "raw": "js-sha1",
+    "name": "js-sha1",
+    "escapedName": "js-sha1",
+    "rawSpec": "",
+    "saveSpec": null,
+    "fetchSpec": "latest"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmmirror.com/js-sha1/-/js-sha1-0.7.0.tgz",
+  "_shasum": "fecaf5f36bb09a51b01da46b43a207c8452c9c1e",
+  "_spec": "js-sha1",
+  "_where": "/Users/liangbowen/Documents/HBuilderProjects/pda-app",
+  "author": {
+    "name": "Chen, Yi-Cyuan",
+    "email": "emn178@gmail.com"
+  },
+  "browser": {
+    "crypto": false,
+    "buffer": false
+  },
+  "bugs": {
+    "url": "https://github.com/emn178/js-sha1/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "A simple SHA1 hash function for JavaScript supports UTF-8 encoding.",
+  "devDependencies": {
+    "expect.js": "~0.3.1",
+    "mocha": "~10.2.0",
+    "nyc": "^15.1.0",
+    "requirejs": "^2.1.22",
+    "tiny-worker": "^2.3.0",
+    "uglify-js": "^3.1.9"
+  },
+  "homepage": "https://github.com/emn178/js-sha1",
+  "keywords": [
+    "sha",
+    "sha1",
+    "encryption",
+    "cryptography",
+    "HMAC"
+  ],
+  "license": "MIT",
+  "main": "src/sha1.js",
+  "name": "js-sha1",
+  "nyc": {
+    "exclude": [
+      "tests"
+    ]
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/emn178/js-sha1.git"
+  },
+  "scripts": {
+    "build": "uglifyjs src/sha1.js -c -m eval --comments -o build/sha1.min.js",
+    "coveralls": "nyc report --reporter=text-lcov | coveralls",
+    "report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
+    "test": "nyc mocha tests/node-test.js"
+  },
+  "version": "0.7.0"
+}

+ 510 - 0
node_modules/js-sha1/src/sha1.js

@@ -0,0 +1,510 @@
+/*
+ * [js-sha1]{@link https://github.com/emn178/js-sha1}
+ *
+ * @version 0.7.0
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
+ * @copyright Chen, Yi-Cyuan 2014-2024
+ * @license MIT
+ */
+/*jslint bitwise: true */
+(function() {
+  'use strict';
+
+  var INPUT_ERROR = 'input is invalid type';
+  var FINALIZE_ERROR = 'finalize already called';
+  var WINDOW = typeof window === 'object';
+  var root = WINDOW ? window : {};
+  if (root.JS_SHA1_NO_WINDOW) {
+    WINDOW = false;
+  }
+  var WEB_WORKER = !WINDOW && typeof self === 'object';
+  var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
+  if (NODE_JS) {
+    root = global;
+  } else if (WEB_WORKER) {
+    root = self;
+  }
+  var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;
+  var AMD = typeof define === 'function' && define.amd;
+  var ARRAY_BUFFER = !root.JS_SHA1_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
+  var HEX_CHARS = '0123456789abcdef'.split('');
+  var EXTRA = [-2147483648, 8388608, 32768, 128];
+  var SHIFT = [24, 16, 8, 0];
+  var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];
+
+  var blocks = [];
+
+  var isArray = Array.isArray;
+  if (root.JS_SHA1_NO_NODE_JS || !isArray) {
+    isArray = function (obj) {
+      return Object.prototype.toString.call(obj) === '[object Array]';
+    };
+  }
+
+  var isView = ArrayBuffer.isView;
+  if (ARRAY_BUFFER && (root.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW || !isView)) {
+    isView = function (obj) {
+      return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
+    };
+  }
+
+  // [message: string, isString: bool]
+  var formatMessage = function (message) {
+    var type = typeof message;
+    if (type === 'string') {
+      return [message, true];
+    }
+    if (type !== 'object' || message === null) {
+      throw new Error(INPUT_ERROR);
+    }
+    if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
+      return [new Uint8Array(message), false];
+    }
+    if (!isArray(message) && !isView(message)) {
+      throw new Error(INPUT_ERROR);
+    }
+    return [message, false];
+  }
+
+  var createOutputMethod = function (outputType) {
+    return function (message) {
+      return new Sha1(true).update(message)[outputType]();
+    };
+  };
+
+  var createMethod = function () {
+    var method = createOutputMethod('hex');
+    if (NODE_JS) {
+      method = nodeWrap(method);
+    }
+    method.create = function () {
+      return new Sha1();
+    };
+    method.update = function (message) {
+      return method.create().update(message);
+    };
+    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
+      var type = OUTPUT_TYPES[i];
+      method[type] = createOutputMethod(type);
+    }
+    return method;
+  };
+
+  var nodeWrap = function (method) {
+    var crypto = require('crypto')
+    var Buffer = require('buffer').Buffer;
+    var bufferFrom;
+    if (Buffer.from && !root.JS_SHA1_NO_BUFFER_FROM) {
+      bufferFrom = Buffer.from;
+    } else {
+      bufferFrom = function (message) {
+        return new Buffer(message);
+      };
+    }
+    var nodeMethod = function (message) {
+      if (typeof message === 'string') {
+        return crypto.createHash('sha1').update(message, 'utf8').digest('hex');
+      } else {
+        if (message === null || message === undefined) {
+          throw new Error(INPUT_ERROR);
+        } else if (message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        }
+      }
+      if (isArray(message) || isView(message) ||
+        message.constructor === Buffer) {
+        return crypto.createHash('sha1').update(bufferFrom(message)).digest('hex');
+      } else {
+        return method(message);
+      }
+    };
+    return nodeMethod;
+  };
+
+  var createHmacOutputMethod = function (outputType) {
+    return function (key, message) {
+      return new HmacSha1(key, true).update(message)[outputType]();
+    };
+  };
+
+  var createHmacMethod = function () {
+    var method = createHmacOutputMethod('hex');
+    method.create = function (key) {
+      return new HmacSha1(key);
+    };
+    method.update = function (key, message) {
+      return method.create(key).update(message);
+    };
+    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
+      var type = OUTPUT_TYPES[i];
+      method[type] = createHmacOutputMethod(type);
+    }
+    return method;
+  };
+
+  function Sha1(sharedMemory) {
+    if (sharedMemory) {
+      blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      this.blocks = blocks;
+    } else {
+      this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+    }
+
+    this.h0 = 0x67452301;
+    this.h1 = 0xEFCDAB89;
+    this.h2 = 0x98BADCFE;
+    this.h3 = 0x10325476;
+    this.h4 = 0xC3D2E1F0;
+
+    this.block = this.start = this.bytes = this.hBytes = 0;
+    this.finalized = this.hashed = false;
+    this.first = true;
+  }
+
+  Sha1.prototype.update = function (message) {
+    if (this.finalized) {
+      throw new Error(FINALIZE_ERROR);
+    }
+
+    var result = formatMessage(message);
+    message = result[0];
+    var isString = result[1];
+    var code, index = 0, i, length = message.length || 0, blocks = this.blocks;
+
+    while (index < length) {
+      if (this.hashed) {
+        this.hashed = false;
+        blocks[0] = this.block;
+        this.block = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+        blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+        blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+        blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      }
+
+      if(isString) {
+        for (i = this.start; index < length && i < 64; ++index) {
+          code = message.charCodeAt(index);
+          if (code < 0x80) {
+            blocks[i >>> 2] |= code << SHIFT[i++ & 3];
+          } else if (code < 0x800) {
+            blocks[i >>> 2] |= (0xc0 | (code >>> 6)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+          } else if (code < 0xd800 || code >= 0xe000) {
+            blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+          } else {
+            code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+            blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];
+            blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+          }
+        }
+      } else {
+        for (i = this.start; index < length && i < 64; ++index) {
+          blocks[i >>> 2] |= message[index] << SHIFT[i++ & 3];
+        }
+      }
+
+      this.lastByteIndex = i;
+      this.bytes += i - this.start;
+      if (i >= 64) {
+        this.block = blocks[16];
+        this.start = i - 64;
+        this.hash();
+        this.hashed = true;
+      } else {
+        this.start = i;
+      }
+    }
+    if (this.bytes > 4294967295) {
+      this.hBytes += this.bytes / 4294967296 << 0;
+      this.bytes = this.bytes % 4294967296;
+    }
+    return this;
+  };
+
+  Sha1.prototype.finalize = function () {
+    if (this.finalized) {
+      return;
+    }
+    this.finalized = true;
+    var blocks = this.blocks, i = this.lastByteIndex;
+    blocks[16] = this.block;
+    blocks[i >>> 2] |= EXTRA[i & 3];
+    this.block = blocks[16];
+    if (i >= 56) {
+      if (!this.hashed) {
+        this.hash();
+      }
+      blocks[0] = this.block;
+      blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+    }
+    blocks[14] = this.hBytes << 3 | this.bytes >>> 29;
+    blocks[15] = this.bytes << 3;
+    this.hash();
+  };
+
+  Sha1.prototype.hash = function () {
+    var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;
+    var f, j, t, blocks = this.blocks;
+
+    for(j = 16; j < 80; ++j) {
+      t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];
+      blocks[j] =  (t << 1) | (t >>> 31);
+    }
+
+    for(j = 0; j < 20; j += 5) {
+      f = (b & c) | ((~b) & d);
+      t = (a << 5) | (a >>> 27);
+      e = t + f + e + 1518500249 + blocks[j] << 0;
+      b = (b << 30) | (b >>> 2);
+
+      f = (a & b) | ((~a) & c);
+      t = (e << 5) | (e >>> 27);
+      d = t + f + d + 1518500249 + blocks[j + 1] << 0;
+      a = (a << 30) | (a >>> 2);
+
+      f = (e & a) | ((~e) & b);
+      t = (d << 5) | (d >>> 27);
+      c = t + f + c + 1518500249 + blocks[j + 2] << 0;
+      e = (e << 30) | (e >>> 2);
+
+      f = (d & e) | ((~d) & a);
+      t = (c << 5) | (c >>> 27);
+      b = t + f + b + 1518500249 + blocks[j + 3] << 0;
+      d = (d << 30) | (d >>> 2);
+
+      f = (c & d) | ((~c) & e);
+      t = (b << 5) | (b >>> 27);
+      a = t + f + a + 1518500249 + blocks[j + 4] << 0;
+      c = (c << 30) | (c >>> 2);
+    }
+
+    for(; j < 40; j += 5) {
+      f = b ^ c ^ d;
+      t = (a << 5) | (a >>> 27);
+      e = t + f + e + 1859775393 + blocks[j] << 0;
+      b = (b << 30) | (b >>> 2);
+
+      f = a ^ b ^ c;
+      t = (e << 5) | (e >>> 27);
+      d = t + f + d + 1859775393 + blocks[j + 1] << 0;
+      a = (a << 30) | (a >>> 2);
+
+      f = e ^ a ^ b;
+      t = (d << 5) | (d >>> 27);
+      c = t + f + c + 1859775393 + blocks[j + 2] << 0;
+      e = (e << 30) | (e >>> 2);
+
+      f = d ^ e ^ a;
+      t = (c << 5) | (c >>> 27);
+      b = t + f + b + 1859775393 + blocks[j + 3] << 0;
+      d = (d << 30) | (d >>> 2);
+
+      f = c ^ d ^ e;
+      t = (b << 5) | (b >>> 27);
+      a = t + f + a + 1859775393 + blocks[j + 4] << 0;
+      c = (c << 30) | (c >>> 2);
+    }
+
+    for(; j < 60; j += 5) {
+      f = (b & c) | (b & d) | (c & d);
+      t = (a << 5) | (a >>> 27);
+      e = t + f + e - 1894007588 + blocks[j] << 0;
+      b = (b << 30) | (b >>> 2);
+
+      f = (a & b) | (a & c) | (b & c);
+      t = (e << 5) | (e >>> 27);
+      d = t + f + d - 1894007588 + blocks[j + 1] << 0;
+      a = (a << 30) | (a >>> 2);
+
+      f = (e & a) | (e & b) | (a & b);
+      t = (d << 5) | (d >>> 27);
+      c = t + f + c - 1894007588 + blocks[j + 2] << 0;
+      e = (e << 30) | (e >>> 2);
+
+      f = (d & e) | (d & a) | (e & a);
+      t = (c << 5) | (c >>> 27);
+      b = t + f + b - 1894007588 + blocks[j + 3] << 0;
+      d = (d << 30) | (d >>> 2);
+
+      f = (c & d) | (c & e) | (d & e);
+      t = (b << 5) | (b >>> 27);
+      a = t + f + a - 1894007588 + blocks[j + 4] << 0;
+      c = (c << 30) | (c >>> 2);
+    }
+
+    for(; j < 80; j += 5) {
+      f = b ^ c ^ d;
+      t = (a << 5) | (a >>> 27);
+      e = t + f + e - 899497514 + blocks[j] << 0;
+      b = (b << 30) | (b >>> 2);
+
+      f = a ^ b ^ c;
+      t = (e << 5) | (e >>> 27);
+      d = t + f + d - 899497514 + blocks[j + 1] << 0;
+      a = (a << 30) | (a >>> 2);
+
+      f = e ^ a ^ b;
+      t = (d << 5) | (d >>> 27);
+      c = t + f + c - 899497514 + blocks[j + 2] << 0;
+      e = (e << 30) | (e >>> 2);
+
+      f = d ^ e ^ a;
+      t = (c << 5) | (c >>> 27);
+      b = t + f + b - 899497514 + blocks[j + 3] << 0;
+      d = (d << 30) | (d >>> 2);
+
+      f = c ^ d ^ e;
+      t = (b << 5) | (b >>> 27);
+      a = t + f + a - 899497514 + blocks[j + 4] << 0;
+      c = (c << 30) | (c >>> 2);
+    }
+
+    this.h0 = this.h0 + a << 0;
+    this.h1 = this.h1 + b << 0;
+    this.h2 = this.h2 + c << 0;
+    this.h3 = this.h3 + d << 0;
+    this.h4 = this.h4 + e << 0;
+  };
+
+  Sha1.prototype.hex = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;
+
+    return HEX_CHARS[(h0 >>> 28) & 0x0F] + HEX_CHARS[(h0 >>> 24) & 0x0F] +
+           HEX_CHARS[(h0 >>> 20) & 0x0F] + HEX_CHARS[(h0 >>> 16) & 0x0F] +
+           HEX_CHARS[(h0 >>> 12) & 0x0F] + HEX_CHARS[(h0 >>> 8) & 0x0F] +
+           HEX_CHARS[(h0 >>> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
+           HEX_CHARS[(h1 >>> 28) & 0x0F] + HEX_CHARS[(h1 >>> 24) & 0x0F] +
+           HEX_CHARS[(h1 >>> 20) & 0x0F] + HEX_CHARS[(h1 >>> 16) & 0x0F] +
+           HEX_CHARS[(h1 >>> 12) & 0x0F] + HEX_CHARS[(h1 >>> 8) & 0x0F] +
+           HEX_CHARS[(h1 >>> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
+           HEX_CHARS[(h2 >>> 28) & 0x0F] + HEX_CHARS[(h2 >>> 24) & 0x0F] +
+           HEX_CHARS[(h2 >>> 20) & 0x0F] + HEX_CHARS[(h2 >>> 16) & 0x0F] +
+           HEX_CHARS[(h2 >>> 12) & 0x0F] + HEX_CHARS[(h2 >>> 8) & 0x0F] +
+           HEX_CHARS[(h2 >>> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
+           HEX_CHARS[(h3 >>> 28) & 0x0F] + HEX_CHARS[(h3 >>> 24) & 0x0F] +
+           HEX_CHARS[(h3 >>> 20) & 0x0F] + HEX_CHARS[(h3 >>> 16) & 0x0F] +
+           HEX_CHARS[(h3 >>> 12) & 0x0F] + HEX_CHARS[(h3 >>> 8) & 0x0F] +
+           HEX_CHARS[(h3 >>> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
+           HEX_CHARS[(h4 >>> 28) & 0x0F] + HEX_CHARS[(h4 >>> 24) & 0x0F] +
+           HEX_CHARS[(h4 >>> 20) & 0x0F] + HEX_CHARS[(h4 >>> 16) & 0x0F] +
+           HEX_CHARS[(h4 >>> 12) & 0x0F] + HEX_CHARS[(h4 >>> 8) & 0x0F] +
+           HEX_CHARS[(h4 >>> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];
+  };
+
+  Sha1.prototype.toString = Sha1.prototype.hex;
+
+  Sha1.prototype.digest = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;
+
+    return [
+      (h0 >>> 24) & 0xFF, (h0 >>> 16) & 0xFF, (h0 >>> 8) & 0xFF, h0 & 0xFF,
+      (h1 >>> 24) & 0xFF, (h1 >>> 16) & 0xFF, (h1 >>> 8) & 0xFF, h1 & 0xFF,
+      (h2 >>> 24) & 0xFF, (h2 >>> 16) & 0xFF, (h2 >>> 8) & 0xFF, h2 & 0xFF,
+      (h3 >>> 24) & 0xFF, (h3 >>> 16) & 0xFF, (h3 >>> 8) & 0xFF, h3 & 0xFF,
+      (h4 >>> 24) & 0xFF, (h4 >>> 16) & 0xFF, (h4 >>> 8) & 0xFF, h4 & 0xFF
+    ];
+  };
+
+  Sha1.prototype.array = Sha1.prototype.digest;
+
+  Sha1.prototype.arrayBuffer = function () {
+    this.finalize();
+
+    var buffer = new ArrayBuffer(20);
+    var dataView = new DataView(buffer);
+    dataView.setUint32(0, this.h0);
+    dataView.setUint32(4, this.h1);
+    dataView.setUint32(8, this.h2);
+    dataView.setUint32(12, this.h3);
+    dataView.setUint32(16, this.h4);
+    return buffer;
+  };
+
+  function HmacSha1(key, sharedMemory) {
+    var i, result = formatMessage(key);
+    key = result[0];
+    if (result[1]) {
+      var bytes = [], length = key.length, index = 0, code;
+      for (i = 0; i < length; ++i) {
+        code = key.charCodeAt(i);
+        if (code < 0x80) {
+          bytes[index++] = code;
+        } else if (code < 0x800) {
+          bytes[index++] = (0xc0 | (code >>> 6));
+          bytes[index++] = (0x80 | (code & 0x3f));
+        } else if (code < 0xd800 || code >= 0xe000) {
+          bytes[index++] = (0xe0 | (code >>> 12));
+          bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
+          bytes[index++] = (0x80 | (code & 0x3f));
+        } else {
+          code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
+          bytes[index++] = (0xf0 | (code >>> 18));
+          bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));
+          bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));
+          bytes[index++] = (0x80 | (code & 0x3f));
+        }
+      }
+      key = bytes;
+    }
+
+    if (key.length > 64) {
+      key = (new Sha1(true)).update(key).array();
+    }
+
+    var oKeyPad = [], iKeyPad = [];
+    for (i = 0; i < 64; ++i) {
+      var b = key[i] || 0;
+      oKeyPad[i] = 0x5c ^ b;
+      iKeyPad[i] = 0x36 ^ b;
+    }
+
+    Sha1.call(this, sharedMemory);
+
+    this.update(iKeyPad);
+    this.oKeyPad = oKeyPad;
+    this.inner = true;
+    this.sharedMemory = sharedMemory;
+  }
+  HmacSha1.prototype = new Sha1();
+
+  HmacSha1.prototype.finalize = function () {
+    Sha1.prototype.finalize.call(this);
+    if (this.inner) {
+      this.inner = false;
+      var innerHash = this.array();
+      Sha1.call(this, this.sharedMemory);
+      this.update(this.oKeyPad);
+      this.update(innerHash);
+      Sha1.prototype.finalize.call(this);
+    }
+  };
+
+  var exports = createMethod();
+  exports.sha1 = exports;
+  exports.sha1.hmac = createHmacMethod();
+
+  if (COMMON_JS) {
+    module.exports = exports;
+  } else {
+    root.sha1 = exports;
+    if (AMD) {
+      define(function () {
+        return exports;
+      });
+    }
+  }
+})();

+ 5 - 0
package-lock.json

@@ -19,6 +19,11 @@
             "resolved": "https://registry.npmmirror.com/is-buffer/-/is-buffer-1.1.6.tgz",
             "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
         },
+        "js-sha1": {
+            "version": "0.7.0",
+            "resolved": "https://registry.npmmirror.com/js-sha1/-/js-sha1-0.7.0.tgz",
+            "integrity": "sha512-oQZ1Mo7440BfLSv9TX87VNEyU52pXPVG19F9PL3gTgNt0tVxlZ8F4O6yze3CLuLx28TxotxvlyepCNaaV0ZjMw=="
+        },
         "md5": {
             "version": "2.3.0",
             "resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
         ]
     },
     "dependencies": {
+        "js-sha1": "^0.7.0",
         "md5": "^2.3.0"
     }
 }

+ 52 - 264
pages/home/home.vue

@@ -1,70 +1,19 @@
 <template>
 	<view class="home-wrap">
-		<view class="title-wrap">
-			<view class="title-header">
-				<view class="title-item" v-for="(item,index) in titleData" :key="index">
-					<text class="item-text">{{item.name}}</text>
-					<text class="item-nub">{{item.value}}</text>
+		<view class="home-title">
+			<view class="title-bac">
+				<view class="roomt">
+					<span class="rom-spn">当前所在仓库</span>
+					<span class="quit-spn"></span>
 				</view>
-			</view>
-			<view class="apploct-wrap">
-				<view class="applict-title">
-					<view class="icon-title">
-
-					</view>
-					<text class="aplition-name">应用管理</text>
-				</view>
-				<view class="app-wrap">
-					<view class="app-item" v-for="(item,index) in appData" :key="index">
-						<navigator :url="item.path" hover-class="navigator-hover">
-							<view class="icon-wrap" :style="{background:item.bgColor}">
-								<view class="icon-imag" :style="{'background-image':'url('+item.iconUrl+')'}">
-
-								</view>
-							</view>
-							<text class="icon-text">{{item.name}}</text>
-						</navigator>
-					</view>
-				</view>
-			</view>
-
-		</view>
-		<view class="ground-wrap">
-			<view class="ground-title">
-				<view class="ground-icon"></view>
-				<ren-dropdown-filter :filterData='filterData' :defaultIndex='defaultIndex' @ed='ed'
-					:stylesData="{padding:'0 0 0 80rpx'}" @onSelected='dateChange'></ren-dropdown-filter>
-				<view class="left-btn" @click="moreView()">
-					<view class="left-text">更多</view>
-					<view class="right-icon"></view>
+				<view class="rom-set">
+					<view class="park"></view>
+					<view class="houseName">{{houseName}}</view>
+					<view class="down"></view>
 				</view>
 			</view>
-			<view class="list-wrap" v-if="groundData.length>0">
-				<view class="list-item" v-for="(item,index) in groundData" :key="index">
-					<view class="list-data">
-						<text class="text-label">单据编号:</text>
-						<text class="text-cont">{{item.id_instock}}</text>
-					</view>
-					<view class="list-data">
-						<text class="text-label">供应商:</text>
-						<text class="text-cont">{{item.lykf}}</text>
-					</view>
-					<view class="list-data">
-						<text class="text-label">商品数量:</text>
-						<text class="text-cont">{{item.qty}}</text>
-					</view>
-					<view class="list-data">
-						<text class="text-label">单据时间:</text>
-						<text class="text-cont">{{item.rq}}</text>
-					</view>
-					<view class="status-text">{{item.flag}}</view>
-				</view>
-			</view>
-			<view class="empty-view" v-if="groundData.length==0">
-				暂无数据
-			</view>
 		</view>
-	</view>
+
 	</view>
 </template>
 
@@ -82,9 +31,9 @@
 
 		},
 		mounted() {
-			this.getDataList({
-				type: "NotOut"
-			});
+			// this.getDataList({
+			// 	type: "NotOut"
+			// });
 		},
 		computed: {
 			...mapState(['groundData'])
@@ -92,23 +41,7 @@
 		data() {
 			return {
 				listData: listData,
-				filterData: [
-					[{
-						text: '待上架',
-						value: 'NotOut'
-					}, {
-						text: '已上架',
-						value: 'YesOut'
-					}]
-				],
-				defaultIndex: [0],
-				titleData: [{
-					name: "待上架",
-					value: 15
-				}, {
-					name: "待出库",
-					value: 15
-				}],
+				houseName: "一号仓库",
 				appData: [{
 						iconUrl: "../../static/shangjia.png",
 						name: "上架确认",
@@ -172,218 +105,73 @@
 		width: 100%;
 		height: 100%;
 		overflow-y: auto;
-		background-color: #F1F1F1;
 
-		.title-wrap {
+		.home-title {
 			width: 100%;
-			height: 480rpx;
-			background-color: #4749A1;
-
-			.title-header {
-				width: 100%;
-				height: 160rpx;
-				display: flex;
-				justify-content: space-around;
-
-				.title-item {
-					width: 120rpx;
-					height: 100%;
-					text-align: center;
-					padding-top: 36rpx;
-
-					.item-text {
-						width: 100%;
-						color: rgba(255, 255, 255, 0.58);
-						font-size: 32rpx;
-					}
-
-					.item-nub {
-						width: 100%;
-						color: #fff;
-						display: inline-block;
-						margin-top: 20rpx;
-						font-size: 56rpx;
-						font-family: PingFangSC-semiBold;
-					}
-				}
-			}
-		}
-
-
-		.apploct-wrap {
-			width: 95%;
-			background-color: #fff;
-			border-radius: 10rpx;
-			margin: 0 auto;
-			margin-top: 45rpx;
-			padding: 10rpx;
-			box-sizing: border-box;
-
-			.applict-title {
-				width: 100%;
-				height: 70rpx;
-				display: flex;
-				align-items: center;
-				border-bottom: 1px solid #CECDCE;
-
-				.icon-title {
-					width: 48rpx;
-					height: 48rpx;
-					background-image: url('../../static/apploction.svg');
-				}
-
-				.aplition-name {
-					font-size: 32rpx;
-					margin-left: 20rpx;
-					font-family: PingFangSC-semiBold;
-				}
-			}
+			height: auto;
 
-			.app-wrap {
+			.title-bac {
 				width: 100%;
-				margin-top: 25rpx;
-				display: flex;
-				flex-wrap: wrap;
-
-				.app-item {
-					width: 25%;
-					height: 170rpx;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					justify-content: space-around;
-
-					.icon-wrap {
-						width: 100rpx;
-						height: 100rpx;
-						border-radius: 50%;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-
-						.icon-imag {
-							width: 60rpx;
-							height: 60rpx;
-							background-size: 100% 100%;
-						}
-					}
-
-					.icon-text {
-						font-size: 24rpx;
-						font-family: PingFangSC-semiBold;
-					}
-				}
-			}
-		}
-
-		.ground-wrap {
-			width: 95%;
-			margin: 0 auto;
-			border-radius: 20rpx;
-			background-color: #fff;
-			margin-top: 200rpx;
-			min-height: 900rpx;
-
-			.ground-title {
-				width: 100%;
-				height: 100rpx;
-				border-bottom: 1px solid #ccc;
-				display: flex;
-				align-items: center;
+				height: 392rpx;
+				border-radius: 0rpx 0rpx 40rpx 40rpx;
+				background: linear-gradient(180deg, rgba(1, 169, 146, 1) 0%, rgba(1, 176, 164, 0.54) 46%, rgba(2, 181, 176, 0.24) 100%, rgba(2, 185, 185, 0) 100%);
 				padding: 20rpx;
 				box-sizing: border-box;
-				position: relative;
-
-				.ground-icon {
-					width: 48rpx;
-					height: 48rpx;
-					background-image: url("../../static/far.svg");
-					background-size: 100% 100%;
-					z-index: 51;
-				}
 
-				.left-btn {
-					width: 120rpx;
-					height: 48rpx;
-					position: absolute;
-					right: 10rpx;
-					top: 50%;
-					margin-top: -24rpx;
-					z-index: 51;
+				.roomt {
+					width: 100%;
+					height: 70rpx;
 					display: flex;
 					align-items: center;
 					justify-content: space-between;
 
-					.right-icon {
+					.rom-spn {
+						color: rgba(255, 255, 255, 0.9);
+						font-size: 36rpx;
+						text-align: left;
+						font-family: PingFangSC-bold;
+					}
+
+					.quit-spn {
 						width: 48rpx;
 						height: 48rpx;
-						background-image: url('../../static/aright.svg');
+						background: url('../../static/logout.svg');
 						background-size: 100% 100%;
 					}
 
-					.left-text {
-						font-size: 30rpx;
-					}
 				}
-			}
-
-			.list-wrap {
-				width: 100%;
-				background-color: #fff;
-				height: auto;
 
-				.list-item {
+				.rom-set {
 					width: 100%;
-					height: 260rpx;
-					border-bottom: 1px solid #ccc;
-					padding: 20rpx 20rpx 20rpx 50rpx;
-					box-sizing: border-box;
-					position: relative;
+					height: 50rpx;
+					display: flex;
+					align-items: center;
 
-					.list-data {
-						width: 70%;
+					.park {
+						width: 40rpx;
 						height: 40rpx;
-						line-height: 40rpx;
-						margin-top: 10rpx;
-
-						.text-label {
-							color: rgba(16, 16, 16, 1);
-							font-size: 28rpx;
-							font-family: PingFangSC-medium;
-						}
+						background: url('../../static/iconPark.svg');
+						background-size: 100% 100%;
+					}
 
-						.text-cont {
-							color: rgba(16, 16, 16, 1);
-							font-size: 28rpx;
-							font-family: PingFangSC-regular;
-						}
+					.houseName {
+						color: rgba(255, 255, 255, 0.9);
+						font-size: 36rpx;
+						text-align: left;
+						font-family: OPPOSans-medium;
+						margin-left:20rpx;
 					}
 
-					.status-text {
-						width: 100rpx;
+					.down {
+						width: 40rpx;
 						height: 40rpx;
-						position: absolute;
-						right: 20rpx;
-						top: 30rpx;
-						font-family: PingFangSC-semiBold;
-						font-size: 28rpx;
-						color: rgba(71, 73, 161, 0.86);
+						background: url('../../static/down.svg');
+						background-size: 100% 100%;
+						margin-left:20rpx;
 					}
 				}
 			}
-
-			.empty-view {
-				width: 100%;
-				height: 300rpx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				margin: auto;
-				color: #818181;
-				font-size: 30rpx;
-			}
 		}
-
 	}
 
 	uni-page-body {

+ 31 - 7
pages/login/index.vue

@@ -1,5 +1,11 @@
 <template>
 	<view class="content">
+		<view class="title-text">
+			欢迎登录!
+		</view>
+		<view class="title-icon">
+
+		</view>
 		<loginPassword :themeColor="themeColor" :logoUrl="logoUrl" @loginFun="loginFun"></loginPassword>
 	</view>
 </template>
@@ -23,10 +29,8 @@
 		methods: {
 			loginFun(data) {
 				this.$http('common.login', data, '登录中', true).then((res) => {
-					if (res.success == "true") {
-						if (res.data && res.data.length > 0) {
-							uni.setStorageSync('token', res.data[0].token);
-						}
+					if (res.success == true) {
+						uni.setStorageSync('token', res.data.token);
 						uni.showToast({
 							title: '登录成功',
 							icon: 'none',
@@ -44,12 +48,32 @@
 	}
 </script>
 
-<style>
+<style scoped lang="scss">
 	.content {
 		width: 100%;
 		height: 100%;
-		/* 	background: url('../../static/home.png');
+		background: url('../../static/loginback.png');
 		background-size: 100% 100%;
-		overflow: auto; */
+		padding-top: 60rpx;
+		position: relative;
+
+		.title-text {
+			width: 200rpx;
+			height: 56rpx;
+			font-family: PingFangSC-bold;
+			font-weight: normal;
+			font-size: 40rpx;
+			margin-left: 50rpx;
+		}
+
+		.title-icon {
+			position: absolute;
+			right: 0rpx;
+			top: 90rpx;
+			width: 358rpx;
+			height: 358rpx;
+			background: url('../../static/icontitle.svg');
+			background-size: 100% 100%;
+		}
 	}
 </style>

+ 2 - 2
request/api.js

@@ -1,8 +1,8 @@
 export default {
 	common: {
-		// 举例api
+		// 登录
 		login: {
-			url: "/SPDapi/LogInfo",
+			url: "/web/lgin/userLgin",
 			auth: false,
 			method: "POST",
 		},

+ 22 - 18
request/index.js

@@ -4,7 +4,7 @@ const shoproRequest = new Request();
 export default function http(url,
 	data = {},
 	toastBefore = '', // 请求前加载提示
-	toastAfter = false, // 请求后错误提示
+	toastAfter = true, // 请求后错误提示
 ) {
 	let api = getApiPath(url);
 	/* 请求之前拦截器 */
@@ -16,6 +16,10 @@ export default function http(url,
 				title: '暂未登录,请先登录',
 				icon: 'none'
 			});
+			uni.navigateTo({
+				url: '/pages/login/index',
+				success: function(res) {}
+			});
 			throw (`暂未登录,已阻止此次API请求: '${api.url}'`);
 		}
 		token && shoproRequest.setConfig(config => {
@@ -32,27 +36,27 @@ export default function http(url,
 	/* 请求之后拦截器 */
 	shoproRequest.interceptor.response((response) => {
 		uni.hideLoading();
-		if (response.code !== 0) {
+		if (response.statusCode !== 200 || response.data.success === false) {
 			if (toastAfter) {
-				uni.showToast({
-					title: response.msg || '请求出错,稍后重试',
-					icon: 'none',
-					duration: 1000,
-					mask: true
-				});
+				if (response.statusCode === 401 || response.code === 502) {
+					uni.showToast({
+						title: '请重新登录!',
+						icon: 'none',
+						duration: 1000,
+						mask: true
+					});
+				} else {
+					uni.showToast({
+						title: response.data.message || '请求出错,稍后重试',
+						icon: 'none',
+						duration: 1000,
+						mask: true
+					});
+				}
 			}
-
 		}
 
-		// token过期注销
-		if (response.code === 161099 || response.code === 160003) {
-			uni.showToast({
-				title: '登录已过期或注销',
-				icon: 'none',
-			});
-			throw (`登录已过期或注销,已阻止请求: '${api.url}'`);
-		}
-		return response
+		return response.data
 	})
 	return shoproRequest.request({
 		url: api.url,

+ 4 - 7
request/request.js

@@ -1,16 +1,13 @@
 // request请求封装
-import {
-	BASE_URL,
-	API_URL
-} from '@/env.js';
+const baseurl = require("../env.js");
 export default class Request {
 	constructor() {
 		// 默认配置
 		this.config = {
-			baseUrl: '/SPDapi',
+			baseUrl: baseurl,
 			header: {
 				'content-type': 'application/json;charset=UTF-8',
-				 "Accept": "application/json;charset=UTF-8"
+				"Accept": "application/json;charset=UTF-8"
 			},
 			url: '',
 			data: {},
@@ -94,7 +91,7 @@ export default class Request {
 			}
 			options.url = mergeUrl
 			options.success = res => {
-				resolve(this.requestAfter(res.data))
+				resolve(this.requestAfter(res))
 			}
 			options.fail = err => {
 				reject(this.requestAfter(err))

+ 6 - 0
static/down.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 448 512" width="20" height="20" style="" filter="none">
+    
+    <g>
+    <path d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" fill="rgba(255,255,255,1)"></path>
+    </g>
+  </svg>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 6 - 0
static/iconPark.svg


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 6 - 0
static/icontitle.svg


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 6 - 0
static/logout.svg


+ 5 - 3
vue.config.js

@@ -1,11 +1,13 @@
+
+const baseurl = require("./env.js");
 module.exports = {
 	devServer: {
 		proxy: {
-			'/SPDapi': {
-				target: 'http://192.168.0.163:9993',
+			[baseurl]: {
+				target: 'http://192.168.0.246:8601',
 				changeOrigin: true,
 				pathRewrite: {
-					'^/SPDapi': '/'
+					["^" + baseurl]: ""
 				}
 			}
 		},