mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 13:26:41 +08:00
更新忽略问题
This commit is contained in:
parent
3c05d17213
commit
23258bc320
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
@ -8,7 +8,7 @@ const baseUrl = 'https://app.demo.winqi.cn/'; //const baseUrl = 'http://hc.demo.
|
||||
|
||||
const hcBaseUrl = 'https://hc.demo.winqi.cn'; // 登录接口
|
||||
|
||||
const loginUrl = baseUrl + 'app/loginWx';
|
||||
const loginUrl = baseUrl + 'app/loginProperty';
|
||||
const areaUrl = baseUrl + "app/area.listAreas";
|
||||
const GetNoticeListUrl = baseUrl + 'app/api.queryNotices'; //报修接口
|
||||
|
||||
|
||||
@ -59,13 +59,15 @@ class LoginFactory {
|
||||
return ;
|
||||
}
|
||||
|
||||
let _userInfo = JSON.parse(util.des.desDecrypt(userInfo));
|
||||
|
||||
uni.request({
|
||||
url: constant.url.loginUrl,
|
||||
method: 'post',
|
||||
header: {
|
||||
APP_ID: constant.app.appId
|
||||
},
|
||||
data: userInfo,
|
||||
data: _userInfo,
|
||||
success: function (res) {
|
||||
console.log('login success...:');
|
||||
res = res.data;
|
||||
|
||||
6059
lib/crypto-js.js
Normal file
6059
lib/crypto-js.js
Normal file
File diff suppressed because it is too large
Load Diff
6
main.js
6
main.js
@ -2,10 +2,14 @@ import Vue from 'vue'
|
||||
import App from './App'
|
||||
import Java110Context from './context/Java110Context.js'
|
||||
|
||||
import cuCustom from './colorui/components/cu-custom.vue'
|
||||
Vue.component('cu-custom',cuCustom)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
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'
|
||||
|
||||
|
||||
11
package-lock.json
generated
Normal file
11
package-lock.json
generated
Normal 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=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,13 @@
|
||||
,{
|
||||
"path" : "pages/login/login",
|
||||
"style" : {
|
||||
"navigationBarTitleText": "请登录"
|
||||
// "navigationBarTitleText": "请登录"
|
||||
"app-plus": {
|
||||
"titleNView": false,
|
||||
"bounce": "none",
|
||||
"scrollIndicator": "none"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,28 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="cu-avatar xl round margin-left lage-avatar" style="background-image:url('logo.png');"></view>
|
||||
<view class="margin-top">
|
||||
<text>{{staffInfo.name}}</text>
|
||||
<view class="login-nav flex justify-center align-center">
|
||||
<text>
|
||||
请登录
|
||||
</text>
|
||||
</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>
|
||||
@ -13,20 +32,92 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
username: '',
|
||||
password: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.hideTabBar({
|
||||
animation:false
|
||||
animation: false
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
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>
|
||||
|
||||
<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>
|
||||
|
||||
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 14 KiB |
34
utils/DesUtil.js
Normal file
34
utils/DesUtil.js
Normal 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
|
||||
}
|
||||
@ -5,7 +5,10 @@ const coreUtil = require("./CoreUtil.js");
|
||||
|
||||
const dateUtil = require("./DateUtil.js");
|
||||
|
||||
const desUtil = require("./DesUtil.js");
|
||||
|
||||
module.exports = {
|
||||
core: coreUtil,
|
||||
date: dateUtil
|
||||
date: dateUtil,
|
||||
des:desUtil
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user