From 20365ba048f4042dfdc223cf2a6fa8c2d5a699f3 Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang <287285524@qq.com>
Date: Tue, 31 Aug 2021 09:42:45 +0800
Subject: [PATCH] 接口修改

---
 src/views/mine/stores/stores-add.vue |    2 
 src/api/index.js                     |  679 +++++++++++++++++++--------------------
 src/views/mine/toggle-identity.vue   |  334 +++++++++---------
 3 files changed, 493 insertions(+), 522 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index 6355ab5..54c2124 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -6,373 +6,348 @@
  * @LastEditTime: 2021-01-04 09:34:57
  */
 
-import $http from './config';
-import oldapi from './oldapi';
-
+import $http from "./config";
+import oldapi from "./oldapi";
 
 const api = {
-    ...oldapi,
-    // 获取微信配置
-    getTokenInfo(data) {
-        data.apploading = 1;
-        return $http.post('/wechat/getSign', data);
-    },
-    // 获取微信token
-    getWeChatUserInfo(data) {
-        return $http.post('/wechat/userInfo', data);
-    },
-    setUserOpenId(data) {
-        return Service.post('/wechat/binding', data);
-    },
-    //token登陆
-    loginByToken(data) {
-        return $http.post('/login/loginByToken', data);
-    },
-    loginByMerToken(data){
-        return $http.post('/login/loginByMerToken',data);
-    },
-    //登陆
-    login(data) {
-        return $http.post('/login/login', data);
-    },
-    //登出
-    logout(data) {
-        return $http.post('/login/logout', data);
-    },
-    // 获取角色列表
-    getRole(data) {
-        return $http.post('/user/getUserMgrInfo', data);
-    },
-    getAgencyMerList(data){
-        return $http.post('/user/getAgencyMerList',data)
-    },
-    // 获取用户信息
-    getPowerInfo(mgrId) {
-        return $http.post('/user/mgr/powerInfo', {
-            mgrId
-        });
-    },
-    // 账户管理——获取用户信息
-    getUserDetail(mgrId) {
-        return $http.post('/user/mgr/detail', {
-            mgrId
-        });
-    },
-    //修改密码
-    userUpdatePwd(data) {
-      return $http.post('/user/updatePwd', data);
-    },
-    //获取验证码
-    userSendMsg(data) {
-      return $http.post('/user/sendMsg', data);
-    },
-    //忘记密码
-      userForgetPwd(data) {
-        return $http.post('/user/forgetPwd', data);
-      },
+  ...oldapi,
+  // 获取微信配置
+  getTokenInfo(data) {
+    data.apploading = 1;
+    return $http.post("/wechat/getSign", data);
+  },
+  // 获取微信token
+  getWeChatUserInfo(data) {
+    return $http.post("/wechat/userInfo", data);
+  },
+  setUserOpenId(data) {
+    return Service.post("/wechat/binding", data);
+  },
+  //token登陆
+  loginByToken(data) {
+    return $http.post("/login/loginByToken", data);
+  },
+  loginByMerToken(data) {
+    return $http.post("/login/loginByMerToken", data);
+  },
+  //登陆
+  login(data) {
+    return $http.post("/login/hwf/login", data);
+  },
+  //登出
+  logout(data) {
+    return $http.post("/login/logout", data);
+  },
+  // 获取角色列表
+  getRole(data) {
+    return $http.post("/user/hwf/getUserMgrInfo", data);
+  },
+  getAgencyMerList(data) {
+    return $http.post("/user/getAgencyMerList", data);
+  },
+  // 获取用户信息
+  getPowerInfo(mgrId) {
+    return $http.post("/user/mgr/powerInfo", {
+      mgrId,
+    });
+  },
+  // 账户管理——获取用户信息
+  getUserDetail(mgrId) {
+    return $http.post("/user/mgr/detail", {
+      mgrId,
+    });
+  },
+  //修改密码
+  userUpdatePwd(data) {
+    return $http.post("/user/updatePwd", data);
+  },
+  //获取验证码
+  userSendMsg(data) {
+    return $http.post("/user/sendMsg", data);
+  },
+  //忘记密码
+  userForgetPwd(data) {
+    return $http.post("/user/forgetPwd", data);
+  },
 
+  // 获取地区列表/sib/public/cmccAreaList
+  // getArea() {获取所有省市区列表
+  //     let data = {
+  //         apploading:1
+  //     };
+  //     return $http.post('/public/areaList',data);
+  // },
+  getArea() {
+    let data = {
+      apploading: 1,
+    };
+    return $http.post("/public/cmccAreaList", data);
+  },
 
+  // 获取机构拥有的地区列表
+  getOrgAreaInfo(orgType) {
+    let data = {
+      apploading: 1,
+      orgType,
+    };
+    return $http.post("/public/getOrgAreaInfo", data);
+  },
+  /**
+   * 渠道相关
+   */
+  //列表
+  getChannel() {
+    return $http.post("/chan/chanList");
+  },
+  //添加
+  addChan(data) {
+    return $http.post("/chan/addChan", data);
+  },
+  //切换状态
+  channSwitchStatus(data) {
+    return $http.post("/chan/switchStatus", data);
+  },
+  //更新渠道详细信息
+  updateChan(data) {
+    return $http.post("/chan/updateChan", data);
+  },
+  //查看/加载渠道详细信息
+  getChannelInfo(chanId) {
+    return $http.post("/chan/viewChanInf", { chanId });
+  },
 
-    // 获取地区列表/sib/public/cmccAreaList
-    // getArea() {获取所有省市区列表
-    //     let data = {
-    //         apploading:1
-    //     };
-    //     return $http.post('/public/areaList',data);
-    // },
-    getArea() {
-        let data = {
-            apploading:1
-        };
-        return $http.post('/public/cmccAreaList',data);
-    },
+  // 获取审批列表
+  getAuditList(data) {
+    return $http.post("/merchant/auditList", data);
+  },
+  //审批商户
+  merAudit(data) {
+    return $http.post("/merchant/audit", data);
+  },
 
-    // 获取机构拥有的地区列表
-    getOrgAreaInfo(orgType) {
-        let data = {
-            apploading:1,
-            orgType
-        };
-        return  $http.post('/public/getOrgAreaInfo', data);
-    },
-    /**
-     * 渠道相关
-     */
-    //列表
-    getChannel() {
-        return $http.post('/chan/chanList');
-    },
-    //添加
-    addChan(data) {
-        return $http.post('/chan/addChan', data);
-    },
-    //切换状态
-    channSwitchStatus(data) {
-        return $http.post('/chan/switchStatus', data);
-    },
-    //更新渠道详细信息
-    updateChan(data) {
-        return $http.post('/chan/updateChan', data);
-    },
-    //查看/加载渠道详细信息
-    getChannelInfo(chanId) {
-        return $http.post('/chan/viewChanInf', {chanId});
-    },
+  // /merchant/auditList
 
-    // 获取审批列表
-    getAuditList(data) {
-        return $http.post('/merchant/auditList', data);
-    },
-    //审批商户
-    merAudit(data){
-        return $http.post('/merchant/audit', data);
-    },
+  getAuditType(data) {
+    return $http.post("/merchant/auditType", data);
+  },
+  setAuditType(data) {
+    return $http.post("/merchant/setAuditType", data);
+  },
 
-    // /merchant/auditList
+  /**
+   * 门店管理相关
+   */
+  //门店列表
+  storeStoreList(data) {
+    return $http.post("/store/storeList", data);
+  },
+  storeStorePersonList(data) {
+    return $http.post("/agency/userList", data);
+  },
+  //门店详情
+  storeDtl(data) {
+    return $http.post("/store/dtl", data);
+  },
+  //编辑门店
+  storeEdit(data) {
+    return $http.post("/store/edit", data);
+  },
+  //添加门店
+  storeAdd(data) {
+    return $http.post("/store/add", data);
+  },
+  agencyAddUser(data) {
+    return $http.post("/agency/addUser", data);
+  },
 
-    getAuditType(data){
-        return $http.post('/merchant/auditType', data);
-    },
-    setAuditType(data){
-        return $http.post('/merchant/setAuditType', data);
-    },
+  // 数据查询相关
+  //获取产品列表
+  getProductList(data) {
+    return $http.post("/prod/typeList", data);
+  },
 
+  // 获取订单初始化数据
+  getOrderInit(data) {
+    return $http.post("/order/init", data);
+  },
 
-    /**
-     * 门店管理相关
-     */
-    //门店列表
-    storeStoreList(data) {
-        return $http.post('/store/storeList', data);
-    },
-    storeStorePersonList(data) {
-        return $http.post('/agency/userList', data);
-    },
-    //门店详情
-    storeDtl(data) {
-        return $http.post('/store/dtl', data);
-    },
-    //编辑门店
-    storeEdit(data) {
-        return $http.post('/store/edit', data);
-    },
-    //添加门店
-    storeAdd(data) {
-        return $http.post('/store/add', data);
-    },
-    agencyAddUser(data){
-        return $http.post('/agency/addUser', data); 
-    },
+  // 账号管理——列表
+  getMgrList(data) {
+    return $http.post("/user/getMgrList", data);
+  },
+  // 账户管理——冻结账户
+  userFreezeMgr(mgrId) {
+    return $http.post("/user/freezeMgr", { mgrId });
+  },
+  // 账户管理——增加账户
+  userAdd(data) {
+    return $http.post("/user/add", data);
+  },
+  // 账户管理——更新账户信息
+  userUpdate(data) {
+    return $http.post("/user/update", data);
+  },
 
+  // 花呗订单列表
+  getHBList(data) {
+    return $http.post("/order/hbList", data);
+  },
+  // 获取花呗订单详情
+  getHBDetail(orderId) {
+    return $http.post("/order/hbOrderDtl", { orderId });
+  },
+  // 花呗订单——退款
+  hbOrderRefund(data) {
+    return $http.post("/hbOrder/refund", data);
+  },
+  // 花呗——订单导出
+  hbExport(data) {
+    return $http.post("/order/hbExport", data);
+  },
+  // 获取产品订单金额统计
+  getAmtReport(prodId) {
+    return $http.post("/order/amtReport", { prodId });
+  },
+  //获取周次商户统计
+  getMerWeeksReport() {
+    return $http.post("/merchant/weeksReport");
+  },
+  // 商户统计
+  getMerReport(data) {
+    return $http.post("/merchant/report", data);
+  },
+  // 获取订单统计
+  getOrderReport(data) {
+    return $http.post("/order/report", data);
+  },
 
+  //获取商户列表
+  merList(data) {
+    return $http.post("/merchant/list", data);
+  },
+  //商户详情
+  merDetail(data) {
+    return $http.post("/merchant/merDetail", data);
+  },
+  //商户照片信息
+  merFile(data) {
+    return $http.post("/merchant/file", data);
+  },
+  //商户列表导出
+  merExport(data) {
+    return $http.post("/merchant/export", data);
+  },
+  getUnAuditNb(data) {
+    return $http.post("/merchant/unAuditNb", data);
+  },
+  // 信用卡分期订单
+  getCreditOrderList(data) {
+    return $http.post("/order/list", data);
+  },
+  // 信用卡分期 导出
+  creditExport(data) {
+    return $http.post("/order/export", data);
+  },
+  // 信用卡分期 详情
+  getCreditDetail(orderId) {
+    return $http.post("/order/orderDtl", { orderId });
+  },
 
+  //商户注册
+  merRegist(data) {
+    return $http.post("/user/hwf/regist", data);
+  },
+  // 商户筛选条件初始化
+  merInitFilter(data) {
+    return $http.post("/merchant/initFilter", data);
+  },
 
+  // 模板列表
+  getTempList(data) {
+    return $http.post("/temp/tempList", data);
+  },
+  // 模板 初始化数据
+  // getTempInit(){
+  //     return $http.post('/temp/init');
+  // },
+  getTempInit(data) {
+    return $http.post("/tempManager/init", data);
+  },
+  // 模板详情
+  // getTempDetail(tempId){
+  //     return $http.post('/temp/detail',{tempId});
+  // },
+  getTempDetail(tempId) {
+    return $http.post("/tempManager/detail", { tempId });
+  },
+  //模板——保存
+  // tempSave(data){
+  //     return $http.post('/temp/save',data);
+  // },
+  tempSave(data) {
+    return $http.post("/tempManager/save", data);
+  },
+  tempManagerUpdate(data) {
+    return $http.post("/tempManager/update", data);
+  },
+  //模板——商户保存
+  tempSaveMerTemp(data) {
+    return $http.post("/temp/saveMerTemp", data);
+  },
+  getTempMerRef(data) {
+    return $http.post("/temp/getTempMerRef", data);
+  },
+  tempGetMerRef(data) {
+    return $http.post("/temp/getMerRef", data);
+  },
+  //模板——商户列表
+  getTempMerList(data) {
+    return $http.post("/temp/tempMerList", data);
+  },
+  //模板 保存商户分配模板
+  saveMerListTemp(data) {
+    return $http.post("/temp/saveMerListTemp", data);
+  },
 
-
-
-
-
-    // 数据查询相关
-    //获取产品列表
-    getProductList(data) {
-        return $http.post('/prod/typeList', data);
-    },
-
-    // 获取订单初始化数据
-    getOrderInit(data) {
-        return $http.post('/order/init', data);
-    },
-
-
-
-
-
-    // 账号管理——列表
-    getMgrList(data) {
-        return $http.post('/user/getMgrList', data);
-    },
-    // 账户管理——冻结账户
-    userFreezeMgr(mgrId){
-        return $http.post('/user/freezeMgr', {mgrId});
-    },
-    // 账户管理——增加账户
-    userAdd(data){
-        return $http.post('/user/add', data);
-    },
-    // 账户管理——更新账户信息
-    userUpdate(data){
-        return $http.post('/user/update', data);
-    },
-
-    // 花呗订单列表
-    getHBList(data){
-        return $http.post('/order/hbList', data);
-    },
-    // 获取花呗订单详情
-    getHBDetail(orderId){
-        return $http.post('/order/hbOrderDtl', {orderId});
-    },
-    // 花呗订单——退款
-    hbOrderRefund(data){
-        return $http.post('/hbOrder/refund', data);
-    },
-    // 花呗——订单导出
-    hbExport(data){
-        return $http.post('/order/hbExport', data);
-    },
-    // 获取产品订单金额统计
-    getAmtReport(prodId){
-        return $http.post('/order/amtReport', {prodId});
-    },
-    //获取周次商户统计
-    getMerWeeksReport(){
-        return $http.post('/merchant/weeksReport');
-    },
-    // 商户统计
-    getMerReport(data){
-        return $http.post('/merchant/report',data);
-    },
-    // 获取订单统计
-    getOrderReport(data){
-        return $http.post('/order/report',data);
-    },
-
-
-
-
-
-
-    //获取商户列表
-    merList(data) {
-        return $http.post('/merchant/list', data);
-    },
-    //商户详情
-    merDetail(data) {
-        return $http.post('/merchant/merDetail', data);
-    },
-    //商户照片信息
-    merFile(data) {
-        return $http.post('/merchant/file', data);
-    },
-    //商户列表导出
-    merExport(data) {
-        return $http.post('/merchant/export', data);
-    },
-    getUnAuditNb(data){
-        return $http.post('/merchant/unAuditNb',data);
-    },
-    // 信用卡分期订单
-    getCreditOrderList(data){
-        return $http.post('/order/list', data);
-    },
-    // 信用卡分期 导出
-    creditExport(data){
-        return $http.post('/order/export', data);
-    },
-    // 信用卡分期 详情
-    getCreditDetail(orderId){
-        return $http.post('/order/orderDtl', {orderId});
-    },
-
-
-
-
-
-    //商户注册
-    merRegist(data) {
-        return $http.post('/user/regist', data);
-    },
-    // 商户筛选条件初始化
-    merInitFilter(data){
-        return $http.post('/merchant/initFilter', data);
-    },
-
-    // 模板列表
-    getTempList(data){
-        return $http.post('/temp/tempList', data);
-    },
-    // 模板 初始化数据
-    // getTempInit(){
-    //     return $http.post('/temp/init');
-    // },
-    getTempInit(data){
-        return $http.post('/tempManager/init',data);
-    },
-    // 模板详情
-    // getTempDetail(tempId){
-    //     return $http.post('/temp/detail',{tempId});
-    // },
-    getTempDetail(tempId){
-        return $http.post('/tempManager/detail',{tempId});
-    },
-    //模板——保存
-    // tempSave(data){
-    //     return $http.post('/temp/save',data);
-    // },
-    tempSave(data){
-        return $http.post('/tempManager/save',data);
-    },
-    tempManagerUpdate(data){
-        return $http.post('/tempManager/update',data)
-    },
-    //模板——商户保存
-    tempSaveMerTemp(data){
-        return $http.post('/temp/saveMerTemp',data);
-    },
-    getTempMerRef(data){
-        return $http.post('/temp/getTempMerRef',data);
-    },
-    tempGetMerRef(data){
-        return $http.post('/temp/getMerRef',data);
-    },
-    //模板——商户列表
-    getTempMerList(data){
-        return $http.post('/temp/tempMerList',data);
-    },
-    //模板 保存商户分配模板
-    saveMerListTemp(data){
-        return $http.post('/temp/saveMerListTemp',data);
-    },
-
-    // 微信扫码登录
-    loginByOpenId(data){
-        return $http.post('/login/loginByOpenId',data)
-    },//openid登录
-    checkOpenIdIsBind(data){
-        return $http.post('/user/checkOpenIdIsBind',data)
-    },//判断是否绑定openId
-    userAddStoreManager(data){
-        return $http.post('/user/addStoreManager',data)
-    },//资料补充
-    // ===========宁夏移动接入调整借口===============
-    // 查询业务归属省份
-    findProvNo(data){
-        return $http.post('/cmccWxpay/findProvNo',data)
-    },
-    //创建订单并且返回二维码/cmccWxpay/nx/create
-    nxCreate(data){
-        return $http.post('/cmccWxpay/nx/create',data)
-    },
-    // 生成二维码初始化/sib/cmccWxpay/nx/init
-    nxInit(data){
-        return $http.post('/cmccWxpay/nx/init',data)
-    },
-    // // 授权结果推送/cmccWxpay/nx/pushOrderStatus
-    // pushOrderStatus(data){
-    //     return $http.post('/cmccWxpay/nx/pushOrderStatus',data)
-    // },
-    // // 返销/cmccWxpay/nx/refund
-    // nxRefund(data){
-    //     return $http.post('/cmccWxpay/nx/refund',data)
-    // },
-    // 检验手机号是否可用/cmccWxpay/nx/verifyMblNo
-    nxVerifyMblNo(data){
-        return $http.post('/cmccWxpay/nx/verifyMblNo',data)
-    },
-}
+  // 微信扫码登录
+  loginByOpenId(data) {
+    return $http.post("/login/loginByOpenId", data);
+  }, //openid登录
+  checkOpenIdIsBind(data) {
+    return $http.post("/user/checkOpenIdIsBind", data);
+  }, //判断是否绑定openId
+  userAddStoreManager(data) {
+    return $http.post("/user/addStoreManager", data);
+  }, //资料补充
+  // ===========宁夏移动接入调整借口===============
+  // 查询业务归属省份
+  findProvNo(data) {
+    return $http.post("/cmccWxpay/findProvNo", data);
+  },
+  //创建订单并且返回二维码/cmccWxpay/nx/create
+  nxCreate(data) {
+    return $http.post("/cmccWxpay/nx/create", data);
+  },
+  // 生成二维码初始化/sib/cmccWxpay/nx/init
+  nxInit(data) {
+    return $http.post("/cmccWxpay/nx/init", data);
+  },
+  // // 授权结果推送/cmccWxpay/nx/pushOrderStatus
+  // pushOrderStatus(data){
+  //     return $http.post('/cmccWxpay/nx/pushOrderStatus',data)
+  // },
+  // // 返销/cmccWxpay/nx/refund
+  // nxRefund(data){
+  //     return $http.post('/cmccWxpay/nx/refund',data)
+  // },
+  // 检验手机号是否可用/cmccWxpay/nx/verifyMblNo
+  nxVerifyMblNo(data) {
+    return $http.post("/cmccWxpay/nx/verifyMblNo", data);
+  },
+};
 
 export default {
-    install(Vue, opt) {
-        Vue.prototype.$api = api;
-    }
-}
+  install(Vue, opt) {
+    Vue.prototype.$api = api;
+  },
+};
diff --git a/src/views/mine/stores/stores-add.vue b/src/views/mine/stores/stores-add.vue
index 11ef058..ce577ae 100644
--- a/src/views/mine/stores/stores-add.vue
+++ b/src/views/mine/stores/stores-add.vue
@@ -12,7 +12,7 @@
           <div v-if="form.areaText">{{ form.areaText }}</div>
           <div v-else style="color: #a2a2a2">请选择</div>
           <svg class="icon" aria-hidden="true" style="width:18px;height:18px;fill:#999;">
