congmao-cli 1.0.0
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/README.md +2 -0
- package/bin/index.js +20 -0
- package/package.json +42 -0
- package/src/commands/create.js +171 -0
- package/src/commands/mcp.js +157 -0
- package/src/mcp/CURSOR_SETUP.md +259 -0
- package/src/mcp/README.md +134 -0
- package/src/mcp/USAGE_EXAMPLES.md +181 -0
- package/src/mcp/get-cursor-config.js +58 -0
- package/src/mcp/package.json +23 -0
- package/src/mcp/pnpm-lock.yaml +2441 -0
- package/src/mcp/src/handlers.js +211 -0
- package/src/mcp/src/http-server.js +332 -0
- package/src/mcp/src/index.js +195 -0
- package/src/mcp/src/schemas.js +54 -0
- package/src/mcp/test-create-project.js +49 -0
- package/src/mcp/test-mcp.js +89 -0
- package/src/mcp/test-show-tree.js +66 -0
- package/src/template/Uni-app/README.md +19 -0
- package/src/template/Uni-app/babel.config.js +81 -0
- package/src/template/Uni-app/package.json +107 -0
- package/src/template/Uni-app/postcss.config.js +27 -0
- package/src/template/Uni-app/public/index.html +25 -0
- package/src/template/Uni-app/shims-uni.d.ts +11 -0
- package/src/template/Uni-app/shims-vue.d.ts +4 -0
- package/src/template/Uni-app/src/App.vue +17 -0
- package/src/template/Uni-app/src/main.js +12 -0
- package/src/template/Uni-app/src/manifest.json +75 -0
- package/src/template/Uni-app/src/pages/index/index.vue +49 -0
- package/src/template/Uni-app/src/pages.json +16 -0
- package/src/template/Uni-app/src/static/logo.png +0 -0
- package/src/template/Uni-app/src/uni.promisify.adaptor.js +13 -0
- package/src/template/Uni-app/src/uni.scss +76 -0
- package/src/template/Uni-app/yarn.lock +11466 -0
- package/src/template/Vue2/.editorconfig +14 -0
- package/src/template/Vue2/.env +2 -0
- package/src/template/Vue2/.env.development +2 -0
- package/src/template/Vue2/.env.site +2 -0
- package/src/template/Vue2/.prettierrc.js +39 -0
- package/src/template/Vue2/.stylelintignore +8 -0
- package/src/template/Vue2/README-zh_CN.md +115 -0
- package/src/template/Vue2/commitlint.config.js +1 -0
- package/src/template/Vue2/docs/docs-starter.png +0 -0
- package/src/template/Vue2/docs/docs-startup.png +0 -0
- package/src/template/Vue2/docs/docs-structure.png +0 -0
- package/src/template/Vue2/globals.d.ts +13 -0
- package/src/template/Vue2/index.html +27 -0
- package/src/template/Vue2/jsx.d.ts +13 -0
- package/src/template/Vue2/mock/index.ts +147 -0
- package/src/template/Vue2/package.json +91 -0
- package/src/template/Vue2/package.json.ejs +91 -0
- package/src/template/Vue2/public/favicon.ico +0 -0
- package/src/template/Vue2/shims-vue.d.ts +5 -0
- package/src/template/Vue2/src/App.vue +19 -0
- package/src/template/Vue2/src/assets/assets-login-bg-black.png +0 -0
- package/src/template/Vue2/src/assets/assets-login-bg-white.png +0 -0
- package/src/template/Vue2/src/assets/assets-logo-full.svg +39 -0
- package/src/template/Vue2/src/assets/assets-product-1.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-2.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-3.svg +5 -0
- package/src/template/Vue2/src/assets/assets-product-4.svg +5 -0
- package/src/template/Vue2/src/assets/assets-result-403.svg +32 -0
- package/src/template/Vue2/src/assets/assets-result-404.svg +36 -0
- package/src/template/Vue2/src/assets/assets-result-500.svg +32 -0
- package/src/template/Vue2/src/assets/assets-result-ie.svg +33 -0
- package/src/template/Vue2/src/assets/assets-result-maintenance.svg +49 -0
- package/src/template/Vue2/src/assets/assets-result-wifi.svg +23 -0
- package/src/template/Vue2/src/assets/assets-setting-auto.svg +13 -0
- package/src/template/Vue2/src/assets/assets-setting-dark.svg +5 -0
- package/src/template/Vue2/src/assets/assets-setting-light.svg +13 -0
- package/src/template/Vue2/src/assets/assets-t-logo.svg +41 -0
- package/src/template/Vue2/src/assets/assets-tencent-logo.png +0 -0
- package/src/template/Vue2/src/components/color/index.vue +35 -0
- package/src/template/Vue2/src/components/product-card/index.vue +121 -0
- package/src/template/Vue2/src/components/result/index.vue +118 -0
- package/src/template/Vue2/src/components/thumbnail/index.vue +49 -0
- package/src/template/Vue2/src/components/trend/index.vue +105 -0
- package/src/template/Vue2/src/config/color.ts +30 -0
- package/src/template/Vue2/src/config/global.ts +2 -0
- package/src/template/Vue2/src/config/host.ts +26 -0
- package/src/template/Vue2/src/config/style.ts +14 -0
- package/src/template/Vue2/src/constants/index.ts +46 -0
- package/src/template/Vue2/src/interface.ts +39 -0
- package/src/template/Vue2/src/layouts/blank.vue +12 -0
- package/src/template/Vue2/src/layouts/components/Breadcrumb.vue +39 -0
- package/src/template/Vue2/src/layouts/components/Content.vue +43 -0
- package/src/template/Vue2/src/layouts/components/Footer.vue +27 -0
- package/src/template/Vue2/src/layouts/components/Header.vue +321 -0
- package/src/template/Vue2/src/layouts/components/LayoutContent.vue +168 -0
- package/src/template/Vue2/src/layouts/components/LayoutHeader.vue +52 -0
- package/src/template/Vue2/src/layouts/components/LayoutSidebar.vue +51 -0
- package/src/template/Vue2/src/layouts/components/MenuContent.vue +108 -0
- package/src/template/Vue2/src/layouts/components/Notice.vue +221 -0
- package/src/template/Vue2/src/layouts/components/Search.vue +134 -0
- package/src/template/Vue2/src/layouts/components/SideNav.vue +150 -0
- package/src/template/Vue2/src/layouts/index.vue +100 -0
- package/src/template/Vue2/src/layouts/setting.vue +404 -0
- package/src/template/Vue2/src/main.js +9 -0
- package/src/template/Vue2/src/main.jsx +51 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/MiddleChart.vue +158 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/OutputOverview.vue +189 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/RankList.vue +111 -0
- package/src/template/Vue2/src/pages/dashboard/base/components/TopPanel.vue +246 -0
- package/src/template/Vue2/src/pages/dashboard/base/index.ts +702 -0
- package/src/template/Vue2/src/pages/dashboard/base/index.vue +44 -0
- package/src/template/Vue2/src/pages/dashboard/detail/index.ts +267 -0
- package/src/template/Vue2/src/pages/dashboard/detail/index.vue +242 -0
- package/src/template/Vue2/src/pages/detail/advanced/components/Product.vue +167 -0
- package/src/template/Vue2/src/pages/detail/advanced/index.less +74 -0
- package/src/template/Vue2/src/pages/detail/advanced/index.vue +219 -0
- package/src/template/Vue2/src/pages/detail/base/index.less +105 -0
- package/src/template/Vue2/src/pages/detail/base/index.vue +46 -0
- package/src/template/Vue2/src/pages/detail/deploy/index.ts +204 -0
- package/src/template/Vue2/src/pages/detail/deploy/index.vue +224 -0
- package/src/template/Vue2/src/pages/detail/secondary/index.less +71 -0
- package/src/template/Vue2/src/pages/detail/secondary/index.vue +131 -0
- package/src/template/Vue2/src/pages/form/base/index.less +57 -0
- package/src/template/Vue2/src/pages/form/base/index.vue +254 -0
- package/src/template/Vue2/src/pages/form/step/index.less +37 -0
- package/src/template/Vue2/src/pages/form/step/index.vue +259 -0
- package/src/template/Vue2/src/pages/frame/doc/index.vue +86 -0
- package/src/template/Vue2/src/pages/frame/tdesign/index.vue +86 -0
- package/src/template/Vue2/src/pages/list/base/index.vue +267 -0
- package/src/template/Vue2/src/pages/list/card/index.vue +221 -0
- package/src/template/Vue2/src/pages/list/components/CommonTable.vue +313 -0
- package/src/template/Vue2/src/pages/list/filter/index.vue +15 -0
- package/src/template/Vue2/src/pages/list/tree/index.vue +174 -0
- package/src/template/Vue2/src/pages/login/components/components-header.vue +74 -0
- package/src/template/Vue2/src/pages/login/components/components-login.vue +154 -0
- package/src/template/Vue2/src/pages/login/components/components-register.vue +144 -0
- package/src/template/Vue2/src/pages/login/index.less +202 -0
- package/src/template/Vue2/src/pages/login/index.vue +53 -0
- package/src/template/Vue2/src/pages/nest-menu/Index.vue +10 -0
- package/src/template/Vue2/src/pages/result/403/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/404/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/500/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/browser-incompatible/index.vue +77 -0
- package/src/template/Vue2/src/pages/result/fail/index.vue +57 -0
- package/src/template/Vue2/src/pages/result/maintenance/index.vue +14 -0
- package/src/template/Vue2/src/pages/result/network-error/index.vue +24 -0
- package/src/template/Vue2/src/pages/result/success/index.vue +59 -0
- package/src/template/Vue2/src/pages/user/index.less +148 -0
- package/src/template/Vue2/src/pages/user/index.ts +157 -0
- package/src/template/Vue2/src/pages/user/index.vue +204 -0
- package/src/template/Vue2/src/permission.js +56 -0
- package/src/template/Vue2/src/router/index.js +43 -0
- package/src/template/Vue2/src/router/modules/base.ts +29 -0
- package/src/template/Vue2/src/router/modules/components.ts +175 -0
- package/src/template/Vue2/src/router/modules/others.ts +55 -0
- package/src/template/Vue2/src/service/service-advance.ts +233 -0
- package/src/template/Vue2/src/service/service-base.ts +205 -0
- package/src/template/Vue2/src/service/service-detail-base.ts +84 -0
- package/src/template/Vue2/src/service/service-detail-deploy.ts +234 -0
- package/src/template/Vue2/src/service/service-detail.ts +57 -0
- package/src/template/Vue2/src/service/service-user.ts +64 -0
- package/src/template/Vue2/src/store/index.ts +22 -0
- package/src/template/Vue2/src/store/modules/notification.ts +90 -0
- package/src/template/Vue2/src/store/modules/permission.ts +66 -0
- package/src/template/Vue2/src/store/modules/setting.ts +122 -0
- package/src/template/Vue2/src/store/modules/tab-router.ts +83 -0
- package/src/template/Vue2/src/store/modules/user.ts +98 -0
- package/src/template/Vue2/src/style/font-family.less +6 -0
- package/src/template/Vue2/src/style/index.less +5 -0
- package/src/template/Vue2/src/style/layout.less +201 -0
- package/src/template/Vue2/src/style/reset.less +78 -0
- package/src/template/Vue2/src/style/variables.less +27 -0
- package/src/template/Vue2/src/utils/charts.ts +38 -0
- package/src/template/Vue2/src/utils/color.ts +118 -0
- package/src/template/Vue2/src/utils/date.ts +12 -0
- package/src/template/Vue2/src/utils/request.ts +60 -0
- package/src/template/Vue2/stylelint.config.js +5 -0
- package/src/template/Vue2/tsconfig.json +26 -0
- package/src/template/Vue2/vite.config.js +58 -0
- package/src/template/Vue3/package.json.ejs +8 -0
- package/src/template/Vue3/pages.json +10 -0
- package/src/template/Vue3/src/main.js +7 -0
- package/src/utils/copy.js +17 -0
- package/src/utils/eslint.js +205 -0
- package/src/utils/logo.js +18 -0
- package/src/utils/render.js +20 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-form
|
|
3
|
+
ref="form"
|
|
4
|
+
:class="['item-container', `login-${type}`]"
|
|
5
|
+
:data="formData"
|
|
6
|
+
:rules="FORM_RULES"
|
|
7
|
+
label-width="0"
|
|
8
|
+
@submit="onSubmit"
|
|
9
|
+
>
|
|
10
|
+
<template v-if="type == 'password'">
|
|
11
|
+
<t-form-item name="account">
|
|
12
|
+
<t-input v-model="formData.account" size="large" placeholder="请输入账号:admin">
|
|
13
|
+
<template #prefix-icon>
|
|
14
|
+
<user-icon />
|
|
15
|
+
</template>
|
|
16
|
+
</t-input>
|
|
17
|
+
</t-form-item>
|
|
18
|
+
|
|
19
|
+
<t-form-item name="password">
|
|
20
|
+
<t-input
|
|
21
|
+
v-model="formData.password"
|
|
22
|
+
size="large"
|
|
23
|
+
:type="showPsw ? 'text' : 'password'"
|
|
24
|
+
clearable
|
|
25
|
+
key="password"
|
|
26
|
+
placeholder="请输入登录密码:admin"
|
|
27
|
+
>
|
|
28
|
+
<template #prefix-icon>
|
|
29
|
+
<lock-on-icon />
|
|
30
|
+
</template>
|
|
31
|
+
<template #suffix-icon>
|
|
32
|
+
<browse-icon v-if="showPsw" @click="showPsw = !showPsw" key="browse" />
|
|
33
|
+
<browse-off-icon v-else @click="showPsw = !showPsw" key="browse-off" />
|
|
34
|
+
</template>
|
|
35
|
+
</t-input>
|
|
36
|
+
</t-form-item>
|
|
37
|
+
|
|
38
|
+
<div class="check-container remember-pwd">
|
|
39
|
+
<t-checkbox>记住账号</t-checkbox>
|
|
40
|
+
<span class="tip">忘记账号?</span>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<!-- 扫码登陆 -->
|
|
45
|
+
<template v-else-if="type == 'qrcode'">
|
|
46
|
+
<div class="tip-container">
|
|
47
|
+
<span class="tip">请使用微信扫一扫登录</span>
|
|
48
|
+
<span class="refresh"
|
|
49
|
+
>刷新
|
|
50
|
+
<refresh-icon color="#0052D9" />
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
<qrcode-vue value="" :size="192" level="H" />
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<!-- 手机号登陆 -->
|
|
57
|
+
<template v-else>
|
|
58
|
+
<t-form-item name="phone">
|
|
59
|
+
<t-input v-model="formData.phone" size="large" placeholder="请输入您的手机号">
|
|
60
|
+
<template #prefix-icon>
|
|
61
|
+
<user-icon />
|
|
62
|
+
</template>
|
|
63
|
+
</t-input>
|
|
64
|
+
</t-form-item>
|
|
65
|
+
|
|
66
|
+
<t-form-item class="verification-code" name="verifyCode">
|
|
67
|
+
<t-input v-model="formData.verifyCode" size="large" placeholder="请输入验证码" key="verifyCode" />
|
|
68
|
+
<t-button variant="outline" :disabled="countDown > 0" @click="handleCounter">
|
|
69
|
+
{{ countDown == 0 ? '发送验证码' : `${countDown}秒后可重发` }}
|
|
70
|
+
</t-button>
|
|
71
|
+
</t-form-item>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<t-form-item v-if="type !== 'qrcode'" class="btn-container">
|
|
75
|
+
<t-button block size="large" type="submit"> 登录 </t-button>
|
|
76
|
+
</t-form-item>
|
|
77
|
+
|
|
78
|
+
<div class="switch-container">
|
|
79
|
+
<span v-if="type !== 'password'" class="tip" @click="switchType('password')">使用账号密码登录</span>
|
|
80
|
+
<span v-if="type !== 'qrcode'" class="tip" @click="switchType('qrcode')">使用微信扫码登录</span>
|
|
81
|
+
<span v-if="type !== 'phone'" class="tip" @click="switchType('phone')">使用手机号登录</span>
|
|
82
|
+
</div>
|
|
83
|
+
</t-form>
|
|
84
|
+
</template>
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
import Vue from 'vue';
|
|
87
|
+
import QrcodeVue from 'qrcode.vue';
|
|
88
|
+
import { UserIcon, LockOnIcon, BrowseOffIcon, BrowseIcon, RefreshIcon } from 'tdesign-icons-vue';
|
|
89
|
+
|
|
90
|
+
const INITIAL_DATA = {
|
|
91
|
+
phone: '',
|
|
92
|
+
account: 'admin',
|
|
93
|
+
password: 'admin',
|
|
94
|
+
verifyCode: '',
|
|
95
|
+
checked: false,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const FORM_RULES = {
|
|
99
|
+
phone: [{ required: true, message: '手机号必填', type: 'error' }],
|
|
100
|
+
account: [{ required: true, message: '账号必填', type: 'error' }],
|
|
101
|
+
password: [{ required: true, message: '密码必填', type: 'error' }],
|
|
102
|
+
verifyCode: [{ required: true, message: '验证码必填', type: 'error' }],
|
|
103
|
+
};
|
|
104
|
+
/** 高级详情 */
|
|
105
|
+
export default Vue.extend({
|
|
106
|
+
name: 'Login',
|
|
107
|
+
components: {
|
|
108
|
+
QrcodeVue,
|
|
109
|
+
UserIcon,
|
|
110
|
+
LockOnIcon,
|
|
111
|
+
BrowseOffIcon,
|
|
112
|
+
BrowseIcon,
|
|
113
|
+
RefreshIcon,
|
|
114
|
+
},
|
|
115
|
+
data() {
|
|
116
|
+
return {
|
|
117
|
+
FORM_RULES,
|
|
118
|
+
type: 'password',
|
|
119
|
+
formData: { ...INITIAL_DATA },
|
|
120
|
+
showPsw: false,
|
|
121
|
+
countDown: 0,
|
|
122
|
+
intervalTimer: null,
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
beforeDestroy() {
|
|
126
|
+
clearInterval(this.intervalTimer);
|
|
127
|
+
},
|
|
128
|
+
methods: {
|
|
129
|
+
switchType(val) {
|
|
130
|
+
this.type = val;
|
|
131
|
+
this.$refs.form.reset();
|
|
132
|
+
},
|
|
133
|
+
async onSubmit({ validateResult }) {
|
|
134
|
+
if (validateResult === true) {
|
|
135
|
+
await this.$store.dispatch('user/login', this.formData);
|
|
136
|
+
|
|
137
|
+
this.$message.success('登录成功');
|
|
138
|
+
this.$router.replace('/').catch(() => '');
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
handleCounter() {
|
|
142
|
+
this.countDown = 60;
|
|
143
|
+
this.intervalTimer = setInterval(() => {
|
|
144
|
+
if (this.countDown > 0) {
|
|
145
|
+
this.countDown -= 1;
|
|
146
|
+
} else {
|
|
147
|
+
clearInterval(this.intervalTimer);
|
|
148
|
+
this.countDown = 0;
|
|
149
|
+
}
|
|
150
|
+
}, 1000);
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
</script>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<t-form
|
|
3
|
+
ref="form"
|
|
4
|
+
:class="['item-container', `register-${type}`]"
|
|
5
|
+
:data="formData"
|
|
6
|
+
:rules="FORM_RULES"
|
|
7
|
+
label-width="0"
|
|
8
|
+
@submit="onSubmit"
|
|
9
|
+
>
|
|
10
|
+
<template v-if="type == 'phone'">
|
|
11
|
+
<t-form-item name="phone">
|
|
12
|
+
<t-input v-model="formData.phone" :maxlength="11" size="large" placeholder="请输入您的手机号">
|
|
13
|
+
<template #prefix-icon>
|
|
14
|
+
<user-icon />
|
|
15
|
+
</template>
|
|
16
|
+
</t-input>
|
|
17
|
+
</t-form-item>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<template v-if="type == 'email'">
|
|
21
|
+
<t-form-item name="email">
|
|
22
|
+
<t-input v-model="formData.email" type="text" size="large" placeholder="请输入您的邮箱">
|
|
23
|
+
<template #prefix-icon>
|
|
24
|
+
<mail-icon />
|
|
25
|
+
</template>
|
|
26
|
+
</t-input>
|
|
27
|
+
</t-form-item>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<t-form-item name="password">
|
|
31
|
+
<t-input
|
|
32
|
+
v-model="formData.password"
|
|
33
|
+
size="large"
|
|
34
|
+
:type="showPsw ? 'text' : 'password'"
|
|
35
|
+
clearable
|
|
36
|
+
placeholder="请输入登录密码"
|
|
37
|
+
>
|
|
38
|
+
<template #prefix-icon>
|
|
39
|
+
<lock-on-icon />
|
|
40
|
+
</template>
|
|
41
|
+
<template #suffix-icon>
|
|
42
|
+
<browse-icon v-if="showPsw" key="browse" @click="showPsw = !showPsw" />
|
|
43
|
+
<browse-off-icon v-else key="browse-off" @click="showPsw = !showPsw" />
|
|
44
|
+
</template>
|
|
45
|
+
</t-input>
|
|
46
|
+
</t-form-item>
|
|
47
|
+
|
|
48
|
+
<template v-if="type == 'phone'">
|
|
49
|
+
<t-form-item class="verification-code" name="verifyCode">
|
|
50
|
+
<t-input v-model="formData.verifyCode" size="large" placeholder="请输入验证码" />
|
|
51
|
+
<t-button variant="outline" :disabled="countDown > 0" @click="handleCounter">
|
|
52
|
+
{{ countDown == 0 ? '发送验证码' : `${countDown}秒后可重发` }}
|
|
53
|
+
</t-button>
|
|
54
|
+
</t-form-item>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<t-form-item class="check-container" name="checked">
|
|
58
|
+
<t-checkbox v-model="formData.checked">我已阅读并同意 </t-checkbox> <span>TDesign服务协议</span> 和
|
|
59
|
+
<span>TDesign 隐私声明</span>
|
|
60
|
+
</t-form-item>
|
|
61
|
+
|
|
62
|
+
<t-form-item>
|
|
63
|
+
<t-button block size="large" type="submit"> 注册 </t-button>
|
|
64
|
+
</t-form-item>
|
|
65
|
+
|
|
66
|
+
<div class="switch-container">
|
|
67
|
+
<span class="tip" @click="switchType(type == 'phone' ? 'email' : 'phone')">{{
|
|
68
|
+
type == 'phone' ? '使用邮箱注册' : '使用手机号注册'
|
|
69
|
+
}}</span>
|
|
70
|
+
</div>
|
|
71
|
+
</t-form>
|
|
72
|
+
</template>
|
|
73
|
+
<script lang="ts">
|
|
74
|
+
import Vue from 'vue';
|
|
75
|
+
import { UserIcon, MailIcon, BrowseIcon, BrowseOffIcon, LockOnIcon } from 'tdesign-icons-vue';
|
|
76
|
+
|
|
77
|
+
const INITIAL_DATA = {
|
|
78
|
+
phone: '',
|
|
79
|
+
email: '',
|
|
80
|
+
password: '',
|
|
81
|
+
verifyCode: '',
|
|
82
|
+
checked: false,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const FORM_RULES = {
|
|
86
|
+
phone: [{ required: true, message: '手机号必填', type: 'error' }],
|
|
87
|
+
email: [{ required: true, email: true, message: '邮箱必填', type: 'error' }],
|
|
88
|
+
password: [{ required: true, message: '密码必填', type: 'error' }],
|
|
89
|
+
verifyCode: [{ required: true, message: '验证码必填', type: 'error' }],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** 高级详情 */
|
|
93
|
+
export default Vue.extend({
|
|
94
|
+
name: 'Register',
|
|
95
|
+
components: {
|
|
96
|
+
UserIcon,
|
|
97
|
+
MailIcon,
|
|
98
|
+
BrowseIcon,
|
|
99
|
+
BrowseOffIcon,
|
|
100
|
+
LockOnIcon,
|
|
101
|
+
},
|
|
102
|
+
data() {
|
|
103
|
+
return {
|
|
104
|
+
FORM_RULES,
|
|
105
|
+
type: 'phone',
|
|
106
|
+
emailOptions: [],
|
|
107
|
+
formData: { ...INITIAL_DATA },
|
|
108
|
+
showPsw: false,
|
|
109
|
+
countDown: 0,
|
|
110
|
+
intervalTimer: null,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
beforeDestroy() {
|
|
114
|
+
clearInterval(this.intervalTimer);
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
onSubmit({ validateResult }: { validateResult: boolean }) {
|
|
118
|
+
if (validateResult === true) {
|
|
119
|
+
if (!this.formData.checked) {
|
|
120
|
+
this.$message.error('请同意TDesign服务协议和TDesign 隐私声明');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.$message.success('注册成功');
|
|
124
|
+
this.$emit('registerSuccess');
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
switchType(val: 'email' | 'phone') {
|
|
128
|
+
this.$refs.form.reset();
|
|
129
|
+
this.type = val;
|
|
130
|
+
},
|
|
131
|
+
handleCounter() {
|
|
132
|
+
this.countDown = 60;
|
|
133
|
+
this.intervalTimer = setInterval(() => {
|
|
134
|
+
if (this.countDown > 0) {
|
|
135
|
+
this.countDown -= 1;
|
|
136
|
+
} else {
|
|
137
|
+
clearInterval(this.intervalTimer);
|
|
138
|
+
this.countDown = 0;
|
|
139
|
+
}
|
|
140
|
+
}, 1000);
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
</script>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
@import '@/style/variables.less';
|
|
2
|
+
|
|
3
|
+
.light {
|
|
4
|
+
&.login-wrapper {
|
|
5
|
+
background-color: white;
|
|
6
|
+
background-image: url('@/assets/assets-login-bg-white.png');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dark {
|
|
11
|
+
&.login-wrapper {
|
|
12
|
+
background-color: var(--td-bg-color-page);
|
|
13
|
+
background-image: url('@/assets/assets-login-bg-black.png');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.login-wrapper {
|
|
18
|
+
height: 100vh;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
background-size: cover;
|
|
22
|
+
background-position: 100%;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.login-container {
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 22%;
|
|
29
|
+
left: 5%;
|
|
30
|
+
min-height: 500px;
|
|
31
|
+
line-height: 22px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.title-container {
|
|
35
|
+
.title {
|
|
36
|
+
font-size: 36px;
|
|
37
|
+
line-height: 44px;
|
|
38
|
+
color: var(--td-text-color-primary);
|
|
39
|
+
margin-top: 4px;
|
|
40
|
+
|
|
41
|
+
&.margin-no {
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sub-title {
|
|
47
|
+
margin-top: 16px;
|
|
48
|
+
|
|
49
|
+
.tip {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
margin-right: 8px;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
|
|
54
|
+
&:first-child {
|
|
55
|
+
color: var(--td-text-color-secondary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:last-child {
|
|
59
|
+
color: var(--td-text-color-primary);
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.item-container {
|
|
67
|
+
width: 400px;
|
|
68
|
+
margin-top: 48px;
|
|
69
|
+
|
|
70
|
+
&.login-qrcode {
|
|
71
|
+
.tip-container {
|
|
72
|
+
width: 192px;
|
|
73
|
+
margin-bottom: 16px;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
|
|
78
|
+
.tip {
|
|
79
|
+
color: var(--td-text-color-primary);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.refresh {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
color: var(--td-brand-color);
|
|
86
|
+
|
|
87
|
+
.t-icon {
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.bottom-container {
|
|
98
|
+
margin-top: 32px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.login-phone {
|
|
103
|
+
.bottom-container {
|
|
104
|
+
margin-top: 66px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.check-container {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
|
|
112
|
+
&.remember-pwd {
|
|
113
|
+
margin-bottom: 16px;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.t-checkbox__label {
|
|
118
|
+
color: var(--td-text-color-secondary);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
span {
|
|
122
|
+
color: var(--td-brand-color);
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.verification-code {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
|
|
134
|
+
.t-form__controls {
|
|
135
|
+
width: 100%;
|
|
136
|
+
|
|
137
|
+
button {
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
width: 102px;
|
|
140
|
+
height: 40px;
|
|
141
|
+
margin-left: 11px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.btn-container {
|
|
147
|
+
margin-top: 48px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.switch-container {
|
|
152
|
+
margin-top: 24px;
|
|
153
|
+
|
|
154
|
+
.tip {
|
|
155
|
+
font-size: 14px;
|
|
156
|
+
color: var(--td-brand-color);
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
display: inline-flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
margin-right: 14px;
|
|
161
|
+
|
|
162
|
+
&:last-child {
|
|
163
|
+
&::after {
|
|
164
|
+
display: none;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&::after {
|
|
169
|
+
content: '';
|
|
170
|
+
display: block;
|
|
171
|
+
width: 1px;
|
|
172
|
+
height: 12px;
|
|
173
|
+
background: var(--td-gray-color-3);
|
|
174
|
+
margin-left: 14px;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.check-container {
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
color: var(--td-text-color-secondary);
|
|
182
|
+
|
|
183
|
+
.tip {
|
|
184
|
+
float: right;
|
|
185
|
+
font-size: 14px;
|
|
186
|
+
color: var(--td-brand-color);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.copyright {
|
|
191
|
+
font-size: 14px;
|
|
192
|
+
position: absolute;
|
|
193
|
+
left: 5%;
|
|
194
|
+
bottom: var(--td-comp-size-xxxl);
|
|
195
|
+
color: var(--td-text-color-secondary);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@media screen and (max-height: 700px) {
|
|
199
|
+
.copyright {
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="login-wrapper">
|
|
3
|
+
<login-header />
|
|
4
|
+
|
|
5
|
+
<div class="login-container">
|
|
6
|
+
<div class="title-container">
|
|
7
|
+
<h1 class="title margin-no">登录到</h1>
|
|
8
|
+
<h1 class="title">TDesign Starter</h1>
|
|
9
|
+
<div class="sub-title">
|
|
10
|
+
<p class="tip">{{ type == 'register' ? '已有账号?' : '没有账号吗?' }}</p>
|
|
11
|
+
<p class="tip" @click="switchType(type == 'register' ? 'login' : 'register')">
|
|
12
|
+
{{ type == 'register' ? '登录' : '注册新账号' }}
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<login v-if="type === 'login'" />
|
|
18
|
+
<register v-else @register-success="switchType('login')" />
|
|
19
|
+
<tdesign-setting />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<footer class="copyright">Copyright @ 2021-2022 Tencent. All Rights Reserved</footer>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script>
|
|
26
|
+
import Login from './components/components-login.vue';
|
|
27
|
+
import Register from './components/components-register.vue';
|
|
28
|
+
import LoginHeader from './components/components-header.vue';
|
|
29
|
+
import TdesignSetting from '@/layouts/setting.vue';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'LoginIndex',
|
|
33
|
+
components: {
|
|
34
|
+
LoginHeader,
|
|
35
|
+
Login,
|
|
36
|
+
Register,
|
|
37
|
+
TdesignSetting,
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
type: 'login',
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
switchType(val) {
|
|
46
|
+
this.type = val;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
<style lang="less">
|
|
52
|
+
@import url('./index.less');
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<result title="403 Forbidden" tip="抱歉,您无权限访问此页面,企业微信联系创建者xiaolaoshi">
|
|
3
|
+
<t-button @click="() => $router.push('/')">返回首页</t-button>
|
|
4
|
+
</result>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import result from '@/components/result/index.vue';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'Result403',
|
|
12
|
+
components: { result },
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<result title="404 Not Found" tip="抱歉,您访问的页面不存在" type="404">
|
|
3
|
+
<t-button @click="() => $router.push('/')">返回首页</t-button>
|
|
4
|
+
</result>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import result from '@/components/result/index.vue';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'Result404',
|
|
12
|
+
components: { result },
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<result title="500 Internal Server Error" type="500" tip="抱歉,服务器出错啦">
|
|
3
|
+
<t-button @click="() => $router.push('/')">返回首页</t-button>
|
|
4
|
+
</result>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import result from '@/components/result/index.vue';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'Result500',
|
|
12
|
+
components: { result },
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<result title="浏览器版本低" tip="抱歉,您正在使用的浏览器版本过低,无法打开当前网页。" type="ie">
|
|
3
|
+
<div class="result-slot-container">
|
|
4
|
+
<t-button class="result-button" @click="() => $router.push('/')">返回首页</t-button>
|
|
5
|
+
<div class="recommend-container">
|
|
6
|
+
<div>TDesign Starter 推荐以下主流浏览器</div>
|
|
7
|
+
<div class="recommend-browser">
|
|
8
|
+
<div>
|
|
9
|
+
<thumbnail class="browser-icon" url="https://tdesign.gtimg.com/starter/result-page/chorme.png" />
|
|
10
|
+
<div>Chrome</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<thumbnail class="browser-icon" url="https://tdesign.gtimg.com/starter/result-page/qq-browser.png" />
|
|
14
|
+
<div>QQ Browser</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</result>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import Result from '@/components/result/index.vue';
|
|
24
|
+
import Thumbnail from '@/components/thumbnail/index.vue';
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'ResultBrowserIncompatible',
|
|
28
|
+
components: { Result, Thumbnail },
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="less" scoped>
|
|
33
|
+
@import '@/style/variables.less';
|
|
34
|
+
|
|
35
|
+
.result-slot-container {
|
|
36
|
+
position: relative;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
color: var(--td-text-color-secondary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.recommend-container {
|
|
45
|
+
position: absolute;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
top: 175px;
|
|
50
|
+
padding: 24px 48px;
|
|
51
|
+
width: 640px;
|
|
52
|
+
background: var(--td-bg-color-container);
|
|
53
|
+
box-shadow: 0px 1px 2px var(--td-shadow-1);
|
|
54
|
+
border-radius: 3px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.recommend-browser {
|
|
58
|
+
display: flex;
|
|
59
|
+
|
|
60
|
+
> div {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
height: 70px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
> div + div {
|
|
69
|
+
margin-left: 40px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.browser-icon {
|
|
74
|
+
width: 36.67px;
|
|
75
|
+
height: 36.67px;
|
|
76
|
+
}
|
|
77
|
+
</style>
|