Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
dangan_dataV
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f6aed480
authored
2025-04-23 17:38:46 +0800
by
zhangmeng
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
中间部分
1 parent
51762012
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
141 deletions
src/api/server.js.js
src/plugins/modal.js
src/routerPc/index.js
src/utils/request.js
src/viewsPc/vip/centerPage.vue
src/viewsPc/vip/scrollingData .vue → src/viewsPc/vip/scrollingData.vue
vite.config.js
src/api/server.js.js
0 → 100644
View file @
f6aed48
import
request
from
'@/utils/request'
/**
* 营业收入
* @returns {*}
*/
export
function
getYS001
()
{
return
request
({
method
:
'post'
,
data
:
{
'INTERFACEID'
:
'YS001'
,
'USERCONTEXT'
:
'a6c49439-f01c-0292-1757-30563fb41c77'
}
})
}
/**
* 应收余额
* @returns {*}
*/
export
function
getYS002
()
{
return
request
({
method
:
'post'
,
data
:
{
'INTERFACEID'
:
'YS002'
,
'USERCONTEXT'
:
'a6c49439-f01c-0292-1757-30563fb41c77'
}
})
}
/**
* 现金余额
* @returns {*}
*/
export
function
getYS003
()
{
return
request
({
method
:
'post'
,
data
:
{
'INTERFACEID'
:
'YS003'
,
'USERCONTEXT'
:
'a6c49439-f01c-0292-1757-30563fb41c77'
}
})
}
/**
* DSO天数
* @returns {*}
*/
export
function
getYS004
()
{
return
request
({
method
:
'post'
,
data
:
{
'INTERFACEID'
:
'YS004'
,
'USERCONTEXT'
:
'a6c49439-f01c-0292-1757-30563fb41c77'
}
})
}
/**
* (五)董事会得分、领导重点关注
* @returns {*}
*/
export
function
getYS005
()
{
return
request
({
method
:
'post'
,
data
:
{
'INTERFACEID'
:
'YS005'
,
'USERCONTEXT'
:
'a6c49439-f01c-0292-1757-30563fb41c77'
}
})
}
src/plugins/modal.js
View file @
f6aed48
import
{
ElMessage
,
ElMessageBox
,
ElNotification
,
ElLoading
}
from
'element-plus'
import
{
ElMessage
,
ElMessageBox
,
ElNotification
,
ElLoading
}
from
'element-plus'
import
{
useStorage
}
from
"@vueuse/core/index"
;
const
language
=
useStorage
(
'language'
,
0
)
const
language
=
useStorage
(
'language'
,
0
)
let
loadingInstance
export
default
{
...
...
@@ -23,19 +23,19 @@ export default {
},
// 弹出提示
alert
(
content
)
{
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
language
.
value
==
0
?
'系统提示'
:
'Tips'
:
'Tips'
)
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
language
.
value
==
0
?
'系统提示'
:
'Tips'
:
'Tips'
)
},
// 错误提示
alertError
(
content
)
{
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
language
.
value
==
0
?
'系统提示'
:
'Tips'
:
'Tips'
,
{
type
:
'error'
})
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
language
.
value
==
0
?
'系统提示'
:
'Tips'
:
'Tips'
,
{
type
:
'error'
})
},
// 成功提示
alertSuccess
(
content
)
{
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
type
:
'success'
})
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
type
:
'success'
})
},
// 警告提示
alertWarning
(
content
)
{
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
type
:
'warning'
})
return
ElMessageBox
.
alert
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
type
:
'warning'
})
},
// 通知提示
notify
(
content
)
{
...
...
@@ -55,17 +55,17 @@ export default {
},
// 确认窗体
confirm
(
content
)
{
return
ElMessageBox
.
confirm
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'OK'
,
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
return
ElMessageBox
.
confirm
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'OK'
,
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
type
:
'warning'
})
},
// 提交内容
prompt
(
content
)
{
return
ElMessageBox
.
prompt
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'OK'
,
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
return
ElMessageBox
.
prompt
(
content
,
language
.
value
==
0
?
'系统提示'
:
'Tips'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'OK'
,
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
type
:
'warning'
})
},
...
...
@@ -79,6 +79,6 @@ export default {
},
// 关闭遮罩层
closeLoading
()
{
loadingInstance
.
close
()
loadingInstance
?
.
close
()
}
}
...
...
src/routerPc/index.js
View file @
f6aed48
...
...
@@ -110,26 +110,28 @@ NProgress.configure({showSpinner: false})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
if
(
getToken
())
{
// 判断当前用户是否已拉取完user_info信息
if
(
!
useUserStore
().
user
)
{
isRelogin
.
show
=
true
useUserStore
().
getInfo
().
then
(()
=>
{
isRelogin
.
show
=
false
next
()
// hack方法 确保addRoutes已完成
}).
catch
(
err
=>
{
useUserStore
().
logOut
().
then
(()
=>
{
ElMessage
.
error
(
err
)
next
({
path
:
'/'
})
})
})
}
else
{
next
()
}
}
else
{
// 没有token
next
()
}
// if (getToken()) {
// // 判断当前用户是否已拉取完user_info信息
// if (!useUserStore().user) {
//
// isRelogin.show = true
// useUserStore().getInfo().then(() => {
// isRelogin.show = false
// next() // hack方法 确保addRoutes已完成
// }).catch(err => {
// useUserStore().logOut().then(() => {
// ElMessage.error(err)
// next({path: '/'})
// })
// })
// } else {
// next()
// }
// } else {
// // 没有token
// next()
// }
})
router
.
afterEach
((
to
)
=>
{
...
...
src/utils/request.js
View file @
f6aed48
...
...
@@ -5,25 +5,20 @@ import {
ElMessage
,
ElLoading
}
from
'element-plus'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
import
{
tansParams
,
blobValidate
}
from
'@/utils/ruoyi'
import
{
tansParams
,
blobValidate
}
from
'@/utils/ruoyi'
import
cache
from
'@/plugins/cache'
import
modal
from
'@/plugins/modal'
import
{
saveAs
}
from
'file-saver'
import
useUserStore
from
'@/store/modules/user'
import
{
sendNotification
}
from
'@/assets/lib/extend'
import
_
from
'lodash'
// const language = cache.local.get('language') || 0
import
{
useStorage
}
from
"@vueuse/core/index"
;
const
language
=
useStorage
(
'language'
,
0
)
import
{
saveAs
}
from
'file-saver'
import
{
sendNotification
}
from
'@/assets/lib/extend'
let
downloadLoadingInstance
// 是否显示重新登录
export
const
isRelogin
=
{
show
:
false
}
export
const
isRelogin
=
{
show
:
false
}
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
// 对应国际化资源文件后缀
axios
.
defaults
.
headers
[
'Content-Language'
]
=
(
language
.
value
==
0
?
'zh_CN'
:
'en_US'
)
// 创建axios实例
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
...
...
@@ -32,15 +27,12 @@ const service = axios.create({
timeout
:
0
})
const
otherWeb
=
[
'ztx-match/'
,
'ztx-webSite/'
,
'ztx-train/'
]
const
excludeUrl
=
[
'system/remindCount/getCounts'
]
const
noModal
=
[
'person/info/extractInfo'
]
// request拦截器
service
.
interceptors
.
request
.
use
(
(
config
)
=>
{
if
(
config
.
method
.
toLowerCase
()
!==
'get'
&&
!
_
.
some
(
noModal
,
(
m
)
=>
config
.
url
.
indexOf
(
m
)
>
-
1
)
)
{
modal
.
loading
()
if
(
!
config
.
url
)
{
config
.
url
=
'/portal/r/jd?cmd=com.dr.coslexpro.cwys.unifiedInterface'
}
// 是否需要设置 token
...
...
@@ -50,9 +42,6 @@ service.interceptors.request.use(
if
(
getToken
()
&&
!
isToken
)
{
config
.
headers
[
'Authorization'
]
=
'Bearer '
+
getToken
()
// 让每个请求携带自定义token 请根据实际情况自行修改
}
if
(
_
.
some
(
otherWeb
,
(
w
)
=>
config
.
url
.
indexOf
(
w
)
>
-
1
))
{
config
.
headers
[
'Ztx-Per-Id'
]
=
useUserStore
().
perId
||
-
1
}
// get请求映射params参数
if
(
config
.
method
===
'get'
)
{
...
...
@@ -93,20 +82,21 @@ service.interceptors.request.use(
const
s_data
=
sessionObj
.
data
// 请求数据
const
s_time
=
sessionObj
.
time
// 请求时间
const
interval
=
1000
// 间隔时间(ms),小于此时间视为重复提交
if
(
s_data
===
requestObj
.
data
&&
requestObj
.
time
-
s_time
<
interval
&&
s_url
===
requestObj
.
url
)
{
const
message
=
'数据正在处理,请勿重复提交'
console
.
warn
(
`[
${
s_url
}
]: `
+
message
)
modal
.
closeLoading
()
return
Promise
.
reject
(
new
Error
(
message
))
}
else
{
// if (
// s_data === requestObj.data &&
// requestObj.time - s_time < interval &&
// s_url === requestObj.url
// ) {
// const message = '数据正在处理,请勿重复提交'
// console.warn(`[${s_url}]: ` + message)
// modal.closeLoading()
// return Promise.reject(new Error(message))
// } else {
// cache.session.setJSON('sessionObj', requestObj)
// }
cache
.
session
.
setJSON
(
'sessionObj'
,
requestObj
)
}
}
}
return
config
},
(
error
)
=>
{
...
...
@@ -119,11 +109,8 @@ service.interceptors.request.use(
// 响应拦截器
service
.
interceptors
.
response
.
use
(
(
res
)
=>
{
if
(
res
.
config
.
method
.
toLowerCase
()
!==
'get'
&&
!
_
.
some
(
noModal
,
(
m
)
=>
res
.
config
.
url
.
indexOf
(
m
)
>
-
1
))
{
modal
.
closeLoading
()
}
// 未设置状态码则默认成功状态
const
code
=
res
.
data
.
code
||
200
const
code
=
res
.
code
||
200
// 获取错误信息
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
// const msg = errorCode[code] || res.data.msg || errorCode['default']
...
...
@@ -137,9 +124,6 @@ service.interceptors.response.use(
return
res
}
if
(
_
.
some
(
excludeUrl
,
(
m
)
=>
res
.
config
.
url
.
indexOf
(
m
)
>
-
1
))
{
return
Promise
.
resolve
(
res
.
data
)
}
if
(
code
===
401
)
{
if
(
!
isRelogin
.
show
)
{
isRelogin
.
show
=
true
...
...
@@ -167,16 +151,16 @@ service.interceptors.response.use(
}
return
Promise
.
reject
(
'会话已过期,请重新登录。'
)
}
else
if
(
code
===
500
)
{
if
(
msg
)
{
ElMessage
({
message
:
msg
,
type
:
'error'
})
sendNotification
(
'错误提示'
,
{
body
:
msg
})
if
(
msg
)
{
ElMessage
({
message
:
msg
,
type
:
'error'
})
sendNotification
(
'错误提示'
,
{
body
:
msg
})
}
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
===
601
)
{
ElMessage
({
message
:
msg
,
type
:
'warning'
})
ElMessage
({
message
:
msg
,
type
:
'warning'
})
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
!==
200
)
{
ElNotification
.
error
({
title
:
msg
})
ElNotification
.
error
({
title
:
msg
})
return
Promise
.
reject
(
'error'
)
}
else
{
return
Promise
.
resolve
(
res
.
data
)
...
...
@@ -184,7 +168,7 @@ service.interceptors.response.use(
},
(
error
)
=>
{
console
.
log
(
'err'
+
error
)
let
{
message
}
=
error
let
{
message
}
=
error
if
(
message
===
'Network Error'
)
{
message
=
'后端接口连接异常'
}
else
if
(
message
.
includes
(
'timeout'
))
{
...
...
@@ -192,8 +176,8 @@ service.interceptors.response.use(
}
else
if
(
message
.
includes
(
'Request failed with status code'
))
{
message
=
'系统接口'
+
message
.
substr
(
message
.
length
-
3
)
+
'异常'
}
ElMessage
({
message
:
message
,
type
:
'error'
,
duration
:
5
*
1000
})
sendNotification
(
'错误提示'
,
{
body
:
message
})
ElMessage
({
message
:
message
,
type
:
'error'
,
duration
:
5
*
1000
})
sendNotification
(
'错误提示'
,
{
body
:
message
})
modal
.
closeLoading
()
return
Promise
.
reject
(
error
)
}
...
...
@@ -212,11 +196,11 @@ export function download(url, params, filename, config) {
return
tansParams
(
params
)
}
],
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
responseType
:
'blob'
,
...
config
})
.
then
(
async
(
res
)
=>
{
.
then
(
async
(
res
)
=>
{
const
data
=
res
.
data
const
isBlob
=
blobValidate
(
data
)
if
(
isBlob
)
{
...
...
src/viewsPc/vip/centerPage.vue
View file @
f6aed48
This diff is collapsed.
Click to expand it.
src/viewsPc/vip/scrollingData
.vue
→
src/viewsPc/vip/scrollingData.vue
View file @
f6aed48
File moved
vite.config.js
View file @
f6aed48
import
{
defineConfig
,
loadEnv
}
from
'vite'
import
path
,
{
resolve
}
from
'path'
import
{
defineConfig
,
loadEnv
}
from
'vite'
import
path
,
{
resolve
}
from
'path'
import
createVitePlugins
from
'./vite/plugins'
import
inject
from
'@rollup/plugin-inject'
import
commonjs
from
'@rollup/plugin-commonjs'
// import legacy from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/
export
default
defineConfig
(({
mode
,
command
})
=>
{
export
default
defineConfig
(({
mode
,
command
})
=>
{
const
env
=
loadEnv
(
mode
,
process
.
cwd
())
return
{
// 部署生产环境和开发环境下的URL。
...
...
@@ -20,32 +18,8 @@ export default defineConfig(({ mode, command }) => {
'window.katex'
:
'katex'
,
'window.Quill'
:
[
'@vueup/vue-quill'
,
'Quill'
]
})
// legacy({
// targets: ['defaults', 'not IE 11'], // 需要兼容的目标列表,可以设置多个
// additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
// renderLegacyChunks: true,
// polyfills: [
// 'es.symbol',
// 'es.array.filter',
// 'es.promise',
// 'es.promise.finally',
// 'es/map',
// 'es/set',
// 'es.array.for-each',
// 'es.object.define-properties',
// 'es.object.define-property',
// 'es.object.get-own-property-descriptor',
// 'es.object.get-own-property-descriptors',
// 'es.object.keys',
// 'es.object.to-string',
// 'web.dom-collections.for-each',
// 'esnext.global-this',
// 'esnext.string.match-all'
// ]
// })
],
resolve
:
{
// https://cn.vitejs.dev/config/#resolve-alias
alias
:
{
// 设置路径
'~'
:
path
.
resolve
(
__dirname
,
'./'
),
...
...
@@ -62,41 +36,14 @@ export default defineConfig(({ mode, command }) => {
host
:
true
,
open
:
true
,
proxy
:
{
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api/ztx-train'
:
{
// target: 'http://123.60.96.243:1896/stage-api',
target
:
'https://jijin.wtwuxicenter.com/stage-api'
,
'/dev-api/portal'
:
{
// target: 'http://116.63.185.147:8088',
target
:
'https://ff9451fo0879.vicp.fun'
,
changeOrigin
:
true
,
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
ztx-train/
,
''
)
},
'/dev-api/ztx-match'
:
{
// target: 'http://192.168.1.118:8083',
target
:
'https://jijin.wtwuxicenter.com/stage-api'
,
changeOrigin
:
true
,
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
ztx-match/
,
''
)
},
'/dev-api/ztx-webSite'
:
{
target
:
'https://wdsfwuxicenter.com/stage-api/'
,
changeOrigin
:
true
,
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
ztx-webSite/
,
''
)
},
'/dev-api'
:
{
// target: 'http://192.168.1.207:5511/',
target
:
'https://jijin.wtwuxicenter.com/stage-api'
,
changeOrigin
:
true
,
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api/
,
''
)
},
'/ticket'
:
{
// target: 'http://192.168.1.131:8098/',
// target: 'http://192.168.1.131:8081/',
target
:
'https://jijin.wtwuxicenter.com/h5/'
,
// target: 'https://ticketh5.wdsfwuxicenter.com/h5/',
changeOrigin
:
true
,
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
ticket/
,
''
)
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
portal/
,
''
)
}
}
},
// fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
css
:
{
postcss
:
{
plugins
:
[
...
...
@@ -114,7 +61,6 @@ export default defineConfig(({ mode, command }) => {
}
},
build
:
{
// target: 'es2015',
rollupOptions
:
{
input
:
{
main
:
resolve
(
__dirname
,
'index.html'
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment