Browse Source

合并prod

prod
dai 4 years ago
parent
commit
e98cdbb9b7
  1. 2
      .env.production
  2. 2
      .env.production.uat
  3. 4
      public/index.html
  4. 2
      src/App.vue
  5. 2
      src/assets/scss/common.scss
  6. 2
      src/components/ren-process-detail/src/ren-process-detail.vue
  7. 2
      src/i18n/index.js
  8. 468
      src/js/ajax.js
  9. 4
      src/main.js
  10. 2
      src/mixins/view-module.js
  11. 102
      src/router/index.js
  12. 6
      src/utils/request.js
  13. 2
      src/views/components/tinymce/index.vue
  14. 6
      src/views/main-content.vue
  15. 6
      src/views/main-shuju/main-content.vue
  16. 2
      src/views/main-shuju/main-navbar.vue
  17. 16
      src/views/main-shuju/main.vue
  18. 89
      src/views/main.vue
  19. 4
      src/views/modules/activiti/model.vue
  20. 2
      src/views/modules/activiti/process-deploy.vue
  21. 2
      src/views/modules/activiti/process-initiation.vue
  22. 2
      src/views/modules/activiti/process.vue
  23. 2
      src/views/modules/base/resi.vue
  24. 2
      src/views/modules/message/mail-template-add-or-update.vue
  25. 2
      src/views/modules/oss/oss-upload.vue
  26. 12
      src/views/modules/shequ/index.vue
  27. 2
      src/views/modules/sys/news-add-or-update.vue
  28. 12
      src/views/modules/visual/communityParty/community.vue
  29. 2
      src/views/pages/404.vue
  30. 2
      src/views/pages/index.vue
  31. 2
      src/views/pages/login copy.vue
  32. 4
      src/views/pages/login.vue

2
.env.production

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api
VUE_APP_NODE_ENV=prod VUE_APP_NODE_ENV=prod
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper

2
.env.production.uat

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api VUE_APP_API_SERVER = http://120.27.18.76/api
VUE_APP_NODE_ENV=prod:uat VUE_APP_NODE_ENV=prod:uat
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper

4
public/index.html

@ -57,13 +57,13 @@
<!-- 验收测试环境 aliyun --> <!-- 验收测试环境 aliyun -->
<% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod:uat' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'http://120.27.18.76/api'
</script> </script>
<% } %> <% } %>
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='prod' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'https://epmet-cloud.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epdc-shibei.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>
</head> </head>

2
src/App.vue

