diff --git a/ruoyi-ui/src/api/system/user.js b/ruoyi-ui/src/api/system/user.js index b5e3edd..975954f 100644 --- a/ruoyi-ui/src/api/system/user.js +++ b/ruoyi-ui/src/api/system/user.js @@ -134,3 +134,5 @@ export function deptTreeSelect() { method: 'get' }) } + + diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index bbfd237..3701edd 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -110,13 +110,27 @@ export const dynamicRoutes = [ path: '/system/role-auth', component: Layout, hidden: true, - permissions: ['system:role:edit'], + permissions: ['system:role:edits'], children: [ { path: 'user/:roleId(\\d+)', component: () => import('@/views/system/role/authUser'), name: 'AuthUser', - meta: { title: '分配用户', activeMenu: '/system/role' } + meta: { title: '分配用户', activeMenu: '/system/user' } + } + ] + }, + { + path: '/system/user-stores', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'auth/:userId(\\d+)', + component: () => import('@/views/system/user/userStores'), + name: 'UserStores', + meta: { title: '分配门店', activeMenu: '/system/user' } } ] }, diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 7150ecb..839b35f 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -67,8 +67,8 @@ service.interceptors.request.use(config => { } return config }, error => { - console.log(error) - Promise.reject(error) + console.log(error) + Promise.reject(error) }) // 响应拦截器 @@ -89,10 +89,10 @@ service.interceptors.response.use(res => { store.dispatch('LogOut').then(() => { location.href = '/index' }) - }).catch(() => { - isRelogin.show = false - }) - } + }).catch(() => { + isRelogin.show = false + }) + } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') } else if (code === 500) { Message({ message: msg, type: 'error' }) diff --git a/ruoyi-ui/src/views/system/user/authRole.vue b/ruoyi-ui/src/views/system/user/authRole.vue index 1f862d7..a218dc8 100644 --- a/ruoyi-ui/src/views/system/user/authRole.vue +++ b/ruoyi-ui/src/views/system/user/authRole.vue @@ -120,4 +120,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 14a0ab1..7754561 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -82,6 +82,7 @@ 重置密码 分配角色 + 分配门店 @@ -432,6 +433,9 @@ export default { case "handleAuthRole": this.handleAuthRole(row) break + case "handleAuthStore": + this.handleAuthStore(row) + break default: break } @@ -486,6 +490,11 @@ export default { const userId = row.userId this.$router.push("/system/user-auth/role/" + userId) }, + /** 分配门店操作 */ + handleAuthStore: function(row) { + const userId = row.userId + this.$router.push("/system/user-stores/auth/" + userId) + }, /** 提交按钮 */ submitForm: function() { this.$refs["form"].validate(valid => { @@ -555,4 +564,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/user/userStores.vue b/ruoyi-ui/src/views/system/user/userStores.vue new file mode 100644 index 0000000..324e104 --- /dev/null +++ b/ruoyi-ui/src/views/system/user/userStores.vue @@ -0,0 +1,165 @@ + + + 基本信息 + + + + + + + + + + + + + + + + 门店信息 + + + + {{ (pageNum - 1) * pageSize + scope.$index + 1 }} + + + + + + + + + + {{ parseTime(scope.row.createTime) }} + + + + + + + + + 提交 + 返回 + + + + + + + + diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 2fc5132..781fea4 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -11,7 +11,8 @@ const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 const baseUrl = 'http://193.112.94.36:8080' // 后端接口 -const port = process.env.port || process.env.npm_config_port || 80 // 端口 +// const port = process.env.port || process.env.npm_config_port || 80 // 端口 +const port = 8080 // vue.config.js 配置说明 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions @@ -31,7 +32,7 @@ module.exports = { // webpack-dev-server 相关配置 devServer: { host: '0.0.0.0', - port: 8087, + port: port, open: true, proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy @@ -98,39 +99,39 @@ module.exports = { .end() config.when(process.env.NODE_ENV !== 'development', config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() - config.optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm - priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single') + config.optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm + priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + config.optimization.runtimeChunk('single') }) } }