更新忽略问题

This commit is contained in:
wuxw 2020-02-22 23:34:06 +08:00
parent 3c05d17213
commit 23258bc320
12 changed files with 6425 additions and 213 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
.DS_Store

View File

@ -8,7 +8,7 @@ const baseUrl = 'https://app.demo.winqi.cn/'; //const baseUrl = 'http://hc.demo.
const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口 const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口
const loginUrl = baseUrl + 'app/loginWx'; const loginUrl = baseUrl + 'app/loginProperty';
const areaUrl = baseUrl + "app/area.listAreas"; const areaUrl = baseUrl + "app/area.listAreas";
const GetNoticeListUrl = baseUrl + 'app/api.queryNotices'; //报修接口 const GetNoticeListUrl = baseUrl + 'app/api.queryNotices'; //报修接口

View File

@ -59,13 +59,15 @@ class LoginFactory {
return ; return ;
} }
let _userInfo = JSON.parse(util.des.desDecrypt(userInfo));
uni.request({ uni.request({
url: constant.url.loginUrl, url: constant.url.loginUrl,
method: 'post', method: 'post',
header: { header: {
APP_ID: constant.app.appId APP_ID: constant.app.appId
}, },
data: userInfo, data: _userInfo,
success: function (res) { success: function (res) {
console.log('login success...:'); console.log('login success...:');
res = res.data; res = res.data;

6059
lib/crypto-js.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,14 @@ import Vue from 'vue'
import App from './App' import App from './App'
import Java110Context from './context/Java110Context.js' import Java110Context from './context/Java110Context.js'
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.java110Context = Java110Context; Vue.prototype.java110Context = Java110Context;
Vue.prototype.java110Context = Java110Context; Vue.prototype.java110Constant = Java110Context.constant;
Vue.prototype.java110Factory = Java110Context.factory;
Vue.prototype.java110Util = Java110Context.util;
App.mpType = 'app' App.mpType = 'app'

11
package-lock.json generated Normal file
View File

@ -0,0 +1,11 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
}
}
}

View File

@ -21,7 +21,13 @@
,{ ,{
"path" : "pages/login/login", "path" : "pages/login/login",
"style" : { "style" : {
"navigationBarTitleText": "请登录" // "navigationBarTitleText": "请登录"
"app-plus": {
"titleNView": false,
"bounce": "none",
"scrollIndicator": "none"
},
"navigationStyle": "custom"
} }
} }

View File

@ -1,9 +1,28 @@
<template> <template>
<view> <view>
<view class="cu-avatar xl round margin-left lage-avatar" style="background-image:url('logo.png');"></view> <view class="login-nav flex justify-center align-center">
<view class="margin-top"> <text>
<text>{{staffInfo.name}}</text> 请登录
</text>
</view> </view>
<view class="flex justify-center logo">
<view class="cu-avatar xl round lage-avatar" style="background-image:url('/static/logo.png');"></view>
</view>
<view class="margin-top">
<view class="cu-form-group margin-top">
<view class="title">用户名</view>
<input placeholder="请输入用户名" name="input" v-model="username"></input>
</view>
<view class="cu-form-group">
<view class="title">密码</view>
<input placeholder="请输入密码" type="password" name="input" v-model="password"></input>
</view>
</view>
<view class="padding flex flex-direction">
<button class="cu-btn bg-green margin-tb-sm lg" @tap="doLogin()">登录</button>
</view>
</view> </view>
@ -13,20 +32,92 @@
export default { export default {
data() { data() {
return { return {
username: '',
password: ''
} }
}, },
onLoad() { onLoad() {
uni.hideTabBar({ uni.hideTabBar({
animation:false animation: false
}); });
}, },
methods: { methods: {
doLogin:function(){
if(this.username == ''){
uni.showToast({
icon:none,
title:"用户名不能为空"
});
return ;
}
if(this.password == ''){
uni.showToast({
icon:none,
title:"密码不能为空"
});
return ;
}
let userInfo = {
username:this.username,
password:this.password
}
uni.request({
url: this.java110Constant.url.loginUrl,
header: this.java110Context.getHeaders(),
data: userInfo,
success: function (res) {
console.log('login success');
res = res.data;
if(res.statusCode != 200){
uni.showToast({
title: res.data
});
return;
}
let _userInfo = this.java110Util.dec.desEncrypt(JSON.stringify(userInfo));
uni.setStorageSync(constant.mapping.USER_INFO,_userInfo);
uni.redirectTo({
url:"/page/index/index"
});
},
fail: function (error) {
//
uni.showToast({
title: '调用接口失败'
});
console.log(error);
}
});
}
} }
} }
</script> </script>
<style> <style>
.logo{
margin-top: 200upx;
margin-bottom: 100upx;
}
.logo view{
height: 200upx;
width: 200upx;
}
.login-nav{
background-color: #00AA00;
height: 90upx;
}
.login-nav text{
color: #FFFFFF;
font-size: 30upx;
}
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 14 KiB

34
utils/DesUtil.js Normal file
View File

@ -0,0 +1,34 @@
import CryptoJS from '../lib/crypto-js.js'
var keyvi = 'java110_hc_wuxw';
function des_encrypt(message) {
var key = CryptoJS.MD5(keyvi).toString();
var iv = CryptoJS.MD5(keyvi).toString();
var crypto_key = CryptoJS.enc.Utf8.parse(key);
var crypto_iv = CryptoJS.enc.Utf8.parse(iv.substr(0,8));
var encode_str = CryptoJS.TripleDES.encrypt(message, crypto_key, {
iv: crypto_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7});
return encode_str.toString();
}
//des解密 DES-EDE3-CBC
function des_decrypt(message)
{
var key = CryptoJS.MD5(keyvi).toString();
var iv = CryptoJS.MD5(keyvi).toString();
var crypto_key = CryptoJS.enc.Utf8.parse(key);
var crypto_iv = CryptoJS.enc.Utf8.parse(iv.substr(0,8));
var decrypt_str = CryptoJS.TripleDES.decrypt(message, crypto_key, {
iv: crypto_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7});
return decrypt_str.toString(CryptoJS.enc.Utf8);
}
module.exports = {
desEncrypt: des_encrypt,
desDecrypt: des_decrypt
}

View File

@ -5,7 +5,10 @@ const coreUtil = require("./CoreUtil.js");
const dateUtil = require("./DateUtil.js"); const dateUtil = require("./DateUtil.js");
const desUtil = require("./DesUtil.js");
module.exports = { module.exports = {
core: coreUtil, core: coreUtil,
date: dateUtil date: dateUtil,
des:desUtil
}; };