@ -19,7 +19,7 @@ export default {
methods: { methods: {
i18nHandle (val, oldVal) { i18nHandle (val, oldVal) {
Cookies.set('language', val) localStorage.setItem('language', val)
document.querySelector('html').setAttribute('lang', val) document.querySelector('html').setAttribute('lang', val)
document.title = messages[val].brand.lg document.title = messages[val].brand.lg
// //

2
src/assets/scss/common.scss

@ -9,7 +9,7 @@ body {
font-size: $--font-size-base; font-size: $--font-size-base;
line-height: $base--line-height; line-height: $base--line-height;
color: $--color-text-primary; color: $--color-text-primary;
background-color: #fff; // background-color: #fff;
} }
a { a {
color: mix(#fff, $--color-primary, 20%); color: mix(#fff, $--color-primary, 20%);

2
src/components/ren-process-detail/src/ren-process-detail.vue

@ -69,7 +69,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL () { getResourceURL () {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': localStorage.getItem('token'),
'processInstanceId': this.dataForm.processInstanceId 'processInstanceId': this.dataForm.processInstanceId
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/his/getInstImage?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/his/getInstImage?${params}`

2
src/i18n/index.js

@ -29,6 +29,6 @@ export const messages = {
} }
export default new VueI18n({ export default new VueI18n({
locale: Cookies.get('language') || 'zh-CN', locale: localStorage.getItem('language') || 'zh-CN',
messages messages
}) })

468
src/js/ajax.js

@ -1,42 +1,40 @@
/* eslint-disable */ /* eslint-disable */
import axios from 'axios' import axios from "axios";
import Cookies from 'js-cookie' import Cookies from "js-cookie";
import router from '@/router' import router from "@/router";
import qs from 'qs' import qs from "qs";
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from "@/utils";
import isPlainObject from 'lodash/isPlainObject' import isPlainObject from "lodash/isPlainObject";
import Vue from 'vue'
import { Loading } from 'element-ui' //引入Loading服务
import Vue from "vue";
import { Loading } from "element-ui"; //引入Loading服务
// 默认超时时间60s // 默认超时时间60s
axios.defaults.timeout = 60000 axios.defaults.timeout = 60000;
let timer let timer;
let loading let loading;
//请求时间超过300ms 提示加载 //请求时间超过300ms 提示加载
function startLoading () { function startLoading() {
if (timer) return if (timer) return;
timer = setTimeout(() => { timer = setTimeout(() => {
loading = Loading.service({ loading = Loading.service({
lock: true, //是否锁定 lock: true, //是否锁定
text: '正在加载……', //加载中需要显示的文字 text: "正在加载……", //加载中需要显示的文字
background: 'rgba(0,0,0,.7)', //背景颜色 background: "rgba(0,0,0,.7)", //背景颜色
}) });
}, 300) }, 300);
} }
//结束加载动画 //结束加载动画
function endLoading () { function endLoading() {
if (timer) { if (timer) {
clearTimeout(timer) clearTimeout(timer);
} }
if (loading) { if (loading) {
loading.close() loading.close();
} }
} }
@ -45,71 +43,65 @@ function endLoading () {
*/ */
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers["Accept-Language"] =
config.headers['token'] = Cookies.get('token') || '' localStorage.getItem("language") || "zh-CN";
config.headers['Authorization'] = Cookies.get('token') || '' config.headers["token"] = localStorage.getItem("token") || "";
config.headers["Authorization"] = localStorage.getItem("token") || "";
// 默认参数 // 默认参数
var defaults = {} var defaults = {};
// 防止缓存,GET请求默认带_t参数 // 防止缓存,GET请求默认带_t参数
if (config.method === 'get') { if (config.method === "get") {
config.params = { config.params = {
...config.params, ...config.params,
...{ _t: new Date().getTime() }, ...{ _t: new Date().getTime() },
} };
} }
if (isPlainObject(config.params)) { if (isPlainObject(config.params)) {
config.params = { config.params = {
...defaults, ...defaults,
...config.params, ...config.params,
} };
} }
if (isPlainObject(config.data)) { if (isPlainObject(config.data)) {
config.data = { config.data = {
...defaults, ...defaults,
...config.data, ...config.data,
} };
if ( if (
/^application\/x-www-form-urlencoded/.test( /^application\/x-www-form-urlencoded/.test(
config.headers['content-type'] config.headers["content-type"]
) )
) { ) {
config.data = qs.stringify(config.data) config.data = qs.stringify(config.data);
} }
} }
return config return config;
}, },
(error) => { (error) => {
return Promise.reject(error) return Promise.reject(error);
} }
) );
/** /**
* 响应拦截 * 响应拦截
*/ */
axios.interceptors.response.use( axios.interceptors.response.use(
(response) => { (response) => {
const code = [10007, 401, 10001, 10005] const code = [10007, 401, 10001, 10005];
if (code.includes(response.data.code) ) { if (code.includes(response.data.code)) {
// debugger; // debugger;
clearLoginInfo() clearLoginInfo();
// localStorage.setItem('userType', 'work') router.replace({ name: "login" });
// let userType = localStorage.getItem("userType");
// if (userType === 'work'){
// router.replace({ name: 'loginWork' })
// }else {
// router.replace({ name: 'login' })
// }
router.replace({ name: 'login' })
return Promise.reject(response.data.msg) return Promise.reject(response.data.msg);
} }
return response return response;
}, },
(error) => { (error) => {
console.error(error) console.error(error);
return Promise.reject(error) return Promise.reject(error);
} }
) );
const post = (url, params, headers) => { const post = (url, params, headers) => {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
@ -119,14 +111,14 @@ const post = (url, params, headers) => {
resolve(res); resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
export const requestPost = async (url = '', params = {}, headers = {}) => { export const requestPost = async (url = "", params = {}, headers = {}) => {
const ret = await post(url, params, headers) const ret = await post(url, params, headers);
console.log(url, ret) console.log(url, ret);
// if (ret.status === 200) { // if (ret.status === 200) {
// var data = res.data // var data = res.data
// if (data.code == 0) { // if (data.code == 0) {
@ -141,7 +133,7 @@ export const requestPost = async (url = '', params = {}, headers = {}) => {
// } else { // } else {
// if (typeof cb_err === 'function') cb_err(res) // if (typeof cb_err === 'function') cb_err(res)
// } // }
} };
/* /*
* 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码 * 1后台请求成功均返回业务上的异常也属于请求成功 res.status=200的响应码
@ -153,140 +145,137 @@ export const requestPost = async (url = '', params = {}, headers = {}) => {
*/ */
export default { export default {
// 并发请求 // 并发请求
all (gets, cb) { all(gets, cb) {
if (gets && gets.length > 0) { if (gets && gets.length > 0) {
let functions = gets.map((get) => { let functions = gets.map((get) => {
return axios.get(processUrl(get.url), { return axios.get(processUrl(get.url), {
params: get.params, params: get.params,
}) });
}) });
axios.all(functions).then( axios.all(functions).then(
axios.spread((..._results) => { axios.spread((..._results) => {
let results = _results.map((_result) => { let results = _results.map((_result) => {
return _result.data.data return _result.data.data;
});
cb(results);
}) })
cb(results) );
})
)
} }
}, },
get (url, params, cb_su, cb_err, headers) { get(url, params, cb_su, cb_err, headers) {
var p = { var p = {
params: params, params: params,
} };
if (headers && JSON.stringify(headers) != '{}') { if (headers && JSON.stringify(headers) != "{}") {
var h = { var h = {
headers: headers, headers: headers,
} };
p = { p = {
...p, ...p,
...h, ...h,
};
} }
} url = url + "?r=" + new Date().getTime(); //时间戳作为随机码,防止IE从缓存获取数据
url = url + '?r=' + new Date().getTime() //时间戳作为随机码,防止IE从缓存获取数据
axios axios
.get(processUrl(url), p) .get(processUrl(url), p)
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data;
var data = res.data
if (data.code == 0) { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data.data, data.msg ) cb_su(data.data, data.msg);
} }
} else { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data) if (typeof cb_err === "function") cb_err(data.msg, data.data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof (cb_err === 'function')) { if (typeof (cb_err === "function")) {
cb_err(err) cb_err(err);
} }
}) });
}, },
put (url, data, cb_su, cb_err) { put(url, data, cb_su, cb_err) {
axios axios
.put(processUrl(url), data) .put(processUrl(url), data)
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data;
if (data.sysresultcode === 'success') { if (data.sysresultcode === "success") {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data.data, data.rspMsg) cb_su(data.data, data.rspMsg);
} }
} else if (data.sysresultcode === 'fail') { } else if (data.sysresultcode === "fail") {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data) if (typeof cb_err === "function") cb_err(data.rspMsg, data.data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(err) cb_err(err);
} }
}) });
}, },
post (url, data, cb_su, cb_err, headers) { post(url, data, cb_su, cb_err, headers) {
var h = {} var h = {};
if (headers && JSON.stringify(headers) != '{}') { if (headers && JSON.stringify(headers) != "{}") {
h = { h = {
headers, headers,
} };
} }
//var data = qs.stringify(paramas); //var data = qs.stringify(paramas);
axios axios
.post(processUrl(url), data, h) .post(processUrl(url), data, h)
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data;
var data = res.data
if (data.code == 0) { if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data.data, data.msg ) cb_su(data.data, data.msg);
} }
} else { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.msg , data.data) if (typeof cb_err === "function") cb_err(data.msg, data.data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(err) cb_err(err);
} }
}) });
}, },
post2 (url, data, cb_su, cb_err, headers) { post2(url, data, cb_su, cb_err, headers) {
var h = {} var h = {};
if (headers && JSON.stringify(headers) != '{}') { if (headers && JSON.stringify(headers) != "{}") {
h = { h = {
headers, headers,
} };
} }
//var data = qs.stringify(paramas); //var data = qs.stringify(paramas);
axios axios
@ -294,22 +283,22 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data;
cb_su(data, data.msg ) cb_su(data, data.msg);
} else { } else {
if (typeof cb_err === 'function') cb_err(data.msg , data) if (typeof cb_err === "function") cb_err(data.msg, data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(data.msg , data) if (typeof cb_err === "function") cb_err(data.msg, data);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(err) cb_err(err);
} }
}) });
}, },
delete (url, params, cb_su, cb_err) { delete(url, params, cb_su, cb_err) {
axios axios
.delete(processUrl(url), { .delete(processUrl(url), {
params: params, params: params,
@ -317,219 +306,217 @@ export default {
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data;
if (data.sysresultcode === 'success') { if (data.sysresultcode === "success") {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data.data, data.rspMsg) cb_su(data.data, data.rspMsg);
} }
} else if (data.sysresultcode === 'fail') { } else if (data.sysresultcode === "fail") {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg, data.data) if (typeof cb_err === "function") cb_err(data.rspMsg, data.data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(err) cb_err(err);
} }
}) });
}, },
//导出文件,包括excel,word等 //导出文件,包括excel,word等
exportFile (url, params, cb_su, cb_err, headers) { exportFile(url, params, cb_su, cb_err, headers) {
var h = {} var h = {};
if (headers && JSON.stringify(headers) != '{}') { if (headers && JSON.stringify(headers) != "{}") {
h = headers h = headers;
} }
var errorMsg = '操作失败' var errorMsg = "操作失败";
url = url + '?r=' + new Date().getTime() //时间戳作为随机码,防止IE从缓存获取数据 url = url + "?r=" + new Date().getTime(); //时间戳作为随机码,防止IE从缓存获取数据
axios({ axios({
method: 'get', method: "get",
url: processUrl(url), url: processUrl(url),
params: params, params: params,
headers: h, //{ tenantCode: "GDYXB" }, headers: h, //{ tenantCode: "GDYXB" },
responseType: 'blob', responseType: "blob",
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data //直接返回blob var data = res.data; //直接返回blob
if (data) { if (data) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data, '操作成功') cb_su(data, "操作成功");
} }
} else { } else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof (cb_err === 'function')) { if (typeof (cb_err === "function")) {
cb_err(errorMsg) cb_err(errorMsg);
} }
}) });
}, },
//导出文件,包括excel,word等 //导出文件,包括excel,word等
exportFilePost (url, params, cb_su, cb_err) { exportFilePost(url, params, cb_su, cb_err) {
//var data = qs.stringify(paramas); //var data = qs.stringify(paramas);
// axios // axios
// .post(processUrl(url), data) // .post(processUrl(url), data)
axios({ axios({
method: 'post', method: "post",
url: processUrl(url), url: processUrl(url),
data: params, data: params,
responseType: 'blob', responseType: "blob",
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data //直接返回blob var data = res.data; //直接返回blob
// if (data.code == 0) { // if (data.code == 0) {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data) cb_su(data);
} } else {
else {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
// } else { // } else {
// if (typeof cb_err === 'function') cb_err(errorMsg) // if (typeof cb_err === 'function') cb_err(errorMsg)
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(err) cb_err(err);
} }
}) });
}, },
//上传文件 //上传文件
importFilePut (url, fileFormData, cb_su, cb_err) { importFilePut(url, fileFormData, cb_su, cb_err) {
var errorMsg = '操作失败' var errorMsg = "操作失败";
let requestConfig = { let requestConfig = {
headers: { headers: {
'Content-Type': 'multipart/form-data', "Content-Type": "multipart/form-data",
// Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(), // Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
}, },
} };
Vue.http Vue.http
.put(processUrl(url), fileFormData, requestConfig) .put(processUrl(url), fileFormData, requestConfig)
.then((res) => { .then((res) => {
if (res && res.status === 200) { if (res && res.status === 200) {
var data = res.body //直接返回blob var data = res.body; //直接返回blob
if (data.sysresultcode === 'fail') { if (data.sysresultcode === "fail") {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg) if (typeof cb_err === "function") cb_err(data.rspMsg);
} else if (data.sysresultcode === 'success') { } else if (data.sysresultcode === "success") {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data, '操作成功') cb_su(data, "操作成功");
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof (cb_err === 'function')) { if (typeof (cb_err === "function")) {
cb_err(errorMsg) cb_err(errorMsg);
} }
}) });
}, },
//上传文件 //上传文件
importFilePost (url, fileFormData, cb_su, cb_err) { importFilePost(url, fileFormData, cb_su, cb_err) {
var errorMsg = '操作失败' var errorMsg = "操作失败";
let requestConfig = { let requestConfig = {
headers: { headers: {
'Content-Type': 'multipart/form-data' "Content-Type": "multipart/form-data",
// Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(), // Authorization: auth.loadTokenType() + ' ' + auth.loadAccessToken(),
} },
} };
Vue.http Vue.http
.post(processUrl(url), fileFormData, requestConfig) .post(processUrl(url), fileFormData, requestConfig)
.then((res) => { .then((res) => {
if (res && res.status === 200) { if (res && res.status === 200) {
var data = res.body //直接返回blob var data = res.body; //直接返回blob
if (data.sysresultcode === 'fail') { if (data.sysresultcode === "fail") {
//业务失败 //业务失败
if (typeof cb_err === 'function') cb_err(data.rspMsg) if (typeof cb_err === "function") cb_err(data.rspMsg);
} else if (data.sysresultcode === 'success') { } else if (data.sysresultcode === "success") {
//业务成功 //业务成功
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data, '操作成功') cb_su(data, "操作成功");
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(errorMsg) if (typeof cb_err === "function") cb_err(errorMsg);
} }
}) })
.catch((err) => { .catch((err) => {
if (typeof (cb_err === 'function')) { if (typeof (cb_err === "function")) {
cb_err(errorMsg) cb_err(errorMsg);
} }
}) });
}, },
//登录获取token/刷新token //登录获取token/刷新token
tokenPost (url, paramas, cb_su, cb_err) { tokenPost(url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas) var data = qs.stringify(paramas);
axios axios
.post(processUrl(url), data) .post(processUrl(url), data)
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data;
if (data) { if (data) {
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data) cb_su(data);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err('登录验证失败') if (typeof cb_err === "function") cb_err("登录验证失败");
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
} else { } else {
if (typeof cb_err === 'function') cb_err(res) if (typeof cb_err === "function") cb_err(res);
} }
}) })
.catch((err) => { .catch((err) => {
var rspMsg = '登录失败,请重试!' var rspMsg = "登录失败,请重试!";
if ( if (
err && err &&
err.response && err.response &&
err.response.status === 401 && err.response.status === 401 &&
err.response.data && err.response.data &&
err.response.data.error === 'unauthorized' err.response.data.error === "unauthorized"
) { ) {
// 用户名不存在时: 状态码401 // 用户名不存在时: 状态码401
// Response Body: // Response Body:
@ -537,92 +524,91 @@ export default {
// "error": "unauthorized", // "error": "unauthorized",
// "error_description": null // "error_description": null
// } // }
rspMsg = err.response.data.error_description || '用户名不存在' rspMsg = err.response.data.error_description || "用户名不存在";
} else if ( } else if (
err && err &&
err.response && err.response &&
err.response.status === 400 && err.response.status === 400 &&
err.response.data && err.response.data &&
err.response.data.error === 'invalid_grant' err.response.data.error === "invalid_grant"
) { ) {
// 用户名存在,密码错误时:状态码400 // 用户名存在,密码错误时:状态码400
// { // {
// "error": "invalid_grant", // "error": "invalid_grant",
// "error_description": "Bad credentials" // "error_description": "Bad credentials"
// } // }
rspMsg = '用户名或密码输入错误' rspMsg = "用户名或密码输入错误";
} }
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(rspMsg) cb_err(rspMsg);
} }
}) });
}, },
//通过接口传递的token进行验证登录 lyx 20191210 //通过接口传递的token进行验证登录 lyx 20191210
async interfacetokenPost (url, paramas, cb_su, cb_err) { async interfacetokenPost(url, paramas, cb_su, cb_err) {
var data = qs.stringify(paramas) var data = qs.stringify(paramas);
await axios await axios
.post(processUrl(url), data) .post(processUrl(url), data)
.then((res) => { .then((res) => {
if (res) { if (res) {
if (res.status === 200) { if (res.status === 200) {
var data = res.data var data = res.data;
if (data) { if (data) {
if (typeof cb_su === 'function') { if (typeof cb_su === "function") {
cb_su(data) cb_su(data);
return true return true;
} }
} else { } else {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err('接口验证失败') cb_err("接口验证失败");
return false return false;
} }
} }
} else { } else {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(res) cb_err(res);
return false return false;
} }
} }
} else { } else {
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(res) cb_err(res);
return false return false;
} }
} }
}) })
.catch((err) => { .catch((err) => {
var rspMsg = '接口验证失败,请重试!' var rspMsg = "接口验证失败,请重试!";
if ( if (
err && err &&
err.response && err.response &&
err.response.status === 401 && err.response.status === 401 &&
err.response.data && err.response.data &&
err.response.data.error === 'unauthorized' err.response.data.error === "unauthorized"
) { ) {
rspMsg = '用户名不存在' rspMsg = "用户名不存在";
} else if ( } else if (
err && err &&
err.response && err.response &&
err.response.status === 400 && err.response.status === 400 &&
err.response.data && err.response.data &&
err.response.data.error === 'invalid_grant' err.response.data.error === "invalid_grant"
) { ) {
rspMsg = '用户名或密码输入错误' rspMsg = "用户名或密码输入错误";
} }
if (typeof cb_err === 'function') { if (typeof cb_err === "function") {
cb_err(rspMsg) cb_err(rspMsg);
return false return false;
} }
}) });
}, },
} };
// 添加服务器端URL // 添加服务器端URL
function processUrl (url) { function processUrl(url) {
if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) {
if (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) { return url;
return url
} }
return process.env.VUE_APP_API_SERVER + url return process.env.VUE_APP_API_SERVER + url;
} }

4
src/main.js

@ -33,7 +33,9 @@ import getQueryPara from "dai-js/modules/getQueryPara";
// 兼容token传参登录 // 兼容token传参登录
if (getQueryPara("token")) { if (getQueryPara("token")) {
console.log('token', getQueryPara("token")); console.log('token', getQueryPara("token"));
Cookies.set("token", getQueryPara("token")); localStorage.setItem("token", getQueryPara("token"));
console.log('token222222', localStorage.getItem('token'));
} }
window.app = Object.assign( window.app = Object.assign(

2
src/mixins/view-module.js

@ -142,7 +142,7 @@ export default {
// 导出 // 导出
exportHandle () { exportHandle () {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': localStorage.getItem('token'),
...this.dataForm ...this.dataForm
}) })
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}` window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`

102
src/router/index.js

@ -161,66 +161,27 @@ router.beforeEach((to, from, next) => {
const customerId = localStorage.getItem("customerId"); const customerId = localStorage.getItem("customerId");
console.log("customerId:", customerId); console.log("customerId:", customerId);
// if(customerId==='1e68188b8f7e9ab15658c164bd5b3676'){
// // if(customerId==='45687aa479955f9d06204d415238f7cc'){
// const menuList=[
// {
// children: [],
// createdBy: "a76fc711807ac9827d7611b0f94ec220",
// createdTime: "2020-08-26 16:38",
// delFlag: null,
// icon: "icon-database",
// id: "abe812eb350f6b5eda575e268e50ac1c",
// name: "定制功能配置",
// parentName: null,
// permissions: "",
// pid: "0",
// resourceList: null,
// revision: 0,
// showFlag: 1,
// sort: 2,
// type: 0,
// updatedBy: "a76fc711807ac9827d7611b0f94ec220",
// updatedTime: "2020-09-02 14:49",
// url: "customer/customize/ConfigItem",
// },
// {
// children: [],
// createdBy: "a76fc711807ac9827d7611b0f94ec220",
// createdTime: "2020-08-26 16:38",
// delFlag: null,
// icon: "icon-file-text",
// id: "8e55eba74c920c00c44c125e3bc73ddc",
// name: "居民端首页配置",
// parentName: null,
// permissions: "",
// pid: "0",
// resourceList: null,
// revision: 0,
// showFlag: 1,
// sort: 3,
// type: 0,
// updatedBy: "a76fc711807ac9827d7611b0f94ec220",
// updatedTime: "2020-09-02 14:49",
// url: "customer/customize/MiniHome",
// }
// ]
// window.SITE_CONFIG['menuList'] = menuList // http
// fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) // .get("/gov/access/menu/nav")
// // next({ ...to, replace: true }) // .then(({ data: res }) => {
// next({ ...to, replace: true }) // if (res.code !== 0) {
// }else{ // // Vue.prototype.$message.error(res.msg)
// return next({
// name: "login",
// });
// }
http // next({
.get("/gov/access/menu/nav") // ...to,
.then(({ data: res }) => { // replace: true,
if (res.code !== 0) { // });
// Vue.prototype.$message.error(res.msg) // })
return next({ // .catch(() => {
name: "login", // next({
}); // name: "login",
} // });
// });
window.SITE_CONFIG["menuShujuList"] = [ window.SITE_CONFIG["menuShujuList"] = [
{ {
icon: "icon-setting", icon: "icon-setting",
@ -293,7 +254,7 @@ router.beforeEach((to, from, next) => {
url: "/visual/communityParty/elegant", url: "/visual/communityParty/elegant",
name: "党员风采", name: "党员风采",
id: "5fwaefwaefawef589", id: "5fwaefwaefawef589",
} },
], ],
}, },
{ {
@ -323,17 +284,6 @@ router.beforeEach((to, from, next) => {
}, },
]; ];
fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
// next({ ...to, replace: true })
next({
...to,
replace: true,
});
})
.catch(() => {
next({
name: "login",
});
});
http http
.get("/gov/access/menu/nav") .get("/gov/access/menu/nav")
@ -426,9 +376,9 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
}, },
{ {
path: "*", path: "*",
redirect: { // redirect: {
name: "404", // name: "404",
}, // },
}, },
]); ]);
window.SITE_CONFIG["dynamicMenuRoutes"] = routes; window.SITE_CONFIG["dynamicMenuRoutes"] = routes;
@ -479,9 +429,9 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
}, },
{ {
path: "*", path: "*",
redirect: { // redirect: {
name: "404", // name: "404",
}, // },
}, },
]); ]);
window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes; window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes;

6
src/utils/request.js

@ -15,9 +15,9 @@ const http = axios.create({
* 请求拦截 * 请求拦截
*/ */
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = localStorage.getItem('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || '' config.headers['token'] = localStorage.getItem('token') || ''
config.headers['Authorization'] = Cookies.get('token') || '' config.headers['Authorization'] = localStorage.getItem('token') || ''
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存,GET请求默认带_t参数 // 防止缓存,GET请求默认带_t参数

2
src/views/components/tinymce/index.vue

@ -137,7 +137,7 @@ export default {
}) })
}, },
getUserToken () { getUserToken () {
let token = Cookie.get('token') let token = localStorage.getItem('token')
// console.log('token', token) // console.log('token', token)
// return this.$store.getters['user/isLogin'] // return this.$store.getters['user/isLogin']
return token return token

6
src/views/main-content.vue

@ -87,7 +87,7 @@ export default {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.sendMessage() // this.sendMessage()
// }) // })
this.token = Cookie.get("token"); this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
}, },
methods: { methods: {
@ -100,7 +100,7 @@ export default {
this.iframeUrl = this.iframeUrl =
url + url +
"?token=" + "?token=" +
Cookie.get("token") + localStorage.getItem("token") +
"&customerId=" + "&customerId=" +
localStorage.getItem("customerId"); localStorage.getItem("customerId");
return isURL(url); return isURL(url);
@ -169,7 +169,7 @@ export default {
console.log("iframe", iframe); console.log("iframe", iframe);
// iframe.postMessage({ // iframe.postMessage({
// token: Cookie.get('token'), // token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId') // customerId: localStorage.getItem('customerId')
// }, '*') // }, '*')
iframe.postMessage({ name: "lalalal" }, "*"); iframe.postMessage({ name: "lalalal" }, "*");

6
src/views/main-shuju/main-content.vue

@ -24,7 +24,7 @@ export default {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.sendMessage() // this.sendMessage()
// }) // })
this.token = Cookie.get('token') this.token = localStorage.getItem('token')
this.customerId = localStorage.getItem('customerId') this.customerId = localStorage.getItem('customerId')
}, },
methods: { methods: {
@ -34,7 +34,7 @@ export default {
// tabs, iframe // tabs, iframe
tabIsIframe (url) { tabIsIframe (url) {
// this.appendIframe(url) // this.appendIframe(url)
this.iframeUrl = url + '?token=' + Cookie.get('token') + '&customerId=' + localStorage.getItem('customerId') this.iframeUrl = url + '?token=' + localStorage.getItem('token') + '&customerId=' + localStorage.getItem('customerId')
return isURL(url) return isURL(url)
}, },
// tabs, tab // tabs, tab
@ -85,7 +85,7 @@ export default {
console.log('iframe', iframe) console.log('iframe', iframe)
// iframe.postMessage({ // iframe.postMessage({
// token: Cookie.get('token'), // token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId') // customerId: localStorage.getItem('customerId')
// }, '*') // }, '*')
iframe.postMessage({ name: 'lalalal' }, '*') iframe.postMessage({ name: 'lalalal' }, '*')

2
src/views/main-shuju/main-navbar.vue

@ -45,7 +45,7 @@
<li <li
class="sub-menu" class="sub-menu"
:class=" :class="
$store.state.mainShuju.activeName == menu.name ? 'z-on' : '' $store.state.mainShuju.activeName == menu.id ? 'z-on' : ''
" "
v-if="menu.children" v-if="menu.children"
:key="menu.id" :key="menu.id"

16
src/views/main-shuju/main.vue

@ -28,6 +28,7 @@ import MainContent from "./main-content";
import debounce from "lodash/debounce"; import debounce from "lodash/debounce";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
export default { export default {
provide() { provide() {
@ -102,25 +103,24 @@ export default {
this.$store.state.mainShuju.activeName = tab.menuId; this.$store.state.mainShuju.activeName = tab.menuId;
this.$store.state.mainShuju.contentTabsActiveName = tab.name; this.$store.state.mainShuju.contentTabsActiveName = tab.name;
}, },
// //
getWorkUserInfo() { async getWorkUserInfo() {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
window.app.ajax.post( const { data, code, msg } = await requestPost(url, params);
url, if (code === 0) {
params,
(data, rspMsg) => {
this.$store.state.user = { ...data }; this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user);
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
if (!localStorage.getItem("customerName")) { if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || ""); localStorage.setItem("customerName", data.customerName || "");
} }
}, } else {
(rspMsg, data) => {
this.$message.error(rspMsg); this.$message.error(rspMsg);
} }
);
}, },
}, },
}; };

89
src/views/main.vue

@ -1,22 +1,25 @@
<template> <template>
<div v-loading.fullscreen.lock="loading" <div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')" :element-loading-text="$t('loading')"
:class="[ :class="[
'aui-wrapper', 'aui-wrapper',
{ 'aui-sidebar--fold': $store.state.sidebarFold }, { 'aui-sidebar--fold': $store.state.sidebarFold },
{ {
'aui-sidebar--noside': 'aui-sidebar--noside':
$store.state.sidebarActiveSubMenuList.length == 0, $store.state.sidebarActiveSubMenuList.length == 0 || $store.state.inIframe,
}, },
{ 'z-iframe': $store.state.inIframe }, { 'z-iframe': $store.state.inIframe },
]"> ]"
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" <main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" />
v-if="!$store.state.inIframe" />
<main-sidebar v-if="!$store.state.inIframe" /> <main-sidebar v-if="!$store.state.inIframe" />
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<main-content v-if="!$store.state.contentIsNeedRefresh" <main-content
@changeCustomerName="changeCustomerName" /> v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName"
/>
</div> </div>
<main-theme-tools v-if="!$store.state.inIframe" /> <main-theme-tools v-if="!$store.state.inIframe" />
</template> </template>
@ -31,12 +34,13 @@ import MainThemeTools from "./main-theme-tools";
import debounce from "lodash/debounce"; import debounce from "lodash/debounce";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
export default { export default {
provide () { provide() {
return { return {
// //
refresh () { refresh() {
this.$store.state.contentIsNeedRefresh = true; this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false; this.$store.state.contentIsNeedRefresh = false;
@ -44,7 +48,7 @@ export default {
}, },
}; };
}, },
data () { data() {
return { return {
loading: true, loading: true,
userType: localStorage.getItem("userType"), userType: localStorage.getItem("userType"),
@ -60,26 +64,23 @@ export default {
watch: { watch: {
$route: "routeHandle", $route: "routeHandle",
}, },
async created () { async created() {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
console.log(this.$store.state.sidebarMenuList);
this.windowResizeHandle(); this.windowResizeHandle();
this.routeHandle(this.$route); this.routeHandle(this.$route);
if (localStorage.getItem("userType") === "work") {
Promise.all([this.getWorkUserInfo()]).then(() => { Promise.all([this.getWorkUserInfo()]).then(() => {
this.loading = false; this.loading = false;
}); });
} else {
Promise.all([this.getUserInfo()]).then(() => {
this.loading = false;
});
}
}, },
computed: {}, computed: {},
methods: { methods: {
changeCustomerName (customerName) { changeCustomerName(customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName); this.$refs["ref_navbar"].changeCustomerName(customerName);
}, },
// //
windowResizeHandle () { windowResizeHandle() {
this.$store.state.sidebarFold = this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false; document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener( window.addEventListener(
@ -91,7 +92,7 @@ export default {
); );
}, },
// , // ,
routeHandle (route) { routeHandle(route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false; return false;
} }
@ -114,7 +115,7 @@ export default {
this.$store.state.contentTabsActiveName = tab.name; this.$store.state.contentTabsActiveName = tab.name;
this.syncLevelOneMenuActive(tab.menuId); this.syncLevelOneMenuActive(tab.menuId);
}, },
async syncLevelOneMenuActive (menuId) { async syncLevelOneMenuActive(menuId) {
await nextTick(); await nextTick();
console.log( console.log(
"*******************************", "*******************************",
@ -137,54 +138,22 @@ export default {
idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : []; idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : [];
}, },
// //
getUserInfo () { async getWorkUserInfo() {
const url = "/epmetuser/operuser/queryOperUserDto";
return this.$http
.get(url)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$store.state.user.id = res.data.id;
this.$store.state.user.realName = res.data.realName;
this.$store.state.user.superAdmin = res.data.superAdmin;
this.$store.state.user.gender = data.gender;
localStorage.setItem("customerId", "");
})
.catch(() => { });
},
//
getWorkUserInfo () {
const url = "/epmetuser/customerstaff/staffbasicinfo"; const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {}; let params = {};
window.app.ajax.post( const { data, code, msg } = await requestPost(url, params);
url, if (code === 0) {
params,
(data, rspMsg) => {
this.$store.state.user = { ...data }; this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user); console.log("user---hahha", this.$store.state.user);
// this.$store.state.user.id = data.id
// this.$store.state.user.realName = data.realName
// this.$store.state.user.superAdmin = data.superAdmin
// this.$store.state.user.gender = data.gender
localStorage.setItem("roleList", data.roleList); localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId); localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id); localStorage.setItem("staffId", data.id);
// this.$store.state.user.roleList = data.roleList if (!localStorage.getItem("customerName")) {
// this.$store.state.user.customerId = data.customerId localStorage.setItem("customerName", data.customerName || "");
}, }
(rspMsg, data) => { } else {
this.$message.error(rspMsg); this.$message.error(rspMsg);
} }
);
// return this.$http.get(url).then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// }).catch(() => { })
}, },
}, },
}; };

4
src/views/modules/activiti/model.vue

@ -83,7 +83,7 @@ export default {
// 线url // 线url
getModelerURL (id) { getModelerURL (id) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': localStorage.getItem('token'),
'modelId': id 'modelId': id
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/modeler.html?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/modeler.html?${params}`
@ -91,7 +91,7 @@ export default {
// url // url
getExportURL (id) { getExportURL (id) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token') 'token': localStorage.getItem('token')
}) })
return `${window.SITE_CONFIG['apiURL']}/activiti/model/export/${id}?${params}` return `${window.SITE_CONFIG['apiURL']}/activiti/model/export/${id}?${params}`
}, },

2
src/views/modules/activiti/process-deploy.vue

@ -28,7 +28,7 @@ export default {
methods: { methods: {
init () { init () {
this.visible = true this.visible = true
this.url = `${window.SITE_CONFIG['apiURL']}/activiti/process/deploy?token=${Cookies.get('token')}` this.url = `${window.SITE_CONFIG['apiURL']}/activiti/process/deploy?token=${localStorage.getItem('token')}`
this.fileList = [] this.fileList = []
}, },
// //

2
src/views/modules/activiti/process-initiation.vue

@ -85,7 +85,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL (id, name) { getResourceURL (id, name) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': localStorage.getItem('token'),
'deploymentId': id, 'deploymentId': id,
'resourceName': name 'resourceName': name
}) })

2
src/views/modules/activiti/process.vue

@ -101,7 +101,7 @@ export default {
// (xml/image)url // (xml/image)url
getResourceURL (id, name) { getResourceURL (id, name) {
var params = qs.stringify({ var params = qs.stringify({
'token': Cookies.get('token'), 'token': localStorage.getItem('token'),
'deploymentId': id, 'deploymentId': id,
'resourceName': name 'resourceName': name
}) })

2
src/views/modules/base/resi.vue

@ -463,7 +463,7 @@ export default {
url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel', url: window.SITE_CONFIG['apiURL'] + '/epmetuser/icresiuser/importExcel',
method: 'post', method: 'post',
data: formData, data: formData,
timeout: '300000', timeout: '900000',
responseType: 'blob' responseType: 'blob'
}) })
.then((res) => { .then((res) => {

2
src/views/modules/message/mail-template-add-or-update.vue

@ -108,7 +108,7 @@ export default {
theme: 'snow' theme: 'snow'
}) })
// (使element upload) // (使element upload)
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${localStorage.getItem('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => { this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click() this.$refs.uploadBtn.$el.click()
}) })

2
src/views/modules/oss/oss-upload.vue

@ -29,7 +29,7 @@ export default {
methods: { methods: {
init () { init () {
this.visible = true this.visible = true
this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${localStorage.getItem('token')}`
this.num = 0 this.num = 0
this.fileList = [] this.fileList = []
}, },

12
src/views/modules/shequ/index.vue

@ -355,7 +355,13 @@
</div> </div>
<!-- 修改弹出框 --> <!-- 修改弹出框 -->
<div v-show="showedFuncPanel"> <div
v-show="showedFuncPanel"
v-if="
Array.isArray($store.state.sidebarMenuList) &&
$store.state.sidebarMenuList.length > 0
"
>
<div class="m-panel"> <div class="m-panel">
<div <div
class="m-list" class="m-list"
@ -711,6 +717,10 @@ export default {
}, },
mounted() { mounted() {
this.getApiData(); this.getApiData();
console.log(
"dynamicMenuRoutes----------------------------",
this.$store.state.sidebarMenuList
);
}, },
methods: { methods: {
computedWidth(label) { computedWidth(label) {

2
src/views/modules/sys/news-add-or-update.vue

@ -108,7 +108,7 @@ export default {
theme: 'snow' theme: 'snow'
}) })
// (使element upload) // (使element upload)
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${localStorage.getItem('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => { this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click() this.$refs.uploadBtn.$el.click()
}) })

12
src/views/modules/visual/communityParty/community.vue

@ -233,6 +233,7 @@ export default {
timeRange (val) { timeRange (val) {
console.log('val-www', val) console.log('val-www', val)
this.getList(this.agencyId); this.getList(this.agencyId);
this.getCateCount(this.agencyId)
} }
}, },
methods: { methods: {
@ -322,7 +323,10 @@ export default {
const url = "/heart/icpartyactivity/statistics" const url = "/heart/icpartyactivity/statistics"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
let params = { let params = {
agencyId agencyId,
serviceMatter: this.serviceMatter == 'all' ? '' : this.serviceMatter,
startTime: this.timeRange && this.timeRange[0] || '',
endTime: this.timeRange && this.timeRange[1] || ''
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -338,7 +342,10 @@ export default {
const url = "/heart/icpartyunit/typestatistics" const url = "/heart/icpartyunit/typestatistics"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/list"
let params = { let params = {
agencyId agencyId,
// serviceMatter: this.serviceMatter == 'all' ? '' : this.serviceMatter,
// startTime: this.timeRange && this.timeRange[0] || '',
// endTime: this.timeRange && this.timeRange[1] || ''
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -575,6 +582,7 @@ export default {
handleSelectChange (val) { handleSelectChange (val) {
this.getList(this.agencyId); this.getList(this.agencyId);
this.getCateCount(this.agencyId)
}, },
pageSizeChangeHandleNew (val) { pageSizeChangeHandleNew (val) {
this.pageNo = 1; this.pageNo = 1;

2
src/views/pages/404.vue

@ -2,7 +2,7 @@
<div class="aui-wrapper aui-page__not-found"> <div class="aui-wrapper aui-page__not-found">
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<div class="aui-content"> <div class="aui-content">
<h2 class="title">400</h2> <h2 class="title">404</h2>
<p class="desc" v-html="$t('notFound.desc')"></p> <p class="desc" v-html="$t('notFound.desc')"></p>
<div class="btn-bar"> <div class="btn-bar">
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button> <el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button>

2
src/views/pages/index.vue

@ -73,7 +73,7 @@ export default {
localStorage.setItem('customerId', res.data.customerId) localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0') localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token) localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' }) this.$router.replace({ name: 'home' })
}) })
.catch(() => {}) .catch(() => {})

2
src/views/pages/login copy.vue

@ -145,7 +145,7 @@ export default {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
localStorage.setItem('userType', 'oper') localStorage.setItem('userType', 'oper')
Cookies.set('token', res.data.token) localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { }) this.$router.replace({ name: 'home' }).catch(() => { })
}).catch(() => { }) }).catch(() => { })
}) })

4
src/views/pages/login.vue

@ -243,7 +243,7 @@ export default {
localStorage.setItem('customerId', res.data.customerId) localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0') localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token) localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' }) this.$router.replace({ name: 'home' })
}) })
.catch(() => { }) .catch(() => { })
@ -271,7 +271,7 @@ export default {
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token) localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'indexWork' }).catch(() => { }) this.$router.replace({ name: 'indexWork' }).catch(() => { })
}) })
.catch(() => { }) .catch(() => { })

Loading…
Cancel
Save