This commit is contained in:
熊成强 2020-11-05 11:49:25 +08:00
parent dd05b91691
commit d936130edd
2 changed files with 13 additions and 15 deletions

View File

@ -19,7 +19,6 @@ export default {
...mapState(['user']) ...mapState(['user'])
}, },
async mounted () { async mounted () {
this.$cookies.set('token', '123', 60)
this.GET_DEPLIST() this.GET_DEPLIST()
}, },
methods: { methods: {
@ -44,7 +43,7 @@ export default {
handleDingtalkLogin (val) { handleDingtalkLogin (val) {
apiDingtalkLogin(val).then(res => { apiDingtalkLogin(val).then(res => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.$cookie.set('token', res.token) this.$cookies.set('token', res.token)
this.dataForm.verify = '登录成功,跳转中...' this.dataForm.verify = '登录成功,跳转中...'
window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code) window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code)
} else { } else {

View File

@ -12,16 +12,9 @@
v-model="input" v-model="input"
clearable> clearable>
</el-input> </el-input>
<el-button @click="handleLogin" type="primary"> </el-button> <el-button @click="handleLogin" type="primary"> </el-button>
<!-- <div style="margin:20px 0;"> <div style="margin:20px 0;">token : {{token}}</div>
<el-input
style="width:400px;"
placeholder="请输入内容"
v-model="verify"
clearable>
</el-input>
<el-button @click="handleVerify" type="primary">获取验证码</el-button>
</div> -->
</div> </div>
</div> </div>
</template> </template>
@ -36,8 +29,9 @@ export default {
return { return {
isShow: false, isShow: false,
islzmanagement, islzmanagement,
input: '', input: localStorage.getItem('input'),
verify: '888888' verify: '888888',
token: this.$cookies.get('token')
} }
}, },
computed: {}, computed: {},
@ -53,9 +47,14 @@ export default {
// console.log('res: ', res) // console.log('res: ', res)
// }, // },
async handleLogin () { async handleLogin () {
localStorage.setItem('input', this.input)
const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify} const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify}
let res = await apiLogin(params) let res = await apiLogin(params)
console.log('res: ', res) if (res.code === 200) {
this.token = res.token
this.$cookies.set('token', res.token, res.expire)
history.go(0)
}
} }
}, },
watch: {} watch: {}