af-mobile-client-vue3 1.4.64 → 1.4.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +120 -120
- package/src/api/user/index.ts +45 -45
- package/src/components/core/ImageUploader/index.vue +510 -510
- package/src/components/data/OtherCharge/OtherChargeGroupModal.vue +542 -542
- package/src/components/data/XForm/index.vue +45 -0
- package/src/components/data/XFormItem/index.vue +32 -3
- package/src/router/guards.ts +131 -131
- package/src/services/api/Login.ts +6 -6
- package/src/services/v3Api.ts +170 -170
- package/src/stores/modules/user.ts +3 -0
- package/src/types/platform.ts +194 -194
- package/src/utils/platform-auth.ts +150 -150
- package/src/views/external/index.vue +158 -158
- package/src/views/loading/AuthLoading.vue +395 -395
- package/src/views/user/login/LoginForm.vue +0 -1
- package/src/views/user/register/index.vue +958 -958
- package/vite.config.ts +122 -122
- package/certs/127.0.0.1+2-key.pem +0 -28
- package/certs/127.0.0.1+2.pem +0 -27
- package/mock/modules/prose.mock.ts.timestamp-1758877157774.mjs +0 -53
- package/mock/modules/user.mock.ts.timestamp-1758877157774.mjs +0 -97
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 统一平台认证工具类
|
|
3
|
-
* 合并了 wechatUtil.ts, wechat.ts 和 auth-platform.ts 的功能
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { RouteLocationNormalized } from 'vue-router'
|
|
7
|
-
import { PLATFORM_ROUTE_MAP, PlatformType } from '@af-mobile-client-vue3/types/platform'
|
|
8
|
-
import { detectEnvironment } from '@af-mobile-client-vue3/utils/environment'
|
|
9
|
-
/**
|
|
10
|
-
* 认证参数接口
|
|
11
|
-
*/
|
|
12
|
-
export interface AuthParams {
|
|
13
|
-
/** 授权码 */
|
|
14
|
-
code?: string
|
|
15
|
-
/** 状态参数 */
|
|
16
|
-
state?: string
|
|
17
|
-
/** 租户名称 */
|
|
18
|
-
tenantName?: string
|
|
19
|
-
/** 平台类型 */
|
|
20
|
-
platformType?: PlatformType
|
|
21
|
-
/** 错误信息 */
|
|
22
|
-
error?: string
|
|
23
|
-
/** 错误描述 */
|
|
24
|
-
error_description?: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 微信回调参数接口(向后兼容)
|
|
29
|
-
*/
|
|
30
|
-
export interface WechatCallbackParams extends AuthParams { }
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 外部用户检测结果接口
|
|
34
|
-
*/
|
|
35
|
-
export interface ExternalUserResult {
|
|
36
|
-
/** 是否为外部用户 */
|
|
37
|
-
isExternal: boolean
|
|
38
|
-
/** 认证参数(仅当 isExternal 为 true 且有授权参数时存在) */
|
|
39
|
-
authParams?: {
|
|
40
|
-
code?: string
|
|
41
|
-
state?: string
|
|
42
|
-
tenantName?: string
|
|
43
|
-
platformType?: string
|
|
44
|
-
platformUserId?: string
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 统一的外部用户检测函数
|
|
50
|
-
* 这是系统中唯一的用户类型检测入口,仅在路由守卫中调用
|
|
51
|
-
* 集成了用户类型检测和认证参数解析功能
|
|
52
|
-
*
|
|
53
|
-
* @param to 目标路由对象
|
|
54
|
-
* @returns 外部用户检测结果,包含是否为外部用户和认证参数
|
|
55
|
-
*/
|
|
56
|
-
export function isExternalUser(to: RouteLocationNormalized): ExternalUserResult {
|
|
57
|
-
console.log('[Platform Detection] 开始检测外部用户环境', { path: to.path, query: to.query })
|
|
58
|
-
|
|
59
|
-
// 第一层检测:URL参数检测(最高优先级)判断公众号登录逻辑
|
|
60
|
-
// 检查路由查询参数中是否有授权参数(code + state)
|
|
61
|
-
const { code, state, appData } = to.query
|
|
62
|
-
if (code && state) {
|
|
63
|
-
// 解析认证参数
|
|
64
|
-
const authParams = {
|
|
65
|
-
code: code as string,
|
|
66
|
-
state: state as string,
|
|
67
|
-
tenantName: state as string,
|
|
68
|
-
platformUserId: code as string,
|
|
69
|
-
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
isExternal: true,
|
|
74
|
-
authParams,
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// 第二层检测:User-Agent环境检测
|
|
79
|
-
// 检查浏览器环境是否为第三方平台
|
|
80
|
-
const env = detectEnvironment()
|
|
81
|
-
// 微信小程序
|
|
82
|
-
if (env.isMiniprogram && appData) {
|
|
83
|
-
const authParams = {
|
|
84
|
-
platformType: PlatformType.WECHAT_MINI,
|
|
85
|
-
appData,
|
|
86
|
-
}
|
|
87
|
-
// 暂未实现 后续需要增加登陆参数
|
|
88
|
-
return {
|
|
89
|
-
isExternal: true,
|
|
90
|
-
authParams,
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// 微信环境检测
|
|
94
|
-
if (env.isWechat) {
|
|
95
|
-
console.log('[Platform Detection] 检测到微信环境,判定为外部用户(无授权参数)')
|
|
96
|
-
return {
|
|
97
|
-
isExternal: true,
|
|
98
|
-
authParams: Object.assign(to.query, {
|
|
99
|
-
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
100
|
-
tenantName: to.query.state as string || '',
|
|
101
|
-
}),
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// 支付宝环境检测
|
|
106
|
-
if (env.isAlipayClient) {
|
|
107
|
-
// 暂未实现 后续需要增加登陆参数
|
|
108
|
-
return {
|
|
109
|
-
isExternal: true,
|
|
110
|
-
authParams: {
|
|
111
|
-
platformType: PlatformType.ALIPAY,
|
|
112
|
-
},
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// 钉钉环境检测
|
|
117
|
-
if (env.isDingTalk) {
|
|
118
|
-
// 暂未实现 后续需要增加登陆参数
|
|
119
|
-
return {
|
|
120
|
-
isExternal: true,
|
|
121
|
-
authParams: {
|
|
122
|
-
platformType: PlatformType.DINGTALK,
|
|
123
|
-
},
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// 第三层检测:路由前缀检测
|
|
128
|
-
// 检查路径是否以外部用户路由前缀开头
|
|
129
|
-
const platformPrefixes = Object.values(PLATFORM_ROUTE_MAP)
|
|
130
|
-
const isExternalRoute = platformPrefixes.some(prefix => to.path.startsWith(prefix)) || to.path.startsWith('/ex/')
|
|
131
|
-
if (isExternalRoute) {
|
|
132
|
-
// 暂未实现 后续需要增加登陆参数
|
|
133
|
-
return {
|
|
134
|
-
isExternal: true,
|
|
135
|
-
authParams: Object.assign(to.query, {
|
|
136
|
-
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
137
|
-
tenantName: to.query.state as string || '',
|
|
138
|
-
}),
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// [Platform Detection] 未检测到外部用户环境,判定为内部用户
|
|
143
|
-
return { isExternal: false }
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// 兼容性导出 - 保持向后兼容
|
|
147
|
-
export function isWechat(): boolean {
|
|
148
|
-
const ua = navigator.userAgent.toLowerCase()
|
|
149
|
-
return /micromessenger/i.test(ua)
|
|
150
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 统一平台认证工具类
|
|
3
|
+
* 合并了 wechatUtil.ts, wechat.ts 和 auth-platform.ts 的功能
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { RouteLocationNormalized } from 'vue-router'
|
|
7
|
+
import { PLATFORM_ROUTE_MAP, PlatformType } from '@af-mobile-client-vue3/types/platform'
|
|
8
|
+
import { detectEnvironment } from '@af-mobile-client-vue3/utils/environment'
|
|
9
|
+
/**
|
|
10
|
+
* 认证参数接口
|
|
11
|
+
*/
|
|
12
|
+
export interface AuthParams {
|
|
13
|
+
/** 授权码 */
|
|
14
|
+
code?: string
|
|
15
|
+
/** 状态参数 */
|
|
16
|
+
state?: string
|
|
17
|
+
/** 租户名称 */
|
|
18
|
+
tenantName?: string
|
|
19
|
+
/** 平台类型 */
|
|
20
|
+
platformType?: PlatformType
|
|
21
|
+
/** 错误信息 */
|
|
22
|
+
error?: string
|
|
23
|
+
/** 错误描述 */
|
|
24
|
+
error_description?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 微信回调参数接口(向后兼容)
|
|
29
|
+
*/
|
|
30
|
+
export interface WechatCallbackParams extends AuthParams { }
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 外部用户检测结果接口
|
|
34
|
+
*/
|
|
35
|
+
export interface ExternalUserResult {
|
|
36
|
+
/** 是否为外部用户 */
|
|
37
|
+
isExternal: boolean
|
|
38
|
+
/** 认证参数(仅当 isExternal 为 true 且有授权参数时存在) */
|
|
39
|
+
authParams?: {
|
|
40
|
+
code?: string
|
|
41
|
+
state?: string
|
|
42
|
+
tenantName?: string
|
|
43
|
+
platformType?: string
|
|
44
|
+
platformUserId?: string
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 统一的外部用户检测函数
|
|
50
|
+
* 这是系统中唯一的用户类型检测入口,仅在路由守卫中调用
|
|
51
|
+
* 集成了用户类型检测和认证参数解析功能
|
|
52
|
+
*
|
|
53
|
+
* @param to 目标路由对象
|
|
54
|
+
* @returns 外部用户检测结果,包含是否为外部用户和认证参数
|
|
55
|
+
*/
|
|
56
|
+
export function isExternalUser(to: RouteLocationNormalized): ExternalUserResult {
|
|
57
|
+
console.log('[Platform Detection] 开始检测外部用户环境', { path: to.path, query: to.query })
|
|
58
|
+
|
|
59
|
+
// 第一层检测:URL参数检测(最高优先级)判断公众号登录逻辑
|
|
60
|
+
// 检查路由查询参数中是否有授权参数(code + state)
|
|
61
|
+
const { code, state, appData } = to.query
|
|
62
|
+
if (code && state) {
|
|
63
|
+
// 解析认证参数
|
|
64
|
+
const authParams = {
|
|
65
|
+
code: code as string,
|
|
66
|
+
state: state as string,
|
|
67
|
+
tenantName: state as string,
|
|
68
|
+
platformUserId: code as string,
|
|
69
|
+
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
isExternal: true,
|
|
74
|
+
authParams,
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 第二层检测:User-Agent环境检测
|
|
79
|
+
// 检查浏览器环境是否为第三方平台
|
|
80
|
+
const env = detectEnvironment()
|
|
81
|
+
// 微信小程序
|
|
82
|
+
if (env.isMiniprogram && appData) {
|
|
83
|
+
const authParams = {
|
|
84
|
+
platformType: PlatformType.WECHAT_MINI,
|
|
85
|
+
appData,
|
|
86
|
+
}
|
|
87
|
+
// 暂未实现 后续需要增加登陆参数
|
|
88
|
+
return {
|
|
89
|
+
isExternal: true,
|
|
90
|
+
authParams,
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// 微信环境检测
|
|
94
|
+
if (env.isWechat) {
|
|
95
|
+
console.log('[Platform Detection] 检测到微信环境,判定为外部用户(无授权参数)')
|
|
96
|
+
return {
|
|
97
|
+
isExternal: true,
|
|
98
|
+
authParams: Object.assign(to.query, {
|
|
99
|
+
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
100
|
+
tenantName: to.query.state as string || '',
|
|
101
|
+
}),
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 支付宝环境检测
|
|
106
|
+
if (env.isAlipayClient) {
|
|
107
|
+
// 暂未实现 后续需要增加登陆参数
|
|
108
|
+
return {
|
|
109
|
+
isExternal: true,
|
|
110
|
+
authParams: {
|
|
111
|
+
platformType: PlatformType.ALIPAY,
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// 钉钉环境检测
|
|
117
|
+
if (env.isDingTalk) {
|
|
118
|
+
// 暂未实现 后续需要增加登陆参数
|
|
119
|
+
return {
|
|
120
|
+
isExternal: true,
|
|
121
|
+
authParams: {
|
|
122
|
+
platformType: PlatformType.DINGTALK,
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 第三层检测:路由前缀检测
|
|
128
|
+
// 检查路径是否以外部用户路由前缀开头
|
|
129
|
+
const platformPrefixes = Object.values(PLATFORM_ROUTE_MAP)
|
|
130
|
+
const isExternalRoute = platformPrefixes.some(prefix => to.path.startsWith(prefix)) || to.path.startsWith('/ex/')
|
|
131
|
+
if (isExternalRoute) {
|
|
132
|
+
// 暂未实现 后续需要增加登陆参数
|
|
133
|
+
return {
|
|
134
|
+
isExternal: true,
|
|
135
|
+
authParams: Object.assign(to.query, {
|
|
136
|
+
platformType: PlatformType.WECHAT_OFFICIAL,
|
|
137
|
+
tenantName: to.query.state as string || '',
|
|
138
|
+
}),
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// [Platform Detection] 未检测到外部用户环境,判定为内部用户
|
|
143
|
+
return { isExternal: false }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 兼容性导出 - 保持向后兼容
|
|
147
|
+
export function isWechat(): boolean {
|
|
148
|
+
const ua = navigator.userAgent.toLowerCase()
|
|
149
|
+
return /micromessenger/i.test(ua)
|
|
150
|
+
}
|
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
3
|
-
import { getPlatformConfig, getPlatformRoutePrefix } from '@af-mobile-client-vue3/types/platform'
|
|
4
|
-
import {
|
|
5
|
-
Icon as VanIcon,
|
|
6
|
-
} from 'vant'
|
|
7
|
-
import { computed } from 'vue'
|
|
8
|
-
import { useRouter } from 'vue-router'
|
|
9
|
-
|
|
10
|
-
const router = useRouter()
|
|
11
|
-
const userStore = useUserStore()
|
|
12
|
-
|
|
13
|
-
const userInfo = computed(() => userStore.getUserInfo())
|
|
14
|
-
const userName = computed(() => userInfo.value?.name || '外部用户')
|
|
15
|
-
const platformType = computed(() => userStore.getPlatformType())
|
|
16
|
-
const platformConfig = computed(() => getPlatformConfig(platformType.value))
|
|
17
|
-
const userDescription = computed(() =>
|
|
18
|
-
platformConfig.value?.description || '外部系统访问用户',
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
function goToProfile() {
|
|
22
|
-
const routePrefix = getPlatformRoutePrefix(platformType.value)
|
|
23
|
-
router.push(`${routePrefix}/my`)
|
|
24
|
-
}
|
|
25
|
-
async function clean() {
|
|
26
|
-
await useUserStore().registerClean()
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<main class="external_main">
|
|
32
|
-
<!-- 顶部导航栏 -->
|
|
33
|
-
<nav class="header_nav">
|
|
34
|
-
<div class="header_content">
|
|
35
|
-
<h1 class="main_title">
|
|
36
|
-
智慧燃气外部系统
|
|
37
|
-
</h1>
|
|
38
|
-
<div class="user_section" @click="goToProfile">
|
|
39
|
-
<VanIcon name="user-o" class="user-icon" />
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</nav>
|
|
43
|
-
|
|
44
|
-
<!-- 主要内容区域 -->
|
|
45
|
-
<div class="content">
|
|
46
|
-
<!-- 用户信息卡片 -->
|
|
47
|
-
<div class="user-card">
|
|
48
|
-
<div class="user-content">
|
|
49
|
-
<div class="user-info">
|
|
50
|
-
<VanIcon name="user-circle-o" size="64" color="#3b82f6" />
|
|
51
|
-
<h2 class="user-name">
|
|
52
|
-
{{ userName }}
|
|
53
|
-
</h2>
|
|
54
|
-
<p class="user-desc">
|
|
55
|
-
{{ userDescription }}
|
|
56
|
-
</p>
|
|
57
|
-
<p v-if="platformConfig" class="platform-name">
|
|
58
|
-
{{ platformConfig.name }}
|
|
59
|
-
</p>
|
|
60
|
-
<p class="platform-name" @click="clean">
|
|
61
|
-
清理缓存
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</main>
|
|
68
|
-
</template>
|
|
69
|
-
|
|
70
|
-
<style scoped lang="less">
|
|
71
|
-
.external_main {
|
|
72
|
-
min-height: 100vh;
|
|
73
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
74
|
-
|
|
75
|
-
.header_nav {
|
|
76
|
-
background: rgba(255, 255, 255, 0.95);
|
|
77
|
-
backdrop-filter: blur(10px);
|
|
78
|
-
padding: 0 16px;
|
|
79
|
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
80
|
-
|
|
81
|
-
.header_content {
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
align-items: center;
|
|
85
|
-
height: 56px;
|
|
86
|
-
|
|
87
|
-
.main_title {
|
|
88
|
-
font-size: 1.125rem;
|
|
89
|
-
font-weight: 600;
|
|
90
|
-
color: #333;
|
|
91
|
-
margin: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.user_section {
|
|
95
|
-
padding: 8px;
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
border-radius: 50%;
|
|
98
|
-
background: rgba(59, 130, 246, 0.1);
|
|
99
|
-
transition: all 0.3s ease;
|
|
100
|
-
|
|
101
|
-
&:active {
|
|
102
|
-
background: rgba(59, 130, 246, 0.2);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.user-icon {
|
|
106
|
-
font-size: 20px;
|
|
107
|
-
color: #3b82f6;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.content {
|
|
114
|
-
padding: 24px 16px;
|
|
115
|
-
display: flex;
|
|
116
|
-
justify-content: center;
|
|
117
|
-
|
|
118
|
-
.user-card {
|
|
119
|
-
width: 100%;
|
|
120
|
-
max-width: 400px;
|
|
121
|
-
border-radius: 12px;
|
|
122
|
-
overflow: hidden;
|
|
123
|
-
background: rgba(255, 255, 255, 0.95);
|
|
124
|
-
backdrop-filter: blur(10px);
|
|
125
|
-
|
|
126
|
-
:deep(.van-card__content) {
|
|
127
|
-
padding: 32px 24px;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.user-content {
|
|
131
|
-
.user-info {
|
|
132
|
-
text-align: center;
|
|
133
|
-
|
|
134
|
-
.user-name {
|
|
135
|
-
font-size: 24px;
|
|
136
|
-
font-weight: 600;
|
|
137
|
-
color: #333;
|
|
138
|
-
margin: 16px 0 8px 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.user-desc {
|
|
142
|
-
font-size: 14px;
|
|
143
|
-
color: #666;
|
|
144
|
-
margin: 0;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.platform-name {
|
|
148
|
-
font-size: 12px;
|
|
149
|
-
color: #3b82f6;
|
|
150
|
-
margin: 4px 0 0 0;
|
|
151
|
-
font-weight: 500;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
3
|
+
import { getPlatformConfig, getPlatformRoutePrefix } from '@af-mobile-client-vue3/types/platform'
|
|
4
|
+
import {
|
|
5
|
+
Icon as VanIcon,
|
|
6
|
+
} from 'vant'
|
|
7
|
+
import { computed } from 'vue'
|
|
8
|
+
import { useRouter } from 'vue-router'
|
|
9
|
+
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
const userStore = useUserStore()
|
|
12
|
+
|
|
13
|
+
const userInfo = computed(() => userStore.getUserInfo())
|
|
14
|
+
const userName = computed(() => userInfo.value?.name || '外部用户')
|
|
15
|
+
const platformType = computed(() => userStore.getPlatformType())
|
|
16
|
+
const platformConfig = computed(() => getPlatformConfig(platformType.value))
|
|
17
|
+
const userDescription = computed(() =>
|
|
18
|
+
platformConfig.value?.description || '外部系统访问用户',
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
function goToProfile() {
|
|
22
|
+
const routePrefix = getPlatformRoutePrefix(platformType.value)
|
|
23
|
+
router.push(`${routePrefix}/my`)
|
|
24
|
+
}
|
|
25
|
+
async function clean() {
|
|
26
|
+
await useUserStore().registerClean()
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<main class="external_main">
|
|
32
|
+
<!-- 顶部导航栏 -->
|
|
33
|
+
<nav class="header_nav">
|
|
34
|
+
<div class="header_content">
|
|
35
|
+
<h1 class="main_title">
|
|
36
|
+
智慧燃气外部系统
|
|
37
|
+
</h1>
|
|
38
|
+
<div class="user_section" @click="goToProfile">
|
|
39
|
+
<VanIcon name="user-o" class="user-icon" />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</nav>
|
|
43
|
+
|
|
44
|
+
<!-- 主要内容区域 -->
|
|
45
|
+
<div class="content">
|
|
46
|
+
<!-- 用户信息卡片 -->
|
|
47
|
+
<div class="user-card">
|
|
48
|
+
<div class="user-content">
|
|
49
|
+
<div class="user-info">
|
|
50
|
+
<VanIcon name="user-circle-o" size="64" color="#3b82f6" />
|
|
51
|
+
<h2 class="user-name">
|
|
52
|
+
{{ userName }}
|
|
53
|
+
</h2>
|
|
54
|
+
<p class="user-desc">
|
|
55
|
+
{{ userDescription }}
|
|
56
|
+
</p>
|
|
57
|
+
<p v-if="platformConfig" class="platform-name">
|
|
58
|
+
{{ platformConfig.name }}
|
|
59
|
+
</p>
|
|
60
|
+
<p class="platform-name" @click="clean">
|
|
61
|
+
清理缓存
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</main>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<style scoped lang="less">
|
|
71
|
+
.external_main {
|
|
72
|
+
min-height: 100vh;
|
|
73
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
74
|
+
|
|
75
|
+
.header_nav {
|
|
76
|
+
background: rgba(255, 255, 255, 0.95);
|
|
77
|
+
backdrop-filter: blur(10px);
|
|
78
|
+
padding: 0 16px;
|
|
79
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
80
|
+
|
|
81
|
+
.header_content {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
align-items: center;
|
|
85
|
+
height: 56px;
|
|
86
|
+
|
|
87
|
+
.main_title {
|
|
88
|
+
font-size: 1.125rem;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
color: #333;
|
|
91
|
+
margin: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.user_section {
|
|
95
|
+
padding: 8px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
background: rgba(59, 130, 246, 0.1);
|
|
99
|
+
transition: all 0.3s ease;
|
|
100
|
+
|
|
101
|
+
&:active {
|
|
102
|
+
background: rgba(59, 130, 246, 0.2);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.user-icon {
|
|
106
|
+
font-size: 20px;
|
|
107
|
+
color: #3b82f6;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.content {
|
|
114
|
+
padding: 24px 16px;
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
|
|
118
|
+
.user-card {
|
|
119
|
+
width: 100%;
|
|
120
|
+
max-width: 400px;
|
|
121
|
+
border-radius: 12px;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
background: rgba(255, 255, 255, 0.95);
|
|
124
|
+
backdrop-filter: blur(10px);
|
|
125
|
+
|
|
126
|
+
:deep(.van-card__content) {
|
|
127
|
+
padding: 32px 24px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.user-content {
|
|
131
|
+
.user-info {
|
|
132
|
+
text-align: center;
|
|
133
|
+
|
|
134
|
+
.user-name {
|
|
135
|
+
font-size: 24px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: #333;
|
|
138
|
+
margin: 16px 0 8px 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.user-desc {
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
color: #666;
|
|
144
|
+
margin: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.platform-name {
|
|
148
|
+
font-size: 12px;
|
|
149
|
+
color: #3b82f6;
|
|
150
|
+
margin: 4px 0 0 0;
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|