Commit bda5e198 by 潘建波

提交

1 parent ee4353b9
{"commit":"f25c960da3c22d3c221e8aea91f7d7a900b0205d","commitDate":"2021-5-31 14:0","buildDate":"2021-6-16 11:9","version":"2.1.0","info":"合并修改"}
\ No newline at end of file \ No newline at end of file
{"commit":"ee4353b91c6bb3ef6b691b251786ce1d00609012","commitDate":"2021-6-16 17:19","buildDate":"2021-6-22 13:50","version":"2.1.0","info":"code增加token"}
\ No newline at end of file \ No newline at end of file
...@@ -79,7 +79,7 @@ service.interceptors.request.use( ...@@ -79,7 +79,7 @@ service.interceptors.request.use(
service.interceptors.response.use(response => { service.interceptors.response.use(response => {
// endLoading(); // endLoading();
if (response.data && response.data.ecode && response.data.ecode == 401) { if (response.data && response.data.ecode && response.data.ecode == 401) {
localStorage.removeItem("atoken"); // localStorage.removeItem("atoken");
router.replace({ router.replace({
path: "/" path: "/"
}); });
......
...@@ -4,7 +4,7 @@ import axios from "axios"; ...@@ -4,7 +4,7 @@ import axios from "axios";
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.245:20080"; // 测试环境url baseUrl = window.config.https?"https://192.168.9.245:20070":"http://192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url // baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -53,6 +53,9 @@ export const constantRouterMap = [{ ...@@ -53,6 +53,9 @@ export const constantRouterMap = [{
}, { }, {
path: "/resetpass", path: "/resetpass",
name: "resetpassword", name: "resetpassword",
meta:{
isopen:true
},
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
......
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
<script> <script>
let particlesConfig = require("../assets/js/particles.json"); let particlesConfig = require("../assets/js/particles.json");
let versioninfo = window.config.version let versioninfo = window.config.version;
let sha1 = require('js-sha1') let sha1 = require("js-sha1");
import types from "../store/types.js"; import types from "../store/types.js";
export default { export default {
name: "Login", name: "Login",
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
password: "", password: "",
showdd: true, showdd: true,
innerHeight: 0, innerHeight: 0,
step:0, step: 0,
logintitle: "", logintitle: "",
isdd: window.config.isdd, isdd: window.config.isdd,
webSocketL: null, webSocketL: null,
...@@ -132,11 +132,12 @@ export default { ...@@ -132,11 +132,12 @@ export default {
}, },
//兼容处理 //兼容处理
login(type) { login(type) {
this.$api.login this.$api.login
.login({ .login({
username: this.ruleForm.username, username: this.ruleForm.username,
password: window.config.encrypt?sha1(this.ruleForm.password):this.baseencode(this.ruleForm.password), password: window.config.encrypt
? sha1(this.ruleForm.password)
: this.baseencode(this.ruleForm.password),
// password: this.ruleForm.password, // password: this.ruleForm.password,
user_type: "user", user_type: "user",
}) })
...@@ -144,17 +145,18 @@ export default { ...@@ -144,17 +145,18 @@ export default {
if (!res.ecode) { if (!res.ecode) {
this.loginMount(res, "user"); this.loginMount(res, "user");
} else { } else {
if(res.ecode == "1000"){ debugger;
this.$router.push('resetpass') if (res.ecode == "1000") {
return false this.$router.push("/resetpass")
} } else {
this.$message({ this.$message({
type: "error", type: "error",
message: res.enote, message: res.enote,
}); });
} }
}
}) })
.catch(err => { .catch((err) => {
this.$message({ this.$message({
type: "error", type: "error",
message: err, message: err,
...@@ -191,19 +193,19 @@ export default { ...@@ -191,19 +193,19 @@ export default {
//获取菜单 //获取菜单
this.$api.login this.$api.login
.getMenus({ .getMenus({
shape: "tree" shape: "tree",
}) })
.then( res => { .then((res) => {
localStorage.setItem( localStorage.setItem(
"menu", "menu",
JSON.stringify(res.menu_tree[0].children) JSON.stringify(res.menu_tree[0].children)
); );
this.$store this.$store
.dispatch("GetMenuRole", res.menu_tree[0].children) .dispatch("GetMenuRole", res.menu_tree[0].children)
.then(r => { .then((r) => {
this.$router this.$router
.push(res.menu_tree[0].children[0].children[0].path) .push(res.menu_tree[0].children[0].children[0].path)
.catch(err => { .catch((err) => {
err; err;
}); });
}); });
...@@ -213,27 +215,27 @@ export default { ...@@ -213,27 +215,27 @@ export default {
this.$api.login this.$api.login
.algocombs({ .algocombs({
limit: "", limit: "",
algo_set: "video" algo_set: "video",
}) })
.then(res => { .then((res) => {
if (!res.ecode) { if (!res.ecode) {
this.$store.commit(types.ALGO, res.list_data); this.$store.commit(types.ALGO, res.list_data);
} }
}) })
.catch(err => {}); .catch((err) => {});
}, },
storeConfList() { storeConfList() {
this.$api.login this.$api.login
.storeconfs({ .storeconfs({
offset: 0, offset: 0,
limit: "" limit: "",
}) })
.then(res => { .then((res) => {
if (!res.ecode) { if (!res.ecode) {
this.$store.commit(types.STORECONF, res.list_data); this.$store.commit(types.STORECONF, res.list_data);
} }
}) })
.catch(err => {}); .catch((err) => {});
}, },
getCodeList() { getCodeList() {
this.$api.codes this.$api.codes
......
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
methods: { methods: {
submitForm(formName) { submitForm(formName) {
let data = { let data = {
old_pwd: window.config.encrypt?sha1(this.ruleForm.password):this.baseencode(this.ruleForm.password), old_pwd: window.config.encrypt?sha1(this.ruleForm.oldpassword):this.baseencode(this.ruleForm.oldpassword),
new_pwd: window.config.encrypt?sha1(this.ruleForm.newpassword):this.baseencode(this.ruleForm.newpassword), new_pwd: window.config.encrypt?sha1(this.ruleForm.newpassword):this.baseencode(this.ruleForm.newpassword),
}; };
...@@ -99,8 +99,16 @@ export default { ...@@ -99,8 +99,16 @@ export default {
if (valid) { if (valid) {
let user_unid = sessionStorage.getItem("user_unid"); let user_unid = sessionStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => { this.$api.ops.resetPwd(data, user_unid).then(res => {
if(!res.ecode){
this.$logs.oplogs(res, "serv_login", `修改密码`); this.$logs.oplogs(res, "serv_login", `修改密码`);
this.$router.push("/login"); this.$router.push("/login");
} else {
this.$message({
type: "error",
message: res.enote
});
}
}).catch(err => { }).catch(err => {
if (err.response) { if (err.response) {
this.$message({ this.$message({
......
...@@ -223,7 +223,7 @@ console.log('上传') ...@@ -223,7 +223,7 @@ console.log('上传')
this.getData(); this.getData();
}, },
getDevs(){ getDevs(){
this.$api.resource.devs({}).then(res=>{ this.$api.resource.devs().then(res=>{
if(res.length > 0) { if(res.length > 0) {
this.devOpt = res.map((v, i) => { this.devOpt = res.map((v, i) => {
return { return {
......
...@@ -343,7 +343,7 @@ export default { ...@@ -343,7 +343,7 @@ export default {
row.user_unid row.user_unid
) )
.then(res => { .then(res => {
if (res.atoken) { if (res.ecode == '200') {
this.$message({ this.$message({
type: "success", type: "success",
message: "重置密码成功!" message: "重置密码成功!"
...@@ -352,7 +352,7 @@ export default { ...@@ -352,7 +352,7 @@ export default {
} else { } else {
this.$message({ this.$message({
type: "error", type: "error",
message: "重置密码失败!" message: res.enote
}); });
} }
}); });
...@@ -389,12 +389,13 @@ export default { ...@@ -389,12 +389,13 @@ export default {
}) })
.then(res => { .then(res => {
if (res.ecode == "200" || !res.ecode) { if (res.ecode == "200" || !res.ecode) {
this.$api.ops this.$api.ops
.bindRole( .bindRole(
{ {
role_unid: this.addForm.role_unid role_unid: this.addForm.role_unid
}, },
res.user_unid res.enote.user_unid
) )
.then(data => { .then(data => {
if (!data.ecode) { if (!data.ecode) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!