|
@@ -0,0 +1,68 @@
|
|
|
+<template>
|
|
|
+ <div id="login">
|
|
|
+ <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
|
|
|
+ <template v-slot:info>
|
|
|
+ <van-form @submit="onSubmit">
|
|
|
+ <van-field v-model="form.password" type="password" name="password" label="新密码" :rules="[{ required: true, message: '请填写密码' }]" />
|
|
|
+ <div style="margin: 16px">
|
|
|
+ <van-button round block type="info" native-type="submit">提交修改</van-button>
|
|
|
+ </div>
|
|
|
+ </van-form>
|
|
|
+ </template>
|
|
|
+ </admin-frame>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: personal } = createNamespacedHelpers('personal');
|
|
|
+export default {
|
|
|
+ name: 'login',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ adminFrame,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {},
|
|
|
+ methods: {
|
|
|
+ ...personal(['updatePassword']),
|
|
|
+ async onSubmit(values) {
|
|
|
+ let data = { id: this.user.id, password: values.password };
|
|
|
+ let res = await this.updatePassword(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let token = localStorage.removeItem('token');
|
|
|
+ let openid = sessionStorage.removeItem('openid');
|
|
|
+ if (token == undefined && openid == undefined) {
|
|
|
+ this.$toast({ type: 'fail', message: '退出登录成功' });
|
|
|
+ this.$router.push({ path: '/login', query: { path: '/exchange/center/index', type: '1' } });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$toast({ type: `fail`, message: `${res.errmsg}` });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: `/exchange/center/index` });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|