优化
This commit is contained in:
parent
dd05b91691
commit
d936130edd
@ -19,7 +19,6 @@ export default {
|
||||
...mapState(['user'])
|
||||
},
|
||||
async mounted () {
|
||||
this.$cookies.set('token', '123', 60)
|
||||
this.GET_DEPLIST()
|
||||
},
|
||||
methods: {
|
||||
@ -44,7 +43,7 @@ export default {
|
||||
handleDingtalkLogin (val) {
|
||||
apiDingtalkLogin(val).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$cookie.set('token', res.token)
|
||||
this.$cookies.set('token', res.token)
|
||||
this.dataForm.verify = '登录成功,跳转中...'
|
||||
window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code)
|
||||
} else {
|
||||
|
||||
@ -12,16 +12,9 @@
|
||||
v-model="input"
|
||||
clearable>
|
||||
</el-input>
|
||||
<el-button @click="handleLogin" type="primary">登 陆</el-button>
|
||||
<!-- <div style="margin:20px 0;">
|
||||
<el-input
|
||||
style="width:400px;"
|
||||
placeholder="请输入内容"
|
||||
v-model="verify"
|
||||
clearable>
|
||||
</el-input>
|
||||
<el-button @click="handleVerify" type="primary">获取验证码</el-button>
|
||||
</div> -->
|
||||
<el-button @click="handleLogin" type="primary">登 陆</el-button>
|
||||
<div style="margin:20px 0;">token : {{token}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -36,8 +29,9 @@ export default {
|
||||
return {
|
||||
isShow: false,
|
||||
islzmanagement,
|
||||
input: '',
|
||||
verify: '888888'
|
||||
input: localStorage.getItem('input'),
|
||||
verify: '888888',
|
||||
token: this.$cookies.get('token')
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
@ -53,9 +47,14 @@ export default {
|
||||
// console.log('res: ', res)
|
||||
// },
|
||||
async handleLogin () {
|
||||
localStorage.setItem('input', this.input)
|
||||
const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify}
|
||||
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: {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user