소스 검색

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

liaofei 2 년 전
부모
커밋
cde78adae0

+ 6 - 0
template/admin/package-lock.json

@@ -15642,6 +15642,12 @@
       "integrity": "sha1-a9KZwTsMRiay2iwDk81DhdYGrLk=",
       "dev": true
     },
+    "jsencrypt": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmmirror.com/jsencrypt/-/jsencrypt-3.3.2.tgz",
+      "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==",
+      "dev": true
+    },
     "jsesc": {
       "version": "2.5.2",
       "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz",

+ 1 - 0
template/admin/package.json

@@ -100,6 +100,7 @@
     "eslint-plugin-prettier": "^3.4.1",
     "eslint-plugin-vue": "^7.2.0",
     "iview-loader": "^1.3.0",
+    "jsencrypt": "^3.3.2",
     "less": "^2.7.3",
     "less-loader": "^4.1.0",
     "lint-staged": "^6.0.0",

+ 11 - 0
template/admin/src/components/verifition/utils/ase.js

@@ -9,3 +9,14 @@ export function aesEncrypt(word, keyWord = 'XwKsGlMcdPMEhR1B') {
   var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
   return encrypted.toString();
 }
+
+/**
+ * @word hash256要加密的内容
+ * @keyWord String  服务器随机返回的关键字
+ *  */
+export function aesEncryptHash(word, keyWord = 'XwKsGlMcdPMEhR1B') {
+  var key = CryptoJS.enc.Utf8.parse(keyWord);
+  var srcs = CryptoJS.enc.Utf8.parse(word);
+  var encrypted = CryptoJS.HmacSHA256(srcs, key);
+  return CryptoJS.enc.Hex.stringify(encrypted);
+}

+ 0 - 37
template/admin/src/locale/index.js

@@ -1,37 +0,0 @@
-import Vue from 'vue';
-import VueI18n from 'vue-i18n';
-import { localRead } from '@/libs/util';
-import customZhCn from './lang/zh-CN';
-import customZhTw from './lang/zh-TW';
-import customEnUs from './lang/en-US';
-import zhCnLocale from 'iview/src/locale/lang/zh-CN';
-import enUsLocale from 'iview/src/locale/lang/en-US';
-import zhTwLocale from 'iview/src/locale/lang/zh-TW';
-
-Vue.use(VueI18n);
-
-// 自动根据浏览器系统语言设置语言
-const navLang = navigator.language;
-const localLang = navLang === 'zh-CN' || navLang === 'en-US' ? navLang : false;
-let lang = localLang || localRead('local') || 'zh-CN';
-
-Vue.config.lang = lang;
-
-// vue-i18n 6.x+写法
-Vue.locale = () => {};
-const messages = {
-  'zh-CN': Object.assign(zhCnLocale, customZhCn),
-  'zh-TW': Object.assign(zhTwLocale, customZhTw),
-  'en-US': Object.assign(enUsLocale, customEnUs),
-};
-const i18n = new VueI18n({
-  locale: lang,
-  messages,
-});
-
-export default i18n;
-
-// vue-i18n 5.x写法
-// Vue.locale('zh-CN', Object.assign(zhCnLocale, customZhCn))
-// Vue.locale('en-US', Object.assign(zhTwLocale, customZhTw))
-// Vue.locale('zh-TW', Object.assign(enUsLocale, customEnUs))

+ 0 - 47
template/admin/src/locale/lang/en-US.js

@@ -1,47 +0,0 @@
-export default {
-  home: 'Home',
-  login: 'Login',
-  components: 'Components',
-  count_to_page: 'Count-to',
-  tables_page: 'Table',
-  split_pane_page: 'Split-pane',
-  markdown_page: 'Markdown-editor',
-  editor_page: 'Rich-Text-Editor',
-  icons_page: 'Custom-icon',
-  img_cropper_page: 'Image-editor',
-  update: 'Update',
-  doc: 'Document',
-  join_page: 'QQ Group',
-  update_table_page: 'Update .CSV',
-  update_paste_page: 'Paste Table Data',
-  multilevel: 'multilevel',
-  directive_page: 'Directive',
-  level_1: 'Level-1',
-  level_2: 'Level-2',
-  level_2_1: 'Level-2-1',
-  level_2_3: 'Level-2-3',
-  level_2_2: 'Level-2-2',
-  level_2_2_1: 'Level-2-2-1',
-  level_2_2_2: 'Level-2-2-2',
-  excel: 'Excel',
-  'upload-excel': 'Upload Excel',
-  'export-excel': 'Export Excel',
-  tools_methods_page: 'Tools Methods',
-  drag_list_page: 'Drag-list',
-  i18n_page: 'Internationalization',
-  modalTitle: 'Modal Title',
-  content: 'This is the modal box content.',
-  buttonText: 'Show Modal',
-  'i18n-tip':
-    'Note: Only this page is multi-language, other pages do not add language content to the multi-language package.',
-  error_store_page: 'Error Collection',
-  error_logger_page: 'Error Logger',
-  query: 'Query',
-  params: 'Params',
-  cropper_page: 'Cropper',
-  message_page: 'Message Center',
-  tree_table_page: 'Tree Table',
-  org_tree_page: 'Org Tree',
-  drag_drawer_page: 'Draggable Drawer',
-  tree_select_page: 'Tree Selector',
-};

+ 0 - 46
template/admin/src/locale/lang/zh-CN.js

@@ -1,46 +0,0 @@
-export default {
-  home: '首页问问',
-  login: '登录',
-  components: '组件',
-  count_to_page: '数字渐变',
-  tables_page: '多功能表格',
-  split_pane_page: '分割窗口',
-  markdown_page: 'Markdown编辑器',
-  editor_page: '富文本编辑器',
-  icons_page: '自定义图标',
-  img_cropper_page: '图片编辑器',
-  update: '上传数据',
-  join_page: 'QQ群问问',
-  doc: '文档',
-  update_table_page: '上传CSV文件',
-  update_paste_page: '粘贴表格数据',
-  multilevel: '多级菜单',
-  directive_page: '指令',
-  level_1: 'Level-1',
-  level_2: 'Level-2',
-  level_2_1: 'Level-2-1',
-  level_2_3: 'Level-2-3',
-  level_2_2: 'Level-2-2',
-  level_2_2_1: 'Level-2-2-1',
-  level_2_2_2: 'Level-2-2-2',
-  excel: 'Excel',
-  'upload-excel': '上传excel',
-  'export-excel': '导出excel',
-  tools_methods_page: '工具函数',
-  drag_list_page: '拖拽列表',
-  i18n_page: '多语言',
-  modalTitle: '模态框题目',
-  content: '这是模态框内容',
-  buttonText: '显示模态框',
-  'i18n-tip': '注:仅此页做了多语言,其他页面没有在多语言包中添加语言内容',
-  error_store_page: '错误收集',
-  error_logger_page: '错误日志',
-  query: '带参路由',
-  params: '动态路由',
-  cropper_page: '图片裁剪',
-  message_page: '消息中心',
-  tree_table_page: '树状表格',
-  org_tree_page: '组织结构树',
-  drag_drawer_page: '可拖动抽屉',
-  tree_select_page: '树状下拉选择器2',
-};

+ 0 - 46
template/admin/src/locale/lang/zh-TW.js

@@ -1,46 +0,0 @@
-export default {
-  home: '首頁',
-  login: '登錄',
-  components: '组件',
-  count_to_page: '数字渐变',
-  tables_page: '多功能表格',
-  split_pane_page: '分割窗口',
-  markdown_page: 'Markdown編輯器',
-  editor_page: '富文本編輯器',
-  icons_page: '自定義圖標',
-  img_cropper_page: '圖片編輯器',
-  update: '上傳數據',
-  join_page: 'QQ群',
-  doc: '文檔',
-  update_table_page: '上傳CSV文件',
-  update_paste_page: '粘貼表格數據',
-  multilevel: '多级菜单',
-  directive_page: '指令',
-  level_1: 'Level-1',
-  level_2: 'Level-2',
-  level_2_1: 'Level-2-1',
-  level_2_3: 'Level-2-3',
-  level_2_2: 'Level-2-2',
-  level_2_2_1: 'Level-2-2-1',
-  level_2_2_2: 'Level-2-2-2',
-  excel: 'Excel',
-  'upload-excel': '上傳excel',
-  'export-excel': '導出excel',
-  tools_methods_page: '工具函數',
-  drag_list_page: '拖拽列表',
-  i18n_page: '多語言',
-  modalTitle: '模態框題目',
-  content: '這是模態框內容',
-  buttonText: '顯示模態框',
-  'i18n-tip': '注:僅此頁做了多語言,其他頁面沒有在多語言包中添加語言內容',
-  error_store_page: '錯誤收集',
-  error_logger_page: '錯誤日誌',
-  query: '帶參路由',
-  params: '動態路由',
-  cropper_page: '圖片裁剪',
-  message_page: '消息中心',
-  tree_table_page: '樹狀表格',
-  org_tree_page: '組織結構樹',
-  drag_drawer_page: '可拖動抽屜',
-  tree_select_page: '樹狀下拉選擇器',
-};

+ 0 - 44
template/admin/src/mock/data.js

@@ -1,44 +0,0 @@
-import Mock from 'mockjs';
-import { doCustomTimes } from '@/libs/util';
-import orgData from './data/org-data';
-import { treeData } from './data/tree-select';
-const Random = Mock.Random;
-
-export const getTableData = (req) => {
-  let tableData = [];
-  doCustomTimes(5, () => {
-    tableData.push(
-      Mock.mock({
-        name: '@name',
-        email: '@email',
-        createTime: '@date',
-      }),
-    );
-  });
-  return tableData;
-};
-
-export const getDragList = (req) => {
-  let dragList = [];
-  doCustomTimes(5, () => {
-    dragList.push(
-      Mock.mock({
-        name: Random.csentence(10, 13),
-        id: Random.increment(10),
-      }),
-    );
-  });
-  return dragList;
-};
-
-export const uploadImage = (req) => {
-  return Promise.resolve();
-};
-
-export const getOrgData = (req) => {
-  return orgData;
-};
-
-export const getTreeSelectData = (req) => {
-  return treeData;
-};

+ 0 - 50
template/admin/src/mock/data/org-data.js

@@ -1,50 +0,0 @@
-export default {
-  id: 0,
-  label: 'XXX科技有限公司',
-  children: [
-    {
-      id: 2,
-      label: '产品研发部',
-      children: [
-        {
-          id: 5,
-          label: '研发-前端',
-        },
-        {
-          id: 6,
-          label: '研发-后端',
-        },
-        {
-          id: 9,
-          label: 'UI设计',
-        },
-        {
-          id: 10,
-          label: '产品经理',
-        },
-      ],
-    },
-    {
-      id: 3,
-      label: '销售部',
-      children: [
-        {
-          id: 7,
-          label: '销售一部',
-        },
-        {
-          id: 8,
-          label: '销售二部',
-        },
-      ],
-    },
-    {
-      id: 4,
-      label: '财务部',
-    },
-    {
-      id: 11,
-      label: 'HR人事',
-    },
-  ],
-};

+ 0 - 82
template/admin/src/mock/data/tree-select.js

@@ -1,82 +0,0 @@
-export const treeData = [
-  {
-    id: 1,
-    title: '1',
-    children: [
-      {
-        id: 11,
-        title: '1-1',
-        loading: false,
-        children: [
-          // {
-          //   id: 111,
-          //   title: '1-1-1'
-          // },
-          // {
-          //   id: 112,
-          //   title: '1-1-2'
-          // },
-          // {
-          //   id: 113,
-          //   title: '1-1-3'
-          // },
-          // {
-          //   id: 114,
-          //   title: '1-1-4'
-          // }
-        ],
-      },
-      {
-        id: 12,
-        title: '1-2',
-        children: [
-          {
-            id: 121,
-            title: '1-2-1',
-          },
-        ],
-      },
-    ],
-  },
-];
-
-export const newTreeData = [
-  {
-    id: 'a',
-    title: 'a',
-    children: [
-      {
-        id: 'a1',
-        title: 'a-1',
-        children: [
-          {
-            id: 112,
-            title: '1-1-2',
-          },
-          {
-            id: 'a12',
-            title: 'a-1-2',
-          },
-          {
-            id: 'a13',
-            title: 'a-1-3',
-          },
-          {
-            id: 'a14',
-            title: 'a-1-4',
-          },
-        ],
-      },
-      {
-        id: 'a2',
-        title: 'a-2',
-        children: [
-          {
-            id: 'a21',
-            title: 'b-2-1',
-          },
-        ],
-      },
-    ],
-  },
-];

+ 0 - 28
template/admin/src/mock/index.js

@@ -1,28 +0,0 @@
-import Mock from 'mockjs';
-// import { login, logout, getUserInfo } from './login'
-import { getTableData, getDragList, uploadImage, getOrgData, getTreeSelectData } from './data';
-import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount } from './user';
-
-// 配置Ajax请求延时,可用来测试网络延迟大时项目中一些效果
-// Mock.setup({
-//   timeout: 1000
-// });
-//
-// // 登录相关和获取用户信息
-// Mock.mock(/\/login/, login);
-// Mock.mock(/\/get_info/, getUserInfo);
-// Mock.mock(/\/logout/, logout);
-// Mock.mock(/\/get_table_data/, getTableData);
-// Mock.mock(/\/get_drag_list/, getDragList);
-// Mock.mock(/\/save_error_logger/, 'success');
-// Mock.mock(/\/image\/upload/, uploadImage);
-// Mock.mock(/\/message\/init/, getMessageInit);
-// Mock.mock(/\/message\/content/, getContentByMsgId);
-// Mock.mock(/\/message\/has_read/, hasRead);
-// Mock.mock(/\/message\/remove_readed/, removeReaded);
-// Mock.mock(/\/message\/restore/, restoreTrash);
-// Mock.mock(/\/message\/count/, messageCount);
-// Mock.mock(/\/get_org_data/, getOrgData);
-// Mock.mock(/\/get_tree_select_data/, getTreeSelectData);
-//
-// export default Mock

