|
@@ -116,12 +116,6 @@
|
|
this.getQwCode()
|
|
this.getQwCode()
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- const params = new URLSearchParams(window.location.search)
|
|
|
|
- const state = params.get('state')
|
|
|
|
- const code = params.get('code')
|
|
|
|
- if (state === 'WWLogin' && code) {
|
|
|
|
- this.doLogin({ code })
|
|
|
|
- }
|
|
|
|
window.addEventListener('keyup', this.enterClick)
|
|
window.addEventListener('keyup', this.enterClick)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -173,22 +167,6 @@
|
|
this.valHandler()
|
|
this.valHandler()
|
|
}).post()
|
|
}).post()
|
|
},
|
|
},
|
|
- doLogin ({ code }) {
|
|
|
|
- this.$request("/login").data({ wxCode: code }).success((r) => {
|
|
|
|
- // 设置登录
|
|
|
|
- this.$store.dispatch('login', r.data);
|
|
|
|
- // 重新初始化系统
|
|
|
|
- this.$request("/load").success((r) => {
|
|
|
|
- this.$store.dispatch('initialize', r.data)
|
|
|
|
- setTitle(this.$route)
|
|
|
|
- }).error(() => {
|
|
|
|
- this.$Notice.error({title: '系统初始化发送异常', desc: r.info, duration: 5})
|
|
|
|
- this.$store.dispatch('logout');
|
|
|
|
- }).get();
|
|
|
|
- }).error(() => {
|
|
|
|
- this.$Message.error({content: '企业微信登录异常'})
|
|
|
|
- }).post()
|
|
|
|
- },
|
|
|
|
handleSubmit(name) {
|
|
handleSubmit(name) {
|
|
let _this = this;
|
|
let _this = this;
|
|
this.$refs[name].validate((valid) => {
|
|
this.$refs[name].validate((valid) => {
|