You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Alanxtl (via GitHub)" <gi...@apache.org> on 2025/07/16 03:51:34 UTC
[PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Alanxtl opened a new pull request, #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697
#684
Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078638916
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.1% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078559696
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [13 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146958085
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#discussion_r2249203132
##########
admin/controller/account/user.go:
##########
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package account
+
+import (
Review Comment:
foramt
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078574839
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [11 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078581825
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [10 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146960928
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146989540
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3076636706
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [13 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#discussion_r2209249929
##########
web/vue.config.js:
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+const path = require('path');
+
+const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+
+// const ThreeExamples = require('import-three-examples')
+function resolve(dir) {
+ return path.join(__dirname,'.', dir);
+}
+
+module.exports = {
+ baseUrl : '/',
Review Comment:
The 'baseUrl' option is deprecated in newer Vue CLI versions; prefer using 'publicPath' only.
```suggestion
```
##########
web/src/views/Screen.vue:
##########
@@ -0,0 +1,58 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div id="app">
+ <router-view/>
+ </div>
+</template>
+
+
+<script>
+
+export default {
+ name: "app",
+ components: {},
+ mounted() {
+ this.init()
+ },
+ methods: {
+ async init() {
+ await this.getData()
+ this.getNowData()
+ },
+ async getData() {
+ setTimeout(function(){
+ console.log(111)
+ }, 5000)
+ clearTimeout()
Review Comment:
clearTimeout is called without a timer ID, so the timeout cannot be canceled. Store the return value from setTimeout and pass it into clearTimeout.
```suggestion
const timerId = setTimeout(function(){
console.log(111)
}, 5000)
clearTimeout(timerId)
```
##########
web/vue.config.js:
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+const path = require('path');
+
+const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
+
+// const ThreeExamples = require('import-three-examples')
+function resolve(dir) {
+ return path.join(__dirname,'.', dir);
+}
+
+module.exports = {
+ baseUrl : '/',
+ publicPath : '/',
+ productionSourceMap: true,
+ chainWebpack: config => {
+ config.resolve.alias
+ .set('@', resolve('src'))
+ .set('@assets',resolve('src/assets'))
+ .set('styles',resolve('src/styles'))
+ .set('@utils',resolve('src/utils'))
+ .set('@views',resolve('src/views'))
+ },
+ devServer:{
+ // 设置代理
+ // before: require('./src/mock'),
+ host: '0.0.0.0',
+ port: 8080,
+ hot: true,
+ https: false,
+ open: false,
+ disableHostCheck: true,
+ proxy: {
+ "/config": {
+ target: process.env.VUE_APP_BACKEND_URL,
+ ws: true, // enable websocket proxy
+ changOrigin: true, // enable proxy module
Review Comment:
Typo in proxy configuration: 'changOrigin' should be 'changeOrigin' to correctly set the proxy's changeOrigin option.
```suggestion
changeOrigin: true, // enable proxy module
```
##########
web/src/views/dashboard/personInfo/userInfo.vue:
##########
@@ -0,0 +1,300 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+<div>
+ <el-form ref="form" :model="user" :rules="rules" label-width="80px">
+ <el-form-item label="用户名称" prop="username">
+ <el-input v-model="user.username" disabled maxlength="12" />
+ </el-form-item>
+ <el-form-item label="旧密码" prop="oldPassword" >
+ <el-input v-model="user.oldPassword" maxlength="12" />
+ </el-form-item>
+ <el-form-item label="新密码" prop="newPassword">
+ <el-input v-model="user.newPassword" maxlength="12" />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" size="mini" @click="submit">保存</el-button>
+ <!-- <el-button type="danger" size="mini" @click="close">关闭</el-button> -->
+ </el-form-item>
+ </el-form>
+ <div>
+ <el-dialog
+ title="短信验证码"
+ :visible.sync="dialogVisible"
+ width="300px"
+ :before-close="handleClose">
+ <div class="login">
+ <!-- 手机号 -->
+ <InputGroup
+ placeholder="手机号"
+ v-model="phone"
+ :error="errors.phone"
+ :disableInput="myDisable"
+ />
+ <!-- 输入验证码 -->
+ <InputGroup
+ v-model="verifyCode"
+ placeholder="验证码"
+ :error="errors.code"
+ :btnTitle="btnTitle"
+ :disabled="disabled"
+ @btnClick="getVerifyCode"
+ />
+ <!-- 登录按钮 -->
+
+ <div class="login_btn">
+ <button @click="handleLogin" :disabled="isClick">确 定</button>
+ </div>
+ </div>
+ </el-dialog>
+ </div>
+</div>
+</template>
+
+<script>
+import InputGroup from '@/components/InputGroup'
+import api from '@/api'
+import fetch from '@/utils/fetch'
+import {mapGetters, mapActions} from 'vuex'
+import { getToken, setToken, removeToken, getLocalStorage, setLocalStorage,clearLocalStorage } from '@/utils/auth'
+export default {
+ components:{InputGroup},
+ props: {
+
+ },
+ data() {
+ return {
+ myDisable:true,
+ phone:"", //手机号
+ verifyCode:"", //验证码
+ btnTitle:"获取验证码",
+ disabled:false, //是否可点击
+ errors:{}, //验证提示信息
+ dialogVisible:false,
+ user:{
+ username:"",
+ oldPassword:"",
+ newPassword:''
+ },
+ // 表单校验
+ rules: {
+ username: [
+ { required: true, message: "用户名称不能为空", trigger: "blur" }
+ ],
+ oldPassword: [
+ { required: true, message: "旧密码不能为空", trigger: "blur" }
+ ],
+ newPassword: [
+ { required: true, message: "新密码不能为空", trigger: "blur" }
+ ]
+ }
+ };
+ },
+ created() {
+ this.user.username = getLocalStorage('operatorInfo').username
+ },
+ computed: {
+ ...mapGetters([
+ 'operatorInfo'
+ ]),
+
+ //手机号和验证码都不能为空
+ isClick(){
+ if(!this.phone || !this.verifyCode) {
+ return true
+ } else {
+ return false
+ }
+
+ }
+ },
+ methods: {
+ ...mapActions([
+ 'setOperatorInfo',
+ 'setToken',
+ ]),
+ submit() {
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ let formData = new FormData();
+ formData.append('username', this.user.username);
+ formData.append('oldPassword', this.user.oldPassword);
+ formData.append('newPassword', this.user.newPassword);
+ fetch({
+ url: api['getPasswordEdit'].url || '',
+ method: 'post',
+ data: formData
+ }).then(res => {
+ console.log(res, '=====>1')
+ this.$msgbox({
+ message: "密码修改成功",
+ title: '成功',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'success'
+ })
+ }).catch(error => {
+ console.log(error);
+ this.$msgbox({
+ message: error.message,
+ title: '失败',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'error'
+ })
+ });
+ }
+ });
+ },
+ getVerifyCode(){
+ //获取验证码
+ if(this.validatePhone()) {
+ let params = {
+ url: api['operatorSendSms'].url,
+ method: 'post',
+ data: {
+ opId: this.operatorInfo.op_code,
+ phone: this.phone,
+ smsType: 3
+ }
+ }
+ fetch(params).then(res => {
+ this.$msgbox({
+ message: '发送成功',
+ title: '成功',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'success'
+ })
+ this.validateBtn()
+ }).catch(error => {
+ this.$msgbox({
+ message: error.message,
+ title: '失败',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'error'
+ })
+ })
+ }
+ },
+ handleLogin() {
+ let params = {
+ url: api['operatorUpdateData'].url,
+ method: 'post',
+ data: {
+ code: this.verifyCode,
+ email: this.user.email,
+ opId: this.operatorInfo.op_code,
+ phone: this.phone,
+ sex: this.user.sex,
+ address: "",
+ }
+ }
+ fetch(params).then(res => {
+ this.$msgbox({
+ message: '数据保存成功',
+ title: '成功',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'success'
+ })
+ let data = this.operatorInfo;
+ Object.assign(data, this.user)
+ this.setOperatorInfo(data)
+ this.dialogVisible = false
+ }).catch(error => {
+ this.$msgbox({
+ message: error.message,
+ title: '失败',
+ customClass: 'my_msgBox singelBtn',
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ type: 'error'
+ })
+ })
+ },
+ validateBtn(){
+ //倒计时
+ let time = 60;
+ let timer = setInterval(() => {
+ if(time == 0) {
+ clearInterval(timer);
+ this.disabled = false;
+ this.btnTitle = "获取验证码";
+ } else {
+ this.btnTitle =time + '秒后重试';
+ this.disabled = true;
+ time--
+ }
+ },1000)
+ },
+ handleClose() {
+ this.dialogVisible = false
+ },
+ validatePhone(){
+ //判断输入的手机号是否合法
+ if(!this.phone) {
+ this.errors = {
+ phone:"手机号码不能为空"
+ }
+ // return false
+ } else if(!/^1[345678]\d{9}$/.test(this.phone)) {
+ this.errors = {
+ phone:"请输入正确是手机号"
Review Comment:
Error message text has a typo: '请输入正确是手机号' should be '请输入正确的手机号'.
```suggestion
phone:"请输入正确的手机号"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3092201865
<img width="707" height="1138" alt="image" src="https://github.com/user-attachments/assets/ab8d90aa-4e01-4596-bda7-b2897de68028" />
上面是 GPT 的建议,我也觉得在根目录下单独放一个 admin 目录更好,不要跟现有代码放一块
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#discussion_r2209151898
##########
web/src/components/common/CustomLayout.vue:
##########
@@ -0,0 +1,246 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="page">
+ <div class="page-head" v-if="fromType">
+ <div class="page-head__title">
+ <span v-if="!subTitle">{{ title }}</span>
+ <el-breadcrumb separator="/" v-else>
+ <el-breadcrumb-item>
+ <div @click="goBack" class="previous-route">
+ {{ title && title.length > 4 ? `${title.substring(0, 4)}...` : title }}
+ </div>
+ </el-breadcrumb-item>
+ <el-breadcrumb-item> {{ subTitle }}</el-breadcrumb-item>
+ <el-breadcrumb-item v-if="thirdTitle">{{
+ thirdTitle
+ }}</el-breadcrumb-item>
+ </el-breadcrumb>
+ </div>
+ <div class="page-head__toolbox">
+ <slot name="toolbox"></slot>
+ </div>
+ </div>
+ <el-scrollbar class="page-content" :class="{ 'page-content--have-fixed-bottom': fixedBottom,
+ 'page-content--fromType' : !fromType }">
+ <slot></slot>
+ <!-- <div class="page-logo"></div> -->
+ </el-scrollbar>
+ </div>
+</template>
+
+<script>
+import { getLocationSearchObj } from '@/utils/common.js'
+
+export default {
+ namne: 'CustomLayout',
+ props: {
+ title: String,
+ subTitle: String,
+ thirdTitle: String,
+ fixedBottom: Boolean
+ },
+ data () {
+ return {
+ fromType: false
+ }
+ },
+ methods: {
+ init() {
+ let params = getLocationSearchObj()
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGf1IGTjcNxZo44b-->Remove this useless assignment to variable "params". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGf1IGTjcNxZo44b&open=AZgRXGf1IGTjcNxZo44b&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/214)
##########
web/src/components/CustomMenu.vue:
##########
@@ -0,0 +1,280 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<template>
+ <div class="custom-menu" v-if="fromType">
+ <!-- <div class="menu-title">内容管理</div>
+ <div class="menu-search">
+ <el-input
+ placeholder="搜索"
+ v-model="keyWord">
+ <i slot="suffix" class="el-input__icon el-icon-search"></i>
+ </el-input>
+ <div class="menu-search-container" v-show="searchBox">
+ <div class="menu-search-item" v-for="item in searchList"
+ :key="item.id" @click="handleSearchMenuClick(item)">{{item.title}}</div>
+ <div class="menu-search--empty" v-show="searchList.length == 0">暂无数据</div>
+ </div>
+ </div> -->
+ <el-menu
+ :default-active="defaultActive"
+ class="custom-menu-container"
+ @open="handleOpen"
+ @close="handleClose">
+ <div v-for="(item, index) in menuList" :key="index">
+ <el-submenu v-if="item.children.length >= 0" :index="item.id">
+ <template slot="title">{{item.name}}</template>
+ <el-menu-item :index="String(child.id)" @click="handleMenuClick(child)"
+ :data-index="child.id"
+ v-for="(child, childIdx) in item.children"
+ :key="childIdx">{{child.name}}</el-menu-item>
+ </el-submenu>
+ <!-- <el-menu-item v-if="item.children.length === 0"
+ :index="item.index"
+ :data-index="item.index"
+ @click="handleMenuClick(item)">{{item.title}}</el-menu-item> -->
+ </div>
+ </el-menu>
+ </div>
+</template>
+
+<script>
+import {getLocationSearchObj} from '@/utils/common.js'
+import {mapMutations, mapGetters} from 'vuex'
+import {clearLocalStorage} from '@/utils/auth.js'
+const debounce = require('lodash/debounce')
+import {menuList} from '@/api/menu-config.js'
+export default {
+ name: 'CustomMenu',
+ data () {
+ return {
+ defaultActive: '', // active menu
+ menuList: menuList, // menu list
+ searchList: [], // search list
+ keyWord: '', // keyword
+ searchBox: false, // search area
+ fromType: true, // true: 显示原有内容, false:隐藏部分内容 是否嵌入到其他项目中,需要对应隐藏部分内容(菜单,header)
+ }
+ },
+ watch: {
+ keyWord (val) {
+ if (val !== '' && val !== undefined) {
+ this.searchBox = true
+ this.handleSearch()
+ } else {
+ this.searchBox = false
+ }
+ }
+ },
+ methods: {
+ ...mapMutations(['setOrgId', 'setCurrentMenu']),
+ // clear page cache
+ clearPagination () {
+ clearLocalStorage('picTxtIdx')
+ clearLocalStorage('picTxtSize')
+ },
+ // 搜索过滤菜单内容
+ handleSearch: debounce(function () {
+ this.$get('/menu/search', {
+ keyWord: this.keyWord
+ }).then(res => {
+ if (res.code === 200) {
+ this.searchList = res.data
+ }
+ }).catch(err => {
+ console.log(err)
+ })
+ }, 200),
+ handleScrollPosition () {
+ let el = document.querySelector('.custom-menu-container')
+ let top = el.scrollTop
+ let current = document.querySelector(`[data-index=${this.defaultActive}]`)
+ let y = current.getBoundingClientRect().y
+ top = top + y - 60 - 56
+ el.scrollTop = top
+ },
+ handleSearchMenuClick (item) {
+ this.keyWord = ''
+ this.searchBox = false
+ this.searchList = []
+ this.handleMenuClick(item)
+ this.defaultActive = item.index
+ setTimeout(() => {
+ this.handleScrollPosition()
+ }, 300)
+ },
+ switchRouter (item) {
+ this.clearPagination()
+ this.$router.push({
+ path: item.componentName,
+ query: {
+ id: new Date().getTime()
+ }
+ })
+ let el = document.querySelector('.page-content .el-scrollbar__wrap')
+ if (el) {
+ el.scrollTop = 0
+ }
+ },
+ handleMenuClick (item) {
+ this.switchRouter(item)
+ },
+ handleOpen(key, keyPath) {
+ // console.log(key, keyPath)
+ },
+ handleClose(key, keyPath) {
+ // console.log(key, keyPath)
+ },
+ initMenu () {
+ // 0: default load method
+ // 1: external tool open
+ // 2: new window open
+ // 3: cover current window open
+ // 4: cloud listen backend content embed
+ // 5: notice not open
+ // 6: application router jump
+ console.log(this.menuList)
+ let findShow = this.menuList.find(item => item.children.length>0)
+ if(findShow){
+ this.initDefaultActive()
+ }else{
+ // this.$router.push({
+ // path:'/403'
+ // })
+ }
+ return;
+ // var type = current.openType
+ this.$get('/menu/getMenuList').then(res => {
+ if (res.code === 200 && res.data && res.data.length > 0) {
+ this.menuList = res.data
+ let findShow = this.menuList.find(item => item.children.length>0)
+ if(findShow){
+ this.initDefaultActive()
+ }else{
+ this.$router.push({
+ path:'/403'
+ })
+ }
+
+ } else {
+ this.$router.push({
+ path:'/403'
+ })
+ // this.$message.error(res.msg)
+ }
+ }).catch(err => {
+ console.log(err)
+ })
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGf5IGTjcNxZo44f-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGf5IGTjcNxZo44f&open=AZgRXGf5IGTjcNxZo44f&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/215)
##########
web/src/utils/cofetch.js:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from './dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/login", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ // console.log(store.getters)
+ // if (store.getters.token) {
+ // config.headers.token = getToken();
+ // }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
+ if(res.code == 503){
+ console.log(res)
+ dlgUtils.loginTimeout()
+ return Promise.reject({code: res.code, message: res.data})
+ }else{
+ setLocalStorage('expireTime', new Date().getTime() + 1000*60*60*24*7)
+ return res;
+ }
+
+ return Promise.reject({code: res.code, message: res.msg})
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgBIGTjcNxZo442-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgBIGTjcNxZo442&open=AZgRXGgBIGTjcNxZo442&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/219)
##########
web/src/utils/directives.js:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import Vue from 'vue';
+import { getLocalStorage } from '@/utils/auth'
+
+// account permission check
+Vue.prototype.$_has = function({rights}) {
+//debugger
+ let operatorInfo = getLocalStorage('operatorInfo');
+ let permission = operatorInfo.rights ? operatorInfo.rights.split(',') : [];
+ let resources = [];
+ let result = false;
+
+ // get current acccount role
+ if(Array.isArray(rights)){
+ rights.forEach((e) => {
+ resources = resources.concat([e]);
+ })
+ }else{
+ resources = resources.concat([rights.split(',')]);
+ }
+ // auth check
+ resources.map((p) => {
+ if(typeof p != 'string'){
+ p = p.toString();
+ }
+ if(permission.includes(p)){
+ return result = true;
Review Comment:
## Assignments should not be made from within sub-expressions
<!--SONAR_ISSUE_KEY:AZgRXGgWIGTjcNxZo45d-->Extract the assignment of "result" from this expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgWIGTjcNxZo45d&open=AZgRXGgWIGTjcNxZo45d&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/233)
##########
web/src/utils/fetch.js:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from '../utils/dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/config", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryn8D9asOnAnEU4Js0" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ console.log(store.getters)
+ let tk = getLocalStorage('operatorInfo').token
+ if (tk && tk != '') {
+ config.headers.token = tk;
+ config.headers.username = getLocalStorage('operatorInfo').username;
+ }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGgTIGTjcNxZo45b-->Remove this useless assignment to variable "expireTime". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgTIGTjcNxZo45b&open=AZgRXGgTIGTjcNxZo45b&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/231)
##########
web/src/utils/fetch.js:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from '../utils/dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/config", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryn8D9asOnAnEU4Js0" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ console.log(store.getters)
+ let tk = getLocalStorage('operatorInfo').token
+ if (tk && tk != '') {
+ config.headers.token = tk;
+ config.headers.username = getLocalStorage('operatorInfo').username;
+ }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
+ if(res.code == 503){
+ console.log(res)
+ dlgUtils.loginTimeout()
+ return Promise.reject({code: res.code, message: res.data})
+ }else{
+ setLocalStorage('expireTime', new Date().getTime() + 1000*60*60*24*7)
+ return res;
+ }
+
+ return Promise.reject({code: res.code, message: res.msg})
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgTIGTjcNxZo45c-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgTIGTjcNxZo45c&open=AZgRXGgTIGTjcNxZo45c&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/232)
##########
web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45B-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45B&open=AZgRXGgHIGTjcNxZo45B&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/226)
##########
web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45D-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45D&open=AZgRXGgHIGTjcNxZo45D&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/227)
##########
web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45E-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45E&open=AZgRXGgHIGTjcNxZo45E&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/228)
##########
web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
+ }
+ }
+ /**websocket关闭事件 */
+ onclose(func) {
+ this._ws.onclose = event => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45F-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45F&open=AZgRXGgHIGTjcNxZo45F&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/229)
##########
web/src/utils/cofetch.js:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from './dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/login", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ // console.log(store.getters)
+ // if (store.getters.token) {
+ // config.headers.token = getToken();
+ // }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGgBIGTjcNxZo441-->Remove this useless assignment to variable "expireTime". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgBIGTjcNxZo441&open=AZgRXGgBIGTjcNxZo441&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/218)
##########
web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
+ }
+ }
+ /**websocket关闭事件 */
+ onclose(func) {
+ this._ws.onclose = event => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ func ? func(event) : false
+ }
+ }
+ /**websocket错误事件 */
+ onerror(func) {
+ this._ws.onerror = event => {
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45G-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45G&open=AZgRXGgHIGTjcNxZo45G&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/230)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo445-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo445&open=AZgRXGgEIGTjcNxZo445&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/221)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo448-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo448&open=AZgRXGgEIGTjcNxZo448&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/224)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo447-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo447&open=AZgRXGgEIGTjcNxZo447&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/223)
##########
web/src/views/dashboard/personInfo/index.vue:
##########
@@ -0,0 +1,191 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="app-container">
+ <el-row :gutter="20">
+ <el-col :span="6" :xs="24">
+ <el-card class="box-card">
+ <div slot="header" class="clearfix">
+ <span>个人信息</span>
+ </div>
+ <div>
+ <div class="text-center">
+ <userAvatar :user="user" />
+ </div>
+ <ul class="list-group list-group-striped">
+ <li class="list-group-item">
+ 用户名称
+ <div class="pull-right">{{ userInfo.username }}</div>
+ </li>
+ <li class="list-group-item">
+ 用户ID
+ <div class="pull-right">{{ userInfo.userId }}</div>
+ </li>
+ <!-- <li class="list-group-item">
+ 手机号码
+ <div class="pull-right">{{ operatorInfo.phone }}</div>
+ </li>
+ <li class="list-group-item">
+ 用户邮箱
+ <div class="pull-right">{{ operatorInfo.email }}</div>
+ </li>
+ <li class="list-group-item">
+ 所属部门
+ <div class="pull-right" v-if="operatorInfo.branch_name">{{ operatorInfo.branch_name }} </div>
+ </li> -->
+ <li class="list-group-item">
+ 所属角色
+ <div class="pull-right">{{userInfo.role == 1 ? 'admin' : 'admin'}}</div>
+ </li>
+ <!-- <li class="list-group-item">
+ <svg-icon icon-class="date" />创建日期
+ <div class="pull-right">{{ user.createTime }}</div>
+ </li> -->
+ </ul>
+ </div>
+ </el-card>
+ </el-col>
+ <el-col :span="18" :xs="24">
+ <el-card>
+ <div slot="header" class="clearfix">
+ <span>基本资料</span>
+ </div>
+ <el-tabs v-model="activeTab" :before-leave="beforeLeave">
+ <el-tab-pane label="修改密码" name="userinfo">
+ <userInfo :user="user" />
+ </el-tab-pane>
+ <!-- <el-tab-pane label="修改密码" name="resetPwd">
+ <resetPwd :user="user" />
+ </el-tab-pane> -->
+ </el-tabs>
+ </el-card>
+ </el-col>
+ </el-row>
+ </div>
+</template>
+
+<script>
+import userAvatar from "./userAvatar";
+import userInfo from "./userInfo";
+import resetPwd from "./resetPwd";
+import {mapGetters, mapActions} from 'vuex'
+import api from '@/api'
+import { getToken, setToken, removeToken, getLocalStorage, setLocalStorage,clearLocalStorage } from '@/utils/auth'
+import fetch from '@/utils/tafetch';
+export default {
+ name: "Profile",
+ components: { userAvatar, userInfo, resetPwd },
+ data() {
+ return {
+ user: {},
+ roleGroup: {},
+ postGroup: {},
+ activeTab: "userinfo",
+ roleMap:new Map([
+ [1, "本部"],
+ [2, "片区"],
+ [3, "网点"],
+ ]),
+ role:'',
+ userInfo:{}
+ };
+ },
+ computed: {
+ ...mapGetters([
+ 'operatorInfo'
+ ])
+ },
+ watch:{
+
+ },
+ created() {
+ this.getUser();
+ const role = this.operatorInfo.department
+ this.role = this.roleMap.get(role)
+ },
+ methods: {
+ getUser() {
+ let formData = new FormData();
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGg8IGTjcNxZo46s-->Remove this useless assignment to variable "formData". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGg8IGTjcNxZo46s&open=AZgRXGg8IGTjcNxZo46s&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/217)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
+ case 'HH':
+ return tf(t.getHours());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo449-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo449&open=AZgRXGgEIGTjcNxZo449&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/225)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo446-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo446&open=AZgRXGgEIGTjcNxZo446&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/222)
##########
web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
+ case 'HH':
+ return tf(t.getHours());
+ break;
+ case 'ss':
+ return tf(t.getSeconds());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo44--->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo44-&open=AZgRXGgEIGTjcNxZo44-&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/220)
##########
web/src/views/dashboard/manage/index.vue:
##########
@@ -0,0 +1,195 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="manage">
+ <div class="manage-head hd_bar">
+ <div class="manage-head__name">Dubbo Go Pixiu</div>
+ <div class="right-menu el-menu-demo">
+ <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
+ <div class="avatar-wrapper">
+ <div class="name">{{operatorInfo.username}}</div>
+ <!-- <img :src="avatar" class="user-avatar"> -->
+ <i class="el-icon-caret-bottom" />
+ </div>
+ <el-dropdown-menu slot="dropdown">
+ <el-dropdown-item>
+ <span>你好 - {{operatorInfo.username}}</span>
+ </el-dropdown-item>
+ <!-- <el-dropdown-item divided @click.native="handleOnOpen">
+ <span>发行系统</span>
+ </el-dropdown-item> -->
+ <el-dropdown-item divided @click.native="handlePersonInfo">
+ <span>个人中心</span>
+ </el-dropdown-item>
+ <el-dropdown-item divided @click.native="handleOnLogOut">
+ <span>退出登录</span>
+ </el-dropdown-item>
+ </el-dropdown-menu>
+ </el-dropdown>
+ </div>
+ </div>
+ <div class="manage-foot">
+ <div class="menu-container" :class="{'menu-container--hide': !fromType}">
+ <custom-menu></custom-menu>
+ </div>
+ <div class="lyt-container">
+ <router-view></router-view>
+ </div>
+ </div>
+
+ </div>
+</template>
+
+<script>
+import CustomMenu from '@/components/CustomMenu.vue'
+import { getLocationSearchObj } from '@/utils/common.js'
+import { getToken, setToken, removeToken, getLocalStorage, setLocalStorage,clearLocalStorage } from '@/utils/auth'
+import {mapGetters, mapActions} from 'vuex'
+export default {
+ name: 'Manage',
+ data() {
+ return {
+ fromType: true,
+ operatorInfo:{}
+ }
+ },
+ components: {
+ CustomMenu
+ },
+ computed: {
+ // ...mapGetters([
+ // 'operatorInfo'
+ // ])
+ },
+ methods: {
+ ...mapActions([
+ 'FedLogOut',
+ ]),
+ init() {
+ this.operatorInfo = getLocalStorage('operatorInfo')
+ let params = getLocationSearchObj()
+ this.fromType = params.from == 1 ? false : true // 判断是否隐藏左侧菜单 true是不隐藏 false的隐藏
+ },
+ handlePersonInfo() {
+ this.$router.push({
+ path:'/personInfo'
+ })
+ },
+ handleOnLogOut() {
+ console.log(1);
+ this.FedLogOut().then(res => {
+ this.$router.push({path: '/login'});
+ });
+ },
+ handleOnOpen() {
+ let port = '30026';
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGg0IGTjcNxZo46Z-->Remove this useless assignment to variable "port". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGg0IGTjcNxZo46Z&open=AZgRXGg0IGTjcNxZo46Z&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/216)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#discussion_r2249203062
##########
admin/controller/account/guest.go:
##########
@@ -0,0 +1,122 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package account
+
+import (
Review Comment:
这就需要format下了
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146422448
烦请使用工具,把 import 都格式化下。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146976955
the ci failed. what a pity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3148370699
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078561979
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [13 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3078604626
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate failed**
Failed conditions
 [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#discussion_r2217538999
##########
admin/web/src/utils/fetch.js:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from '../utils/dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/config", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryn8D9asOnAnEU4Js0" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ console.log(store.getters)
+ let tk = getLocalStorage('operatorInfo').token
+ if (tk && tk != '') {
+ config.headers.token = tk;
+ config.headers.username = getLocalStorage('operatorInfo').username;
+ }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
+ if(res.code == 503){
+ console.log(res)
+ dlgUtils.loginTimeout()
+ return Promise.reject({code: res.code, message: res.data})
+ }else{
+ setLocalStorage('expireTime', new Date().getTime() + 1000*60*60*24*7)
+ return res;
+ }
+
+ return Promise.reject({code: res.code, message: res.msg})
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgTIGTjcNxZo45c-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgTIGTjcNxZo45c&open=AZgRXGgTIGTjcNxZo45c&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/252)
##########
admin/web/src/views/dashboard/personInfo/index.vue:
##########
@@ -0,0 +1,191 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="app-container">
+ <el-row :gutter="20">
+ <el-col :span="6" :xs="24">
+ <el-card class="box-card">
+ <div slot="header" class="clearfix">
+ <span>个人信息</span>
+ </div>
+ <div>
+ <div class="text-center">
+ <userAvatar :user="user" />
+ </div>
+ <ul class="list-group list-group-striped">
+ <li class="list-group-item">
+ 用户名称
+ <div class="pull-right">{{ userInfo.username }}</div>
+ </li>
+ <li class="list-group-item">
+ 用户ID
+ <div class="pull-right">{{ userInfo.userId }}</div>
+ </li>
+ <!-- <li class="list-group-item">
+ 手机号码
+ <div class="pull-right">{{ operatorInfo.phone }}</div>
+ </li>
+ <li class="list-group-item">
+ 用户邮箱
+ <div class="pull-right">{{ operatorInfo.email }}</div>
+ </li>
+ <li class="list-group-item">
+ 所属部门
+ <div class="pull-right" v-if="operatorInfo.branch_name">{{ operatorInfo.branch_name }} </div>
+ </li> -->
+ <li class="list-group-item">
+ 所属角色
+ <div class="pull-right">{{userInfo.role == 1 ? 'admin' : 'admin'}}</div>
+ </li>
+ <!-- <li class="list-group-item">
+ <svg-icon icon-class="date" />创建日期
+ <div class="pull-right">{{ user.createTime }}</div>
+ </li> -->
+ </ul>
+ </div>
+ </el-card>
+ </el-col>
+ <el-col :span="18" :xs="24">
+ <el-card>
+ <div slot="header" class="clearfix">
+ <span>基本资料</span>
+ </div>
+ <el-tabs v-model="activeTab" :before-leave="beforeLeave">
+ <el-tab-pane label="修改密码" name="userinfo">
+ <userInfo :user="user" />
+ </el-tab-pane>
+ <!-- <el-tab-pane label="修改密码" name="resetPwd">
+ <resetPwd :user="user" />
+ </el-tab-pane> -->
+ </el-tabs>
+ </el-card>
+ </el-col>
+ </el-row>
+ </div>
+</template>
+
+<script>
+import userAvatar from "./userAvatar";
+import userInfo from "./userInfo";
+import resetPwd from "./resetPwd";
+import {mapGetters, mapActions} from 'vuex'
+import api from '@/api'
+import { getToken, setToken, removeToken, getLocalStorage, setLocalStorage,clearLocalStorage } from '@/utils/auth'
+import fetch from '@/utils/tafetch';
+export default {
+ name: "Profile",
+ components: { userAvatar, userInfo, resetPwd },
+ data() {
+ return {
+ user: {},
+ roleGroup: {},
+ postGroup: {},
+ activeTab: "userinfo",
+ roleMap:new Map([
+ [1, "本部"],
+ [2, "片区"],
+ [3, "网点"],
+ ]),
+ role:'',
+ userInfo:{}
+ };
+ },
+ computed: {
+ ...mapGetters([
+ 'operatorInfo'
+ ])
+ },
+ watch:{
+
+ },
+ created() {
+ this.getUser();
+ const role = this.operatorInfo.department
+ this.role = this.roleMap.get(role)
+ },
+ methods: {
+ getUser() {
+ let formData = new FormData();
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGg8IGTjcNxZo46s-->Remove this useless assignment to variable "formData". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGg8IGTjcNxZo46s&open=AZgRXGg8IGTjcNxZo46s&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/237)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo447-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo447&open=AZgRXGgEIGTjcNxZo447&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/243)
##########
admin/web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45B-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45B&open=AZgRXGgHIGTjcNxZo45B&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/246)
##########
admin/web/src/utils/fetch.js:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from '../utils/dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/config", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryn8D9asOnAnEU4Js0" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ console.log(store.getters)
+ let tk = getLocalStorage('operatorInfo').token
+ if (tk && tk != '') {
+ config.headers.token = tk;
+ config.headers.username = getLocalStorage('operatorInfo').username;
+ }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGgTIGTjcNxZo45b-->Remove this useless assignment to variable "expireTime". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgTIGTjcNxZo45b&open=AZgRXGgTIGTjcNxZo45b&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/251)
##########
admin/web/src/components/common/CustomLayout.vue:
##########
@@ -0,0 +1,246 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="page">
+ <div class="page-head" v-if="fromType">
+ <div class="page-head__title">
+ <span v-if="!subTitle">{{ title }}</span>
+ <el-breadcrumb separator="/" v-else>
+ <el-breadcrumb-item>
+ <div @click="goBack" class="previous-route">
+ {{ title && title.length > 4 ? `${title.substring(0, 4)}...` : title }}
+ </div>
+ </el-breadcrumb-item>
+ <el-breadcrumb-item> {{ subTitle }}</el-breadcrumb-item>
+ <el-breadcrumb-item v-if="thirdTitle">{{
+ thirdTitle
+ }}</el-breadcrumb-item>
+ </el-breadcrumb>
+ </div>
+ <div class="page-head__toolbox">
+ <slot name="toolbox"></slot>
+ </div>
+ </div>
+ <el-scrollbar class="page-content" :class="{ 'page-content--have-fixed-bottom': fixedBottom,
+ 'page-content--fromType' : !fromType }">
+ <slot></slot>
+ <!-- <div class="page-logo"></div> -->
+ </el-scrollbar>
+ </div>
+</template>
+
+<script>
+import { getLocationSearchObj } from '@/utils/common.js'
+
+export default {
+ namne: 'CustomLayout',
+ props: {
+ title: String,
+ subTitle: String,
+ thirdTitle: String,
+ fixedBottom: Boolean
+ },
+ data () {
+ return {
+ fromType: false
+ }
+ },
+ methods: {
+ init() {
+ let params = getLocationSearchObj()
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGf1IGTjcNxZo44b-->Remove this useless assignment to variable "params". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGf1IGTjcNxZo44b&open=AZgRXGf1IGTjcNxZo44b&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/234)
##########
admin/web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
+ }
+ }
+ /**websocket关闭事件 */
+ onclose(func) {
+ this._ws.onclose = event => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ func ? func(event) : false
+ }
+ }
+ /**websocket错误事件 */
+ onerror(func) {
+ this._ws.onerror = event => {
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45G-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45G&open=AZgRXGgHIGTjcNxZo45G&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/250)
##########
admin/web/src/utils/cofetch.js:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from './dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/login", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ // console.log(store.getters)
+ // if (store.getters.token) {
+ // config.headers.token = getToken();
+ // }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGgBIGTjcNxZo441-->Remove this useless assignment to variable "expireTime". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgBIGTjcNxZo441&open=AZgRXGgBIGTjcNxZo441&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/238)
##########
admin/web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45D-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45D&open=AZgRXGgHIGTjcNxZo45D&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/247)
##########
admin/web/src/components/CustomMenu.vue:
##########
@@ -0,0 +1,280 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<template>
+ <div class="custom-menu" v-if="fromType">
+ <!-- <div class="menu-title">内容管理</div>
+ <div class="menu-search">
+ <el-input
+ placeholder="搜索"
+ v-model="keyWord">
+ <i slot="suffix" class="el-input__icon el-icon-search"></i>
+ </el-input>
+ <div class="menu-search-container" v-show="searchBox">
+ <div class="menu-search-item" v-for="item in searchList"
+ :key="item.id" @click="handleSearchMenuClick(item)">{{item.title}}</div>
+ <div class="menu-search--empty" v-show="searchList.length == 0">暂无数据</div>
+ </div>
+ </div> -->
+ <el-menu
+ :default-active="defaultActive"
+ class="custom-menu-container"
+ @open="handleOpen"
+ @close="handleClose">
+ <div v-for="(item, index) in menuList" :key="index">
+ <el-submenu v-if="item.children.length >= 0" :index="item.id">
+ <template slot="title">{{item.name}}</template>
+ <el-menu-item :index="String(child.id)" @click="handleMenuClick(child)"
+ :data-index="child.id"
+ v-for="(child, childIdx) in item.children"
+ :key="childIdx">{{child.name}}</el-menu-item>
+ </el-submenu>
+ <!-- <el-menu-item v-if="item.children.length === 0"
+ :index="item.index"
+ :data-index="item.index"
+ @click="handleMenuClick(item)">{{item.title}}</el-menu-item> -->
+ </div>
+ </el-menu>
+ </div>
+</template>
+
+<script>
+import {getLocationSearchObj} from '@/utils/common.js'
+import {mapMutations, mapGetters} from 'vuex'
+import {clearLocalStorage} from '@/utils/auth.js'
+const debounce = require('lodash/debounce')
+import {menuList} from '@/api/menu-config.js'
+export default {
+ name: 'CustomMenu',
+ data () {
+ return {
+ defaultActive: '', // active menu
+ menuList: menuList, // menu list
+ searchList: [], // search list
+ keyWord: '', // keyword
+ searchBox: false, // search area
+ fromType: true, // true: 显示原有内容, false:隐藏部分内容 是否嵌入到其他项目中,需要对应隐藏部分内容(菜单,header)
+ }
+ },
+ watch: {
+ keyWord (val) {
+ if (val !== '' && val !== undefined) {
+ this.searchBox = true
+ this.handleSearch()
+ } else {
+ this.searchBox = false
+ }
+ }
+ },
+ methods: {
+ ...mapMutations(['setOrgId', 'setCurrentMenu']),
+ // clear page cache
+ clearPagination () {
+ clearLocalStorage('picTxtIdx')
+ clearLocalStorage('picTxtSize')
+ },
+ // 搜索过滤菜单内容
+ handleSearch: debounce(function () {
+ this.$get('/menu/search', {
+ keyWord: this.keyWord
+ }).then(res => {
+ if (res.code === 200) {
+ this.searchList = res.data
+ }
+ }).catch(err => {
+ console.log(err)
+ })
+ }, 200),
+ handleScrollPosition () {
+ let el = document.querySelector('.custom-menu-container')
+ let top = el.scrollTop
+ let current = document.querySelector(`[data-index=${this.defaultActive}]`)
+ let y = current.getBoundingClientRect().y
+ top = top + y - 60 - 56
+ el.scrollTop = top
+ },
+ handleSearchMenuClick (item) {
+ this.keyWord = ''
+ this.searchBox = false
+ this.searchList = []
+ this.handleMenuClick(item)
+ this.defaultActive = item.index
+ setTimeout(() => {
+ this.handleScrollPosition()
+ }, 300)
+ },
+ switchRouter (item) {
+ this.clearPagination()
+ this.$router.push({
+ path: item.componentName,
+ query: {
+ id: new Date().getTime()
+ }
+ })
+ let el = document.querySelector('.page-content .el-scrollbar__wrap')
+ if (el) {
+ el.scrollTop = 0
+ }
+ },
+ handleMenuClick (item) {
+ this.switchRouter(item)
+ },
+ handleOpen(key, keyPath) {
+ // console.log(key, keyPath)
+ },
+ handleClose(key, keyPath) {
+ // console.log(key, keyPath)
+ },
+ initMenu () {
+ // 0: default load method
+ // 1: external tool open
+ // 2: new window open
+ // 3: cover current window open
+ // 4: cloud listen backend content embed
+ // 5: notice not open
+ // 6: application router jump
+ console.log(this.menuList)
+ let findShow = this.menuList.find(item => item.children.length>0)
+ if(findShow){
+ this.initDefaultActive()
+ }else{
+ // this.$router.push({
+ // path:'/403'
+ // })
+ }
+ return;
+ // var type = current.openType
+ this.$get('/menu/getMenuList').then(res => {
+ if (res.code === 200 && res.data && res.data.length > 0) {
+ this.menuList = res.data
+ let findShow = this.menuList.find(item => item.children.length>0)
+ if(findShow){
+ this.initDefaultActive()
+ }else{
+ this.$router.push({
+ path:'/403'
+ })
+ }
+
+ } else {
+ this.$router.push({
+ path:'/403'
+ })
+ // this.$message.error(res.msg)
+ }
+ }).catch(err => {
+ console.log(err)
+ })
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGf5IGTjcNxZo44f-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGf5IGTjcNxZo44f&open=AZgRXGf5IGTjcNxZo44f&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/235)
##########
admin/web/src/views/dashboard/manage/index.vue:
##########
@@ -0,0 +1,195 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<template>
+ <div class="manage">
+ <div class="manage-head hd_bar">
+ <div class="manage-head__name">Dubbo Go Pixiu</div>
+ <div class="right-menu el-menu-demo">
+ <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
+ <div class="avatar-wrapper">
+ <div class="name">{{operatorInfo.username}}</div>
+ <!-- <img :src="avatar" class="user-avatar"> -->
+ <i class="el-icon-caret-bottom" />
+ </div>
+ <el-dropdown-menu slot="dropdown">
+ <el-dropdown-item>
+ <span>你好 - {{operatorInfo.username}}</span>
+ </el-dropdown-item>
+ <!-- <el-dropdown-item divided @click.native="handleOnOpen">
+ <span>发行系统</span>
+ </el-dropdown-item> -->
+ <el-dropdown-item divided @click.native="handlePersonInfo">
+ <span>个人中心</span>
+ </el-dropdown-item>
+ <el-dropdown-item divided @click.native="handleOnLogOut">
+ <span>退出登录</span>
+ </el-dropdown-item>
+ </el-dropdown-menu>
+ </el-dropdown>
+ </div>
+ </div>
+ <div class="manage-foot">
+ <div class="menu-container" :class="{'menu-container--hide': !fromType}">
+ <custom-menu></custom-menu>
+ </div>
+ <div class="lyt-container">
+ <router-view></router-view>
+ </div>
+ </div>
+
+ </div>
+</template>
+
+<script>
+import CustomMenu from '@/components/CustomMenu.vue'
+import { getLocationSearchObj } from '@/utils/common.js'
+import { getToken, setToken, removeToken, getLocalStorage, setLocalStorage,clearLocalStorage } from '@/utils/auth'
+import {mapGetters, mapActions} from 'vuex'
+export default {
+ name: 'Manage',
+ data() {
+ return {
+ fromType: true,
+ operatorInfo:{}
+ }
+ },
+ components: {
+ CustomMenu
+ },
+ computed: {
+ // ...mapGetters([
+ // 'operatorInfo'
+ // ])
+ },
+ methods: {
+ ...mapActions([
+ 'FedLogOut',
+ ]),
+ init() {
+ this.operatorInfo = getLocalStorage('operatorInfo')
+ let params = getLocationSearchObj()
+ this.fromType = params.from == 1 ? false : true // 判断是否隐藏左侧菜单 true是不隐藏 false的隐藏
+ },
+ handlePersonInfo() {
+ this.$router.push({
+ path:'/personInfo'
+ })
+ },
+ handleOnLogOut() {
+ console.log(1);
+ this.FedLogOut().then(res => {
+ this.$router.push({path: '/login'});
+ });
+ },
+ handleOnOpen() {
+ let port = '30026';
Review Comment:
## Unused assignments should be removed
<!--SONAR_ISSUE_KEY:AZgRXGg0IGTjcNxZo46Z-->Remove this useless assignment to variable "port". <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGg0IGTjcNxZo46Z&open=AZgRXGg0IGTjcNxZo46Z&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/236)
##########
admin/web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
+ }
+ }
+ /**websocket关闭事件 */
+ onclose(func) {
+ this._ws.onclose = event => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45F-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45F&open=AZgRXGgHIGTjcNxZo45F&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/249)
##########
admin/web/src/utils/directives.js:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import Vue from 'vue';
+import { getLocalStorage } from '@/utils/auth'
+
+// account permission check
+Vue.prototype.$_has = function({rights}) {
+//debugger
+ let operatorInfo = getLocalStorage('operatorInfo');
+ let permission = operatorInfo.rights ? operatorInfo.rights.split(',') : [];
+ let resources = [];
+ let result = false;
+
+ // get current acccount role
+ if(Array.isArray(rights)){
+ rights.forEach((e) => {
+ resources = resources.concat([e]);
+ })
+ }else{
+ resources = resources.concat([rights.split(',')]);
+ }
+ // auth check
+ resources.map((p) => {
+ if(typeof p != 'string'){
+ p = p.toString();
+ }
+ if(permission.includes(p)){
+ return result = true;
Review Comment:
## Assignments should not be made from within sub-expressions
<!--SONAR_ISSUE_KEY:AZgRXGgWIGTjcNxZo45d-->Extract the assignment of "result" from this expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgWIGTjcNxZo45d&open=AZgRXGgWIGTjcNxZo45d&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/253)
##########
admin/web/src/utils/cofetch.js:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import axios from 'axios'
+import {Message} from 'element-ui'
+import {getToken, getLocalStorage, setLocalStorage} from '@/utils/auth'
+import store from '@/store/store.js'
+import * as dlgUtils from './dialogUtils'
+import Vue from 'vue'
+import ElementUI from 'element-ui'
+const SUCCESS_CODE = 200;
+import wsConsts from '@/utils/wsConsts'
+
+// 创建axios实例
+const service = axios.create({
+ baseURL: "/login", // api的base_url
+ dataType:"json",
+ headers: {"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" },
+ timeout: 5000 // 请求超时时间
+})
+
+
+// request拦截器
+service.interceptors.request.use(config => {
+ // console.log(store.getters)
+ // if (store.getters.token) {
+ // config.headers.token = getToken();
+ // }
+
+
+ // if (config.method.toLowerCase() !== 'get' && Object.keys(config.data).length > 0) {
+ // let body = {};
+ // let data = {};
+
+ // for (let key in config.data) {
+ // if (key != 'method') {
+ // body[key] = config.data[key];
+ // }
+ // }
+ // data = body
+ // // if (getToken()) {
+ // // data.ticket = getToken() || '';
+ // // }
+
+ // config.data = JSON.stringify(data)
+ // }
+
+ return config
+}, error => {
+ console.log(error) // for debug
+ Promise.reject(error)
+})
+Vue.prototype.$http = service
+
+Vue.prototype.$post = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.post(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$put = function (url, data) {
+ return new Promise((resolve, reject) => {
+ service.put(url, data).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+Vue.prototype.$delete = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.delete(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+ })
+ })
+}
+
+Vue.prototype.$get = function (url, params = {}) {
+ return new Promise((resolve, reject) => {
+ service.get(url, {
+ params
+ }).then(res => {
+ if (res.code == 10001) {
+ resolve(res)
+ } else {
+ resolve(res)
+ }
+ }).catch(err => {
+ // ElementUI.Message.error('网络错误,请重试!')
+ console.log(err)
+ reject(err)
+
+ })
+ })
+}
+// respone拦截器
+service.interceptors.response.use(response => {
+ if (!response.data) {
+ return Promise.reject({code: "", message: '网络异常'});
+ }
+ const res = response.data;
+ console.log(res)
+ if (!res.hasOwnProperty('code')) {
+ return res;
+ }
+
+ let expireTime = getLocalStorage('expireTime');
+ if(res.code == 503){
+ console.log(res)
+ dlgUtils.loginTimeout()
+ return Promise.reject({code: res.code, message: res.data})
+ }else{
+ setLocalStorage('expireTime', new Date().getTime() + 1000*60*60*24*7)
+ return res;
+ }
+
+ return Promise.reject({code: res.code, message: res.msg})
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgBIGTjcNxZo442-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgBIGTjcNxZo442&open=AZgRXGgBIGTjcNxZo442&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/239)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo448-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo448&open=AZgRXGgEIGTjcNxZo448&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/244)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo446-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo446&open=AZgRXGgEIGTjcNxZo446&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/242)
##########
admin/web/src/utils/socket.js:
##########
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* jshint esversion:6 */
+class socket {
+ constructor(params) {
+ this._params = params
+ this.init()
+ }
+
+ /* 初始化 */
+ init() {
+ // 重中之重,不然重连的时候会越来越快
+ clearInterval(this._reconnect_timer)
+ clearInterval(this._heart_timer)
+
+ // 取出所有参数
+ const params = this._params
+ // 设置连接路径
+ const {
+ url,
+ port
+ } = params
+ const global_params = ['heartBeat', 'heartMsg', 'reconnect', 'reconnectTime', 'reconnectTimes']
+
+ // 定义全局变量
+ Object.keys(params).forEach(key => {
+ if (global_params.indexOf(key) !== -1) {
+ this[key] = params[key]
+ }
+ })
+
+ const ws_url = port ? url + ':' + port : url
+
+ this._ws = new WebSocket(ws_url)
+
+ // 默认绑定事件
+ this._ws.onopen = () => {
+ // 设置状态为开启
+ this._alive = true
+ clearInterval(this._reconnect_timer)
+ // 连接后进入心跳状态
+ //this.onheartbeat()
+ }
+
+ this._ws.onclose = () => {
+ // 设置状态为断开
+ this._alive = false
+
+ clearInterval(this._heart_timer)
+
+ // 自动重连开启 + 不在重连状态下
+ if (this.reconnect === true) {
+ /* 断开后立刻重连 */
+ this.onreconnect()
+ }
+ }
+ }
+
+ /* 心跳事件 */
+ onheartbeat(func) {
+ // 在连接状态下
+ setTimeout(() => {
+ if (this._alive === true) {
+ if (!this.first === true) {
+ this.first = true
+ /* 心跳计时器 */
+ this._heart_timer = setInterval(() => {
+ // 发送心跳信息
+ this.send('{"bissnessType":"doSale","chargeWay":"03","data":"{amount:1}"}')
+ func ? func(this) : false
+ }, this.heartBeat)
+ }
+ }
+ }, 500)
+ }
+
+ /* 重连事件 */
+ onreconnect(func) {
+ /* 重连间隔计时器 */
+ this._reconnect_timer = setInterval(() => {
+ // 限制重连次数
+ if (this.reconnectTimes <= 0) {
+ // 关闭定时器
+ // this._isReconnect = false
+ clearInterval(this._reconnect_timer)
+ // 跳出函数之间的循环
+ return
+ } else {
+ // 重连一次-1
+ this.reconnectTimes--
+ }
+ // 进入初始状态
+ this.init()
+ func ? func(this) : false
+ }, this.reconnectTime)
+ }
+
+ // 发送消息
+ send(text) {
+ if (text === 'undefined') return
+ if (this._alive === true) {
+ text = typeof text === 'string' ? text : JSON.stringify(text)
+ this._ws.send(text)
+ }
+ }
+
+ /**断开连接 */
+ close() {
+ if (this._alive === true) {
+ // 关闭自动连接
+ this.reconnect = false
+ this._ws.close()
+ }
+ }
+
+ /**接受消息 */
+ onmessage(func, all = false) {
+ this._ws.onmessage = data => func(!all ? data.data : data)
+ }
+
+ /**websocket连接成功事件 */
+ onopen(func) {
+ this._ws.onopen = event => {
+ this._alive = true
+ func ? func(event) : false
Review Comment:
## Non-empty statements should change control flow or have at least one side-effect
<!--SONAR_ISSUE_KEY:AZgRXGgHIGTjcNxZo45E-->Expected an assignment or function call and instead saw an expression. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgHIGTjcNxZo45E&open=AZgRXGgHIGTjcNxZo45E&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/248)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
+ case 'HH':
+ return tf(t.getHours());
+ break;
+ case 'ss':
+ return tf(t.getSeconds());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo44--->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo44-&open=AZgRXGgEIGTjcNxZo44-&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/240)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo445-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo445&open=AZgRXGgEIGTjcNxZo445&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/241)
##########
admin/web/src/utils/utils.js:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 一些工具类的集合
+ */
+
+//dataURL to blob,
+export function dataUrlToBlob(dataURI){
+ let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // mime类型
+ let byteString = atob(dataURI.split(',')[1]); //base64 解码
+
+ let arrayBuffer = new ArrayBuffer(byteString.length); //创建缓冲数组
+ let intArray = new Uint8Array(arrayBuffer); //创建视图
+
+ for (let i = 0; i < byteString.length; i++) {
+ intArray[i] = byteString.charCodeAt(i);
+ }
+ return new Blob([intArray], {type: mimeString});
+}
+
+export function format(time, format){
+ var t = new Date(time);
+ var tf = function(i){return (i < 10 ? '0' : '') + i};
+ return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function(a){
+ switch(a){
+ case 'yyyy':
+ return tf(t.getFullYear());
+ break;
+ case 'MM':
+ return tf(t.getMonth() + 1);
+ break;
+ case 'mm':
+ return tf(t.getMinutes());
+ break;
+ case 'dd':
+ return tf(t.getDate());
+ break;
+ case 'HH':
+ return tf(t.getHours());
+ break;
Review Comment:
## All code should be reachable
<!--SONAR_ISSUE_KEY:AZgRXGgEIGTjcNxZo449-->Unreachable code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&issues=AZgRXGgEIGTjcNxZo449&open=AZgRXGgEIGTjcNxZo449&pullRequest=697">SonarQube Cloud</a></p>
[Show more details](https://github.com/apache/dubbo-go-pixiu/security/code-scanning/245)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3092707565
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3146958340
> 烦请使用工具,把 import 都格式化下。
all done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697#issuecomment-3148920614
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697) **Quality Gate passed**
Issues
 [288 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=697&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_coverage&view=list)
 [3.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go-pixiu&pullRequest=697&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=697)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] chore(pixiu-admin): Migrate dubbo-go-pixiu/pixiu-admin to apache/dubbo-go-pixiu [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks merged PR #697:
URL: https://github.com/apache/dubbo-go-pixiu/pull/697
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org