fix: 根据项目code个性化定制的bug
This commit is contained in:
parent
4918d99218
commit
8629e1bf61
|
@ -6,6 +6,7 @@ NODE_ENV = development
|
|||
# VUE_APP_TITLE = '托克逊能源管理平台'
|
||||
# VUE_APP_TITLE = '中建材光子科技有限公司'
|
||||
VUE_APP_TITLE = '超低排放系统'
|
||||
VUE_APP_PJ = 'pf'
|
||||
|
||||
# 接口地址
|
||||
#VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
|
||||
|
|
|
@ -406,9 +406,10 @@ export default {
|
|||
},
|
||||
config: {
|
||||
base: {
|
||||
url: `${config.API_URL}/system/base_config/`,
|
||||
name: "账户信息",
|
||||
req: async function(project){
|
||||
return await http.get(`${config.API_URL}/system/base_config${project}`);
|
||||
req: async function(data){
|
||||
return await http.get(this.url, data);
|
||||
}
|
||||
},
|
||||
getInfo: {
|
||||
|
|
|
@ -10,8 +10,7 @@ const routes = [
|
|||
"meta": {
|
||||
"title": "工作台",
|
||||
"icon": "el-icon-home-filled",
|
||||
"type": "menu",
|
||||
"perms": ["photon"]
|
||||
"type": "menu"
|
||||
},
|
||||
"children": [
|
||||
//首页
|
||||
|
|
|
@ -128,19 +128,33 @@ export default {
|
|||
var res1 = await that.$API.auth.info.get();
|
||||
that.$TOOL.data.set("USER_INFO", res1);
|
||||
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
||||
let base_name_short = this.$TOOL.data.get('BASE_INFO').base.base_name_short;
|
||||
console.log(this.$TOOL.data.get('BASE_INFO'))
|
||||
if (base_name_short == '托克逊能管') {
|
||||
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
||||
if (base_dashboard == null || base_dashboard == undefined) {
|
||||
base_dashboard = '/dashboard'
|
||||
}
|
||||
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
||||
that.$API.am.area.list.req({ page_size: 999 }).then(res => {
|
||||
if (res.err_msg) {
|
||||
} else {
|
||||
debugger;
|
||||
let areaList = res.results;
|
||||
that.$TOOL.data.set("qyjyAreaList", areaList);
|
||||
if (res1.type === 'employee') {
|
||||
this.$router.replace({
|
||||
path: "/dashboard_enm",
|
||||
path: "/",
|
||||
});
|
||||
} else if (base_name_short == '光子科技') {
|
||||
} else {
|
||||
this.$router.replace({
|
||||
path: "/dashboard_photon",
|
||||
path: "/rpm/rpj",
|
||||
});
|
||||
} else if (base_name_short == '超低排放') {
|
||||
}
|
||||
that.$message.success("Login Success 登录成功");
|
||||
that.islogin = false;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$router.replace({
|
||||
path: "/dashboard_enp",
|
||||
path: base_dashboard,
|
||||
});
|
||||
}
|
||||
// if(this.$TOOL.data.get('BASE_INFO').base.base_name_short=='托克逊能管'){//托克逊
|
||||
|
@ -175,6 +189,8 @@ export default {
|
|||
} catch (err) {
|
||||
that.islogin = false;
|
||||
console.log(err);
|
||||
} finally {
|
||||
that.islogin = false;
|
||||
}
|
||||
// var res = await this.$API.auth.token.post(data)
|
||||
// console.log(res, err)
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
<template>
|
||||
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
|
||||
<el-form-item prop="phone" style="margin-bottom: 25px;">
|
||||
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
|
||||
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable
|
||||
:placeholder="$t('login.mobilePlaceholder')">
|
||||
<template #prepend>+86</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" style="margin-bottom: 35px;">
|
||||
<div class="login-msg-yzm">
|
||||
<el-input v-model="form.code" prefix-icon="el-icon-unlock" clearable :placeholder="$t('login.smsPlaceholder')"></el-input>
|
||||
<el-button @click="getYzm" :disabled="disabled">{{this.$t('login.smsGet')}}<span v-if="disabled"> ({{time}})</span></el-button>
|
||||
<el-input v-model="form.code" prefix-icon="el-icon-unlock" clearable
|
||||
:placeholder="$t('login.smsPlaceholder')"></el-input>
|
||||
<el-button @click="getYzm" :disabled="disabled">{{ this.$t('login.smsGet') }}<span v-if="disabled">
|
||||
({{ time }})</span></el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
|
||||
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn')
|
||||
}}</el-button>
|
||||
</el-form-item>
|
||||
<!-- <div class="login-reg">
|
||||
{{$t('login.noAccount')}} <router-link to="/user_register">{{$t('login.createAccount')}}</router-link>
|
||||
|
@ -31,14 +35,16 @@
|
|||
rules: {
|
||||
phone: [
|
||||
{ required: true, message: this.$t('login.mobileError') },
|
||||
{validator: (rule, value, callback) => {
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
let reg = /^1[3456789]\d{9}$/;
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error('请输入正确的手机号'));
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
code: [
|
||||
|
@ -90,11 +96,11 @@
|
|||
that.$API.auth.info.get().then(res1 => {
|
||||
that.$TOOL.data.set("USER_INFO", res1);
|
||||
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
||||
if(this.$TOOL.data.get('BASE_INFO').base.base_name_short=='托克逊能管'){//托克逊
|
||||
this.$router.replace({
|
||||
path: "/dashboard_enm",
|
||||
});
|
||||
}else{//曲阳金隅
|
||||
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
||||
if (base_dashboard == null || base_dashboard == undefined) {
|
||||
base_dashboard = '/dashboard'
|
||||
}
|
||||
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
||||
that.$API.am.area.list.req({ page_size: 999 }).then(res => {
|
||||
if (res.err_msg) {
|
||||
} else {
|
||||
|
@ -114,6 +120,10 @@
|
|||
that.islogin = false;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$router.replace({
|
||||
path: base_dashboard,
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
|
@ -127,6 +137,4 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<style></style>
|
||||
|
|
|
@ -158,13 +158,15 @@ export default {
|
|||
methods: {
|
||||
getDept() {
|
||||
let that = this;
|
||||
let project = '';
|
||||
if (that.project_code == undefined) {
|
||||
project = '/';
|
||||
} else {
|
||||
project = '?project_code=' + that.project_code;
|
||||
let req = {};
|
||||
if (that.project_code == undefined || that.project_code == '#') {
|
||||
if (process.env.NODE_ENV == 'development') {
|
||||
req.project_code = process.env.VUE_APP_PJ;
|
||||
}
|
||||
that.$API.system.config.base.req(project).then((res) => {
|
||||
} else {
|
||||
req.project_code = that.project_code;
|
||||
}
|
||||
that.$API.system.config.base.req(req).then((res) => {
|
||||
that.baseConfig = res.base;
|
||||
that.$store.commit("SET_baseName", res.base.base_name);
|
||||
that.$store.commit("SET_baseLogo", res.base.base_logo);
|
||||
|
|
Loading…
Reference in New Issue