|
@@ -6,7 +6,6 @@
|
|
|
<img
|
|
<img
|
|
|
src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/373e3ccd35be4ba2a72376050027612e.png"
|
|
src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/373e3ccd35be4ba2a72376050027612e.png"
|
|
|
style="height: 560px;object-fit: contain;border-bottom-left-radius: 10px;border-top-left-radius: 10px"/>
|
|
style="height: 560px;object-fit: contain;border-bottom-left-radius: 10px;border-top-left-radius: 10px"/>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class='right flex flex-col flex-child-average'>
|
|
<div class='right flex flex-col flex-child-average'>
|
|
@@ -27,7 +26,8 @@
|
|
|
<vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25' :logoSrc='logoSrc' :text='qrCodeText'
|
|
<vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25' :logoSrc='logoSrc' :text='qrCodeText'
|
|
|
size='260'/>
|
|
size='260'/>
|
|
|
</div>
|
|
</div>
|
|
|
- <span class='mt-10 bold main-color font-16' style="margin-top: -20px">打开微信扫描二维码登陆梧桐树云平台</span>
|
|
|
|
|
|
|
+ <span class='mt-10 bold main-color font-16'
|
|
|
|
|
+ style="margin-top: -20px">打开微信扫描二维码登陆梧桐树云平台</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else class=' flex flex-col flex-center'>
|
|
<div v-else class=' flex flex-col flex-center'>
|
|
|
<span class='font-24 black bold'>欢迎来到梧桐树云平台👏</span>
|
|
<span class='font-24 black bold'>欢迎来到梧桐树云平台👏</span>
|
|
@@ -108,17 +108,17 @@ layout: 'empty',
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import md5 from 'js-md5'
|
|
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 permissionStore from '@/store/permission.js'
|
|
|
import VueQr from 'vue-qr/src/packages/vue-qr.vue'
|
|
import VueQr from 'vue-qr/src/packages/vue-qr.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'login',
|
|
name: 'login',
|
|
|
- components: {VueQr},
|
|
|
|
|
|
|
+ components: { VueQr },
|
|
|
watch: {
|
|
watch: {
|
|
|
qrCodeLogin: {
|
|
qrCodeLogin: {
|
|
|
- handler(val) {
|
|
|
|
|
|
|
+ handler (val) {
|
|
|
if (val) {
|
|
if (val) {
|
|
|
this.qrCode()
|
|
this.qrCode()
|
|
|
this.checkLogin()
|
|
this.checkLogin()
|
|
@@ -127,12 +127,12 @@ export default {
|
|
|
immediate: true
|
|
immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setup() {
|
|
|
|
|
|
|
+ setup () {
|
|
|
const user = useStore()
|
|
const user = useStore()
|
|
|
const permission = permissionStore()
|
|
const permission = permissionStore()
|
|
|
- return {user, permission}
|
|
|
|
|
|
|
+ return { user, permission }
|
|
|
},
|
|
},
|
|
|
- data() {
|
|
|
|
|
|
|
+ data () {
|
|
|
return {
|
|
return {
|
|
|
flag: false,
|
|
flag: false,
|
|
|
form: {
|
|
form: {
|
|
@@ -141,16 +141,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [
|
|
name: [
|
|
|
- {required: true, message: '请输入手机号码', trigger: 'blur'},
|
|
|
|
|
- {min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur'}
|
|
|
|
|
|
|
+ { required: true, message: '请输入手机号码', trigger: 'blur' },
|
|
|
|
|
+ { min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
pass: [
|
|
pass: [
|
|
|
- {required: true, message: '请输入密码', trigger: 'blur'},
|
|
|
|
|
- {min: 3, max: 12, message: '长度在 3 到 12 个字符', trigger: 'blur'}
|
|
|
|
|
|
|
+ { required: true, message: '请输入密码', trigger: 'blur' },
|
|
|
|
|
+ { min: 3, max: 12, message: '长度在 3 到 12 个字符', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
code: [
|
|
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: '',
|
|
code: '',
|
|
@@ -162,22 +162,22 @@ export default {
|
|
|
logoSrc: new URL('../assets/img/logo.png', import.meta.url).href
|
|
logoSrc: new URL('../assets/img/logo.png', import.meta.url).href
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
|
|
+ created () {
|
|
|
this.permission.cleanPermission()
|
|
this.permission.cleanPermission()
|
|
|
removeToken()
|
|
removeToken()
|
|
|
this.init()
|
|
this.init()
|
|
|
},
|
|
},
|
|
|
- unmounted() {
|
|
|
|
|
|
|
+ unmounted () {
|
|
|
clearInterval(this.time)
|
|
clearInterval(this.time)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- init() {
|
|
|
|
|
|
|
+ init () {
|
|
|
this.$api.login.captcha().then(res => {
|
|
this.$api.login.captcha().then(res => {
|
|
|
this.code = res.image
|
|
this.code = res.image
|
|
|
this.header = res.key
|
|
this.header = res.key
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- submint() {
|
|
|
|
|
|
|
+ submint () {
|
|
|
this.$refs.loginForm.validate((res) => {
|
|
this.$refs.loginForm.validate((res) => {
|
|
|
if (res) {
|
|
if (res) {
|
|
|
const params = {
|
|
const params = {
|
|
@@ -188,7 +188,7 @@ export default {
|
|
|
scope: 'all',
|
|
scope: 'all',
|
|
|
type: 'account'
|
|
type: 'account'
|
|
|
}
|
|
}
|
|
|
- const header = {captchaKey: this.header, captchaCode: this.form.code}
|
|
|
|
|
|
|
+ const header = { captchaKey: this.header, captchaCode: this.form.code }
|
|
|
this.$api.login.login(params, header).then(res => {
|
|
this.$api.login.login(params, header).then(res => {
|
|
|
if (res.error_description) {
|
|
if (res.error_description) {
|
|
|
this.$message.error(res.error_description)
|
|
this.$message.error(res.error_description)
|
|
@@ -204,11 +204,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- loginAdmin() {
|
|
|
|
|
|
|
+ loginAdmin () {
|
|
|
this.form.name = 'admin'
|
|
this.form.name = 'admin'
|
|
|
this.form.pass = 'admin'
|
|
this.form.pass = 'admin'
|
|
|
},
|
|
},
|
|
|
- getInfo() {
|
|
|
|
|
|
|
+ getInfo () {
|
|
|
this.getPermission()
|
|
this.getPermission()
|
|
|
this.$api.login.getUserInfo().then(res => {
|
|
this.$api.login.getUserInfo().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -222,14 +222,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getPermission() {
|
|
|
|
|
|
|
+ getPermission () {
|
|
|
this.$api.login.getPermission().then(res => {
|
|
this.$api.login.getPermission().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.permission.addPermission(res.data)
|
|
this.permission.addPermission(res.data)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- checkLogin() {
|
|
|
|
|
|
|
+ checkLogin () {
|
|
|
let count = 0
|
|
let count = 0
|
|
|
this.time = setInterval(() => {
|
|
this.time = setInterval(() => {
|
|
|
count = count + 1
|
|
count = count + 1
|
|
@@ -247,7 +247,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
},
|
|
},
|
|
|
- qrCode() {
|
|
|
|
|
|
|
+ qrCode () {
|
|
|
this.$api.login.qrCode().then(res => {
|
|
this.$api.login.qrCode().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.sessionId = res.data
|
|
this.sessionId = res.data
|
|
@@ -255,8 +255,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- codeLogin() {
|
|
|
|
|
- this.$api.login.qrCodeLogin({sessionId: this.sessionId}).then(res => {
|
|
|
|
|
|
|
+ codeLogin () {
|
|
|
|
|
+ this.$api.login.qrCodeLogin({ sessionId: this.sessionId }).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
const tmp = res.data
|
|
const tmp = res.data
|
|
|
console.log(Object.prototype.hasOwnProperty.call(tmp, 'phone'))
|
|
console.log(Object.prototype.hasOwnProperty.call(tmp, 'phone'))
|
|
@@ -288,6 +288,7 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss' scoped>
|
|
<style lang='scss' scoped>
|
|
|
|
|
+//noinspection ALL
|
|
|
.bg {
|
|
.bg {
|
|
|
background-image: url("https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/7667edec62f44063a50c66e8654eaa87.png");
|
|
background-image: url("https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/7667edec62f44063a50c66e8654eaa87.png");
|
|
|
}
|
|
}
|