Commit bc3e5144 by liudx

联调用户管理

parent a72e36fc
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
border: 2px solid #4079ff; border: 2px solid #4079ff;
border-radius: 8px; border-radius: 8px;
.type { .type {
width: 90px; width: 160px;
height: 40px; height: 40px;
// margin-top: 10px; // margin-top: 10px;
// line-height: 50px; // line-height: 50px;
......
import { createRouter, createWebHistory } from 'vue-router' import { createRouter, createWebHistory ,createWebHashHistory } from 'vue-router'
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
// import HomeView from '../views/HomeView.vue' // import HomeView from '../views/HomeView.vue'
import login from "../views/login/index.vue" import login from "../views/login/index.vue"
...@@ -25,7 +25,7 @@ import securitySetting from "../views/userset/securitySetting.vue" ...@@ -25,7 +25,7 @@ import securitySetting from "../views/userset/securitySetting.vue"
//管理员设置 //管理员设置
import adminset from "../views/adminset/index.vue" import adminset from "../views/adminset/index.vue"
import userInfo from "../views/adminset/userInfo.vue" import userInfo from "../views/adminset/userInfo.vue"
import notFound from "../views/404.vue"
const routes = [ const routes = [
...@@ -35,6 +35,11 @@ const routes = [ ...@@ -35,6 +35,11 @@ const routes = [
// component: AdminLogin, // component: AdminLogin,
}, },
{ {
path: '/404',
name: 'notFound',
component: notFound,
},
{
path: '/login', path: '/login',
name: 'login', name: 'login',
component: login, component: login,
...@@ -153,9 +158,10 @@ const routes = [ ...@@ -153,9 +158,10 @@ const routes = [
] ]
const router = createRouter({ const router = createRouter({
history: createWebHistory(process.env.BASE_URL), history: createWebHashHistory(process.env.BASE_URL),
// mode:'hash', mode:'hash',
routes routes,
}) })
router.beforeEach((to,from,next)=>{ router.beforeEach((to,from,next)=>{
if (to.path === '/login' || to.path === '/adminLogin' ||to.path === '/forget') { if (to.path === '/login' || to.path === '/adminLogin' ||to.path === '/forget') {
...@@ -175,4 +181,5 @@ router.beforeEach((to,from,next)=>{ ...@@ -175,4 +181,5 @@ router.beforeEach((to,from,next)=>{
export default router export default router
import { get, post,put } from './request' import { get, post, put, Delete } from './request'
/** /**
* 示例 * 示例
get请求 get请求
export const changePassword = p => get('/api/home/changePassword',{}); export const changePassword = p => get('/api/home/changePassword',{});
oost请求 oost请求
export const login = p => post('/api/common/login', p); export const login = p => post('/api/common/login', p);
*/ */
export const login = p => post('/api/common/login', p); export const login = p => post('/api/common/login', p);
export const changePassword = p => post('/api/common/changePassword',p); export const changePassword = p => post('/api/common/changePassword', p);
export const sendSms = p => post('/api/common/sendSms',p); export const sendSms = p => post('/api/common/sendSms', p);
export const users = p => get('/api/backup/users?page='+p.page+'&size='+p.size); export const users = p => get('/api/backup/users?page=' + p.page + '&size=' + p.size);
export const changeStatus = p => put('/api/backup/users/'+p.id,{status:p.status}); export const changeStatus = p => put('/api/backup/users/' + p.id, { status: p.status });
export const addusers = p => post('/api/backup/users',p); export const addusers = p => post('/api/backup/users', p);
export const deleusers = p => Delete('/api/backup/users', p);
......
...@@ -2,11 +2,16 @@ import axios from 'axios'; ...@@ -2,11 +2,16 @@ import axios from 'axios';
import store from '../store/index' import store from '../store/index'
// 环境的切换 // 环境的切换
axios.defaults.baseURL = '/api'; axios.defaults.baseURL = '';
// 请求超时时间 // 请求超时时间
axios.defaults.timeout = 50000; axios.defaults.timeout = 50000;
// post请求头 // post请求头
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; // axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// // post请求头
// axios.defaults.headers.delete['Content-Type'] = 'application/json;charset=UTF-8';
axios.defaults.headers = {
'Content-Type': 'application/json;charset=UTF-8'
}
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
...@@ -133,3 +138,21 @@ axios.interceptors.response.use( ...@@ -133,3 +138,21 @@ axios.interceptors.response.use(
}) })
}); });
} }
/**
* delete方法,对应delete请求
* @param {String} url [请求的url地址]
* @param {Object} params [请求时携带的参数]
*/export function Delete(url, params) {
return new Promise((resolve, reject) => {
axios.delete(url, { data: JSON.stringify(params), headers: { 'Content-Type': 'application/json' } })
.then(res => {
resolve(res.data);
// 处理响应
})
.catch(err => {
// 处理错误
reject(err.data)
});
});
}
\ No newline at end of file
import { get, post, put, Delete } from './request'
export const uploadFile = p => post('/api/common/uploadFile', p);
export const userInfo = p => get('/api/users/userInfo', {});
export const bduserInfo = p => post('/api/users/userInfo', p);
export const updateuserInfo = p => put('/api/users/userInfo', p);
<template>
<div class="notFind">
<svg
width="380px"
height="500px"
viewBox="0 0 837 1045"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
>
<g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
sketch:type="MSPage"
>
<path
d="M353,9 L626.664028,170 L626.664028,487 L353,642 L79.3359724,487 L79.3359724,170 L353,9 Z"
id="Polygon-1"
stroke="#007FB2"
stroke-width="6"
sketch:type="MSShapeGroup"
></path>
<path
d="M78.5,529 L147,569.186414 L147,648.311216 L78.5,687 L10,648.311216 L10,569.186414 L78.5,529 Z"
id="Polygon-2"
stroke="#EF4A5B"
stroke-width="6"
sketch:type="MSShapeGroup"
></path>
<path
d="M773,186 L827,217.538705 L827,279.636651 L773,310 L719,279.636651 L719,217.538705 L773,186 Z"
id="Polygon-3"
stroke="#795D9C"
stroke-width="6"
sketch:type="MSShapeGroup"
></path>
<path
d="M639,529 L773,607.846761 L773,763.091627 L639,839 L505,763.091627 L505,607.846761 L639,529 Z"
id="Polygon-4"
stroke="#F2773F"
stroke-width="6"
sketch:type="MSShapeGroup"
></path>
<path
d="M281,801 L383,861.025276 L383,979.21169 L281,1037 L179,979.21169 L179,861.025276 L281,801 Z"
id="Polygon-5"
stroke="#5a5c6c"
stroke-width="6"
sketch:type="MSShapeGroup"
></path>
</g>
</svg>
<div class="message-box">
<h1>404</h1>
<p>页面找不到啦 !</p>
<div class="buttons-con">
<div class="action-link-wrap">
<a @click="$router.go(-1)" class="link-button link-back-button"
>返回上一页</a
>
<a @click="$router.replace({ name: 'cockpit' })" class="link-button"
>前往首页</a
>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name:'notFound'
};
</script>
<style lang="less" scoped>
.notFind {
width: 100%;
height: 100%;
background-color: #2f3242;
}
svg {
position: absolute;
top: 50%;
left: 50%;
margin-top: -250px;
margin-left: -400px;
}
.message-box {
height: 200px;
width: 380px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: 50px;
color: #fff;
font-family: Roboto;
font-weight: 300;
}
.message-box h1 {
font-size: 60px;
line-height: 46px;
margin-bottom: 40px;
}
.buttons-con .action-link-wrap {
margin-top: 40px;
}
.buttons-con .action-link-wrap a {
background: #68c950;
padding: 8px 25px;
border-radius: 4px;
color: #fff;
font-weight: bold;
font-size: 14px;
transition: all 0.3s linear;
cursor: pointer;
text-decoration: none;
margin-right: 10px;
}
.buttons-con .action-link-wrap a:hover {
background: #5a5c6c;
color: #fff;
}
#Polygon-1,
#Polygon-2,
#Polygon-3,
#Polygon-4,
#Polygon-4,
#Polygon-5 {
animation: float 1s infinite ease-in-out alternate;
}
#Polygon-2 {
animation-delay: 0.2s;
}
#Polygon-3 {
animation-delay: 0.4s;
}
#Polygon-4 {
animation-delay: 0.6s;
}
#Polygon-5 {
animation-delay: 0.8s;
}
@keyframes float {
100% {
transform: translateY(20px);
}
}
@media (max-width: 750px) {
svg {
position: absolute;
top: 50%;
left: 50%;
margin-top: -250px;
margin-left: -190px;
}
.message-box {
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -190px;
text-align: center;
}
}
</style>
...@@ -39,9 +39,10 @@ ...@@ -39,9 +39,10 @@
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<!-- <a @click="change(record)" danger v-if="text">禁用</a> <!-- <a @click="change(record)" danger v-if="text">禁用</a>
<a v-else>使用</a> --> <a v-else>使用</a> -->
<a-switch @click="change(record)" v-model:checked="status" <a-switch
></a-switch @click="change(record)"
> v-model:checked="record.status"
></a-switch>
</template> </template>
</template> </template>
</a-table> </a-table>
...@@ -74,13 +75,13 @@ ...@@ -74,13 +75,13 @@
<script> <script>
// import { AES_Encrypt, AES_Decrypt } from "@/utils/aes_util.js"; // import { AES_Encrypt, AES_Decrypt } from "@/utils/aes_util.js";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { users, changeStatus,addusers } from "@/utils/loginAPI"; import { users, changeStatus, addusers, deleusers } from "@/utils/loginAPI";
export default { export default {
name: "userInfo", name: "userInfo",
data() { data() {
return { return {
visible: false, visible: false,
username:'', username: "",
visibleDelete: false, visibleDelete: false,
columns: [ columns: [
{ {
...@@ -162,23 +163,24 @@ export default { ...@@ -162,23 +163,24 @@ export default {
this.visibleDelete = false; this.visibleDelete = false;
}, },
add() { add() {
addusers({account_number:this.username}).then(res=>{ addusers({ account_number: this.username }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.getList() this.getList();
this.visible = false; this.visible = false;
message.success(res.msg); message.success(res.msg);
}else{ } else {
message.error(res.msg); message.error(res.msg);
} }
}) });
}, },
//用户列表初始化 //用户列表初始化
init() { init() {
this.getList(); this.getList();
}, },
//获取用户列表
getList(page) { getList(page) {
users({ users({
page: page||1, page: page || 1,
size: 10, size: 10,
}).then((res) => { }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
...@@ -192,15 +194,37 @@ export default { ...@@ -192,15 +194,37 @@ export default {
selectedTableRows(selectedRowKeys, selectedRows) { selectedTableRows(selectedRowKeys, selectedRows) {
// 批量选中的key // 批量选中的key
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
console.log(selectedRowKeys);
},
//删除用户
deleteUser() {
let parma = {
user_ids: [...this.selectedRowKeys],
};
console.log(parma);
deleusers(parma).then((res) => {
// console.log(res)
if (res.code == 0) {
message.success(res.msg);
this.visibleDelete = false;
this.getList();
} else {
message.error(res.msg);
this.visibleDelete = false;
}
});
}, },
//修改用户状态 //修改用户状态
change(record) { change(record) {
changeStatus({ id: record.id, status: !record.status }).then((res) => { let status = record.status;
changeStatus({ id: record.id, status: status }).then((res) => {
// console.log(res); // console.log(res);
if (res.code == 0) { if (res.code == 0) {
this.getList()
message.success(res.msg); message.success(res.msg);
this.getList();
} else {
message.error(res.msg);
} }
}); });
}, },
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
<div style="width: 70%"> <div style="width: 70%;display: none;">
<EchartsCon <EchartsCon
:id="'applyTrend1'" :id="'applyTrend1'"
:option="option1" :option="option1"
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
</div> </div>
</div> </div>
<div class="company_con_anchor"> <div class="company_con_anchor">
<a-anchor> <a-anchor @click="handleAnchorClick">
<a-anchor-link <a-anchor-link
style="font-size: 20px; color: #1c1c28; font-weight: bold" style="font-size: 20px; color: #1c1c28; font-weight: bold"
title="企业概况" title="企业概况"
...@@ -410,6 +410,15 @@ export default { ...@@ -410,6 +410,15 @@ export default {
}, },
}; };
}, },
methods: {
handleAnchorClick(e, link) {
// 阻止点击的默认事件修改路由
e.preventDefault();
// console.log(link)
// var srcolls = document.getElementById(link.href);
// srcolls.scrollIntoView({ block: "start", behavior: "smooth" });
},
},
}; };
</script> </script>
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
>次产学研合作。其中,与<span class="color">{{ >次产学研合作。其中,与<span class="color">{{
joint.max_name_apply joint.max_name_apply
}}</span }}</span
>最为密切,合作次数为<span class="color">{{ joint.max_value_apply }}</span >最为密切,合作次数为<span class="color">{{
joint.max_value_apply
}}</span
>次,与该企业合作次数最多的申请人如下图所示。 >次,与该企业合作次数最多的申请人如下图所示。
</p> </p>
<EchartsCon :option="option1" :id="'echarts1'"></EchartsCon> <EchartsCon :option="option1" :id="'echarts1'"></EchartsCon>
...@@ -33,7 +35,7 @@ ...@@ -33,7 +35,7 @@
</div> </div>
</div> </div>
<div class="company_con_anchor"> <div class="company_con_anchor">
<a-anchor> <a-anchor @click="handleAnchorClick">
<a-anchor-link <a-anchor-link
style="font-size: 20px; color: #1c1c28; font-weight: bold" style="font-size: 20px; color: #1c1c28; font-weight: bold"
title="技术合作" title="技术合作"
...@@ -84,6 +86,9 @@ export default { ...@@ -84,6 +86,9 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
handleAnchorClick(e, link) {
e.preventDefault();
},
init() { init() {
this.getOptions1(); this.getOptions1();
this.getOptions2(); this.getOptions2();
...@@ -95,17 +100,27 @@ export default { ...@@ -95,17 +100,27 @@ export default {
symbolSize: 40, symbolSize: 40,
category: 0, category: 0,
value: 0, value: 0,
x: 550,
y: 250,
// fixed: true,
}, },
]; ];
let links = []; let links = [];
//添加数据 //添加数据
if (this.joint.joint_application.length != 0) { if (this.joint.joint_application.length != 0) {
this.joint.joint_application.forEach((item) => { this.joint.joint_application.forEach((item, index) => {
points.push({ points.push({
name: item.name, name: item.name,
symbolSize: 40, symbolSize: 40,
category: 1, category: 1,
value: item.value, value: item.value,
// x:
// index % 2 == 1
// ? 550 + (index % 2) * (600)
// : 550 - (index % 2) * 600,
// y: 750,
// x:550+
}); });
links.push({ links.push({
source: this.company_name, source: this.company_name,
...@@ -113,6 +128,7 @@ export default { ...@@ -113,6 +128,7 @@ export default {
value: item.value, value: item.value,
}); });
}); });
console.log(points);
} }
this.option1 = { this.option1 = {
legend: { legend: {
...@@ -122,11 +138,12 @@ export default { ...@@ -122,11 +138,12 @@ export default {
series: [ series: [
{ {
type: "graph", type: "graph",
layout: "force", layout: "none",
force: { force: {
repulsion: 1500, repulsion: 100,
edgeLength: 30, edgeLength: 30,
}, },
bottom: 0,
roam: false, roam: false,
label: { label: {
show: true, show: true,
...@@ -139,6 +156,48 @@ export default { ...@@ -139,6 +156,48 @@ export default {
}, },
}, },
data: points, data: points,
// data: [
// {
// name: "1",
// symbolSize: 40,
// category: 1,
// value: "3",
// // x: 80,
// // y: 80,
// x: 550 + Math.cos(((Math.PI * 1) / 10) * 10) * 200,
// y: 550 + Math.sin(((Math.PI * 1) / 10) * 10) * 200,
// },
// {
// name: "2",
// symbolSize: 40,
// category: 1,
// value: "3",
// // x: 80,
// // y: 80,
// x: 550 + Math.cos(((Math.PI * 2) / 10) * 10) * 200,
// y: 550 + Math.sin(((Math.PI * 2) / 10) * 10) * 200,
// },
// {
// name: "3",
// symbolSize: 40,
// category: 1,
// value: "3",
// // x: 80,
// // y: 80,
// x: 550 + Math.cos(((Math.PI * 3) / 10) * 10) * 200,
// y: 550 + Math.sin(((Math.PI * 3) / 10) * 10) * 200,
// },
// {
// name: "4",
// symbolSize: 40,
// category: 1,
// value: "3",
// // x: 80,
// // y: 80,
// x: 550 + Math.cos(((Math.PI * 4) / 10) * 10) * 200,
// y: 550 + Math.sin(((Math.PI * 4) / 10) * 10) * 200,
// },
// ],
links: links, links: links,
lineStyle: { lineStyle: {
normal: { normal: {
...@@ -172,8 +231,7 @@ export default { ...@@ -172,8 +231,7 @@ export default {
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {},
},
}, },
}, },
yAxis: { yAxis: {
......
...@@ -60,15 +60,15 @@ ...@@ -60,15 +60,15 @@
/> />
</a-config-provider> </a-config-provider>
</a-form-item> </a-form-item>
<a-row><label for="">注册资本</label></a-row> <a-row><label for="">注册资本(人民币)</label></a-row>
<a-row> <a-row>
<a-col :span="11"> <a-col :span="11">
<a-form-item name="capital_nums_min"> <a-form-item name="capital_nums_min">
<a-input <a-input
v-model="formState.capital_nums_min" v-model="formState.capital_nums_min"
style="width: 95%" style="width: 80%"
placeholder="请输入数值" placeholder="请输入数值"
></a-input> ></a-input>&nbsp;
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="1">-</a-col> <a-col :span="1">-</a-col>
...@@ -76,9 +76,9 @@ ...@@ -76,9 +76,9 @@
<a-form-item name="capital_nums_max"> <a-form-item name="capital_nums_max">
<a-input <a-input
v-model="formState.capital_nums_max" v-model="formState.capital_nums_max"
style="width: 95%" style="width: 80%"
placeholder="请输入数值" placeholder="请输入数值"
></a-input> ></a-input>&nbsp;
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
v-model:value="valueInnovation" v-model:value="valueInnovation"
placeholder="请选择" placeholder="请选择"
:options="optionsInnovation" :options="optionsInnovation"
allowClear
></a-select> ></a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
...@@ -215,7 +216,6 @@ export default { ...@@ -215,7 +216,6 @@ export default {
optionsArea: [], optionsArea: [],
valueInnovation: "", valueInnovation: "",
optionsInnovation: [ optionsInnovation: [
{ label: "请选择", value: "" },
{ label: "企业科创能力", value: "企业科创能力" }, { label: "企业科创能力", value: "企业科创能力" },
{ label: "企业技术合作", value: "企业技术合作" }, { label: "企业技术合作", value: "企业技术合作" },
], ],
...@@ -378,7 +378,7 @@ export default { ...@@ -378,7 +378,7 @@ export default {
: null, : null,
capital_nums_min: Number(this.formState.capital_nums_min), capital_nums_min: Number(this.formState.capital_nums_min),
capital_nums_max: Number(this.formState.capital_nums_max), capital_nums_max: Number(this.formState.capital_nums_max),
innovate: this.valueInnovation, innovate: this.valueInnovation?this.valueInnovation:null,
}; };
//将筛选条件渲染到页面上//搜索结果标签 //将筛选条件渲染到页面上//搜索结果标签
let filter = []; let filter = [];
...@@ -388,11 +388,14 @@ export default { ...@@ -388,11 +388,14 @@ export default {
...params.area, ...params.area,
...params.company_industry, ...params.company_industry,
...params.qualification, ...params.qualification,
params.innovate, // params.innovate,
]; ];
if (key == "keyword") { if (key == "keyword") {
params.keyword ? filter.push(params.keyword) : ""; params.keyword ? filter.push(params.keyword) : "";
} }
if(key == "innovate"){
params.innovate?filter.push(params.innovate) : "";
}
} }
this.filter = filter; this.filter = filter;
//请求接口 //请求接口
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="company_con"> <div class="company_con">
<div class="company_con_left"> <div class="company_con_left">
<!-- 研发规模 --> <!-- 研发规模 -->
<div class="company_con1" id="researchDevelopment "> <div class="company_con1" id="researchDevelopment">
<h2 class="title">研发规模</h2> <h2 class="title">研发规模</h2>
<a-descriptions <a-descriptions
bordered bordered
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</div> </div>
</div> </div>
<div class="company_con_anchor"> <div class="company_con_anchor">
<a-anchor> <a-anchor @click="handleAnchorClick">
<a-anchor-link <a-anchor-link
style="font-size: 20px; color: #1c1c28; font-weight: bold" style="font-size: 20px; color: #1c1c28; font-weight: bold"
title="研发概要" title="研发概要"
...@@ -554,6 +554,9 @@ export default { ...@@ -554,6 +554,9 @@ export default {
}, },
]; ];
}, },
handleAnchorClick(e,link){
e.preventDefault();
},
}, },
created() { created() {
this.deveSustainData = this.$props.deveSustain; this.deveSustainData = this.$props.deveSustain;
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</div> </div>
</div> </div>
<div class="company_con_anchor"> <div class="company_con_anchor">
<a-anchor> <a-anchor @click="handleAnchorClick">
<a-anchor-link <a-anchor-link
style="font-size: 20px; color: #1c1c28; font-weight: bold" style="font-size: 20px; color: #1c1c28; font-weight: bold"
title="科创能力评价" title="科创能力评价"
...@@ -93,6 +93,9 @@ export default { ...@@ -93,6 +93,9 @@ export default {
this.getOption2(); this.getOption2();
}, },
methods: { methods: {
handleAnchorClick(e,link){
e.preventDefault();
},
getOption1() { getOption1() {
let chart = echarts.init(document.getElementById("echartsraodar")); let chart = echarts.init(document.getElementById("echartsraodar"));
let option1 = { let option1 = {
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
> >
<a-form-item <a-form-item
name="username" name="username"
:rules="[ :rules="[{ required: true, message: '请输入用户名!' }]"
{ required: true, message: '请输入用户名!' },
]"
> >
<a-input v-model:value="formState.username"> <a-input v-model:value="formState.username">
<template #prefix> <template #prefix>
...@@ -44,9 +42,7 @@ ...@@ -44,9 +42,7 @@
<a-form-item <a-form-item
name="password" name="password"
:rules="[ :rules="[{ required: true, message: '请输入密码!' }]"
{ required: true, message: '请输入密码!' },
]"
> >
<a-input-password v-model:value="formState.password"> <a-input-password v-model:value="formState.password">
<template #prefix> <template #prefix>
...@@ -56,7 +52,7 @@ ...@@ -56,7 +52,7 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-form-item name="remember" > <a-form-item name="remember">
<a-checkbox v-model:checked="formState.remember" <a-checkbox v-model:checked="formState.remember"
>记住密码</a-checkbox >记住密码</a-checkbox
> >
...@@ -79,7 +75,7 @@ ...@@ -79,7 +75,7 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<div class="admin_login"> <div class="admin_login">
<img src="../../static/login/icon-glydl.png" alt="">&nbsp;&nbsp; <img src="../../static/login/icon-glydl.png" alt="" />&nbsp;&nbsp;
<router-link to="/login">账户登录</router-link> <router-link to="/login">账户登录</router-link>
</div> </div>
<!-- <div style="float: right;"> <!-- <div style="float: right;">
...@@ -90,8 +86,16 @@ ...@@ -90,8 +86,16 @@
</div> </div>
</div> </div>
<footer> <footer>
<a style="color: #818A9F;" href="http://zhongyanrenzhi.com/#/product2" target="_blank">产品介绍&nbsp;&nbsp;&nbsp;&nbsp;</a>| <a
<a style="color: #818A9F;" target="_blank" href="http://zhongyanrenzhi.com/#/into/1" style="color: #818a9f"
href="http://zhongyanrenzhi.com/#/product2"
target="_blank"
>产品介绍&nbsp;&nbsp;&nbsp;&nbsp;</a
>|
<a
style="color: #818a9f"
target="_blank"
href="http://zhongyanrenzhi.com/#/into/1"
>&nbsp;&nbsp;&nbsp;&nbsp;关于中研认知</a >&nbsp;&nbsp;&nbsp;&nbsp;关于中研认知</a
><br /> ><br />
<span>版权所有:北京中研硕福科技有限公司&nbsp;&nbsp;&nbsp;&nbsp;</span <span>版权所有:北京中研硕福科技有限公司&nbsp;&nbsp;&nbsp;&nbsp;</span
...@@ -114,33 +118,34 @@ export default { ...@@ -114,33 +118,34 @@ export default {
}, },
}; };
}, },
methods:{ methods: {
//账号登录 //账号登录
login(){ login() {
let param = AES_Encrypt( let param = AES_Encrypt(
JSON.stringify({ JSON.stringify({
login_name:this.formState.username, login_name: this.formState.username,
password:this.formState.password, password: this.formState.password,
}) })
); );
login({ login({
param, param,
}).then((res) => { }).then((res) => {
console.log(res) // console.log(res);
if(res.code == 0){ if (res.code == 0) {
message.success('登录成功') message.success("登录成功");
// this.$store.commit('setTOKEN',res.data.token) // this.$store.commit('setTOKEN',res.data.token)
this.$store.commit('setname',this.formState.username) // this.$store.commit('setname',this.formState.username)
localStorage.setItem('token',res.data.token) localStorage.setItem("login_name", this.formState.username);
localStorage.setItem("token", res.data.token);
this.$router.push({ this.$router.push({
path:'/adminset' path: "/adminset",
}) });
}else{ } else {
message.error(res.msg) message.error(res.msg);
} }
}); });
}, },
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -148,7 +153,7 @@ export default { ...@@ -148,7 +153,7 @@ export default {
height: 50px; height: 50px;
} }
/deep/.ant-form { /deep/.ant-form {
margin-top:30px; margin-top: 30px;
} }
/deep/.login-form-button { /deep/.login-form-button {
width: 100%; width: 100%;
...@@ -156,8 +161,7 @@ export default { ...@@ -156,8 +161,7 @@ export default {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
} }
/deep/.ant-form-item-control-input{ /deep/.ant-form-item-control-input {
height: 60px; height: 60px;
} }
.login { .login {
...@@ -240,8 +244,8 @@ export default { ...@@ -240,8 +244,8 @@ export default {
} }
} }
} }
.admin_login{ .admin_login {
img{ img {
width: 20px; width: 20px;
vertical-align: middle; vertical-align: middle;
} }
......
...@@ -22,13 +22,7 @@ ...@@ -22,13 +22,7 @@
<div class="login_title"> <div class="login_title">
<span>账户登录</span> <span>账户登录</span>
</div> </div>
<a-form <a-form :model="formState" name="normal_login" class="login-form">
:model="formState"
name="normal_login"
class="login-form"
@finish="onFinish"
@finishFailed="onFinishFailed"
>
<a-form-item <a-form-item
name="username" name="username"
:rules="[{ required: true, message: '请输入用户名!' }]" :rules="[{ required: true, message: '请输入用户名!' }]"
...@@ -132,6 +126,7 @@ export default { ...@@ -132,6 +126,7 @@ export default {
methods: { methods: {
//账号登录 //账号登录
login() { login() {
console.log(this.formState.password);
let param = AES_Encrypt( let param = AES_Encrypt(
JSON.stringify({ JSON.stringify({
login_name: this.formState.username, login_name: this.formState.username,
...@@ -142,6 +137,9 @@ export default { ...@@ -142,6 +137,9 @@ export default {
param, param,
}).then((res) => { }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
if (res.data.is_admin) {
message.warning("请切换管理员登录页面");
} else {
message.success("登录成功"); message.success("登录成功");
// this.$store.commit("setname", this.formState.username); // this.$store.commit("setname", this.formState.username);
...@@ -156,7 +154,8 @@ export default { ...@@ -156,7 +154,8 @@ export default {
this.$router.push({ this.$router.push({
path: "/index", path: "/index",
}); });
localStorage.setItem("current",'首页'); localStorage.setItem("current", "首页");
}
} else { } else {
message.error(res.msg); message.error(res.msg);
} }
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
</div> </div>
</div> </div>
<div class="company_con_anchor"> <div class="company_con_anchor">
<a-anchor> <a-anchor @click="handleAnchorClick">
<!-- <a-anchor-link href="#technicalSummary" title="AI技术摘要" /> --> <!-- <a-anchor-link href="#technicalSummary" title="AI技术摘要" /> -->
<a-anchor-link href="#summary" title="摘要" /> <a-anchor-link href="#summary" title="摘要" />
<a-anchor-link href="#techAera" title="技术领域" /> <a-anchor-link href="#techAera" title="技术领域" />
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
mode="multiple" mode="multiple"
placeholder="请选择" placeholder="请选择"
style="width: 300px" style="width: 300px"
></a-select> ></a-select><a-button type="primary">搜索</a-button>
<div class="result"> <div class="result">
推荐 推荐
<span style="color: #4079ff; font-weight: bold">{{ count }}</span <span style="color: #4079ff; font-weight: bold">{{ count }}</span
...@@ -400,6 +400,9 @@ export default { ...@@ -400,6 +400,9 @@ export default {
DownOutlined, DownOutlined,
}, },
methods: { methods: {
handleAnchorClick(e,link){
e.preventDefault();
},
openModal() { openModal() {
this.visible = true; this.visible = true;
}, },
......
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
:label-col="{ span: 2 }" :label-col="{ span: 2 }"
:wrapper-col="{ span: 5 }" :wrapper-col="{ span: 5 }"
autocomplete="off" autocomplete="off"
ref="form"
> >
<a-form-item label="头像" name="img" class="header_label"> <a-form-item label="头像" name="img" class="header_label">
<img src="../../static/user/img-tx-big.png" alt="" class="header" /> <img src="../../static/user/img-tx-big.png" alt="" class="header" />
<a-upload <a-upload
v-model:file-list="fileList" v-model:file-list="fileList"
name="file" name="file"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" action="/api/api/common/uploadFile"
:headers="headers" :headers="headers"
@change="handleChange" @change="handleChange"
> >
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
<a-form-item <a-form-item
label="手机号" label="手机号"
:rules="[ :rules="[
{ require: true, message: '请输入手机号' },
{ {
pattern: pattern:
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
...@@ -131,6 +133,13 @@ ...@@ -131,6 +133,13 @@
import { AES_Encrypt, AES_Decrypt } from "@/utils/aes_util.js"; import { AES_Encrypt, AES_Decrypt } from "@/utils/aes_util.js";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { sendSms } from "@/utils/loginAPI"; import { sendSms } from "@/utils/loginAPI";
import {
uploadFile,
userInfo,
bduserInfo,
updateuserInfo,
} from "@/utils/userAPI";
export default { export default {
name: "personalSetting", name: "personalSetting",
data() { data() {
...@@ -146,9 +155,10 @@ export default { ...@@ -146,9 +155,10 @@ export default {
authorization: "authorization-text", authorization: "authorization-text",
}, },
formState: { formState: {
name: "李建国", name: "",
phone: "", phone: "",
code: "", code: "",
head_img: "",
}, },
updateform: { updateform: {
phone: "", phone: "",
...@@ -160,27 +170,72 @@ export default { ...@@ -160,27 +170,72 @@ export default {
created() { created() {
//获取个人详细信息 //获取个人详细信息
// this.formState.phone = "1"; // this.formState.phone = "1";
this.getUserInfo();
}, },
mounted() { mounted() {
this.login_name = localStorage.getItem('login_name'); this.login_name = localStorage.getItem("login_name");
}, },
methods: { methods: {
handleChange(info) { //获取用户信息
if (info.file.status !== "uploading") { getUserInfo() {
console.log(info.file, info.fileList); userInfo().then((res) => {
if (res.code == 0) {
this.formState.name = res.data.name;
this.formState.head_img = res.data.head_img;
this.formState.phone = res.data.phone;
this.phone = res.data.phone;
} }
if (info.file.status === "done") { });
message.success(`${info.file.name} file uploaded successfully`); },
} else if (info.file.status === "error") { //修改手机号
message.error(`${info.file.name} file upload failed.`); handleOk() {
if (this.updateform.phone && this.updateform.code) {
this.visibleupdate = false;
this.formState.phone = this.updateform.phone;
} else {
message.error("请输入手机号和验证码");
} }
}, },
//发送验证码 //发送验证码
sendCode() { sendCode() {
//修改手机号弹窗发送验证码
if (this.visibleupdate) {
if (this.updateform.phone) {
sendSms({ phone: this.updateform.phone }).then((res) => {
// console.log(res)
if (res.code == 0) {
this.updateform.phone = "";
this.updateform.code = "";
this.isSend = true;
const TIME_COUNT = 60;
message.success(res.msg);
//获取验证码倒计时
if (!this.timer) {
this.RemainingTime = TIME_COUNT;
this.isSend = true;
this.timer = setInterval(() => {
if (
this.RemainingTime > 0 &&
this.RemainingTime <= TIME_COUNT
) {
this.RemainingTime--;
} else {
this.isSend = false;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
} else {
message.error(res.msg);
}
});
} else {
message.error(res.msg);
}
} else {
if (this.formState.phone) { if (this.formState.phone) {
sendSms({ phone: this.formState.phone }).then((res) => { sendSms({ phone: this.formState.phone }).then((res) => {
// console.log(res)
if (res.code == 0) { if (res.code == 0) {
this.isSend = true; this.isSend = true;
const TIME_COUNT = 60; const TIME_COUNT = 60;
...@@ -209,9 +264,42 @@ export default { ...@@ -209,9 +264,42 @@ export default {
} else { } else {
message.error("请先输入手机号"); message.error("请先输入手机号");
} }
}
}, },
//保存个人信息 //保存个人信息
save() {}, save() {
//更新手机号修改信息
if (this.phone != "" && this.formState.code == "") {
updateuserInfo({
head_img: this.formState.head_img,
name: this.formState.name,
phone: this.formState.phone,
}).then((res) => {
if (res.code == 0) {
// this.formState.phone = this.updateform.phone;
message.success(res.msg);
} else {
message.error(res.msg);
}
});
} else {
//绑定手机号
if (this.formState.phone == "") {
bduserInfo({ ...this.formState }).then((res) => {
if (res.code == 0) {
message.success(res.msg);
location.reload();
} else {
message.error(res.msg);
}
});
} else {
message.error("请输入手机号");
}
}
//
},
//修改手机号 //修改手机号
updatePhone() { updatePhone() {
this.visibleupdate = true; this.visibleupdate = true;
......
...@@ -107,8 +107,8 @@ export default { ...@@ -107,8 +107,8 @@ export default {
}, },
//发送验证码 //发送验证码
sendCode() { sendCode() {
if (this.phone) { if (this.formState.phone) {
sendSms({ phone: this.phone }).then((res) => { sendSms({ phone: this.formState.phone }).then((res) => {
// console.log(res) // console.log(res)
if (res.code == 0) { if (res.code == 0) {
this.isSend = true; this.isSend = true;
......
...@@ -18,12 +18,12 @@ module.exports = { ...@@ -18,12 +18,12 @@ module.exports = {
// 配置不同的后台API地址 // 配置不同的后台API地址
proxy: { proxy: {
'/api': { '/api': {
target: 'http://39.100.39.50:5089/', target: 'http://39.100.39.50:5089',
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
pathRewrite: { // pathRewrite: {
'^/api': '' // '^/api': ''
} // }
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment