diff --git a/src/api/trustlogin.js b/src/api/trustlogin.js index 3526cd7..59bc99b 100755 --- a/src/api/trustlogin.js +++ b/src/api/trustlogin.js @@ -14,10 +14,10 @@ export function getTrustLoginList(query) { } // 保存信任登录状态 -export function saveStatusSetting(query) { +export function saveStatusSetting(data) { return fetch({ url: 'members/trustlogin/setting', - method: 'put', - params: query + method: 'post', + params: data }) } diff --git a/src/components/sp-picker/pickers/picker-goodsitem.vue b/src/components/sp-picker/pickers/picker-goodsitem.vue index 2c55ea0..7112148 100755 --- a/src/components/sp-picker/pickers/picker-goodsitem.vue +++ b/src/components/sp-picker/pickers/picker-goodsitem.vue @@ -104,6 +104,7 @@ v-model="formData.distributor_id" clearable :placeholder="$t('3157a2d5.06accf')" + :query-params="{ show_distributor_self: 1 }" @change="onSearch" /> diff --git a/src/i18n/locales/ar.json b/src/i18n/locales/ar.json index 23b72ed..c861d3b 100644 --- a/src/i18n/locales/ar.json +++ b/src/i18n/locales/ar.json @@ -11563,6 +11563,19 @@ "b64b502c.939d53": "تقديم", "b64b502c.3b1083": "تم الحفظ بنجاح", "b64b502c.6de920": "فشل الحفظ", + "b64b502c.f8a201": "Services ID", + "b64b502c.f8a202": "Team ID", + "b64b502c.f8a203": "Key ID", + "b64b502c.f8a204": "المفتاح الخاص (.p8)", + "b64b502c.f8a205": "الصق محتوى ملف .p8 كاملاً (متعدد الأسطر)", + "b64b502c.f8a206": "extra_config", + "b64b502c.f8a207": "تكوين JSON إضافي اختياري", + "b64b502c.f8a208": "app_id", + "b64b502c.f8a209": "secret", + "b64b502c.f8a20a": "يرجى إدخال Services ID", + "b64b502c.f8a20b": "يرجى إدخال Team ID و Key ID", + "b64b502c.f8a20c": "يرجى لصق المفتاح الخاص .p8 كاملاً (متعدد الأسطر)", + "b64b502c.f8a20d": "تنسيق المفتاح الخاص غير صحيح. الصق محتوى PEM كاملاً", "9e8ad576.f48f94": "سبب الرفض", "9e8ad576.714fa9": "اختياري. حتى 50 حرفاً.", "9e8ad576.e83a25": "تأكيد", @@ -12682,6 +12695,9 @@ "ab2cdfe4.8098e2": "الجوال", "ab2cdfe4.60d045": "الاسم", "ab2cdfe4.0d4934": "اسم المتجر", + "ab2cdfe4.f6d738": "رقم المتجر", + "ab2cdfe4.867738": "يرجى إدخال اسم المتجر", + "ab2cdfe4.68f04a": "يرجى إدخال رقم المتجر", "ab2cdfe4.464f3d": "الدور", "ab2cdfe4.b1dae9": "مدير", "ab2cdfe4.710ad0": "معطل", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 7f94192..3968406 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -11563,6 +11563,19 @@ "b64b502c.939d53": "Submit", "b64b502c.3b1083": "Saved successfully", "b64b502c.6de920": "Save failed", + "b64b502c.f8a201": "Services ID", + "b64b502c.f8a202": "Team ID", + "b64b502c.f8a203": "Key ID", + "b64b502c.f8a204": "Private key (.p8)", + "b64b502c.f8a205": "Paste the full .p8 file content (multiple lines allowed)", + "b64b502c.f8a206": "extra_config", + "b64b502c.f8a207": "Optional JSON extra configuration", + "b64b502c.f8a208": "app_id", + "b64b502c.f8a209": "secret", + "b64b502c.f8a20a": "Please enter Services ID", + "b64b502c.f8a20b": "Please enter Team ID and Key ID", + "b64b502c.f8a20c": "Please paste the full .p8 private key (multiple lines allowed)", + "b64b502c.f8a20d": "Invalid private key format. Paste the full PEM content", "9e8ad576.f48f94": "Reason for rejection", "9e8ad576.714fa9": "Optional. Up to 50 characters.", "9e8ad576.e83a25": "Confirm", @@ -12682,6 +12695,9 @@ "ab2cdfe4.8098e2": "Mobile", "ab2cdfe4.60d045": "Name", "ab2cdfe4.0d4934": "Store name", + "ab2cdfe4.f6d738": "Store No.", + "ab2cdfe4.867738": "Please enter store name", + "ab2cdfe4.68f04a": "Please enter store No.", "ab2cdfe4.464f3d": "Role", "ab2cdfe4.b1dae9": "Admin", "ab2cdfe4.710ad0": "Disabled", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 73fe84e..ae3d074 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -11563,6 +11563,19 @@ "b64b502c.939d53": "提交", "b64b502c.3b1083": "保存成功", "b64b502c.6de920": "保存失败", + "b64b502c.f8a201": "Services ID", + "b64b502c.f8a202": "Team ID", + "b64b502c.f8a203": "Key ID", + "b64b502c.f8a204": "私钥 (.p8)", + "b64b502c.f8a205": "直接粘贴 .p8 文件全文(可多行)", + "b64b502c.f8a206": "extra_config", + "b64b502c.f8a207": "可选 JSON 扩展配置", + "b64b502c.f8a208": "app_id", + "b64b502c.f8a209": "secret", + "b64b502c.f8a20a": "请填写 Services ID", + "b64b502c.f8a20b": "请填写 Team ID 和 Key ID", + "b64b502c.f8a20c": "请粘贴完整 .p8 私钥(可多行)", + "b64b502c.f8a20d": "私钥格式不正确,请粘贴完整 PEM 内容", "9e8ad576.f48f94": "拒绝原因", "9e8ad576.714fa9": "非必填项,请填写不超过50字。", "9e8ad576.e83a25": "确认", @@ -12682,6 +12695,9 @@ "ab2cdfe4.8098e2": "手机号", "ab2cdfe4.60d045": "姓名", "ab2cdfe4.0d4934": "店铺名称", + "ab2cdfe4.f6d738": "店铺号", + "ab2cdfe4.867738": "请输入店铺名称", + "ab2cdfe4.68f04a": "请输入店铺号", "ab2cdfe4.464f3d": "角色", "ab2cdfe4.b1dae9": "管理员", "ab2cdfe4.710ad0": "禁用", diff --git a/src/i18n/locales/zh-TW.json b/src/i18n/locales/zh-TW.json index 56f018b..4904c81 100644 --- a/src/i18n/locales/zh-TW.json +++ b/src/i18n/locales/zh-TW.json @@ -12682,6 +12682,9 @@ "ab2cdfe4.8098e2": "手機號", "ab2cdfe4.60d045": "姓名", "ab2cdfe4.0d4934": "店鋪名稱", + "ab2cdfe4.f6d738": "店鋪號", + "ab2cdfe4.867738": "請輸入店鋪名稱", + "ab2cdfe4.68f04a": "請輸入店鋪號", "ab2cdfe4.464f3d": "角色", "ab2cdfe4.b1dae9": "管理員", "ab2cdfe4.710ad0": "禁用", diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 6e64b4e..a752932 100755 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -3,6 +3,7 @@ * See LICENSE file for license details. */ import api from '@/api' +import { decodeJwtPayload } from '@/utils/jwt' const userStore = { namespaced: true, @@ -195,9 +196,7 @@ const userStore = { setToken({ commit }, token) { commit('setToken', token) // 解析token中的user信息,并且保存 - let tokenArray = token.split('.') - let user = atob(tokenArray[1]) - user = JSON.parse(user) + const user = decodeJwtPayload(token) commit('setTokenExp', user.exp) commit('setUserName', user.mobile) commit('setAuthorizer', user.is_authorizer) diff --git a/src/utils/index.js b/src/utils/index.js index 356449b..6a42cfc 100755 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -15,6 +15,8 @@ export * from './src/type-helper' export * from './src/utils' +export * from './jwt' + export { install as VuePrototype } from './src/prototype' // 云店 diff --git a/src/utils/jwt.js b/src/utils/jwt.js new file mode 100644 index 0000000..51308de --- /dev/null +++ b/src/utils/jwt.js @@ -0,0 +1,16 @@ +/** + * Copyright © ShopeX (http://www.shopex.cn). All rights reserved. + * See LICENSE file for license details. + */ + +/** + * 解析 JWT payload(兼容 base64url:- _ 与缺省 padding) + * @param {string} token + * @returns {object} + */ +export function decodeJwtPayload(token) { + const base64Url = String(token || '').split('.')[1] || '' + const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/') + const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=') + return JSON.parse(atob(padded)) +} diff --git a/src/view/auth/login.vue b/src/view/auth/login.vue index 49b49b8..3286b28 100755 --- a/src/view/auth/login.vue +++ b/src/view/auth/login.vue @@ -116,7 +116,7 @@ const login_bg_ecshopx = require(`@/assets/imgs/login-b2b2c.jpg`) const login_bg_free_ecshopx = require(`@/assets/imgs/login-free-ecshopx.jpg`) import { mapMutations } from 'vuex' import { requiredRules, MinRules } from '@/utils/validate' -import { unescape } from '@/utils' +import { decodeJwtPayload, unescape } from '@/utils' import loadingBtn from '@/components/loading-btn' export default { components: { @@ -277,8 +277,7 @@ export default { type: 'success' }) const userInfo = await this.$api.login.getAdminInfo() - let base64Url = token.split('.')[1] - const { menu_type } = JSON.parse(atob(base64Url)) + const { menu_type } = decodeJwtPayload(token) console.log('menu_type', menu_type) this.SET_USERINFO(userInfo) if (this.loginType == 'distributor') { diff --git a/src/view/base/account/storestaff.vue b/src/view/base/account/storestaff.vue index fde962c..5da0f8d 100755 --- a/src/view/base/account/storestaff.vue +++ b/src/view/base/account/storestaff.vue @@ -37,6 +37,12 @@ + + + + + + @@ -69,6 +75,17 @@ + + + + {{ item.shop_code }} + + + import { mapMutations } from 'vuex' -import { unescape } from '@/utils' +import { decodeJwtPayload, unescape } from '@/utils' export default { data() { return { @@ -79,9 +79,8 @@ export default { type: 'success' }) const userInfo = await this.$api.login.getAdminInfo() - let base64Url = token.split('.')[1] // const { menu_type } = await this.$api.wechat.getAuthorizerInfo() - const { menu_type } = JSON.parse(atob(base64Url)) + const { menu_type } = decodeJwtPayload(token) console.log('menu_type', menu_type) this.SET_USERINFO(userInfo) this.SET_LOGIN_TYPE({ loginType: this.loginType || userInfo.logintype }) diff --git a/src/view/mall/trade/shipping/templates.vue b/src/view/mall/trade/shipping/templates.vue index 11e6944..48f9a8d 100755 --- a/src/view/mall/trade/shipping/templates.vue +++ b/src/view/mall/trade/shipping/templates.vue @@ -124,6 +124,17 @@ export default { const refName = refMap[this.activeName] return refName ? this.$refs[refName] : null }, + getActiveTabRef() { + const refMap = { + first: 'buyerTemplates', + second: 'weightTemplates', + third: 'numberTemplates', + fourth: 'priceTemplates', + fifth: 'volumeTemplates' + } + const refName = refMap[this.activeName] + return refName ? this.$refs[refName] : null + }, getList() { const ref = this.getActiveTabRef() if (ref && typeof ref.getShippingTemplatesList === 'function') { diff --git a/src/view/member/trustlogin/list.vue b/src/view/member/trustlogin/list.vue index e569e5f..93b0540 100755 --- a/src/view/member/trustlogin/list.vue +++ b/src/view/member/trustlogin/list.vue @@ -5,102 +5,95 @@ - - - - - - - - {{ $t('b64b502c.224e2c') }} - - - - - - {{ scope.row.name }} - - - - - - - {{ $t('b64b502c.cc42dd') }} - - - {{ $t('b64b502c.b15d91') }} - - - - - - - - - - - - - - {{ $t('b64b502c.224e2c') }} - - - - - - {{ scope.row.name }} - - - - - - - {{ $t('b64b502c.cc42dd') }} - - - {{ $t('b64b502c.b15d91') }} - - - - - - - - - - - - + + + + + + {{ $t('b64b502c.224e2c') }} + + + + + + {{ scope.row.name }} + + + + + + + {{ $t('b64b502c.cc42dd') }} + + + {{ $t('b64b502c.b15d91') }} + + + + + + + + + + + + + + - + + + + + + + + + + + + - + - - + + - - - {{ $t('b64b502c.939d53') }} - - - - - + + + + + + + {{ $t('b64b502c.939d53') }} + + + +