Commit 3c68eb62 authored by 姬鋆屾's avatar 姬鋆屾

tui

parent bff937dd
......@@ -14,3 +14,4 @@ VUE_APP_PORTAL_PORT = 21085
# 站点请求地址
VUE_APP_SITETREE_URL = http://8.136.255.30:11078/base/site/siteTree
VUE_APP_API_appName = '智慧办公管理平台'
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>智慧办公平台</title>
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/index.css">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= VUE_APP_API_appName %></title>
<link
rel="stylesheet"
href="https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/index.css"
/>
</head>
<body>
<noscript>
<strong>We're sorry but app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong
>We're sorry but app doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
......
......@@ -7,23 +7,34 @@
<script>
export default {
mounted() {
let token = this.$route.query.token
console.log("token:"+token)
if(token ) {
let token = this.$route.query.token;
if (token) {
this.$route.query.sysName
? localStorage.setItem("sysName", this.$route.query.sysName)
: "";
this.$route.query.sysLogo
? localStorage.setItem("sysLogo", this.$route.query.sysLogo)
: "";
process.env.VUE_APP_API_appName = this.$route.query.sysName
? this.$route.query.sysName
: process.env.VUE_APP_API_appName;
window.sessionStorage.setItem("token", token);
this.$router.push('/index') // 有token直接跳转首页
}else{
this.$router.push("/index"); // 有token直接跳转首页
} else {
this.$message({
message: '没有权限,正在跳转登录页面...',
center: true
});
setTimeout(function(){
window.location.href=process.env.VUE_APP_PORTAL_URL=='undefined'?'http://192.168.0.98:11072':process.env.VUE_APP_PORTAL_URL
//this.$router.push('/login')
},1000)
message: "没有权限,正在跳转登录页面...",
center: true,
});
setTimeout(function() {
window.location.href =
process.env.VUE_APP_PORTAL_URL == "undefined"
? "http://192.168.0.98:11072"
: process.env.VUE_APP_PORTAL_URL;
//this.$router.push('/login')
}, 1000);
}
}
}
},
};
</script>
<style>
......@@ -31,4 +42,4 @@ export default {
width: 300px;
height: 100px;
}
</style>
\ No newline at end of file
</style>
......@@ -3,32 +3,40 @@
<template>
<div class="page page-login flex flex-v">
<div class="form-wrap flex flex-1">
<el-form @submit.prevent='onSubmit' ref="form" :model="form" label-width="80px" size="small">
<h1>智慧办公管理平台</h1>
<el-form
@submit.prevent="onSubmit"
ref="form"
:model="form"
label-width="80px"
size="small"
>
<h1>{{ sysName }}</h1>
<el-form-item label="用户名">
<el-input v-model="form.loginName"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" type='password'></el-input>
<el-input v-model="form.password" type="password"></el-input>
</el-form-item>
<el-form-item size="large">
<el-button type="primary" native-type='submit' :loading='loading' @click='onSubmit'>登录</el-button>
<el-button
type="primary"
native-type="submit"
:loading="loading"
@click="onSubmit"
>登录</el-button
>
</el-form-item>
</el-form>
</div>
<div class="footer">
</div>
<div class="footer"></div>
</div>
</template>
<script>
export default {
name: "login",
created() {
},
created() {},
methods: {
login() {
this.loading = true;
......@@ -38,7 +46,7 @@ export default {
},
loginSuccess({ data }) {
this.$store.commit("setUserData", data);
console.log("userData",this.$store.state.userData)
console.log("userData", this.$store.state.userData);
this.$router.replace({
path: this.redirect,
});
......@@ -72,6 +80,7 @@ export default {
loginName: "",
password: "",
},
sysName: process.env.VUE_APP_API_appName,
};
},
};
......@@ -120,4 +129,3 @@ export default {
}
}
</style>
module.exports = {
productionSourceMap: false,
assetsDir: 's',
configureWebpack: {
externals: {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
"element-ui": "ELEMENT"
},
},
lintOnSave:false,
devServer: {
inline: true,
disableHostCheck: true,
port: 8085,
hot: true,//自动保存
proxy: {
'/office': {
target: 'http://8.136.255.30:11078',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
}
}
}
}
productionSourceMap: false,
assetsDir: "s",
configureWebpack: {
externals: {
vue: "Vue",
vuex: "Vuex",
"vue-router": "VueRouter",
"element-ui": "ELEMENT",
},
},
lintOnSave: false,
devServer: {
inline: true,
disableHostCheck: true,
port: 8085,
hot: true, //自动保存
proxy: {
"/office": {
target: "http://192.168.0.98:11072",
// target: 'http://8.136.255.30:11078',
changeOrigin: true,
secure: false,
cookieDomainRewrite: "localhost",
},
},
},
};
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