-            <use xlink:href="#iconyou"></use>
+            <use xlink:href="#iconyou" />
           </svg>
         </div>
       </v-cell>
diff --git a/src/views/mine/toggle-identity.vue b/src/views/mine/toggle-identity.vue
index b0c8ed3..af8d046 100644
--- a/src/views/mine/toggle-identity.vue
+++ b/src/views/mine/toggle-identity.vue
@@ -6,185 +6,181 @@
  * @Description: 切换身份页面
  -->
 <template>
-    <div class="identity-box">
-        <v-navbar :title="$route.query.title" fixed></v-navbar>
-        <section class="role-box" v-for="(item, index) in roleList" :key="index">
-            <van-radio-group v-if="item.arr.length"  v-model="roleId">
-                <h4 class="title">{{item.title}}</h4>
-                <div class="flex-between-g role-item" v-for="(role, k) in item.arr" :key="k">
-                    <div class="left">
-                        <p class="flex-start-g">
-                            <svg class="icon" aria-hidden="true" style="width:15px;height:15px;">
-                                <use xlink:href="#iconyonghu"></use>
-                            </svg>
-                            <span class="name">{{role.orgName}}</span>
-                        </p>
-                        <p class="flex-start-g">
-                            <svg class="icon" aria-hidden="true"  style="width:15px;height:15px;">
-                                <use xlink:href="#iconshijian"></use>
-                            </svg>
-                            <time class='time'>创建时间:{{role.creTime | timeformat('yyyy-MM-dd HH:mm:ss')}}</time>
-                        </p>
-                    </div>
-                    <div @click="setRole(role)" v-if="role.status == 1 && role.supStatus == 1" >
-                        <van-radio :name="role.id" :checked-color="$store.state.backColor"  />
-                    </div>
-                </div>
-            </van-radio-group>
-        </section>
-        <van-button class="btn-login" :color="$store.state.backColor" @click="getRoleInfo">登录</van-button>
-    </div>
+  <div class="identity-box">
+    <v-navbar :title="$route.query.title" fixed></v-navbar>
+    <section class="role-box" v-for="(item, index) in roleList" :key="index">
+      <van-radio-group v-if="item.arr.length" v-model="roleId">
+        <h4 class="title">{{ item.title }}</h4>
+        <div class="flex-between-g role-item" v-for="(role, k) in item.arr" :key="k">
+          <div class="left">
+            <p class="flex-start-g">
+              <svg class="icon" aria-hidden="true" style="width:15px;height:15px;">
+                <use xlink:href="#iconyonghu"></use>
+              </svg>
+              <span class="name">{{ role.orgName }}</span>
+            </p>
+            <p class="flex-start-g">
+              <svg class="icon" aria-hidden="true" style="width:15px;height:15px;">
+                <use xlink:href="#iconshijian"></use>
+              </svg>
+              <time class="time">创建时间:{{ role.creTime | timeformat("yyyy-MM-dd HH:mm:ss") }}</time>
+            </p>
+          </div>
+          <div @click="setRole(role)" v-if="role.status == 1 && role.supStatus == 1">
+            <van-radio :name="role.id" :checked-color="$store.state.backColor" />
+          </div>
+        </div>
+      </van-radio-group>
+    </section>
+    <van-button class="btn-login" :color="$store.state.backColor" @click="getRoleInfo">登录</van-button>
+  </div>
 </template>
 
 <script>