+ 0 - 31
template/admin/src/mock/login.js

@@ -1,31 +0,0 @@
-// import { getParams } from '@/libs/util'
-// const USER_MAP = {
-//   super_admin: {
-//     name: 'super_admin',
-//     user_id: '1',
-//     access: ['super_admin', 'admin'],
-//     token: 'super_admin',
-//     avatar: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png'
-//   },
-//   admin: {
-//     name: 'admin',
-//     user_id: '2',
-//     access: ['admin'],
-//     token: 'admin',
-//     avatar: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4'
-//   }
-// }
-//
-// export const login = req => {
-//   req = JSON.parse(req.body)
-//   return { token: USER_MAP[req.userName].token }
-// }
-//
-// export const getUserInfo = req => {
-//   const params = getParams(req.url)
-//   return USER_MAP[params.token]
-// }
-//
-// export const logout = req => {
-//   return null
-// }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 64
template/admin/src/mock/user.js


+ 5 - 1
template/admin/src/pages/account/login/index.vue

@@ -75,6 +75,8 @@ import '@/assets/js/canvas-nest.min';
 import Verify from '@/components/verifition/Verify';
 import { PrevLoading } from '@/utils/loading.js';
 import { formatFlatteningRoutes, findFirstNonNullChildren } from '@/libs/system';
