|
|
@@ -4,8 +4,8 @@
|
|
|
<div class="flex flex-center flex-child-average">
|
|
|
<div class="flex left">
|
|
|
<img
|
|
|
- src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/3938373d1b0c44c899f94cba263ff4a8.jpg"
|
|
|
- style="
|
|
|
+ src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/3938373d1b0c44c899f94cba263ff4a8.jpg"
|
|
|
+ style="
|
|
|
height: 560px;
|
|
|
object-fit: contain;
|
|
|
border-bottom-left-radius: 10px;
|
|
|
@@ -17,80 +17,80 @@
|
|
|
<div class="right flex flex-col flex-child-average">
|
|
|
<div class="flex flex-col flex-justify-between" style="height: 560px">
|
|
|
<div
|
|
|
- class="flex flex-justify-end"
|
|
|
- style="margin-right: 3px; margin-top: 3px"
|
|
|
+ class="flex flex-justify-end"
|
|
|
+ style="margin-right: 3px; margin-top: 3px"
|
|
|
>
|
|
|
- <div>
|
|
|
+ <div v-if="!dev">
|
|
|
<img
|
|
|
- v-if="qrCodeLogin"
|
|
|
- src="../assets/img/com.png"
|
|
|
- style="width: 80px"
|
|
|
- @click="qrCodeLogin = !qrCodeLogin"
|
|
|
+ v-if="qrCodeLogin"
|
|
|
+ src="../assets/img/com.png"
|
|
|
+ style="width: 80px"
|
|
|
+ @click="qrCodeLogin = !qrCodeLogin"
|
|
|
/>
|
|
|
<img
|
|
|
- v-else
|
|
|
- src="../assets/img/code.png"
|
|
|
- style="width: 80px"
|
|
|
- @click="qrCodeLogin = !qrCodeLogin"
|
|
|
+ v-else
|
|
|
+ src="../assets/img/code.png"
|
|
|
+ style="width: 80px"
|
|
|
+ @click="qrCodeLogin = !qrCodeLogin"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
- v-if="qrCodeLogin"
|
|
|
- class="flex flex-center flex-col"
|
|
|
- style="height: 500px; margin-top: -20px"
|
|
|
+ v-if="qrCodeLogin"
|
|
|
+ class="flex flex-center flex-col"
|
|
|
+ style="height: 500px; margin-top: -20px"
|
|
|
>
|
|
|
<span class="font-24 black bold">欢迎来到梧桐树云服务👏</span>
|
|
|
<div
|
|
|
- class="flex flex-col flex-center"
|
|
|
- style="height: 360px; width: 360px; margin-top: -20px"
|
|
|
+ class="flex flex-col flex-center"
|
|
|
+ style="height: 360px; width: 360px; margin-top: -20px"
|
|
|
>
|
|
|
<vue-qr
|
|
|
- :currentLevel="3"
|
|
|
- :logoCornerRadius="4"
|
|
|
- :logoScale="0.25"
|
|
|
- :logoSrc="logoSrc"
|
|
|
- :text="qrCodeText"
|
|
|
- size="260"
|
|
|
+ :currentLevel="3"
|
|
|
+ :logoCornerRadius="4"
|
|
|
+ :logoScale="0.25"
|
|
|
+ :logoSrc="logoSrc"
|
|
|
+ :text="qrCodeText"
|
|
|
+ size="260"
|
|
|
/>
|
|
|
</div>
|
|
|
<span
|
|
|
- class="mt-10 bold main-color font-16"
|
|
|
- style="margin-top: -20px"
|
|
|
- >打开微信扫描二维码登录梧桐树云服务</span
|
|
|
+ class="mt-10 bold main-color font-16"
|
|
|
+ style="margin-top: -20px"
|
|
|
+ >打开微信扫描二维码登录梧桐树云服务</span
|
|
|
>
|
|
|
</div>
|
|
|
<div v-else class="flex flex-col flex-center" style="height: 500px">
|
|
|
<span class="font-24 black bold">欢迎来到梧桐树云服务👏</span>
|
|
|
<div
|
|
|
- class="flex flex-col flex-center mt-5"
|
|
|
- style="width: 450px; height: 400px"
|
|
|
+ class="flex flex-col flex-center mt-5"
|
|
|
+ style="width: 450px; height: 400px"
|
|
|
>
|
|
|
<el-form ref="loginForm" :model="form" :rules="rules">
|
|
|
<el-form-item prop="name">
|
|
|
<el-input
|
|
|
- v-model="form.name"
|
|
|
- placeholder="用户帐号"
|
|
|
- prefix-icon="Avatar"
|
|
|
- size="large"
|
|
|
+ v-model="form.name"
|
|
|
+ placeholder="用户帐号"
|
|
|
+ prefix-icon="Avatar"
|
|
|
+ size="large"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="pass">
|
|
|
<el-input
|
|
|
- v-model="form.pass"
|
|
|
- :type="flag ? 'text' : 'password'"
|
|
|
- placeholder="密码"
|
|
|
- prefix-icon="WalletFilled"
|
|
|
- size="large"
|
|
|
+ v-model="form.pass"
|
|
|
+ :type="flag ? 'text' : 'password'"
|
|
|
+ placeholder="密码"
|
|
|
+ prefix-icon="WalletFilled"
|
|
|
+ size="large"
|
|
|
>
|
|
|
<template v-slot:suffix>
|
|
|
<div class="pointer" @click="flag = !flag">
|
|
|
<el-icon v-if="!flag">
|
|
|
- <Hide/>
|
|
|
+ <Hide />
|
|
|
</el-icon>
|
|
|
<el-icon v-else>
|
|
|
- <View/>
|
|
|
+ <View />
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -98,72 +98,74 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="code">
|
|
|
<el-input
|
|
|
- v-model="form.code"
|
|
|
- class="append"
|
|
|
- placeholder="验证码"
|
|
|
- prefix-icon="Refresh"
|
|
|
- size="large"
|
|
|
- @keyup.enter="submint"
|
|
|
+ v-model="form.code"
|
|
|
+ class="append"
|
|
|
+ placeholder="验证码"
|
|
|
+ prefix-icon="Refresh"
|
|
|
+ size="large"
|
|
|
+ @keyup.enter="submint"
|
|
|
>
|
|
|
<template v-slot:append>
|
|
|
<img
|
|
|
- :src="code"
|
|
|
- class="pic"
|
|
|
- @click="init"
|
|
|
- style="
|
|
|
+ :src="code"
|
|
|
+ class="pic"
|
|
|
+ @click="init"
|
|
|
+ style="
|
|
|
height: 40px;
|
|
|
background-color: red;
|
|
|
background-blend-mode: lighten;
|
|
|
"
|
|
|
- alt="code"
|
|
|
+ alt="code"
|
|
|
/>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<div
|
|
|
- class="flex flex-align-center flex-justify-between full-width"
|
|
|
+ class="flex flex-align-center flex-justify-between full-width"
|
|
|
>
|
|
|
- <div></div>
|
|
|
- <el-link :underline="false" class="font-12" type="primary"
|
|
|
- >忘记密码?
|
|
|
- </el-link
|
|
|
- >
|
|
|
+ <div v-if="dev" class="flex flex-center full-width">
|
|
|
+ <el-button type="primary" plain @click="loginTest(1)"
|
|
|
+ >测试管理员001</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" plain @click="loginTest(2)"
|
|
|
+ >测试用户001</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-button
|
|
|
- size="large"
|
|
|
- style="width: 78%"
|
|
|
- type="primary"
|
|
|
- @click="submint"
|
|
|
- >登录
|
|
|
- </el-button
|
|
|
+ size="large"
|
|
|
+ style="width: 78%"
|
|
|
+ type="primary"
|
|
|
+ @click="submint"
|
|
|
+ >登录</el-button
|
|
|
>
|
|
|
<div class="flex flex-col mt-10 flex-center">
|
|
|
<span class="grey-6">由梧桐研究院提供技术支持</span>
|
|
|
<span class="grey-6 mt-5">使用问题请咨询:15587166921</span>
|
|
|
<el-button
|
|
|
- color="#558FF1"
|
|
|
- @click="
|
|
|
+ color="#558FF1"
|
|
|
+ @click="
|
|
|
download(
|
|
|
'https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/a53cc056c3914ae9884992dafe7a9679.pdf'
|
|
|
)
|
|
|
"
|
|
|
- style="width: 160px"
|
|
|
- plain
|
|
|
- class="mt-10 blockss"
|
|
|
+ style="width: 160px"
|
|
|
+ plain
|
|
|
+ class="mt-10 blockss"
|
|
|
>
|
|
|
点击下载用户指南
|
|
|
</el-button>
|
|
|
<span class="grey-6 mt-5 font-12 mt-20"
|
|
|
- >为了获得最佳体验,您可以<span
|
|
|
+ >为了获得最佳体验,您可以<span
|
|
|
class="blue pointer"
|
|
|
@click="
|
|
|
download('https://www.google.cn/intl/zh-CN/chrome/')
|
|
|
"
|
|
|
- >点击此处</span
|
|
|
- >获取Chrome 浏览器</span
|
|
|
+ >点击此处</span
|
|
|
+ >获取Chrome 浏览器</span
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -173,7 +175,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
- <foolter/>
|
|
|
+ <foolter />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -188,15 +190,15 @@ layout: 'empty',
|
|
|
|
|
|
<script>
|
|
|
import md5 from 'js-md5'
|
|
|
-import {useStore} from '@/store/user.js'
|
|
|
-import {removeToken, setToken} from '../utils/auth.js'
|
|
|
+import { useStore } from '@/store/user.js'
|
|
|
+import { removeToken, setToken } from '../utils/auth.js'
|
|
|
import permissionStore from '@/store/permission.js'
|
|
|
import VueQr from 'vue-qr/src/packages/vue-qr.vue'
|
|
|
import foolter from '@/layout/foolter.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'login',
|
|
|
- components: {VueQr, foolter},
|
|
|
+ components: { VueQr, foolter },
|
|
|
watch: {
|
|
|
qrCodeLogin: {
|
|
|
handler(val) {
|
|
|
@@ -211,27 +213,27 @@ export default {
|
|
|
setup() {
|
|
|
const user = useStore()
|
|
|
const permission = permissionStore()
|
|
|
- return {user, permission}
|
|
|
+ return { user, permission }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
flag: false,
|
|
|
form: {
|
|
|
- name: 'adminzj',
|
|
|
- pass: '123456'
|
|
|
+ name: '',
|
|
|
+ pass: ''
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
- {required: true, message: '请输入用户帐号', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入用户帐号', trigger: 'blur' }
|
|
|
// { min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur' }
|
|
|
],
|
|
|
pass: [
|
|
|
- {required: true, message: '请输入密码', trigger: 'blur'},
|
|
|
- {min: 3, max: 16, message: '长度在 3 到 16 个字符', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入密码', trigger: 'blur' },
|
|
|
+ { min: 3, max: 16, message: '长度在 3 到 16 个字符', trigger: 'blur' }
|
|
|
],
|
|
|
code: [
|
|
|
- {required: true, message: '请输入验证码', trigger: 'blur'},
|
|
|
- {min: 5, max: 5, message: '验证码不正确', trigger: 'blur'}
|
|
|
+ { required: true, message: '请输入验证码', trigger: 'blur' },
|
|
|
+ { min: 5, max: 5, message: '验证码不正确', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
code: '',
|
|
|
@@ -248,10 +250,6 @@ export default {
|
|
|
created() {
|
|
|
this.permission.cleanPermission()
|
|
|
// fixme prod 环境暂时开启账号登录功能
|
|
|
- // this.dev = window.location.href.indexOf('localhost') > -1 || window.location.href.indexOf('https://dev.wutongshucloud.com/') > -1 || window.location.href.indexOf('192.168.31') > -1
|
|
|
- this.dev =
|
|
|
- window.location.href.indexOf('localhost') > -1 ||
|
|
|
- window.location.href.indexOf('192.168.31') > -1
|
|
|
removeToken()
|
|
|
this.init()
|
|
|
},
|
|
|
@@ -260,15 +258,17 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- const dev =
|
|
|
- window.location.href.indexOf('dash.wutongshucloud.com') > -1 ||
|
|
|
- window.location.href.indexOf('localhost') > -1
|
|
|
- sessionStorage.setItem('dev', dev)
|
|
|
+ this.dev =
|
|
|
+ window.location.href.indexOf('localhost') > -1 ||
|
|
|
+ window.location.href.indexOf('https://test.wutongshucloud.com/') > -1 ||
|
|
|
+ window.location.href.indexOf('192.168.31') > -1
|
|
|
+ sessionStorage.setItem('dev', this.dev)
|
|
|
+
|
|
|
this.$api.login.captcha().then(res => {
|
|
|
this.code = res.image
|
|
|
this.header = res.key
|
|
|
})
|
|
|
- const menu = {active: 0, subActive: 0}
|
|
|
+ const menu = { active: 0, subActive: 0 }
|
|
|
localStorage.setItem('index', JSON.stringify(menu))
|
|
|
localStorage.removeItem('data-type')
|
|
|
},
|
|
|
@@ -295,7 +295,7 @@ export default {
|
|
|
this.init()
|
|
|
} else {
|
|
|
setToken(res.access_token)
|
|
|
- this.user.setUserInfo({name: res.real_name})
|
|
|
+ this.user.setUserInfo({ name: res.real_name })
|
|
|
this.getInfo()
|
|
|
}
|
|
|
})
|
|
|
@@ -306,8 +306,8 @@ export default {
|
|
|
},
|
|
|
download(url) {
|
|
|
window.open(
|
|
|
- url,
|
|
|
- '_blank' // <- This is what makes it open in a new window.
|
|
|
+ url,
|
|
|
+ '_blank' // <- This is what makes it open in a new window.
|
|
|
)
|
|
|
},
|
|
|
loginAdmin() {
|
|
|
@@ -355,12 +355,12 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.sessionId = res.data
|
|
|
this.qrCodeText =
|
|
|
- 'https://prod.wutongshucloud.com/login?id=' + this.sessionId
|
|
|
+ 'https://prod.wutongshucloud.com/login?id=' + this.sessionId
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
codeLogin() {
|
|
|
- this.$api.login.qrCodeLogin({sessionId: this.sessionId}).then(res => {
|
|
|
+ this.$api.login.qrCodeLogin({ sessionId: this.sessionId }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
const tmp = res.data
|
|
|
if (Object.prototype.hasOwnProperty.call(tmp, 'phone')) {
|
|
|
@@ -385,6 +385,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ loginTest(type) {
|
|
|
+ if (type === 1) {
|
|
|
+ this.form.name = 'admin001'
|
|
|
+ this.form.pass = 'admin123456'
|
|
|
+ } else if (type === 2) {
|
|
|
+ this.form.name = 'user001'
|
|
|
+ this.form.pass = 'admin123456'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -396,7 +405,6 @@ export default {
|
|
|
background-image: url('https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/7667edec62f44063a50c66e8654eaa87.png');
|
|
|
background-size: cover;
|
|
|
background-repeat: no-repeat;
|
|
|
-
|
|
|
.footer {
|
|
|
position: fixed;
|
|
|
bottom: 10px;
|