Commit e0d0c8a0 by chenwq

前端配置服务变更

1 parent 0108ab9e
......@@ -13,6 +13,7 @@
"axios": "^0.18.0",
"element-ui": "^2.15.1",
"glsx-vue-common": "^1.2.8",
"glsx-common": "^2.10.1",
"node-sass": "^4.14.1",
"sass-loader": "^7.1.0",
"vue": "^2.5.17"
......
/*
* @Description:
* @Description:
* @Author: huyue
* @Date: 2022-11-08 10:23:20
* @LastEditors: huyue
......@@ -16,6 +16,7 @@ import { Request as request } from 'glsx-vue-common'
// import '@/styles/index.css'
// 组件
import '@/components'
import { utils } from 'glsx-common'
// import { Util } from './common/util'
// import _ from 'lodash'
// import axios from 'axios'
......@@ -80,14 +81,14 @@ var mixin = {
}
Date.prototype.format = function (fmt) {
let o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
//季度
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
//季度
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds() //毫秒
"S": this.getMilliseconds() //毫秒
}
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
for (let k in o) {
......@@ -95,16 +96,32 @@ Date.prototype.format = function (fmt) {
}
return fmt
}
const URL =
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/record-config') => {
// const URL =
// 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
// const getConfig = (url = URL + '/record-config') => {
// return new Promise((resolve, reject) => {
// request({ url }).then((res) => {
// if (res.status === 'success') {
// resolve({ vue: Vue, config: JSON.parse(res.data) })
// } else {
// reject('ERROR.')
// }
// })
// })
// }
const getConfig = () => {
let params = {
moduleName: 'glsx-oss-record',
mockUrl:
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/record-config',
httpOptions: {
Headers: { refererurl: location.href },
request: { timeout: 30000 }
}
}
return new Promise((resolve, reject) => {
request({ url }).then((res) => {
if (res.status === 'success') {
resolve({ vue: Vue, config: JSON.parse(res.data) })
} else {
reject('ERROR.')
}
utils.getConfig(params).then(res => {
resolve({ vue: Vue, config: res })
})
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!