+import { encryptWithKey } from '@/utils/ase.js';
+
 export default {
   components: {
     Verify,
@@ -106,6 +108,7 @@ export default {
       key: '',
       copyright: '',
       version: '',
+      publicKey: '',
     };
   },
   created() {
@@ -169,6 +172,7 @@ export default {
           this.swiperList = data.slide.length ? data.slide : [{ slide: this.defaultSwiperList }];
           this.key = data.key;
           this.copyright = data.copyright;
+          this.publicKey = data.publicKey;
           this.version = data.version;
           this.login_captcha = data.login_captcha;
         })
@@ -192,7 +196,7 @@ export default {
       this.loading = true;
       AccountLogin({
         account: this.formInline.username,
-        pwd: this.formInline.password,
+        pwd: encryptWithKey(this.formInline.password, this.publicKey),
         key: this.key,
         captchaType: 'blockPuzzle',
         captchaVerification: params ? params.captchaVerification : '',

+ 4 - 4
template/admin/src/pages/setting/devise/diyIndex.vue

@@ -334,6 +334,9 @@ export default {
     this.$store.commit('mobildConfig/SETEMPTY');
   },
   created() {
+    window.onbeforeunload = () => {
+      return '刷新页面将丢失内容,是否继续?';
+    };
     this.categoryList();
     this.getUrlList();
     this.pageId = this.$route.query.id;
@@ -371,9 +374,6 @@ export default {
     });
   },
   methods: {
-    beforeUnload() {
-      return '确认是否保存?';
-    },
     saveModal() {
       if (!this.saveName) return this.$Message.warning('请先输入模板名称');
       this.saveConfig(1, this.saveName);
@@ -409,7 +409,7 @@ export default {
     closeWindow() {
       this.$Modal.confirm({
         title: '确定关闭当前页吗?',
-        content: '离开前请确认保存您的设计',
+        content: '关闭页面前请先保存数据,未保存的话数据会丢失',
         okText: '确定',
         cancelText: '取消',
         loading: true,

+ 22 - 0
template/admin/src/utils/ase.js

@@ -0,0 +1,22 @@
+import CryptoJS from 'crypto-js';
+import JSEncrypt from 'jsencrypt';
+
+/**
+ * @word hash256要加密的内容
+ * @keyWord String  服务器随机返回的关键字
+ *  */
+export function aesEncryptHash(word, keyWord = 'XwKsGlMcdPMEhR1B') {
+  var key = CryptoJS.enc.Utf8.parse(keyWord);
+  var srcs = CryptoJS.enc.Utf8.parse(word);
+  var encrypted = CryptoJS.HmacSHA256(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
+  return encrypted.toString();
+}
+/**
+ * @word key加密
+ * @keyWord String  服务器随机返回的关键字
+ *  */
+export function encryptWithKey(password, publicKey) {
+  const encryptor = new JSEncrypt();
+  encryptor.setPublicKey(publicKey);
+  return encryptor.encrypt(password);
+}

+ 3 - 1
template/uni-app/manifest.json

@@ -26,7 +26,9 @@
             "Payment" : {},
             "Share" : {},
             "VideoPlayer" : {},
-            "OAuth" : {}
+            "OAuth" : {},
+            "Barcode" : {},
+            "Camera" : {}
         },
         "safearea" : {
             "bottom" : {

+ 43 - 9
template/uni-app/pages/goods/order_details/index.vue

@@ -359,8 +359,8 @@
 						hover-class='none' :url="'/pages/goods/goods_logistics/index?orderId='+ orderInfo.order_id">
 						{{$t(`查看物流`)}}
 					</navigator>
-					<view class='bnt bg-color' v-if="orderInfo.type == 3 && orderInfo.refund_type == 0 && orderInfo.paid"
-						@tap='goJoinPink'>
+					<view class='bnt bg-color'
+						v-if="orderInfo.type == 3 && orderInfo.refund_type == 0 && orderInfo.paid" @tap='goJoinPink'>
 						{{$t(`查看拼团`)}}
 					</view>
 					<view class='bnt bg-color' v-if="status.class_status==3 && !split.length" @click='confirmOrder()'>
@@ -585,10 +585,11 @@
 				this.getOrderInfo();
 				this.getUserInfo();
 				this.getCustomerType();
-				let options = wx.getEnterOptionsSync();
-				if (options.scene == '1038' && options.referrerInfo.appId == 'wxef277996acc166c3') {
+				let opt = wx.getEnterOptionsSync();
+				console.log(opt)
+				if (opt.scene == '1038' && opt.referrerInfo.appId == 'wxef277996acc166c3') {
 					// 代表从收银台小程序返回
-					let extraData = options.referrerInfo.extraData;
+					let extraData = opt.referrerInfo.extraData;
 					if (!extraData) {
 						// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
 						this.getOrderInfo();
@@ -1034,12 +1035,45 @@
 				})
 			},
 			confirmOrder(orderId) {
+				let that = this;
+				// #ifdef MP
+				if (wx.openBusinessView && this.orderInfo.order_shipping_open && this.orderInfo
+					.trade_no) {
+					uni.showLoading({
+						title: this.$t(`加载中`)
+					});
+					wx.openBusinessView({
+						businessType: 'weappOrderConfirm',
+						extraData: {
+							transaction_id: this.orderInfo.trade_no
+						},
+						success() {},
+						fail(err) {
+							uni.hideLoading();
+							return that.$util.Tips({
+								title: err.errMsg
+							});
+						},
+						complete() {
+							uni.hideLoading();
+						}
+					});
+				} else {
+					this.defaultTake(orderId)
+				}
+				// #endif
+				// #ifndef MP
+				this.defaultTake(orderId)
+				// #endif
+			},
+			defaultTake(orderId) {
 				let that = this;
 				uni.showModal({
 					title: that.$t(`确认收货`),
 					content: that.$t(`为保障权益,请收到货确认无误后,再确认收货`),
-					success: function(res) {
+					success: (res) => {
 						if (res.confirm) {
+							console.log('1')
 							orderTake(orderId ? orderId : that.order_id).then(res => {
 								return that.$util.Tips({
 									title: that.$t(`操作成功`),
@@ -1489,12 +1523,12 @@
 			-webkit-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
 			-moz-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
 			box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
-			bottom: 110rpx;
-			/* #ifdef APP-PLUS */ 
+			bottom: 110rpx;
+			/* #ifdef APP-PLUS */
 			bottom: calc(110rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
 			bottom: calc(110rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
 
-			/* #endif */ 
+			/* #endif */
 			.more-btn {
 				color: #333;
 				padding: 4rpx;