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

tui

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