提交 e30134de 作者: 毛细亚

更新代码

上级 be3d5787
...@@ -14,7 +14,7 @@ alwaysApply: false ...@@ -14,7 +14,7 @@ alwaysApply: false
- [store/](mdc:src/store):Vuex 状态管理,主文件为 [index.js](mdc:src/store/index.js)。 - [store/](mdc:src/store):Vuex 状态管理,主文件为 [index.js](mdc:src/store/index.js)。
- [api/](mdc:src/api):接口请求封装,示例:[user.js](mdc:src/api/user.js)。 - [api/](mdc:src/api):接口请求封装,示例:[user.js](mdc:src/api/user.js)。
- [utils/](mdc:src/utils):工具函数和请求封装,如 [request.js](mdc:src/utils/request.js)。 - [utils/](mdc:src/utils):工具函数和请求封装,如 [request.js](mdc:src/utils/request.js)。
- [mixins/](mdc:src/mixins):Vue 混入逻辑,如 [externalUserId.js](mdc:src/mixins/externalUserId.js)。 - [mixins/](mdc:src/mixins):Vue 混入逻辑,如 [external_userid.js](mdc:src/mixins/external_userid.js)。
- [views/](mdc:src/views):页面组件,如 [HomeView.vue](mdc:src/views/HomeView.vue)、[AboutView.vue](mdc:src/views/AboutView.vue)。 - [views/](mdc:src/views):页面组件,如 [HomeView.vue](mdc:src/views/HomeView.vue)、[AboutView.vue](mdc:src/views/AboutView.vue)。
- [styles/](mdc:src/styles):全局和局部样式文件。 - [styles/](mdc:src/styles):全局和局部样式文件。
- [components/](mdc:src/components):可复用组件(当前为空)。 - [components/](mdc:src/components):可复用组件(当前为空)。
......
...@@ -8,3 +8,4 @@ VUE_APP_URL = 'http://localhost:9528' ...@@ -8,3 +8,4 @@ VUE_APP_URL = 'http://localhost:9528'
NODE_ENV = 'development' NODE_ENV = 'development'
ENV = 'development' ENV = 'development'
isTestWx = true
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
- @store/:Vuex 状态管理,主文件为 @index.js。 - @store/:Vuex 状态管理,主文件为 @index.js。
- @api/:接口请求封装,示例:@user.js。 - @api/:接口请求封装,示例:@user.js。
- @utils/:工具函数和请求封装,如 @request.js。 - @utils/:工具函数和请求封装,如 @request.js。
- @mixins/:Vue 混入逻辑,如 @externalUserId.js。 - @mixins/:Vue 混入逻辑,如 @external_userid.js。
- @views/:页面组件,如 @HomeView.vue、@AboutView.vue。 - @views/:页面组件,如 @HomeView.vue、@AboutView.vue。
- @styles/:全局和局部样式文件。 - @styles/:全局和局部样式文件。
- @components/:可复用组件(当前为空)。 - @components/:可复用组件(当前为空)。
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
<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="favicon.ico"> <link rel="icon" href="favicon.ico">
<title>cebianlan</title> <title>company_app</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,shrink-to-fit=no,user-scalable=no">
<script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script> <script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
<script defer src="static/js/chunk-vendors.js"></script><script defer src="static/js/app.js"></script></head> <script defer src="static/js/chunk-vendors.js"></script><script defer src="static/js/app.js"></script></head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but cebianlan doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but company_app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
</body> </body>
......
{ {
"name": "cebianlan", "name": "company_app",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
"dingtalk-jsapi": "^3.1.0", "dingtalk-jsapi": "^3.1.0",
"element-ui": "^2.15.14", "element-ui": "^2.15.14",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"lib-flexible": "^0.3.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.1", "moment": "^2.29.1",
"postcss-plugin-px2rem": "^0.8.1",
"sass": "^1.89.0", "sass": "^1.89.0",
"sass-loader": "^16.0.5", "sass-loader": "^16.0.5",
"vconsole": "^3.15.1", "vconsole": "^3.15.1",
......
...@@ -38,12 +38,18 @@ importers: ...@@ -38,12 +38,18 @@ importers:
js-cookie: js-cookie:
specifier: ^3.0.5 specifier: ^3.0.5
version: 3.0.5 version: 3.0.5
lib-flexible:
specifier: ^0.3.2
version: 0.3.2
lodash: lodash:
specifier: ^4.17.21 specifier: ^4.17.21
version: 4.17.21 version: 4.17.21
moment: moment:
specifier: ^2.29.1 specifier: ^2.29.1
version: 2.30.1 version: 2.30.1
postcss-plugin-px2rem:
specifier: ^0.8.1
version: 0.8.1
sass: sass:
specifier: ^1.89.0 specifier: ^1.89.0
version: 1.89.0 version: 1.89.0
...@@ -2585,6 +2591,10 @@ packages: ...@@ -2585,6 +2591,10 @@ packages:
resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
has-flag@1.0.0:
resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==}
engines: {node: '>=0.10.0'}
has-flag@3.0.0: has-flag@3.0.0:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
engines: {node: '>=4'} engines: {node: '>=4'}
...@@ -3114,6 +3124,9 @@ packages: ...@@ -3114,6 +3124,9 @@ packages:
launch-editor@2.10.0: launch-editor@2.10.0:
resolution: {integrity: sha512-D7dBRJo/qcGX9xlvt/6wUYzQxjh5G1RvZPgPv8vi4KRU99DVQL/oW7tnVOCCTm2HGeo3C5HvGE5Yrh6UBoZ0vA==} resolution: {integrity: sha512-D7dBRJo/qcGX9xlvt/6wUYzQxjh5G1RvZPgPv8vi4KRU99DVQL/oW7tnVOCCTm2HGeo3C5HvGE5Yrh6UBoZ0vA==}
lib-flexible@0.3.2:
resolution: {integrity: sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg==}
lilconfig@2.1.0: lilconfig@2.1.0:
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
engines: {node: '>=10'} engines: {node: '>=10'}
...@@ -3893,6 +3906,9 @@ packages: ...@@ -3893,6 +3906,9 @@ packages:
peerDependencies: peerDependencies:
postcss: ^8.2.15 postcss: ^8.2.15
postcss-plugin-px2rem@0.8.1:
resolution: {integrity: sha512-gNxhrnR57pnGrPLLqVNWY9+BWgj46kYkphw+0gpRJf9tjgwI7/tLqQPK7KdlksB2SSAddOb11otDVwri8b8mXw==}
postcss-reduce-initial@5.1.2: postcss-reduce-initial@5.1.2:
resolution: {integrity: sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==} resolution: {integrity: sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==}
engines: {node: ^10 || ^12 || >=14.0} engines: {node: ^10 || ^12 || >=14.0}
...@@ -3928,6 +3944,10 @@ packages: ...@@ -3928,6 +3944,10 @@ packages:
postcss-value-parser@4.2.0: postcss-value-parser@4.2.0:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
postcss@5.2.18:
resolution: {integrity: sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==}
engines: {node: '>=0.12'}
postcss@7.0.39: postcss@7.0.39:
resolution: {integrity: sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==} resolution: {integrity: sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
...@@ -4379,6 +4399,10 @@ packages: ...@@ -4379,6 +4399,10 @@ packages:
source-map-support@0.5.21: source-map-support@0.5.21:
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
source-map@0.5.7:
resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
engines: {node: '>=0.10.0'}
source-map@0.6.1: source-map@0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
...@@ -4514,6 +4538,10 @@ packages: ...@@ -4514,6 +4538,10 @@ packages:
resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==}
engines: {node: '>=0.8.0'} engines: {node: '>=0.8.0'}
supports-color@3.2.3:
resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==}
engines: {node: '>=0.8.0'}
supports-color@5.5.0: supports-color@5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'} engines: {node: '>=4'}
...@@ -6584,15 +6612,13 @@ snapshots: ...@@ -6584,15 +6612,13 @@ snapshots:
ansi-html-community@0.0.8: {} ansi-html-community@0.0.8: {}
ansi-regex@2.1.1: ansi-regex@2.1.1: {}
optional: true
ansi-regex@3.0.1: {} ansi-regex@3.0.1: {}
ansi-regex@5.0.1: {} ansi-regex@5.0.1: {}
ansi-styles@2.2.1: ansi-styles@2.2.1: {}
optional: true
ansi-styles@3.2.1: ansi-styles@3.2.1:
dependencies: dependencies:
...@@ -6986,7 +7012,6 @@ snapshots: ...@@ -6986,7 +7012,6 @@ snapshots:
has-ansi: 2.0.0 has-ansi: 2.0.0
strip-ansi: 3.0.1 strip-ansi: 3.0.1
supports-color: 2.0.0 supports-color: 2.0.0
optional: true
chalk@2.4.2: chalk@2.4.2:
dependencies: dependencies:
...@@ -8231,11 +8256,12 @@ snapshots: ...@@ -8231,11 +8256,12 @@ snapshots:
has-ansi@2.0.0: has-ansi@2.0.0:
dependencies: dependencies:
ansi-regex: 2.1.1 ansi-regex: 2.1.1
optional: true
has-bigints@1.1.0: has-bigints@1.1.0:
optional: true optional: true
has-flag@1.0.0: {}
has-flag@3.0.0: {} has-flag@3.0.0: {}
has-flag@4.0.0: {} has-flag@4.0.0: {}
...@@ -8800,6 +8826,8 @@ snapshots: ...@@ -8800,6 +8826,8 @@ snapshots:
picocolors: 1.1.1 picocolors: 1.1.1
shell-quote: 1.8.2 shell-quote: 1.8.2
lib-flexible@0.3.2: {}
lilconfig@2.1.0: {} lilconfig@2.1.0: {}
lines-and-columns@1.2.4: {} lines-and-columns@1.2.4: {}
...@@ -9555,6 +9583,10 @@ snapshots: ...@@ -9555,6 +9583,10 @@ snapshots:
postcss: 8.5.3 postcss: 8.5.3
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
postcss-plugin-px2rem@0.8.1:
dependencies:
postcss: 5.2.18
postcss-reduce-initial@5.1.2(postcss@8.5.3): postcss-reduce-initial@5.1.2(postcss@8.5.3):
dependencies: dependencies:
browserslist: 4.24.5 browserslist: 4.24.5
...@@ -9589,6 +9621,13 @@ snapshots: ...@@ -9589,6 +9621,13 @@ snapshots:
postcss-value-parser@4.2.0: {} postcss-value-parser@4.2.0: {}
postcss@5.2.18:
dependencies:
chalk: 1.1.3
js-base64: 2.6.4
source-map: 0.5.7
supports-color: 3.2.3
postcss@7.0.39: postcss@7.0.39:
dependencies: dependencies:
picocolors: 0.2.1 picocolors: 0.2.1
...@@ -10122,6 +10161,8 @@ snapshots: ...@@ -10122,6 +10161,8 @@ snapshots:
buffer-from: 1.1.2 buffer-from: 1.1.2
source-map: 0.6.1 source-map: 0.6.1
source-map@0.5.7: {}
source-map@0.6.1: {} source-map@0.6.1: {}
spdx-correct@3.2.0: spdx-correct@3.2.0:
...@@ -10242,7 +10283,6 @@ snapshots: ...@@ -10242,7 +10283,6 @@ snapshots:
strip-ansi@3.0.1: strip-ansi@3.0.1:
dependencies: dependencies:
ansi-regex: 2.1.1 ansi-regex: 2.1.1
optional: true
strip-ansi@4.0.0: strip-ansi@4.0.0:
dependencies: dependencies:
...@@ -10285,8 +10325,11 @@ snapshots: ...@@ -10285,8 +10325,11 @@ snapshots:
postcss: 8.5.3 postcss: 8.5.3
postcss-selector-parser: 6.1.2 postcss-selector-parser: 6.1.2
supports-color@2.0.0: supports-color@2.0.0: {}
optional: true
supports-color@3.2.3:
dependencies:
has-flag: 1.0.0
supports-color@5.5.0: supports-color@5.5.0:
dependencies: dependencies:
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<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><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,shrink-to-fit=no,user-scalable=no">
<script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script> <script src="https://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
</head> </head>
<body> <body>
......
...@@ -12,15 +12,21 @@ ...@@ -12,15 +12,21 @@
{{ item.label }} {{ item.label }}
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
<!-- 绑定的 w 账号 -->
<!-- <bindUserList /> -->
</div> </div>
<div class="mobile-content "> <div class="mobile-content">
<router-view></router-view> <router-view></router-view>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import bindUserList from '@/views/components/bindGameAccount/bindUserList.vue'
export default { export default {
name: 'App', name: 'App',
components: {
bindUserList
},
data() { data() {
return { return {
menuList: [ menuList: [
...@@ -53,21 +59,26 @@ export default { ...@@ -53,21 +59,26 @@ export default {
} }
}, },
watch: { watch: {
'$route.path'(val) { // '$route.path'(val) {
this.selectedPath = val // this.selectedPath = val
} // }
}, },
created() { created() {
if (this.$route.path === '/' || this.$route.path === '') { // if (this.$route.path === '/' || this.$route.path === '') {
this.$router.replace('/userInfo') // this.$router.replace('/userInfo')
} else { // } else {
this.selectedPath = this.$route.path // this.selectedPath = this.$route.path
} // }
}, },
} }
</script> </script>
<style scoped> <style scoped>
#app{
width: 100%;
height: 100%;
background: #fff;
}
.mobile-app-wrapper { .mobile-app-wrapper {
max-width: 380px; max-width: 380px;
min-width: 360px; min-width: 360px;
...@@ -104,15 +115,13 @@ export default { ...@@ -104,15 +115,13 @@ export default {
.mobile-content { .mobile-content {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 18px 10px 10px 10px;
background: #f0f2f5;
} }
.mobile-content > div { .mobile-content > div {
background: #fff; background: #fff;
border-radius: 8px; border-radius: 8px;
min-height: 60vh; min-height: 60vh;
box-shadow: 0 2px 8px #f0f1f2; box-shadow: 0 2px 8px #f0f1f2;
padding: 24px 10px; padding: 10px;
} }
.el-menu--horizontal>.el-menu-item{ .el-menu--horizontal>.el-menu-item{
height: 50px; height: 50px;
......
// 客户绑定掌游账号列表
import request from '@/utils/request'
function returnApi(api) {
return '/sidebar' + api
}
// w 账号绑定列表
export function zyouBindMember(data) {
return request({
url: returnApi('/external_user/zyouBindMember'),
method: 'post',
data
})
}
// 检查账号绑定
export function checkZyouBind(data) {
return request({
url: returnApi('/external_user/checkZyouBind'),
method: 'post',
data
})
}
// 绑定掌游账号
// 绑定掌游账号
export function zyouBind(data) {
return request({
url: returnApi('/external_user/zyouBind'),
method: 'post',
headers: {
'Corp-Id': data.bindUserCorpID || store.state.user.corpId
},
data
})
}
export function detailsInfoRequest(data) {
return request({
url: returnApi('/external_user/info'),
method: 'post',
data
})
}
\ No newline at end of file
<template>
<div class="newPage rowFlex allCenter">
<el-pagination
:total="Number(pageInfo.total)"
:current-page.sync="pageInfo.page"
:page-size="Number(pageInfo.page_size)"
background
layout="total,prev, pager, next, jumper"
@current-change="handleCurrentChange"
>
</el-pagination>
</div>
</template>
<script type="text/javascript">
export default {
name: 'page',
props: ['pageInfo'],
data() {
return {}
},
mounted() {
},
methods: {
handleCurrentChange(newPage) {
this.pageInfo.page = newPage
this.$emit('requestNextPage', this.pageInfo)
}
}
}
</script>
<style lang="scss" scoped>
.newPage {
width: 100%;
height: 60px;
background: #fff;
border-radius: 0 0 5px 5px;
padding-bottom: 20px;
}
</style>
\ No newline at end of file
...@@ -7,7 +7,7 @@ import 'element-ui/lib/theme-chalk/index.css'; ...@@ -7,7 +7,7 @@ import 'element-ui/lib/theme-chalk/index.css';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import _ from 'lodash'; import _ from 'lodash';
import '@/styles/index.scss' // global css import '@/styles/index.scss' // global css
import 'lib-flexible/flexible.js'
Vue.use(ElementUI); Vue.use(ElementUI);
// import '@/styles/index.scss' // global css // import '@/styles/index.scss' // global css
Vue.config.productionTip = false Vue.config.productionTip = false
......
// mixins/externalUserId.js
// 签名获取外部用户externalUserId逻辑
import { getSign, getAgentSign } from '@/api/user';
export default {
data() {
return {
externalUserId: ''
};
},
created() {
},
mounted() {
// 获取企业签名信息
localStorage.removeItem('externalUserId');
this.getCompanySign();
},
methods: {
//获取企业签名信息
getCompanySign() {
// let url = "获取config或agentConfig配置的参数接口";
//该paramUrl 为你使用微信sdk-js相关接口的页面地址 该地址需要配置到应用后台的可信域名下
let url = window.location.href.split("#")[0];
let params = { url };
getSign(params).then(res => {
this.companyConfigInit(res.data);
}).catch(err => {
console.log(err);
});
},
//企业验证配置
companyConfigInit(data) {
let that = this;
// noncestr: "ww09b472814e7d260f"
// signature: "442fde92aa1a440e5e9636364378186e6463306c"
// timestamp: "1647912587432
let { timestamp, noncestr, signature } = data || {};
let wxConfig = localStorage.getItem('wxConfig') ? JSON.parse(localStorage.getItem('wxConfig')) : {};
let { corpid } = wxConfig;
// eslint-disable-next-line
wx.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: corpid, // 必填,企业微信的corpID
timestamp: timestamp, // 必填,生成签名的时间戳
nonceStr: noncestr, // 必填,生成签名的随机串
signature: signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: ["getContext", "getCurExternalContact", "invoke"] //你要调用的sdk接口必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
});
// eslint-disable-next-line
wx.ready(function () {
that.appAgentConfig();
});
// eslint-disable-next-line
wx.error(function (res) {
console.log('config失败了', res)
});
},
//获取应用签名信息
appAgentConfig() {
let url = window.location.href.split("#")[0];
let params = { url };
getAgentSign(params).then((res) => {
let { code, data, message } = res || {};
if (code === 200) {
this.appConfigInit(data);
} else {
console.log(message);
}
})
},
//应用验证配置
appConfigInit(data) {
let that = this;
let { timestamp, noncestr, signature } = data || {};
let wxConfig = localStorage.getItem('wxConfig') ? JSON.parse(localStorage.getItem('wxConfig')) : {};
let { corpid, agentid } = wxConfig;
// eslint-disable-next-line
wx.agentConfig({
corpid,
agentid,
timestamp: timestamp,
nonceStr: noncestr,
signature: signature,
jsApiList: ["getContext", "getCurExternalContact", "invoke"],
success: function () {
// eslint-disable-next-line
wx.invoke('getCurExternalContact', {
}, function (res) {
// alert('invoke成功了')
// alert(JSON.stringify(res),'invokeData数据')
console.log('invoke成功了', res)
if (res.err_msg == "getCurExternalContact:ok") {
localStorage.setItem('externalUserId', res.userId);
// this.$store.dispatch("common/setExternalUserId", res.userId);
that.externalUserId = res.userId; //返回当前外部联系人userId
// alert(that.externalUserId);
} else {
//错误处理
}
//查看相关接口是否可以调用
// that.checkJsApi();
});
},
fail: function (res) {
console.log('invoke失败了', res)
// alert('invoke失败了', res)
if (res.errMsg.indexOf("function not exist") > -1) {
alert("版本过低请升级");
}
}
});
},
}
}
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import userInfo from '../views/userInfo.vue' import userInfo from '../views/userInfo/userInfo.vue'
import quickReply from '../views/quickReply.vue' import quickReply from '../views/quickReply.vue'
import giftRecord from '../views/giftRecord.vue' import giftRecord from '../views/giftRecord.vue'
import applyRecord from '../views/applyRecord.vue' import applyRecord from '../views/applyRecord.vue'
...@@ -49,11 +49,11 @@ const routes = [ ...@@ -49,11 +49,11 @@ const routes = [
name: 'login', name: 'login',
component: () => import('../views/login.vue') component: () => import('../views/login.vue')
}, },
// { {
// path: '/ddLogin', path: '/testWx',
// name: 'ddLogin', name: 'testWx',
// component: () => import('../views/ddLogin.vue') component: () => import('../views/testWx.vue')
// } },
] ]
const router = new VueRouter({ const router = new VueRouter({
/* 这里用 hash 模式 因为本项目是在企微 服务器下的一个二级页面 如果用 history 模式 需要修改 nginx 配置 在 nginx 配置中 需要添加 location /company_app/ { /* 这里用 hash 模式 因为本项目是在企微 服务器下的一个二级页面 如果用 history 模式 需要修改 nginx 配置 在 nginx 配置中 需要添加 location /company_app/ {
...@@ -69,14 +69,13 @@ const router = new VueRouter({ ...@@ -69,14 +69,13 @@ const router = new VueRouter({
routes routes
}) })
// router/index.js // router/index.js
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 需要登录态的页面 // 需要登录态的页面
const needAuth = !['/login'].includes(to.path) const needAuth = !['/login'].includes(to.path)
// 检查登录信息 // 检查登录信息
const wecomUserId = Cookies.get('wx_userid') const wecomUserId = Cookies.get('userid')
const cser_id = Cookies.get('cser_id') const cser_id = Cookies.get('cser_id')
const token = Cookies.get('token') const token = Cookies.get('token')
const urlParams = getParams(); const urlParams = getParams();
...@@ -87,13 +86,11 @@ router.beforeEach((to, from, next) => { ...@@ -87,13 +86,11 @@ router.beforeEach((to, from, next) => {
} else { } else {
// 缺少登录信息,跳转到登录页 // 缺少登录信息,跳转到登录页
// 跳转到 login 的时候带上当前 url 的参数 // 跳转到 login 的时候带上当前 url 的参数
// next({ next({
// path: '/login', path: '/login',
// query: urlParams query: urlParams
// }) })
// next()
next()
} }
} else { } else {
// 登录页、回调页等不需要校验 // 登录页、回调页等不需要校验
......
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import user from './modules/user' import user from './modules/user'
import game from './modules/game'
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
...@@ -13,6 +14,7 @@ export default new Vuex.Store({ ...@@ -13,6 +14,7 @@ export default new Vuex.Store({
actions: { actions: {
}, },
modules: { modules: {
user user,
game
} }
}) })
// 和游戏相关的逻辑处理
// 管理公共的store
import { zyouBindMember } from '@/api/works'
const state = {
accountSelect: '', // 当前选中的用户的member_id
bindGameUserList: [], // 用户绑定的游戏角色
changeSelectWindow: false, // 切换客服窗口的时候 下发通知
chatUserInfo: {}, // 当前选中的用户的详情
}
const mutations = {
set_accountSelect(state, data) {
state.accountSelect = data
},
set_bindGameUserList(state, data) {
state.bindGameUserList = data
},
set_chatUserInfo(state, data) {
state.chatUserInfo = data
}
}
const actions = {
// 游戏绑定用户
gameBindUser({ dispatch, commit }, data) {
return new Promise((resolve, reject) => {
zyouBindMember(data).then(async (res) => {
if (res.status_code == 1) {
res.data.data.map((item) => {
item.member_id = item.member_id + ''
})
if (res.data.data && res.data.data.length > 0) {
res.data.data.map((item) => {
item.label = item.username
item.value = item.member_id
})
}
commit('set_bindGameUserList', res.data.data)
resolve(res.data.data)
}
})
})
},
}
export default {
namespaced: true,
state,
mutations,
actions
}
...@@ -6,11 +6,11 @@ const state = { ...@@ -6,11 +6,11 @@ const state = {
"agent_signature": "05a47ef848266c48ff28f52e7749ba8b70adcc14", "agent_signature": "05a47ef848266c48ff28f52e7749ba8b70adcc14",
"corp_signature": "29e61720786b3c6dac31f1041c70878b4819842e", "corp_signature": "29e61720786b3c6dac31f1041c70878b4819842e",
"time": 1747726636, "time": 1747726636,
externalUserId:'' external_userid:''
}, },
userid:'userid', userid:'JinDuoXia',
corp_id:'', corp_id:'',
externalUserId:'', external_userid:'',
token:'', token:'',
cser_info:{ cser_info:{
cser_id:'', cser_id:'',
...@@ -22,10 +22,11 @@ const state = { ...@@ -22,10 +22,11 @@ const state = {
corp_signature:'', corp_signature:'',
time:'' time:''
}, },
externalUserId:'' external_userid:'wm5rUgMgAAjqjOcqp8i3lEhFZDQieWug'
// 六子的 用户id wm5rUgMgAAjqjOcqp8i3lEhFZDQieWug // 六子的 用户id wm5rUgMgAAjqjOcqp8i3lEhFZDQieWug
// 我的 wx_userid JinDuoXia cser_id 4090 corp_id wweaefe716636df3d1 cser_id 4090 token token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOjQwOTAsImlhdCI6MTc0NzgxMjMxMiwiZXhwIjoxNzQ4NDE3MTEyLCJuYmYiOjE3NDc4MTIzMTIsInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiMjBkOTY3MDZiYzI1MDdmY2MxOWI2MjU1YTM0YWQ3M2YifQ.yX7E7QHV7x2ubpa8iK3Avy794EiHNCaW2CtB4A4UQWo // 我的 userid JinDuoXia cser_id 4090 corp_id wweaefe716636df3d1 cser_id 4090 token token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJpc3MiOjQwOTAsImlhdCI6MTc0NzgxMjMxMiwiZXhwIjoxNzQ4NDE3MTEyLCJuYmYiOjE3NDc4MTIzMTIsInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiMjBkOTY3MDZiYzI1MDdmY2MxOWI2MjU1YTM0YWQ3M2YifQ.yX7E7QHV7x2ubpa8iK3Avy794EiHNCaW2CtB4A4UQWo
} }
const mutations = { const mutations = {
set_userInfo(state,userInfo){ set_userInfo(state,userInfo){
state.userInfo = userInfo state.userInfo = userInfo
...@@ -36,8 +37,8 @@ const mutations = { ...@@ -36,8 +37,8 @@ const mutations = {
set_corp_id(state,corp_id){ set_corp_id(state,corp_id){
state.corp_id = corp_id state.corp_id = corp_id
}, },
set_externalUserId(state,externalUserId){ set_external_userid(state,external_userid){
state.externalUserId = externalUserId state.external_userid = external_userid
}, },
set_token(state,token){ set_token(state,token){
state.token = token state.token = token
......
// cover some element-ui styles
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
font-weight: 400 !important;
}
.el-upload {
input[type='file'] {
display: none !important;
}
}
.el-upload__input {
display: none;
}
// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
transform: none;
left: 0;
position: relative;
margin: 0 auto;
}
// refine element ui upload
.upload-container {
.el-upload {
width: 100%;
.el-upload-dragger {
width: 100%;
height: 200px;
}
}
}
// dropdown
.el-dropdown-menu {
a {
display: block;
}
}
// to fix el-date-picker css style
.el-range-separator {
box-sizing: content-box;
}
.el-radio-button:focus {
box-shadow: none !important;
}
.el-drawer__header > span,
.el-tabs__item {
outline: none;
}
.el-drawer__body {
position: relative;
}
.error-message {
z-index: 5000 !important;
}
.el-drawer__header>span,.el-tabs__item{
outline: none;
}
.el-icon-circle-close {
color: #fff;
}
\ No newline at end of file
/**
* I think element-ui's default theme color is too light for long-term use.
* So I modified the default color and you can modify it to your liking.
**/
/* theme color */
$--color-primary: #00BF8A;
// $--color-success: #13ce66;
// $--color-warning: #ffba00;
// $--color-danger: #ff4949;
// $--color-info: #1E1E1E;
$--button-font-weight: 400;
// $--color-text-regular: #1f2d3d;
$--border-color-light: #dfe4ed;
$--border-color-lighter: #e6ebf5;
$--table-border: 1px solid #dfe6ec;
/* icon font path, required */
$--font-path: '~bi-eleme/lib/theme-chalk/fonts';
@import '~bi-eleme/packages/theme-chalk/src/index';
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
theme: $--color-primary;
}
\ No newline at end of file
// 全局函数和变量
$color: #00BF8A; // 全局颜色
@function vw($px) {
@return ($px / 1920) * 100vw;
}
@function vh($px) {
@return ($px / 1080) * 100vw;
}
.flex_x {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.flex_y {
display: flex;
flex-flow: column;
justify-content: space-between;
}
.flex_wrap {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item-content {
.el-select--small {
.el-tag:first-child {
max-width: 64% !important;
}
}
}
.BiInput_single_clear {
.el-input__suffix {
display: none !important;
}
}
.display_none_dialog {
.el-drawer__body::-webkit-scrollbar {
/*滚动条整体样式*/
width: 0;
background: #fff;
border-radius: 3px;
}
.el-drawer__body::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
width: 0;
border-radius: 3px;
background: rgba(221, 221, 221, 1);
}
}
.radio {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
}
.el-input__count {
vertical-align: top;
}
.el-range-separator {
margin-right: 10px !important;
}
:root {
--primary-color: #2563eb;
--primary-hover: #1d4ed8;
--bg-color: #f8fafc;
--chat-bg: #ffffff;
--user-msg-bg: #2563eb;
--ai-msg-bg: #f1f5f9;
--border-color: #e2e8f0;
--text-primary: #1e293b;
--text-secondary: #64748b;
}
\ No newline at end of file
@import "./variables.scss"; @import "./variables.scss";
@import "./mixin.scss";
@import "./transition.scss";
@import "./element-ui.scss";
@import "./sidebar.scss";
@import "./ui.scss";
@import 'uistyle.scss';
@import './reset.scss';
// @tailwind base; // 重设的 css 代码 // @tailwind base; // 重设的 css 代码
// @tailwind components; // @tailwind components;
......
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
@mixin scrollBar {
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
@mixin relative {
position: relative;
width: 100%;
height: 100%;
}
.success {
background-color: #67c23a;
}
// .info {
// background-color: #909399;
// }
.primary {
background-color: #409eff;
}
.danger {
background-color: #f56c6c;
}
.warning {
background-color: #e6a23c;
}
.content-outer {
.bi-tabs-box {
background-color: #fff;
margin-bottom: 10px;
overflow-y: hidden;
.el-tabs__nav-wrap.is-top::after {
content: none;
}
.el-tabs__active-bar.is-top {
top: 0;
}
.el-tabs__header.is-top {
margin-bottom: 0;
}
.el-tabs__content {
padding: 0;
display: none;
overflow: initial;
}
.el-tabs__item.is-top {
min-width: 100px;
text-align: center;
}
// .el-tabs--border-card {
// border: none;
// box-shadow: none;
// .el-tabs__nav {
// display: flex;
// }
// & > .el-tabs__header {
// border-bottom: none;
// .el-tabs__item {
// margin-top: 0;
// border: none;
// display: block;
// }
// }
// }
}
& > .content-head.container {
padding-bottom: 0 !important;
background-color: white;
}
.content-table {
margin-top: 10px;
background-color: white;
padding: 20px;
.action-box {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
.table-table {
padding-bottom: 20px;
}
.pagination-container {
margin-top: 20px;
display: flex;
justify-content: center;
}
}
.drawer-container {
// padding: 20px;
}
}
.bi-column-container {
display: flex;
justify-content: space-between;
.column-container {
margin-left: 20px;
width: 230px;
flex: 0 0 230px;
}
}
.colorStatus {
display: inline-block;
> p {
display: inline;
}
.all {
padding: 2px 8px;
height: 20px;
line-height: 16px;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #3491fa;
border: 1px solid #c3e7fe;
background: #e8f7ff;
}
// 成功
.success {
padding: 2px 8px;
height: 20px;
line-height: 16px;
background: #e1fff0;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #00bf8a;
}
.indeter {
padding: 2px 8px;
height: 20px;
line-height: 16px;
background: #fffae0;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
border-radius: 4px;
border: 1px solid #ffe4ba;
color: #ff7d00;
}
.fail {
padding: 2px 8px;
height: 20px;
line-height: 16px;
background: #ffece8;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #f53f3f;
border: 1px solid #fdcdc5;
}
.normal {
padding: 2px 8px;
height: 20px;
line-height: 16px;
background: #f4f4f4;
border-radius: 4px;
font-size: 12px;
font-weight: 400;
color: #86909c;
}
.dianFail {
display: inline-block;
width: 8px;
height: 8px;
background: #f45454;
border-radius: 5px;
}
.dianLineup {
display: inline-block;
width: 8px;
height: 8px;
background: #c9cdd4;
border-radius: 5px;
}
.dianLoading {
display: inline-block;
width: 8px;
height: 8px;
background: #f45454;
border-radius: 5px;
}
.dianSuccess {
display: inline-block;
width: 8px;
height: 8px;
background: #00bf8a;
border-radius: 5px;
}
.dianWait {
display: inline-block;
width: 8px;
height: 8px;
background: #ff9d02;
border-radius: 5px;
}
.dianNormal {
display: inline-block;
width: 8px;
height: 8px;
background: #c9cdd4;
border-radius: 5px;
}
.dianOk {
display: inline-block;
width: 8px;
height: 8px;
background: #0fc6c2;
border-radius: 5px;
}
.dianKou {
display: inline-block;
width: 8px;
height: 8px;
background: #3491fa;
border-radius: 5px;
}
}
.el-dialog {
.dialog-footer {
position: relative;
}
}
// 弹窗的按钮位置
.dialog-footer {
width: calc(100%);
position: absolute;
bottom: 0px;
right: 0;
padding-top: 20px;
padding-bottom: 20px;
padding-right: 20px;
border-top: 1px solid rgba(0, 0, 0, 0.06);
justify-content: flex-end;
overflow: hidden;
background: #fff;
z-index: 10;
.btn {
width: 84px;
height: 32px;
}
}
.tableheader-popper-editdialog {
.dialog-footer {
padding-top: 0;
padding-right: 0;
}
}
.el-drawer__header {
padding: 0 20px !important;
line-height: 58px;
height: 58px;
// padding-bottom: 0;
margin-bottom: 0;
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
// border: 1px rgba(0, 0, 0, 0.06) solid;
// box-shadow: 0 1px 4px rgb(0 21 41 / 8%);
}
// 带background的title
.baseInfo {
width: 100%;
height: auto;
margin-bottom: 10px;
border: 1px solid #f1f5fd;
background: #fff;
.content{
padding-top: 0!important;
}
.title {
width: 100%;
height: 40px;
background: #f7f8fa;
font-size: 14px;
font-weight: 500;
color: #323335;
padding-left: 10px;
line-height: 40px;
margin-bottom: 20px;
}
}
.drawer-container-title{
width: 100%;
height: auto;
font-weight: 500;
font-size: 16px;
color: #323335;
line-height: 22px;
text-align: left;
border-left: 3px solid #00BF8A;
text-indent: 10px;
font-weight: 500;
line-height: 16px;
margin-bottom: 20px;
}
// 弹窗里面的确定 取消按钮暂时固定选择
.layerBtns {
display: flex;
justify-content: flex-end;
.btn {
width: auto;
height: 32px;
}
.el-button {
font-weight: 500 !important;
}
}
.el-image__inner {
border-radius: 5px;
}
p {
margin: 0;
}
//
.infoText {
color: #86909c;
font-size: 12px;
}
// .el-drawer__body{
// position: relative;
// }
.el-dialog__header {
min-height: 40px;
}
.avatar-uploader .el-upload:hover {
// border:1px dashed #00BF8A !important;
}
// form 里面label换行的时候的样式
.lineHeight {
.el-form-item__label {
line-height: 20px !important;
}
}
// 应用icon样式
.miniappIcon {
width: 30px;
height: 30px;
border-radius: 30px;
margin-right: 10px;
}
.miniappIconText {
position: relative;
top: -10px;
}
.textInfo {
color: rgb(153, 153, 153);
font-size: 12px;
}
.textHidden {
word-break: break-all;
}
.redText {
font-size: 14px;
font-weight: 400;
color: #ff4d4f;
}
//注意样式
.carefulText {
width: 100%;
height: 40px;
background: #fff7e8;
border-radius: 4px;
font-size: 14px;
font-weight: 400;
color: #323335;
padding-left: 10px;
margin-top: 0 !important;
margin-bottom: 10px;
display: flex;
align-items: center;
.icon {
color: #ff7d00 !important;
font-size: 14px;
margin: 0 10px;
}
i {
color: #ff7d00 !important;
font-size: 14px;
}
}
.search-form {
.el-select__tags {
max-width: 200px !important;
}
}
.el-form-item__label {
font-weight: 600;
}
.el-table__header .cell {
color: #323335;
font-weight: 500;
}
.el-tooltip {
max-width: 200px;
}
.tooltipWidth {
max-width: 250px;
line-height: 18px !important;
}
.el-tag {
margin-right: 5px !important;
}
.el-date-range-picker__header {
border: none !important;
}
.el-tabs__header {
margin-bottom: 15px;
}
.el-icon-question {
color: #86909c;
}
.id_color {
font-size: 14px;
color: #86909c;
}
#app {
.main-container {
min-height: 100%;
padding-top: 0px !important;
transition: margin-left .28s;
margin-left: $sideBarWidth;
position: relative;
}
.sidebar-container {
transition: width 0.28s;
width: $sideBarWidth !important;
background-color: $menuBg;
height: 100%;
position: fixed;
font-size: 0px;
top: 0;
bottom: 0;
left: 0;
z-index: 1001;
overflow: hidden;
box-shadow: 0 1px 4px #00152914;
// reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
}
.scrollbar-wrapper {
overflow-x: hidden !important;
}
.el-scrollbar__bar.is-vertical {
right: 0px;
}
.el-scrollbar {
height: 100%;
}
&.has-logo {
.el-scrollbar {
height: calc(100% - 90px);
}
}
.is-horizontal {
display: none;
}
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
.svg-icon {
margin-right: 16px;
width: 22px;
height: 22px;
background-size: contain;
color: #8893aa;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
.el-menu {
border: none;
height: 100%;
width: 100% !important;
}
// menu hover
.submenu-title-noDropdown,
.el-submenu__title {
&:hover {
background-color: $menuHover !important;
}
}
.is-active > .el-submenu__title,
.is-active > .el-submenu__title svg,
.is-active.submenu-title-noDropdown,
.is-active.submenu-title-noDropdown svg {
color: $subMenuActiveText !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .el-submenu .el-menu-item {
min-width: $sideBarWidth !important;
// background-color: $subMenuBg !important;
&:hover {
background-color: $subMenuHover !important;
}
}
}
.hideSidebar {
.sidebar-container {
width: 54px !important;
}
.main-container {
margin-left: 54px;
}
.submenu-title-noDropdown {
padding: 0 !important;
position: relative;
.el-tooltip {
padding: 0 !important;
.svg-icon {
margin-left: 15px;
}
.sub-el-icon {
margin-left: 19px;
}
}
}
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 15px;
}
.sub-el-icon {
margin-left: 19px;
}
.el-submenu__icon-arrow {
display: none;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
}
}
}
}
.el-menu--collapse .el-menu .el-submenu {
min-width: $sideBarWidth !important;
}
// mobile responsive
.mobile {
.main-container {
margin-left: 0px;
}
.sidebar-container {
transition: transform .28s;
width: $sideBarWidth !important;
}
&.hideSidebar {
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$sideBarWidth, 0, 0);
}
}
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
}
}
}
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
.svg-icon {
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
}
.nest-menu .el-submenu>.el-submenu__title,
.el-menu-item {
&:hover {
// you can use $subMenuHover
background-color: $menuHover !important;
}
}
// the scroll bar appears when the subMenu is too long
>.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
}
.el-menu-item{
position: relative;
&::after{
content:' ';
position: absolute;
width: 3px;
height: 0;
right: 0;
top: 0;
transition: .3s;
}
&.is-active::after{
height: 100%
}
}
.el-submenu .el-menu-item{
padding-left: 60px !important;
}
.el-submenu__title{
font-size: 16px !important;
font-weight: 500 !important;
color: #323335 !important;
}
.submenu-title-noDropdown:not(.el-submenu .submenu-title-noDropdown){
font-size: 16px !important;
font-weight: 500 !important;
color: #323335 !important;
}
\ No newline at end of file
// global transition css
/* fade */
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.28s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all .5s;
}
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
}
// rotage-transform
.rotage-transform-leave-active,
.rotage-transform-enter-active {
transition: all 1s;
}
.rotage-transform-enter {
transform: rotate(180deg);
}
.rotage-transform-leave-to {
transform: rotate(0deg);
}
/* breadcrumb transition */
.breadcrumb-enter-active,
.breadcrumb-leave-active {
transition: all .5s;
}
.breadcrumb-enter,
.breadcrumb-leave-active {
opacity: 0;
transform: translateX(20px);
}
.breadcrumb-move {
transition: all .5s;
}
.breadcrumb-leave-active {
position: absolute;
}
// $appmainWidth
/*
*Font
*默认为font-size: 14px;line-height: 20px;
*/
body {
font-size: 14px;
line-height: 20px;
color: #323335;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
#app {
height: 100%;
background-color: #e5e5e5;
.navbar {
height: $navbarHeight;
.navbar-box {
height: $navbarHeight;
line-height: $navbarHeight;
.app-breadcrumb {
padding: 10px 0;
}
}
}
.app-main {
min-height: calc(100vh - #{$navbarHeight});
}
}
.app-main {
.text {
&-12 {
font-size: 12px;
line-height: 18px;
}
&-14 {
font-size: 14px;
line-height: 20px;
}
&-16 {
font-size: 16px;
line-height: 22px;
}
&-24 {
font-size: 16px;
line-height: 34px;
}
}
.container {
padding: 20px;
background: #fff;
border-radius: 4px;
& + .container {
margin-top: 10px;
}
}
}
.search-form {
display: flex;
flex-wrap: wrap;
& + * {
margin-top: 15px !important;
}
.search-item {
min-width: 330px !important;
padding-right: 20px;
padding-bottom: 20px;
margin-bottom: 0;
margin-right: 0;
margin-left: 0;
margin-top: 0;
display: flex;
flex: 0 0 auto;
.item-label,
.select-label {
flex-wrap: 0;
flex-shrink: 0;
padding-right: 10px;
margin-bottom: 0;
margin-right: 0;
margin-left: 0;
margin-top: 0;
text-align: right;
line-height: 16px;
display: flex;
align-items: center;
flex-direction: row-reverse;
max-height: 32px;
overflow: hidden;
}
.select-value {
.el-input__inner {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
.item-label {
width: 80px;
}
.select-label {
width: 100px;
margin-right: -1px;
text-align: right;
padding-right: 0;
.is-focus .el-input__inner {
z-index: 1;
}
.el-input__inner {
position: relative;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:focus {
z-index: 1;
}
}
}
.item-content,
.select-content {
flex-grow: 1;
& > * {
width: 100%;
}
}
.select-content {
height: 32px;
.input-number-range {
position: relative;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
&.is-focus {
z-index: 1;
}
}
&:not(.el-select) {
.is-focus .el-input__inner {
z-index: 1;
}
.el-input__inner {
position: relative;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:focus {
z-index: 1;
}
}
}
&.el-select {
.el-input .el-input__inner {
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
}
}
}
}
.hideSidebar {
.search-form {
@media screen and (max-width: 1103px) {
.search-item {
width: 50%;
// &:nth-last-child(3) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1104px) {
.search-item {
width: 33.3%;
// &:nth-last-child(4) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1434px) {
.search-item {
width: 25%;
// &:nth-last-child(5) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1764px) {
.search-item {
width: 20%;
// &:nth-last-child(6) ~ .search-item {
// padding-bottom: 0;
// }
}
}
}
}
.openSidebar {
.search-form {
@media screen and (max-width: 910px) {
.search-item {
width: 50%;
// &:nth-last-child(3) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1240px) {
.search-item {
width: 33.3%;
// &:nth-last-child(4) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1570px) {
.search-item {
width: 25%;
// &:nth-last-child(5) ~ .search-item {
// padding-bottom: 0;
// }
}
}
@media screen and (min-width: 1900px) {
.search-item {
width: 20%;
// &:nth-last-child(6) ~ .search-item {
// padding-bottom: 0;
// }
}
}
}
}
/* element-ui */
.el-select,
.el-cascader {
.el-input__inner {
padding-right: 20px;
}
.el-input__suffix {
z-index: 1;
width: 20px;
}
.el-cascader__tags {
width: 210px;
flex-wrap: nowrap;
display: flex;
align-items: center;
}
.el-cascader__search-input {
min-width: 10px;
margin-left: 10px;
}
}
.el-date-editor {
.el-range__close-icon {
width: 15px;
}
}
.el-button + .el-button {
margin-left: 10px;
}
// .el-dialog__wrapper {
// display: flex;
// align-items: center;
// .el-dialog {
// min-width: 480px;
// margin-top: 50px;
// margin-bottom: 50px;
// max-height: calc(100vh - 100px);
// .el-dialog__header {
// padding: 16px 20px;
// line-height: 20px;
// font-size: 16px;
// color: rgba(0, 0, 0, 0.85);
// border-bottom: 1px solid rgba(0, 0, 0, 0.06);
// }
// }
// }
#app .sidebar-container .nest-menu .el-submenu > .el-submenu__title,
#app .sidebar-container .el-submenu .el-menu-item {
// color: #606266;
}
#app .sidebar-container .el-menu .el-menu-item .svg-icon + span {
font-weight: 500;
font-size: 16px;
// color: #606266;
}
#app .sidebar-container .el-menu .el-submenu__title .svg-icon + span {
font-size: 16px;
font-weight: 500;
}
#app .sidebar-container .svg-icon {
color: #8893aa;
}
#app .is-active .svg-icon {
color: #00bf8a;
}
#app .el-table thead th.el-table__cell .cell {
display: inline-block;
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
// background-color: #fff9f5;
opacity: 1;
}
.el-picker-panel.el-date-range-picker.el-popper.has-sidebar.has-time.my-popper {
z-index: 200000 !important;
}
.input-number-right-aligned .el-input-number__increase,
.input-number-right-aligned .el-input-number__decrease {
display: inline-block;
width: auto;
}
.input-number-right-aligned .el-input {
text-align: left;
}
.input-number-right-aligned .el-input-number__inner {
text-align: left;
}
// .rowFlex .el-input-number .el-input__inner {
// text-align: left !important;
// }
// 框架样式更改 重新规划
#app {
.app-main {
background: #eeeff5;
padding: 0 15px;
.dashboard {
width: calc(100% - 30px);
}
.content-head.container {
border-radius: 4px;
}
// 表格样式
.content-table {
border-radius: 4px;
margin-top: 15px;
}
.el-table {
// 表格里面的选择框
.el-table-column--selection .cell {
padding: 10px 16px !important;
}
.el-table__fixed-right {
background: #fff;
}
}
}
// 面包屑
.app-breadcrumb.el-breadcrumb {
padding: 14px 0;
.no-redirect {
font-size: 14px;
color: #323335;
font-weight: 700;
}
}
.content-head.container {
border-radius: 4px;
}
// 表格样式
.content-table {
border-radius: 4px;
margin-top: 15px;
}
.el-table {
// 表格里面的选择框
.el-table-column--selection .cell {
padding: 10px 16px !important;
}
.el-table__fixed-right {
background: #fff;
}
}
}
// 选择应用
.selectRouter {
.el-input__suffix {
height: 32px;
}
}
.el-tooltip__popper {
max-width: 300px;
}
// .app-main{
// // 图表的icon颜色
// i,.icon{
// color: #86909C;
// }
// }
.tableContent {
color: #323335 !important;
font-weight: 400 !important;
.tableHeader {
background: #f2f3f5;
}
}
.goRight {
width: 28px;
height: 27px;
background: #00bf8a;
border-radius: 14px;
color: #ffffff;
font-size: 16px;
margin: 0 20px;
cursor: pointer;
border-radius: 14px;
i {
color: #ffffff;
font-size: 16px;
margin: 0 20px;
cursor: pointer;
border-radius: 14px;
i {
color: #ffffff;
}
}
}
// 暂无数据
.noContent {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
i {
font-size: 42px;
color: #86909c;
}
.text {
font-size: 14px;
font-weight: 400;
color: #c9cdd4;
margin-top: 5px;
}
}
// 修改 tabs 全局样式
.el-tabs {
.el-tabs__header {
height: 50px;
border-radius: 4px;
}
.el-tabs__nav-scroll {
height: 50px;
}
.el-tabs__item {
height: 50px;
line-height: 50px;
font-size: 16px;
color: #4e5969;
}
.el-tabs__item.is-active{
color: #00bf8a;
}
}
// 表格样式
.content-outer {
.table-table {
padding-bottom: 20px !important;
}
}
.imageIcon {
position: relative;
}
// 统一标签样式
.checkTagsView {
width: 100%;
.tagsItem {
margin-right: 5px;
margin-bottom: 5px;
}
}
// toast 样式
.el-message{
z-index: 999999 !important;
}
// form 表单类型
.el-form-item .el-form-item, .el-form-item .el-form-item.el-form-item--small{
margin-bottom: 16px;
}
// 描述文字样式
.infoTextColor{
color: #86909c;
}
.infoSpan {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
max-width: 250px;
p {
font-size: 12px;
max-width: 100%;
line-height: 20px;
color: #86909c;
}
span {
color: #ffa81d;
}
}
// tab 样式 .tabs__content 默认 overflow 为 hidden 为 hidden 的时候 表格表头吸顶功能异常 需要 overflow 设置为 initial
.el-tabs__content {
overflow: initial;
}
\ No newline at end of file
...@@ -32,14 +32,14 @@ service.interceptors.request.use( ...@@ -32,14 +32,14 @@ service.interceptors.request.use(
? config.url + JSON.stringify(config.data) ? config.url + JSON.stringify(config.data)
: config.url : config.url
}) })
const authToken = getToken()
// 设置认证token // 设置认证token
if (store.state.user.token) { if (authToken) {
config.headers['Authtoken'] = getToken() config.headers['Authtoken'] = authToken
} }
console.log(store.state.user.corp_id,'store.state.user.corp_id') const corp_id = store.state.user.corp_id || Cookies.get('corp_id')
if (store.state.user.corp_id) { if (corp_id) {
config.headers['Corp-Id'] = store.state.user.corp_id config.headers['Corp-Id'] = corp_id
} }
return config return config
}, },
...@@ -49,6 +49,7 @@ service.interceptors.request.use( ...@@ -49,6 +49,7 @@ service.interceptors.request.use(
} }
) )
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
/** /**
...@@ -69,9 +70,8 @@ service.interceptors.response.use( ...@@ -69,9 +70,8 @@ service.interceptors.response.use(
if (res.status_code !== STATUS_CODE_SUCCESS) { if (res.status_code !== STATUS_CODE_SUCCESS) {
if (res.status_code === -1) { if (res.status_code === -1) {
// 登录 过期 重新去登录 // 登录 过期 重新去登录
removeToken()
// removeToken() window.location.href = window.location.origin +'/company_app/index.html?corp_id='+Cookies.get('corp_id')
// window.location.href = window.location.origin +'/company_app/index.html?corp_id='+Cookies.get('corp_id')
return res return res
} }
Message({ Message({
......
<template>
<div class="bindUserList rowFlex columnCenter">
<div class="select">
<el-select v-model="bindAccount" placeholder="请选择关联账号" :clearable="false" @change="handleChange">
<el-option label="新增关联账号" value="add" @click="addNewUser">
</el-option>
<el-option v-for="(item, index) in bindGameUserList" :key="index" :label="item.username"
:value="item.member_id">
</el-option>
</el-select>
</div>
<p v-if="bindGameUserList.length > 0" class="num">
总共{{ bindGameUserList.length }}个账号
</p>
<addUser
:show.sync="showLayer"
title="选择玩家"
width="60%"
/>
</div>
</template>
<script type="text/javascript">
import { detailsInfoRequest } from '@/api/works'
import { mapState, mapMutations, mapActions } from 'vuex'
import addUser from './addUser.vue'
// 更新代码
export default {
components: {
addUser
},
data() {
return {
showLayer: false,
accountValue: '',
bindAccount:'',
memberCheckList:[], // 自定义列
}
},
computed: {
...mapState('game', [
'bindGameUserList',
]),
...mapState('user', [
'userid',
'external_userid'
]),
},
watch: {
accountSelect(val) {
this.bindAccount = val
}
},
async mounted() {
this.bindUserList()
this.requestDetails()
},
methods: {
...mapMutations('game', [
'set_accountSelect',
'set_chatUserInfo'
]),
...mapActions('game', ['gameBindUser']),
handleChange(value) {
if (value == 'add') {
this.showLayer = true
} else {
this.set_accountSelect(value)
}
},
addNewUser() {
console.log(11)
},
async requestDetails() {
const data = {
userid: this.userid,
external_userid: this.external_userid
}
const res = await detailsInfoRequest(data)
if (res.data && res.data.userid) {
this.chatUserDetails = res.data
this.set_chatUserInfo(this.chatUserDetails) // 设置云端信息
if (this.chatUserDetails.self_defined_columns && this.chatUserDetails.self_defined_columns.length > 0) {
this.memberCheckList =
this.chatUserDetails.self_defined_columns.map(
(item) => item.name
)
} else {
this.memberCheckList = []
}
} else {
this.chatUserDetails = {}
}
// 获取到用户的详情 储存在缓存里面
},
// 绑定列表
async bindUserList() {
const data = {
userid: this.userid,
external_userid: this.external_userid
}
const res = await this.gameBindUser(data)
if (res.length > 0) {
this.set_accountSelect(res[0].member_id)
this.bindAccount = res[0].member_id
} else {
this.set_accountSelect('')
this.bindAccount = ''
}
}
}
}
</script>
<style lang="scss" scoped>
.bindUserList {
margin: 10px;
.select {
::v-deep .el-input--small .el-input__inner {
// border-radius: 16px;
border: none;
// color: $color;
min-width: 200px;
height: 30px;
line-height: 30px;
background: #ecfff6;
color: #46c988;
}
::v-deep .el-input__suffix {
// display: none;
color: #46c988;
}
}
.num {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
margin-left: 10px;
white-space: nowrap;
color: #F53F3F;
}
}
</style>
\ No newline at end of file
<template>
<el-table
ref="multipleTable"
:data="list"
tooltip-effect="dark"
style="width: 100%"
size="medium"
highlight-current-row
:header-cell-style="{
background: '#F7F8FA',
color: '#333333',
fontWeight: 500,
}"
@current-change="handleCurrent"
>
<el-table-column width="50px">
<template v-slot="scope">
<!-- label值要与el-table数据id实现绑定 -->
<el-radio
v-model="unitInfo.role_id"
style="margin-left:10px;"
:label="scope.row.role_id"
>{{ "" }}</el-radio>
</template>
</el-table-column>
<el-table-column
label="w账号"
prop="username"
width="140"
>
</el-table-column>
<el-table-column
label="角色名"
prop="role_name"
>
</el-table-column>
<el-table-column
label="区服"
prop="server_name"
>
</el-table-column>
<el-table-column
label="充值金额"
prop="recharge_total"
>
<template v-slot="scope">
{{ scope.row.recharge_total }}
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
props: ['list'],
data() {
return {
currentRow: [],
unitInfo: {
userId: ''
}
}
},
watch: {
list(newVal, oldVal) {
this.unitInfo = { userId: '' }
}
},
methods: {
handleCurrent(val) {
console.log(val)
if (val) {
this.unitInfo = val
this.$emit('checkedTag', this.unitInfo)
}
}
}
}
</script>
<style scoped lang='scss'>
.el-dropdown {
margin-left: 10px;
}
.tags {
background: #ecfff6;
border-radius: 4px;
border: 1px solid #c5ffe2;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #46c988;
padding: 0 5px;
max-width: 100%;
font-size: 12px;
}
.tagItem {
display: inline-block;
}
.allTags {
.tags {
margin-left: 10px;
}
}
.el-dropdown-link {
cursor: pointer;
}
.qrImage {
width: vw(140);
height: vw(140);
}
.tableImage {
width: 30px;
height: 30px;
border-radius: 30px;
margin-right: 10px;
}
.infoSpan {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
max-width: 120px;
span {
color: #ffa81d;
}
}
::v-deep .el-table__header-wrapper .el-checkbox {
display: none;
}
</style>
\ No newline at end of file
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</ul> </ul>
</el-dialog> </el-dialog>
<div v-if="dingUserInfo">钉钉用户:{{ dingUserInfo.name }}</div> <div v-if="dingUserInfo">钉钉用户:{{ dingUserInfo.name }}</div>
<div v-if="externalUserId">企微外部联系人ID:{{ externalUserId }}</div> <div v-if="external_userid">企微外部联系人ID:{{ external_userid }}</div>
</div> </div>
<div v-if="showQrCode"> <div v-if="showQrCode">
跳转中 请稍等... 跳转中 请稍等...
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
return { return {
wecomUserInfo: null, // 企微用户信息 wecomUserInfo: null, // 企微用户信息
dingUserInfo: null, // 钉钉用户信息 dingUserInfo: null, // 钉钉用户信息
externalUserId: null, // 企微外部联系人ID external_userid: null, // 企微外部联系人ID
signData: null, // 企微签名数据 signData: null, // 企微签名数据
orgList: [], orgList: [],
urlParams:{}, urlParams:{},
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
} }
}, },
async mounted() { async mounted() {
const wx_userid = Cookies.get('wx_userid') const userid = Cookies.get('userid')
const urlParams = getParams(); const urlParams = getParams();
console.log(urlParams,'mounted') console.log(urlParams,'mounted')
await this.initOrganization(); await this.initOrganization();
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
this.showQrCode = true this.showQrCode = true
this.handleDingCallback(); this.handleDingCallback();
}else{ }else{
if(!wx_userid){ // 没有静默授权过 if(!userid){ // 没有静默授权过
await this.startWeComSilentAuth(); await this.startWeComSilentAuth();
}else{ }else{
this.initDingTalkLogin(); // 已经静默授权过 初始化钉钉扫码 this.initDingTalkLogin(); // 已经静默授权过 初始化钉钉扫码
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
...mapState('user',['corp_id']) ...mapState('user',['corp_id'])
}, },
methods: { methods: {
...mapMutations('user',['set_corp_id','set_userid','set_externalUserId','set_userInfo','set_token','set_cser_info','set_signData']), ...mapMutations('user',['set_corp_id','set_userid','set_external_userid','set_userInfo','set_token','set_cser_info','set_signData']),
goDingding(){ goDingding(){
window.location.href = this.DDTestUrl window.location.href = this.DDTestUrl
}, },
...@@ -112,8 +112,8 @@ export default { ...@@ -112,8 +112,8 @@ export default {
Cookies.set('corp_id',corp_id, { expires: 7 }) Cookies.set('corp_id',corp_id, { expires: 7 })
this.set_corp_id(corp_id) this.set_corp_id(corp_id)
}, },
cacheWx_userid(userid){ cacheuserid(userid){
Cookies.set('wx_userid',userid, { expires: 7 }) Cookies.set('userid',userid, { expires: 7 })
this.set_userid(userid) this.set_userid(userid)
}, },
cacheWx_userinfo(userinfo){ cacheWx_userinfo(userinfo){
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
const res = await getAuthUser({ code: this.urlParams.code, url: window.location.href,corp_id:appid }); const res = await getAuthUser({ code: this.urlParams.code, url: window.location.href,corp_id:appid });
if (res.status_code === 1) { if (res.status_code === 1) {
this.cacheWx_userinfo(res.data) this.cacheWx_userinfo(res.data)
this.cacheWx_userid(res.data.userid) this.cacheuserid(res.data.userid)
this.initDingTalkLogin(); this.initDingTalkLogin();
} else { } else {
// 错误处理 // 错误处理
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
this.signData = res.data this.signData = res.data
this.cacheSignData(res.data) this.cacheSignData(res.data)
try{ try{
await this.registerWeComSDK(); this.registerWeComSDK();
this.$router.push('/')// 一切准备工作就绪 this.$router.push('/')// 一切准备工作就绪
}catch(err){ }catch(err){
console.log(err,'初始化sdk 失败') console.log(err,'初始化sdk 失败')
...@@ -174,16 +174,15 @@ export default { ...@@ -174,16 +174,15 @@ export default {
// 2. 注册企微JS-SDK // 2. 注册企微JS-SDK
registerWeComSDK() { registerWeComSDK() {
return new Promise((resolve,reject)=>{
ww.register({ ww.register({
corpId: Cookies.get('corp_id'), corpId: Cookies.get('corp_id'),
agentId: this.signData.agent_id, agentId: this.signData.agent_id,
jsApiList: jsApiList, jsApiList: jsApiList,
// getConfigSignature: () => Promise.resolve({ getConfigSignature: () => Promise.resolve({
// nonceStr: this.signData.nonce_str, nonceStr: this.signData.nonce_str,
// timestamp: this.signData.signature_time, timestamp: this.signData.signature_time,
// signature: this.signData.corp_signature, signature: this.signData.corp_signature,
// }), }),
// 只用到应用的 api 可以只进行应用的签名 // 只用到应用的 api 可以只进行应用的签名
getAgentConfigSignature: () => Promise.resolve({ getAgentConfigSignature: () => Promise.resolve({
nonceStr: this.signData.nonce_str, nonceStr: this.signData.nonce_str,
...@@ -191,24 +190,20 @@ export default { ...@@ -191,24 +190,20 @@ export default {
signature: this.signData.agent_signature, signature: this.signData.agent_signature,
}), }),
onAgentConfigSuccess: (res) => { onAgentConfigSuccess: (res) => {
resolve(res)
console.log('注册成功可以调用企微 js-sdk',res) console.log('注册成功可以调用企微 js-sdk',res)
// 注册成功后不立即获取外部联系人,等钉钉扫码后再获取 // 注册成功后不立即获取外部联系人,等钉钉扫码后再获取
}, },
onAgentConfigFail: (err) => { onAgentConfigFail: (err) => {
console.log('注册失败不能使用企微js-sdk',err) console.log('注册失败不能使用企微js-sdk',err)
reject(err)
// 错误处理 // 错误处理
} }
}); });
})
}, },
// 3. 获取组织列表并选取默认组织 // 3. 获取组织列表并选取默认组织
async initOrganization() { async initOrganization() {
const res = await getOrganization(); const res = await getOrganization();
console.log(22222,res)
if (res.data.status_code === 1) { if (res.data.status_code === 1) {
console.log(3333) console.log(3333)
this.orgList = res.data.data.data; this.orgList = res.data.data.data;
...@@ -265,7 +260,7 @@ export default { ...@@ -265,7 +260,7 @@ export default {
async handleDingTalkLogin(event) { async handleDingTalkLogin(event) {
console.log('收到扫码回调') console.log('收到扫码回调')
const corp_id = Cookies.get('corp_id') const corp_id = Cookies.get('corp_id')
const userid = Cookies.get('wx_userid') const userid = Cookies.get('userid')
if (event.origin !== 'https://login.dingtalk.com') return; if (event.origin !== 'https://login.dingtalk.com') return;
const loginTmpCode = event.data; const loginTmpCode = event.data;
// 跳转到后端,后端用loginTmpCode换取钉钉用户信息 // 跳转到后端,后端用loginTmpCode换取钉钉用户信息
...@@ -306,9 +301,9 @@ export default { ...@@ -306,9 +301,9 @@ export default {
ww.getCurExternalContact({ ww.getCurExternalContact({
success: (res) => { success: (res) => {
if (res.err_msg === "getCurExternalContact:ok") { if (res.err_msg === "getCurExternalContact:ok") {
this.externalUserId = res.userId; this.external_userid = res.userId;
this.set_externalUserId(this.externalUserId) this.set_external_userid(this.external_userid)
console.log(this.externalUserId,'获取企微外部联系人') console.log(this.external_userid,'获取企微外部联系人')
} }
}, },
fail: (err) => { fail: (err) => {
......
<template>
<h1>1231312312312312321</h1>
</template>
<script>
import * as ww from '@wecom/jssdk'
import { getSignature } from '@/api/user'
export default {
name: 'testWx',
data() {
return {
signData: {},
}
},
mounted() {
this.getSignature()
console.log(window.location.href,'window.location.href')
},
methods: {
async getSignature(){
console.log('获取签名',window.location.href)
const res = await getSignature({ corp_id: 'wweaefe716636df3d1', path: window.location.href });
if(res.status_code === 1){
this.signData = res.data
try{
this.registerWeComSDK();
}catch(err){
console.log(err,'初始化sdk 失败')
}
}
},
registerWeComSDK() {
ww.register({
corpId: 'wweaefe716636df3d1',
agentId: this.signData.agent_id,
jsApiList: ['getExternalUserInfo'],
getConfigSignature: () => Promise.resolve({
nonceStr: this.signData.nonce_str,
timestamp: this.signData.signature_time,
signature: this.signData.corp_signature,
}),
// 只用到应用的 api 可以只进行应用的签名
getAgentConfigSignature: () => Promise.resolve({
nonceStr: this.signData.nonce_str,
timestamp: this.signData.signature_time,
signature: this.signData.agent_signature,
}),
onAgentConfigSuccess: (res) => {
console.log('注册成功可以调用企微 js-sdk',res)
this.getCurExternalContact()
// 注册成功后不立即获取外部联系人,等钉钉扫码后再获取
},
onAgentConfigFail: (err) => {
console.log('注册失败不能使用企微js-sdk',err)
// 错误处理
}
});
},
getCurExternalContact() {
ww.getCurExternalContact({
success: (res) => {
if (res.err_msg === "getCurExternalContact:ok") {
console.log(res,'获取企微外部联系人')
}
},
fail: (err) => {
console.log(err,'获取企微外部联系人失败')
// 错误处理
}
});
},
}
}
</script>
\ No newline at end of file
<template>
<div class="info-tab-content">
资料
</div>
</template>
<script>
export default {
name: 'InfoTabContent',
}
</script>
<style lang="scss" scoped>
.info-tab-content{
width: 100%;
height: 100%;
background: #fff;
}
</style>
\ No newline at end of file
<template>
<div class="roleInfo-tab-content">
角色信息
</div>
</template>
<script>
export default {
name: 'RoleInfoTabContent',
}
</script>
<style lang="scss" scoped>
.roleInfo-tab-content{
width: 100%;
height: 100%;
background: #fff;
}
</style>
\ No newline at end of file
<template>
<div class="violationRecord-tab-content">
违规记录
</div>
</template>
<script>
export default {
name: 'ViolationRecordTabContent',
}
</script>
<style lang="scss" scoped>
.violationRecord-tab-content{
width: 100%;
height: 100%;
background: #fff;
}
</style>
\ No newline at end of file
<template> <template>
<div class="userInfo-content"> <div class="userInfo-content">
<!-- 用 el-tabs 有三个 tab 分别是 客户资料 角色信息 违规记录 用 v-for 循环 -->
<el-tabs v-model="activeTab" >
<el-tab-pane v-for="item in tabList" :key="item.name" :label="item.name" :name="item.value">
<Info v-if="item.value === 'userInfo'"/>
<RoleInfo v-if="item.value === 'roleInfo'"/>
<ViolationRecord v-if="item.value === 'violationRecord'"/>
</el-tab-pane>
</el-tabs>
</div> </div>
</template> </template>
<script> <script>
import Info from './components/Info.vue'
import RoleInfo from './components/RoleInfo.vue'
import ViolationRecord from './components/ViolationRecord.vue'
export default { export default {
name: '', name: 'UserInfo',
components:{
Info,
RoleInfo,
ViolationRecord
},
mounted() { mounted() {
}, },
data() { data() {
return { return {
activeTab:'userInfo',
tabList:[
{
name:'客户资料',
value:'userInfo'
},
{
name:'角色信息',
value:'roleInfo'
},
{
name:'违规记录',
value:'violationRecord'
}
]
} }
}, },
created(){ created(){
......
...@@ -50,9 +50,28 @@ module.exports = defineConfig({ ...@@ -50,9 +50,28 @@ module.exports = defineConfig({
sassOptions: { sassOptions: {
outputStyle: 'expanded' outputStyle: 'expanded'
}, },
additionalData: ` // additionalData: `
@use "@/styles/global.scss"; // @use "@/styles/global.scss";
` // `
},
postcss: {
// postcssOptions: {
// plugins: [
// require("postcss-plugin-px2rem")({
// rootValue: 37.5, //换算基数,
// // unitPrecision: 5, //允许REM单位增长到的十进制数字。
// //propWhiteList: [], //默认值是一个空数组,这意味着禁用白名单并启用所有属性。
// propBlackList: ["border"], //黑名单
// exclude: /(node_module)/, //默认false,可以(reg)利用正则表达式排除某些文件夹的方法。默认值为false,即该项目中所有的px均会被转换为rem
// //(以上exclude配置,如/node_modules|pc/i 排除node_modules文件夹以及所有名为pc的文件夹下的,所有文件的px转换)
// selectorBlackList: ['van-', 'el-'], //要忽略并保留为px的选择器。此处举例:van-为vant-UI的前缀,el-为element-UI的前缀
// // ignoreIdentifier: false, //(boolean/string)忽略单个属性的方法,启用ignoreidentifier后,replace将自动设置为true。
// // replace: true, // (布尔值)替换包含REM的规则,而不是添加回退。
// mediaQuery: false, //(布尔值)允许在媒体查询中转换px。
// minPixelValue: 2, //设置要替换的最小像素值(2px会被转rem)。 默认 0
// }),
// ]
// }
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论