-import { mapActions, mapState } from 'vuex';
-    export default {
-        data() {
-            return {
-                roleList: [],//角色列表
-                roleId: '',//radio的value
-                role:null //当前选中的角色
-            }
+import { mapActions, mapState } from "vuex";
+export default {
+  data() {
+    return {
+      roleList: [], //角色列表
+      roleId: "", //radio的value
+      role: null, //当前选中的角色
+    };
+  },
+  computed: {
+    ...mapState(["userinfo"]),
+  },
+  created() {
+    this.roleId = this.userinfo.id;
+    if (sessionStorage.isLoginByOpenId == 1) {
+      this.roleList = [
+        {
+          title: "门店",
+          arr: JSON.parse(localStorage.storeList),
         },
-        computed:{
-            ...mapState(['userinfo'])
-        },
-        created() {
-            this.roleId = this.userinfo.id;
-            if(sessionStorage.isLoginByOpenId == 1){
-                this.roleList = [{
-                    title:'门店',
-                    arr:JSON.parse(localStorage.storeList) 
-                }]
-            }else{
-                this.getRole();
-            }
-            
-        },
-        methods: {
-            ...mapActions(['setUserMenu']),
-            // 设置当前选中的角色
-            setRole(role){
-                this.role = role;
-            },
-            // 获取角色
-            getRole() {
-                this.$api.getRole().then((res) => {
-                    let {
-                        agencyList,
-                        chanList,
-                        merchantList,
-                        storeList
-                    } = res.body;
-                    this.roleList.push({
-                        title:'代理',
-                        arr:agencyList || []
-                    });
-                    this.roleList.push({
-                        title:'渠道',
-                        arr:chanList || []
-                    });
-                    this.roleList.push({
-                        title:'商户',
-                        arr:merchantList || []
-                    });
-                    this.roleList.push({
-                        title:'门店',
-                        arr:storeList || []
-                    });
-
-                }).catch((err) => {
-
-                });
-            },
-            // 获取用户信息
-            getRoleInfo(){
-                if(!this.roleId){
-                     this.$notify('请选择登录角色');
-                    return
-                }
-                this.setUserMenu({
-                    vm:this,
-                    lastLoginMgrId:this.roleId,
-                })
-                // this.$api.getPowerInfo(this.roleId).then((res) => {
-
-                // }).catch((err) => {
-
-                // });
-            }
-        },
+      ];
+    } else {
+      this.getRole();
     }
+  },
+  methods: {
+    ...mapActions(["setUserMenu"]),
+    // 设置当前选中的角色
+    setRole(role) {
+      this.role = role;
+    },
+    // 获取角色
+    getRole() {
+      this.$api
+        .getRole()
+        .then((res) => {
+          let { agencyList, chanList, merchantList, storeList } = res.body;
+          this.roleList.push({
+            title: "代理",
+            arr: agencyList || [],
+          });
+          this.roleList.push({
+            title: "渠道",
+            arr: chanList || [],
+          });
+          this.roleList.push({
+            title: "商户",
+            arr: merchantList || [],
+          });
+          this.roleList.push({
+            title: "门店",
+            arr: storeList || [],
+          });
+        })
+        .catch((err) => {});
+    },
+    // 获取用户信息
+    getRoleInfo() {
+      if (!this.roleId) {
+        this.$notify("请选择登录角色");
+        return;
+      }
+      this.setUserMenu({
+        vm: this,
+        lastLoginMgrId: this.roleId,
+      });
+      // this.$api.getPowerInfo(this.roleId).then((res) => {
+
+      // }).catch((err) => {
+
+      // });
+    },
+  },
+};
 </script>
 
 <style lang="less" scoped>
-    .identity-box {
-        background-color: @c-bg-f5;
-        min-height: 100%;
-        padding-top: 44px;
-        padding-bottom: 30px;
+.identity-box {
+  background-color: @c-bg-f5;
+  min-height: 100%;
+  padding-top: 44px;
+  padding-bottom: 30px;
+}
+
+.role-box {
+  .title {
+    .lh(30px);
+    margin-left: 20px;
+    margin-top: 15px;
+    color: @c-text-999;
+    font-size: @font-14;
+  }
+
+  .role-item {
+    padding: 0 12px;
+    background-color: @c-bg-fff;
+    margin: 0 8px 1px;
+    border-radius: 3px;
+  }
+
+  .left {
+    height: 75px;
+    .flex(center, flex-start, wrap, column);
+
+    p:first-child {
+      margin-bottom: 10px;
     }
 
-    .role-box {
-        .title {
-            .lh(30px);
-            margin-left: 20px;
-            margin-top: 15px;
-            color: @c-text-999;
-            font-size: @font-14;
-        }
-
-        .role-item {
-            padding: 0 12px;
-            background-color: @c-bg-fff;
-            margin: 0 8px 1px;
-            border-radius: 3px;
-        }
-
-        .left {
-            height: 75px;
-            .flex(center, flex-start, wrap, column);
-
-            p:first-child {
-                margin-bottom: 10px;
-            }
-
-            .icon {
-                margin-right: 8px;
-            }
-        }
-
-        .name {
-            width: 200px;
-            font-size: @font-16;
-            font-weight: bold;
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-        }
-
-        .time {
-            font-size: @font-12;
-            color: @c-text-999;
-        }
-
-        .circle {
-            height: 18px;
-            width: 18px;
-            margin-right: 2px;
-            border-radius: 50%;
-            background-color: #fff;
-            border: 2px solid @c-default;
-        }
+    .icon {
+      margin-right: 8px;
     }
+  }
 
-    .btn-login {
-        display: block;
-        .lh(44px);
-        width: 320px;
-        margin: 25px auto 0;
-        background-color: @c-bg-default;
-        color: @c-text-fff;
-        border-radius: 22px;
-    }
+  .name {
+    width: 200px;
+    font-size: @font-16;
+    font-weight: bold;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+
+  .time {
+    font-size: @font-12;
+    color: @c-text-999;
+  }
+
+  .circle {
+    height: 18px;
+    width: 18px;
+    margin-right: 2px;
+    border-radius: 50%;
+    background-color: #fff;
+    border: 2px solid @c-default;
+  }
+}
+
+.btn-login {
+  display: block;
+  .lh(44px);
+  width: 320px;
+  margin: 25px auto 0;
+  background-color: @c-bg-default;
+  color: @c-text-fff;
+  border-radius: 22px;
+}
 </style>

--
Gitblit v1.8.0