|
|
@@ -5,10 +5,18 @@
|
|
|
<img src="../../assets/logo.png" height="50" />
|
|
|
</h3>
|
|
|
<div class="user-info">
|
|
|
- <i class="el-icon-s-custom"></i>
|
|
|
- <span v-html="user.realName" style="margin-right:10px;"></span>
|
|
|
- <a href="#" @click="openChangePwDialog()" style="margin-right:10px;">修改密码</a>
|
|
|
- <a href="#" @click="logout()">退出</a>
|
|
|
+ <el-dropdown @command="handleCommand">
|
|
|
+ <span class="el-dropdown-link" style="cursor:pointer;">
|
|
|
+ <i class="el-icon-s-custom"></i>
|
|
|
+ <span v-html="user.realName" style="margin-right:10px;"></span>
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="editPwd">修改密码</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="bindWechat">微信绑定</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="exit">退出</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
<div style="position:absolute;bottom:0px;left:255px;right:400px;">
|
|
|
<tags-view />
|
|
|
@@ -74,6 +82,17 @@
|
|
|
<el-button type="primary" @click="changePw">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="扫码绑定微信"
|
|
|
+ :visible.sync="bindWechatVisible"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="340px"
|
|
|
+ >
|
|
|
+ <div v-loading="bindWechatLoading">
|
|
|
+ <img :src="bindWechatUrl" style="width:300px;fit-object:cover;"/>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
@@ -128,7 +147,10 @@ export default {
|
|
|
newPassword: "",
|
|
|
newPasswordTwo: ""
|
|
|
},
|
|
|
- sidebarHeight: window.innerHeight
|
|
|
+ sidebarHeight: window.innerHeight,
|
|
|
+ bindWechatVisible: false,
|
|
|
+ bindWechatUrl: "",
|
|
|
+ bindWechatLoading: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -200,6 +222,33 @@ export default {
|
|
|
self.form.newPasswordTwo = "";
|
|
|
self.dialogFormVisible = false;
|
|
|
this.$refs["form"].resetFields();
|
|
|
+ },
|
|
|
+ openBindWechatDialog() {
|
|
|
+ this.bindWechatVisible = true;
|
|
|
+ this.bindWechatLoading = true;
|
|
|
+
|
|
|
+ userApi.bindWechat(this.user.id).then(response=>{
|
|
|
+ var jsonData = response.data;
|
|
|
+ this.bindWechatLoading = false;
|
|
|
+
|
|
|
+ if(jsonData.result){
|
|
|
+ this.bindWechatUrl = jsonData.data;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$message.warning(jsonData.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCommand(command){
|
|
|
+ if(command=="editPwd"){
|
|
|
+ this.openChangePwDialog();
|
|
|
+ }
|
|
|
+ else if(command=="bindWechat"){
|
|
|
+ this.openBindWechatDialog();
|
|
|
+ }
|
|
|
+ else if(command=="exit"){
|
|
|
+ this.logout();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|