From 269d4377980a1e1ed05f8513430ab49304eafa72 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 17 May 2023 10:38:54 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0uniapp=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/uni-app/manifest.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/template/uni-app/manifest.json b/template/uni-app/manifest.json index 07c444047..cfadfdf0c 100644 --- a/template/uni-app/manifest.json +++ b/template/uni-app/manifest.json @@ -26,7 +26,9 @@ "Payment" : {}, "Share" : {}, "VideoPlayer" : {}, - "OAuth" : {} + "OAuth" : {}, + "Barcode" : {}, + "Camera" : {} }, "safearea" : { "bottom" : { From e18022e00e9b919807aaf67a24737ca0ce00ed5f Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 17 May 2023 10:47:26 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0login=E5=8A=A0?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/package-lock.json | 6 +++++ template/admin/package.json | 1 + .../src/components/verifition/utils/ase.js | 11 ++++++++++ .../admin/src/pages/account/login/index.vue | 6 ++++- template/admin/src/utils/ase.js | 22 +++++++++++++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 template/admin/src/utils/ase.js diff --git a/template/admin/package-lock.json b/template/admin/package-lock.json index 5f651f4a2..7a72ec076 100644 --- a/template/admin/package-lock.json +++ b/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", diff --git a/template/admin/package.json b/template/admin/package.json index db7647fa3..0fefd56df 100644 --- a/template/admin/package.json +++ b/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", diff --git a/template/admin/src/components/verifition/utils/ase.js b/template/admin/src/components/verifition/utils/ase.js index 35290979e..5783a7679 100644 --- a/template/admin/src/components/verifition/utils/ase.js +++ b/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); +} diff --git a/template/admin/src/pages/account/login/index.vue b/template/admin/src/pages/account/login/index.vue index 42e191154..d62b1ff9e 100644 --- a/template/admin/src/pages/account/login/index.vue +++ b/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 : '', diff --git a/template/admin/src/utils/ase.js b/template/admin/src/utils/ase.js new file mode 100644 index 000000000..48762bfd6 --- /dev/null +++ b/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); +} From 5f8604ee15ebe9ed41abcdbf48b41b9cd481ede5 Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 17 May 2023 10:47:57 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E5=B0=8F=E7=A8=8B=E5=BA=8Fapi?= =?UTF-8?q?=E6=94=B6=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/goods/order_details/index.vue | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/template/uni-app/pages/goods/order_details/index.vue b/template/uni-app/pages/goods/order_details/index.vue index 7a770cd53..344ee30d2 100644 --- a/template/uni-app/pages/goods/order_details/index.vue +++ b/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(`查看物流`)}} - + {{$t(`查看拼团`)}} @@ -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,41 @@ }) }, confirmOrder(orderId) { + let that = this; + // #ifdef MP + if (wx.openBusinessView && this.orderInfo.order_shipping_open && this.orderInfo + .trade_no) { + wx.openBusinessView({ + businessType: 'weappOrderConfirm', + extraData: { + transaction_id: this.orderInfo.trade_no + }, + success() {}, + fail(err) { + return that.$util.Tips({ + title: err.errMsg + }); + }, + complete() { + //dosomething + } + }); + } 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 +1519,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; From 7b0738ba6d933af5eb133c6fd54d5f1c3fb4abba Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 17 May 2023 11:38:21 +0800 Subject: [PATCH 4/6] =?UTF-8?q?improve:=20diy=E9=A1=B5=E9=9D=A2=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=8F=8A=E5=85=B3=E9=97=AD=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/pages/setting/devise/diyIndex.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/template/admin/src/pages/setting/devise/diyIndex.vue b/template/admin/src/pages/setting/devise/diyIndex.vue index dba55e280..a58c6fd18 100644 --- a/template/admin/src/pages/setting/devise/diyIndex.vue +++ b/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, From 8307a7cf3a9d41be4eba7d71a4618f7cf5f13b99 Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 17 May 2023 11:38:47 +0800 Subject: [PATCH 5/6] =?UTF-8?q?improve:=20=E6=B7=BB=E5=8A=A0=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=94=B6=E8=B4=A7loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/uni-app/pages/goods/order_details/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/uni-app/pages/goods/order_details/index.vue b/template/uni-app/pages/goods/order_details/index.vue index 344ee30d2..f01d04d7e 100644 --- a/template/uni-app/pages/goods/order_details/index.vue +++ b/template/uni-app/pages/goods/order_details/index.vue @@ -1039,6 +1039,9 @@ // #ifdef MP if (wx.openBusinessView && this.orderInfo.order_shipping_open && this.orderInfo .trade_no) { + uni.showLoading({ + title: this.$t(`加载中`) + }); wx.openBusinessView({ businessType: 'weappOrderConfirm', extraData: { @@ -1046,12 +1049,13 @@ }, success() {}, fail(err) { + uni.hideLoading(); return that.$util.Tips({ title: err.errMsg }); }, complete() { - //dosomething + uni.hideLoading(); } }); } else { From 5f7da3754914b045b7bd4333902e68e84b16bcfc Mon Sep 17 00:00:00 2001 From: From-wh Date: Wed, 17 May 2023 15:13:32 +0800 Subject: [PATCH 6/6] =?UTF-8?q?improve:=20=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/locale/index.js | 37 ---------- template/admin/src/locale/lang/en-US.js | 47 ------------ template/admin/src/locale/lang/zh-CN.js | 46 ------------ template/admin/src/locale/lang/zh-TW.js | 46 ------------ template/admin/src/mock/data.js | 44 ----------- template/admin/src/mock/data/org-data.js | 50 ------------- template/admin/src/mock/data/tree-select.js | 82 --------------------- template/admin/src/mock/index.js | 28 ------- template/admin/src/mock/login.js | 31 -------- template/admin/src/mock/user.js | 64 ---------------- 10 files changed, 475 deletions(-) delete mode 100644 template/admin/src/locale/index.js delete mode 100644 template/admin/src/locale/lang/en-US.js delete mode 100644 template/admin/src/locale/lang/zh-CN.js delete mode 100644 template/admin/src/locale/lang/zh-TW.js delete mode 100644 template/admin/src/mock/data.js delete mode 100644 template/admin/src/mock/data/org-data.js delete mode 100644 template/admin/src/mock/data/tree-select.js delete mode 100644 template/admin/src/mock/index.js delete mode 100644 template/admin/src/mock/login.js delete mode 100644 template/admin/src/mock/user.js diff --git a/template/admin/src/locale/index.js b/template/admin/src/locale/index.js deleted file mode 100644 index ccbf1caa9..000000000 --- a/template/admin/src/locale/index.js +++ /dev/null @@ -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)) diff --git a/template/admin/src/locale/lang/en-US.js b/template/admin/src/locale/lang/en-US.js deleted file mode 100644 index 40174ca9e..000000000 --- a/template/admin/src/locale/lang/en-US.js +++ /dev/null @@ -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', -}; diff --git a/template/admin/src/locale/lang/zh-CN.js b/template/admin/src/locale/lang/zh-CN.js deleted file mode 100644 index 8f10be012..000000000 --- a/template/admin/src/locale/lang/zh-CN.js +++ /dev/null @@ -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', -}; diff --git a/template/admin/src/locale/lang/zh-TW.js b/template/admin/src/locale/lang/zh-TW.js deleted file mode 100644 index c4598d943..000000000 --- a/template/admin/src/locale/lang/zh-TW.js +++ /dev/null @@ -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: '樹狀下拉選擇器', -}; diff --git a/template/admin/src/mock/data.js b/template/admin/src/mock/data.js deleted file mode 100644 index 62f8476c2..000000000 --- a/template/admin/src/mock/data.js +++ /dev/null @@ -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; -}; diff --git a/template/admin/src/mock/data/org-data.js b/template/admin/src/mock/data/org-data.js deleted file mode 100644 index 028a5f009..000000000 --- a/template/admin/src/mock/data/org-data.js +++ /dev/null @@ -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人事', - }, - ], -}; diff --git a/template/admin/src/mock/data/tree-select.js b/template/admin/src/mock/data/tree-select.js deleted file mode 100644 index 54603866a..000000000 --- a/template/admin/src/mock/data/tree-select.js +++ /dev/null @@ -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', - }, - ], - }, - ], - }, -]; diff --git a/template/admin/src/mock/index.js b/template/admin/src/mock/index.js deleted file mode 100644 index 952717b50..000000000 --- a/template/admin/src/mock/index.js +++ /dev/null @@ -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 diff --git a/template/admin/src/mock/login.js b/template/admin/src/mock/login.js deleted file mode 100644 index ab5fa7bc8..000000000 --- a/template/admin/src/mock/login.js +++ /dev/null @@ -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 -// } diff --git a/template/admin/src/mock/user.js b/template/admin/src/mock/user.js deleted file mode 100644 index 956665903..000000000 --- a/template/admin/src/mock/user.js +++ /dev/null @@ -1,64 +0,0 @@ -import Mock from 'mockjs'; -import { doCustomTimes } from '@/libs/util'; -const Random = Mock.Random; - -export const getMessageInit = () => { - let unreadList = []; - doCustomTimes(3, () => { - unreadList.push( - Mock.mock({ - title: Random.cword(10, 15), - create_time: '@date', - msg_id: Random.increment(100), - }), - ); - }); - let readedList = []; - doCustomTimes(4, () => { - readedList.push( - Mock.mock({ - title: Random.cword(10, 15), - create_time: '@date', - msg_id: Random.increment(100), - }), - ); - }); - let trashList = []; - doCustomTimes(2, () => { - trashList.push( - Mock.mock({ - title: Random.cword(10, 15), - create_time: '@date', - msg_id: Random.increment(100), - }), - ); - }); - return { - unread: unreadList, - readed: readedList, - trash: trashList, - }; -}; - -export const getContentByMsgId = () => { - return `
        这是消息内容,这个内容是使用富文本编辑器编辑的,所以你可以看到一些格式
  1. 你可以查看Mock返回的数据格式,和api请求的接口,来确定你的后端接口的开发
  2. 使用你的真实接口后,前端页面基本不需要修改即可满足基本需求
  3. 快来试试吧

${Random.csentence( - 100, - 200, - )}

`; -}; - -export const hasRead = () => { - return true; -}; - -export const removeReaded = () => { - return true; -}; - -export const restoreTrash = () => { - return true; -}; - -export const messageCount = () => { - return 3; -};